@a2simcode/ui 0.0.184 → 0.0.185
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/simcode-ui.es.js +25413 -10490
- package/dist/simcode-ui.umd.js +14 -2
- package/dist/stats.html +1 -1
- package/dist/ui.css +1 -1
- package/package.json +2 -1
package/dist/simcode-ui.umd.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
(function(H,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("sortablejs"),require("@visactor/vtable"),require("element-plus"),require("echarts"),require("@bwip-js/browser"),require("countup.js"),require("sql-formatter"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lang-javascript"),require("@codemirror/lang-css"),require("@codemirror/lang-html"),require("@codemirror/lang-json"),require("@codemirror/lang-sql"),require("@codemirror/lang-xml"),require("@codemirror/lang-python"),require("@codemirror/lang-markdown"),require("@codemirror/lang-java"),require("@codemirror/autocomplete"),require("@codemirror/commands"),require("@codemirror/language"),require("@vueuse/core"),require("async-validator"),require("@wangeditor/editor"),require("diagram-js"),require("min-dom"),require("min-dash"),require("tiny-svg"),require("inherits"),require("diagram-js-direct-editing")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","sortablejs","@visactor/vtable","element-plus","echarts","@bwip-js/browser","countup.js","sql-formatter","codemirror","@codemirror/view","@codemirror/state","@codemirror/lang-javascript","@codemirror/lang-css","@codemirror/lang-html","@codemirror/lang-json","@codemirror/lang-sql","@codemirror/lang-xml","@codemirror/lang-python","@codemirror/lang-markdown","@codemirror/lang-java","@codemirror/autocomplete","@codemirror/commands","@codemirror/language","@vueuse/core","async-validator","@wangeditor/editor","diagram-js","min-dom","min-dash","tiny-svg","inherits","diagram-js-direct-editing"],n):(H=typeof globalThis<"u"?globalThis:H||self,n(H.SimCodeUI={},H.Vue,H.IconifyVue,H.dayjs,H.Sortable,H.VTable,H.ElementPlus,H.echarts,H.bwipjs,H.CountUp,H.SqlFormatter,H.CodeMirror,H.CodeMirrorView,H.CodeMirrorState,H.CodeMirrorLangJavaScript,H.CodeMirrorLangCSS,H.CodeMirrorLangHTML,H.CodeMirrorLangJSON,H.CodeMirrorLangSQL,H.CodeMirrorLangXML,H.CodeMirrorLangPython,H.CodeMirrorLangMarkdown,H.CodeMirrorLangJava,H.CodeMirrorAutocomplete,H.CodeMirrorCommands,H.CodeMirrorLanguage,H.VueUse,H.AsyncValidator,H.WangEditor,H.Diagram,H.minDom,H.minDash,H.tinySvg,H.inherits,H.DiagramJsDirectEditing))})(this,function(H,n,an,na,or,Ve,Mu,ar,rr,Au,Nu,ju,Wt,ir,Zn,Pu,Hu,zu,Ou,Lu,Du,Iu,Fu,lr,sr,Qn,cr,dr,Vi,oa,G,R,P,rn,ur){Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var $u=Object.create,Mi=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Uu=Object.getOwnPropertyNames,Ju=Object.getPrototypeOf,Yu=Object.prototype.hasOwnProperty,Rt=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Gu=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=Uu(t),i=0,l=r.length,s;i<l;i++)s=r[i],!Yu.call(e,s)&&s!==o&&Mi(e,s,{get:(d=>t[d]).bind(null,s),enumerable:!(a=Wu(t,s))||a.enumerable});return e},vt=(e,t,o)=>(o=e!=null?$u(Ju(e)):{},Gu(t||!e||!e.__esModule?Mi(o,"default",{value:e,enumerable:!0}):o,e));na=vt(na,1),or=vt(or,1);let pn=vt(Ve,1);Ve=vt(Ve),ar=vt(ar,1),rr=vt(rr,1),dr=vt(dr,1),oa=vt(oa,1),rn=vt(rn,1),ur=vt(ur,1);var fe=e=>(e.install=t=>{t.component(e.name,e)},e);function aa(e){return e&&Array.isArray(e)}function Ai(e,t){return toString.call(e)===`[object ${t}]`}function Ku(e){return e!==null&&Ai(e,"Object")}var xt=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0),qu=(0,n.defineComponent)({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(e){const t=e,o=(0,n.computed)(()=>{const r=t.icon;if(r.indexOf(":")===-1)return(0,an.getIcon)(`jcode:${t.icon}`)==null,`jcode:${t.icon}`;const i=`jcode:${r.split(":")[1]}`;return(0,an.getIcon)(i)!=null?i:r}),a=(0,n.computed)(()=>({size:t.size,color:t.color,icon:o.value}));return(r,i)=>e.isDiv?((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({key:0},r.$attrs,{class:"j-icon jicon",style:{height:`${e.size}px`}}),[(0,n.createVNode)((0,n.unref)(an.Icon),(0,n.mergeProps)(a.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16)):((0,n.openBlock)(),(0,n.createElementBlock)("span",(0,n.mergeProps)({key:1},r.$attrs,{class:"jicon"}),[(0,n.createVNode)((0,n.unref)(an.Icon),(0,n.mergeProps)(a.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),Hn=qu,Xu=["disabled"],Zu={key:2},Qu=(0,n.defineComponent)({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=u=>{!f.value&&!a.disabled&&(r("click",u),a.href&&window.open(a.href,a.target?a.target:"_self"))},l=(0,n.shallowRef)(null),s=()=>{l.value?.focus()},d=()=>{l.value?.blur()},c=(0,n.computed)(()=>a.notLabel||!a.label),f=(0,n.ref)(!1);(0,n.watch)(()=>a.loading,u=>{if(typeof u=="boolean")f.value=u;else if(xt(u?.delay))f.value=!1;else{const h=setTimeout(()=>{f.value=!0},u.delay);return()=>clearTimeout(h)}},{immediate:!0});const p=(0,n.computed)(()=>a.label||"");return t({focus:s,blur:d}),(u,h)=>((0,n.openBlock)(),(0,n.createElementBlock)("button",{ref_key:"buttonNodeRef",ref:l,type:"button",class:(0,n.normalizeClass)(["j-button",{"j-button-primary":e.type=="primary","j-button-success":e.type=="success","j-button-default":e.type=="default","j-button-dashed":e.type=="dashed","j-button-link":e.type=="link","j-button-text":e.type=="text","j-button-ghost":e.ghost==!0,"j-button-danger":e.danger==!0,"j-button-lg":e.size=="large","j-button-sm":e.size=="small","j-button-circle":e.shape=="circle","j-button-round":e.shape=="round","j-button-block":e.block==!0,"j-button-loading":f.value==!0,"j-button-icon-only":c.value==!0,"j-button-compact":e.compact==!0,"j-button-last-compact-item":e.lastCompactItem==!0,"j-button-first-compact-item":e.firstCompactItem==!0}]),disabled:e.disabled,onClick:(0,n.withModifiers)(i,["stop"])},[f.value?((0,n.openBlock)(),(0,n.createBlock)(Hn,{key:0,icon:"mdi:loading",size:e.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):e.icon?((0,n.openBlock)(),(0,n.createBlock)(Hn,{key:1,icon:e.icon},null,8,["icon"])):(0,n.createCommentVNode)("",!0),e.notLabel?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",Zu,(0,n.toDisplayString)(p.value),1)),(0,n.renderSlot)(u.$slots,"iconAfter")],10,Xu))}}),ef=Qu,ra=fe(ef);function eo(e){Object.keys(e||{}).forEach(t=>{delete e[t]})}function Ni(e){const{toString:t}=Object.prototype,o={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&e instanceof Element?"element":o[t.call(e)]}function Vt(e){const t=Ni(e);let o;if(t==="array")o=[];else if(t==="object")o={};else return e;if(t==="array")for(let a=0,r=e.length;a<r;a++)e[a]=(e[a]===0,e[a]),e[a]&&delete e[a].$parent,o.push(Vt(e[a]));else t==="object"&&Object.keys(e).forEach(a=>{e&&delete e.$parent,o[a]=Vt(e[a])});return o}function ko(e,t,o=[]){Object.keys(t).forEach(a=>{o.indexOf(a)===-1&&(e[a]=t[a])})}var ln=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),fr=0;function ia(e=""){const t=Date.now(),o=Math.floor(Math.random()*1e9);return fr++,e?e+"_"+o+fr+String(t):o+fr+String(t)}var pr=e=>{if(e)try{const t=new Function("return "+e)();return typeof t=="function"?{res:!0,msg:"ok",fn:t}:(console.warn("此方法不是一个函数",e),{res:!1,msg:"此方法不是一个函数"})}catch(t){return console.warn(t,e),{res:!1,msg:t}}else return{res:!1,msg:"没设置脚本函数"}};function hr(e,t,o){if(!e||typeof e!="object")return e;const a=Array.isArray(t)?t:t.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(a.length===0)return e;let r=e;for(let i=0;i<a.length-1;i++){const l=a[i],s=a[i+1];(!(l in r)||typeof r[l]!="object"||r[l]===null)&&(r[l]=/^\d+$/.test(s)?[]:{}),r=r[l]}return r[a[a.length-1]]=o,e}var So=e=>{let t=parseFloat(e);return isNaN(t)?0:(t=Math.round(e*100)/100,t)},tf=function(e,t,o){const a=(e-1)*t;return a+t>=o.length?o.slice(a,o.length):o.slice(a,a+t)},nf=function(e,t){const o=(e.page-1)*e.rows,a=o+e.rows>=t.length?t.slice(o,t.length):t.slice(o,o+e.rows);return{rows:a,total:t.length,page:e.page,records:a.length}},of=function(e){return e.filter((t,o,a)=>a.indexOf(t,0)===o)},ji=e=>{if(!/^\d*(\.\d*)?$/.test(e))return"Number is wrong!";const t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],o=["","十","百","千","万","亿","点",""],a=(""+e).replace(/(^0*)/g,"").split(".");let r=0,i="";for(let l=a[0].length-1;l>=0;l--){switch(r){case 0:i=o[7]+i;break;case 4:new RegExp("0{4}\\d{"+(a[0].length-l-1)+"}$").test(a[0])||(i=o[4]+i);break;case 8:i=o[5]+i,o[7]=o[5],r=0;break}r%4===2&&a[0].charAt(l+2)!=="0"&&a[0].charAt(l+1)==="0"&&(i=t[0]+i),a[0].charAt(l)!=="0"&&(i=t[Number(a[0].charAt(l))]+o[r%4]+i),r++}if(a.length>1){i+=o[6];for(let l=0;l<a[1].length;l++)i+=t[Number(a[1].charAt(l))]}return i},Pi=e=>{const t=(e+"").split("."),o=t[0]+"",a=t[1]||"",r=o.length%3;let i=o.substring(0,r);for(let l=0;l<Math.floor(o.length/3);l++)i+=","+o.substring(r+l*3,r+(l+1)*3);return r===0&&(i=i.substring(1)),e=i+(a?"."+a:""),e},At=e=>{if(!e)return;if(typeof document>"u"||!document.body)return e.length*7;const t=document.createElement("span");t.style.fontSize="14px",t.style.visibility="hidden",t.style.position="absolute",t.innerText=e,document.body.appendChild(t);const o=t.offsetWidth;return document.body.removeChild(t),o};function Hi(e){return e==null||e===void 0||e===""?"":e===e.toUpperCase()?e.split("_").map(t=>(t=t.toLowerCase(),t.slice(0,1).toUpperCase()+t.slice(1))).join(""):e.slice(0,1).toUpperCase()+e.slice(1)}function af(e,t=!0){if(e==null||e===void 0||e==="")return"";t&&(e=Hi(e));let o="";for(let a=0,r=e.length;a<r&&(o+=e[a].toLowerCase(),!(a<r-1&&e[a+1]===e[a+1].toLowerCase()||a<r-2&&e[a+2]===e[a+2].toLowerCase()));a++);if(o.length<e.length)for(let a=o.length,r=e.length;a<r;a++)o+=e[a];return o}function Ge(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");if(typeof Object.assign=="function")return Object.assign(e,...t);const o=Object(e);for(let a=0;a<t.length;a++){const r=t[a];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])}return o}function zi(e,t,o){const a={},r={};return e.forEach(i=>{a[i[o]]=a[i[o]]||[],a[i[o]].push(i),r[i[t]]=i}),{group:a,map:r}}function gr(e,t,o,a,r,i){const l=[];return e==null?Object.keys(t.group).forEach(s=>{(!i||!i.includes(s))&&(t.map[s]||t.group[s].forEach(d=>{(!i||!i.includes(d[o]))&&(a&&(d.value=d[a]),r&&(d.label=d[r]),t.group[d[o]]&&t.group[d[o]].length>0&&(d.children=gr(t.group[d[o]],t,o,a,r,i)),l.push(d))}))}):e.forEach(s=>{(!i||!i.includes(s[o]))&&(a&&(s.value=s[a]),r&&(s.label=s[r]),t.group[s[o]]&&t.group[s[o]].length>0&&(s.children=gr(t.group[s[o]],t,o,a,r,i)),l.push(s))}),l}function Oi(e,t,o,a,r,i){if(e.length===0||!t&&!e[0]._id)return e;const l=t||"_id";o=o||"_pid";const s=[];let d={};if(a?e.forEach(c=>{d[c[a]]||(d[c[a]]=!0,s.push(Vt(c)))}):e.forEach(c=>{s.push(Vt(c))}),d={},l===o){const c=[];return s.forEach(f=>{(!i||!i.includes(f[l]))&&(a&&(f.value=f[a]),r&&(f.label=f[r]),c.push(f))}),c}return gr(null,zi(s,l,o),l,a,r,i)}var Li=(e,t,o,a)=>{o=o||[];for(let r=0,i=o.length;r<i;r++){const l=o[r],s={};s._id=l.prop||`${t}_${r}`,s._pid=t,Object.keys(l).forEach(c=>{(!a||a.indexOf(c)===-1)&&(s[c]=l[c])}),e.push(s);const d=l.children||[];d.length>0&&(s._hasChildren=!0,Li(e,s._id,d))}},Di=(e,t)=>{const o=[];return Li(o,"0",e,t),o},Ii=(e,t,o,a)=>{t=t||[];for(let r=0,i=t.length;r<i;r++){const l=t[r],s={value:l[o],label:l[a]};e.push(s);const d=l.children||[];d.length>0&&(s.children=[],Ii(s.children,d,o,a))}},rf=(e,t,o)=>{const a=[];return Ii(a,e,t||"value",o||"label"),a},Fi=(e,t,o,a="",r)=>{t=t||[];for(let i=0,l=t.length;i<l;i++){const s=t[i],d=o(s),c=a?`${a}.${d}`:d,f=s.children||[];if(f.length>0)Fi(e,f,o,c,r);else{const p={};Object.keys(s).forEach(u=>{(!r||r.indexOf(u)===-1)&&(p[u]=s[u])}),p.label=c,e.push(p)}}},$i=(e,t,o)=>{const a=[];return Fi(a,e,t,"",o),a},la=e=>["j-autocomplete","j-checkbox","j-count","j-cascader-select","j-date","j-guid","j-input","j-number","j-now-time","j-radio","j-rate","j-textarea","j-tree-select","j-time","j-select","j-switch","j-slider-captcha","j-slider","j-barcode"].includes(e)||e.indexOf("j-input")!=-1,Wi=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,Nt=e=>{const t={...e.config||{}};if(e.getCompConfig){const o=e.getCompConfig({config:t,formData:e.formData,row:e.row,getTableData:e.getTableData,pRowData:e.pRowData})||{};for(const a in o)t[a]=o[a];return t}return t},sa=e=>e.getCompType?e.getCompType({config:e.config,formData:e.formData,row:e.row,getTableData:e.getTableData,pRowData:e.pRowData}):e.type,Ui=(e,t,o)=>{const a=Nt(o),r=sa({...o,config:a}),i={label:e,config:a,type:r};if(r==="j-autocomplete")return i;if(a&&a.options)if(e?.split){const l=e.split(","),s=Di(a.options);i.label=l.map(d=>s.find(c=>c.value===d)?.label).join(r==="j-cascader-select"?"/":",")}else i.label=a.options.find(l=>l.value===e)?.label;else t&&(i.label=t({value:e,type:r,config:a,row:o.row}));return i},lf="YYYY-MM-DD HH:mm:ss",sf="YYYY-MM-DD";function ca(e,t=lf){return e==null||e===""?"":(0,na.default)(e).format(t)}function Eo(e,t=sf){return e==null||e===""?"":(0,na.default)(e).format(t)}var cf=e=>{let t;if(e instanceof Date)t=e;else if(typeof e=="string"){if(t=new Date(e),isNaN(t))throw new Error("Invalid date string")}else if(e===void 0)t=new Date;else throw new TypeError("dateParam must be a Date object or a date string");return"日一二三四五六".charAt(t.getDay())};function Ji(e){const t="j-loading-spin",o=document.querySelector(`.${t}`);if(e){if(!o){document.body.style.overflow="hidden";const a=new DocumentFragment,r=document.createElement("div");r.className=t;const i=document.createElement("span");i.className="j-loading-spin-dot";for(let l=0;l<4;l++){const s=document.createElement("i");i.appendChild(s)}r.appendChild(i),a.appendChild(r),document.body.appendChild(a)}}else o&&o.parentNode&&(document.body.style.overflow="",o.parentNode.removeChild(o))}var df=(()=>{let e=null,t=0;return o=>{o?(t++,e&&clearTimeout(e),Ji(!0),e=null):(t=Math.max(0,t-1),t===0&&(e&&clearTimeout(e),e=setTimeout(()=>{Ji(!1),e=null},400)))}})();function hn(e){df(e)}var uf=Rt(((e,t)=>{t.exports={}})),jt=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a():typeof define=="function"&&define.amd?define([],a):o.CryptoJS=a()})(e,function(){var o=o||(function(a,r){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof require=="function")try{i=uf()}catch{}var l=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||(function(){function b(){}return function(y){var C;return b.prototype=y,C=new b,b.prototype=null,C}})(),d={},c=d.lib={},f=c.Base=(function(){return{extend:function(b){var y=s(this);return b&&y.mixIn(b),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var y in b)b.hasOwnProperty(y)&&(this[y]=b[y]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),p=c.WordArray=f.extend({init:function(b,y){b=this.words=b||[],y!=r?this.sigBytes=y:this.sigBytes=b.length*4},toString:function(b){return(b||h).stringify(this)},concat:function(b){var y=this.words,C=b.words,S=this.sigBytes,v=b.sigBytes;if(this.clamp(),S%4)for(var x=0;x<v;x++){var E=C[x>>>2]>>>24-x%4*8&255;y[S+x>>>2]|=E<<24-(S+x)%4*8}else for(var _=0;_<v;_+=4)y[S+_>>>2]=C[_>>>2];return this.sigBytes+=v,this},clamp:function(){var b=this.words,y=this.sigBytes;b[y>>>2]&=4294967295<<32-y%4*8,b.length=a.ceil(y/4)},clone:function(){var b=f.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var y=[],C=0;C<b;C+=4)y.push(l());return new p.init(y,b)}}),u=d.enc={},h=u.Hex={stringify:function(b){for(var y=b.words,C=b.sigBytes,S=[],v=0;v<C;v++){var x=y[v>>>2]>>>24-v%4*8&255;S.push((x>>>4).toString(16)),S.push((x&15).toString(16))}return S.join("")},parse:function(b){for(var y=b.length,C=[],S=0;S<y;S+=2)C[S>>>3]|=parseInt(b.substr(S,2),16)<<24-S%8*4;return new p.init(C,y/2)}},g=u.Latin1={stringify:function(b){for(var y=b.words,C=b.sigBytes,S=[],v=0;v<C;v++){var x=y[v>>>2]>>>24-v%4*8&255;S.push(String.fromCharCode(x))}return S.join("")},parse:function(b){for(var y=b.length,C=[],S=0;S<y;S++)C[S>>>2]|=(b.charCodeAt(S)&255)<<24-S%4*8;return new p.init(C,y)}},m=u.Utf8={stringify:function(b){try{return decodeURIComponent(escape(g.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return g.parse(unescape(encodeURIComponent(b)))}},w=c.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(b){typeof b=="string"&&(b=m.parse(b)),this._data.concat(b),this._nDataBytes+=b.sigBytes},_process:function(b){var y,C=this._data,S=C.words,v=C.sigBytes,x=this.blockSize,E=v/(x*4);b?E=a.ceil(E):E=a.max((E|0)-this._minBufferSize,0);var _=E*x,T=a.min(_*4,v);if(_){for(var V=0;V<_;V+=x)this._doProcessBlock(S,V);y=S.splice(0,_),C.sigBytes-=T}return new p.init(y,T)},clone:function(){var b=f.clone.call(this);return b._data=this._data.clone(),b},_minBufferSize:0});c.Hasher=w.extend({cfg:f.extend(),init:function(b){this.cfg=this.cfg.extend(b),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(b){return this._append(b),this._process(),this},finalize:function(b){return b&&this._append(b),this._doFinalize()},blockSize:16,_createHelper:function(b){return function(y,C){return new b.init(C).finalize(y)}},_createHmacHelper:function(b){return function(y,C){return new k.HMAC.init(b,C).finalize(y)}}});var k=d.algo={};return d})(Math);return o})})),Yi=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return(function(){var a=o,r=a.lib.WordArray,i=a.enc;i.Base64={stringify:function(s){var d=s.words,c=s.sigBytes,f=this._map;s.clamp();for(var p=[],u=0;u<c;u+=3)for(var h=d[u>>>2]>>>24-u%4*8&255,g=d[u+1>>>2]>>>24-(u+1)%4*8&255,m=d[u+2>>>2]>>>24-(u+2)%4*8&255,w=h<<16|g<<8|m,k=0;k<4&&u+k*.75<c;k++)p.push(f.charAt(w>>>6*(3-k)&63));var b=f.charAt(64);if(b)for(;p.length%4;)p.push(b);return p.join("")},parse:function(s){var d=s.length,c=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var p=0;p<c.length;p++)f[c.charCodeAt(p)]=p}var u=c.charAt(64);if(u){var h=s.indexOf(u);h!==-1&&(d=h)}return l(s,d,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(s,d,c){for(var f=[],p=0,u=0;u<d;u++)if(u%4){var h=c[s.charCodeAt(u-1)]<<u%4*2|c[s.charCodeAt(u)]>>>6-u%4*2;f[p>>>2]|=h<<24-p%4*8,p++}return r.create(f,p)}})(),o.enc.Base64})})),Gi=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return(function(a){var r=o,i=r.lib,l=i.WordArray,s=i.Hasher,d=r.algo,c=[];(function(){for(var m=0;m<64;m++)c[m]=a.abs(a.sin(m+1))*4294967296|0})();var f=d.MD5=s.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,w){for(var k=0;k<16;k++){var b=w+k,y=m[b];m[b]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}var C=this._hash.words,S=m[w+0],v=m[w+1],x=m[w+2],E=m[w+3],_=m[w+4],T=m[w+5],V=m[w+6],N=m[w+7],z=m[w+8],j=m[w+9],A=m[w+10],B=m[w+11],L=m[w+12],U=m[w+13],te=m[w+14],se=m[w+15],I=C[0],$=C[1],Y=C[2],M=C[3];I=p(I,$,Y,M,S,7,c[0]),M=p(M,I,$,Y,v,12,c[1]),Y=p(Y,M,I,$,x,17,c[2]),$=p($,Y,M,I,E,22,c[3]),I=p(I,$,Y,M,_,7,c[4]),M=p(M,I,$,Y,T,12,c[5]),Y=p(Y,M,I,$,V,17,c[6]),$=p($,Y,M,I,N,22,c[7]),I=p(I,$,Y,M,z,7,c[8]),M=p(M,I,$,Y,j,12,c[9]),Y=p(Y,M,I,$,A,17,c[10]),$=p($,Y,M,I,B,22,c[11]),I=p(I,$,Y,M,L,7,c[12]),M=p(M,I,$,Y,U,12,c[13]),Y=p(Y,M,I,$,te,17,c[14]),$=p($,Y,M,I,se,22,c[15]),I=u(I,$,Y,M,v,5,c[16]),M=u(M,I,$,Y,V,9,c[17]),Y=u(Y,M,I,$,B,14,c[18]),$=u($,Y,M,I,S,20,c[19]),I=u(I,$,Y,M,T,5,c[20]),M=u(M,I,$,Y,A,9,c[21]),Y=u(Y,M,I,$,se,14,c[22]),$=u($,Y,M,I,_,20,c[23]),I=u(I,$,Y,M,j,5,c[24]),M=u(M,I,$,Y,te,9,c[25]),Y=u(Y,M,I,$,E,14,c[26]),$=u($,Y,M,I,z,20,c[27]),I=u(I,$,Y,M,U,5,c[28]),M=u(M,I,$,Y,x,9,c[29]),Y=u(Y,M,I,$,N,14,c[30]),$=u($,Y,M,I,L,20,c[31]),I=h(I,$,Y,M,T,4,c[32]),M=h(M,I,$,Y,z,11,c[33]),Y=h(Y,M,I,$,B,16,c[34]),$=h($,Y,M,I,te,23,c[35]),I=h(I,$,Y,M,v,4,c[36]),M=h(M,I,$,Y,_,11,c[37]),Y=h(Y,M,I,$,N,16,c[38]),$=h($,Y,M,I,A,23,c[39]),I=h(I,$,Y,M,U,4,c[40]),M=h(M,I,$,Y,S,11,c[41]),Y=h(Y,M,I,$,E,16,c[42]),$=h($,Y,M,I,V,23,c[43]),I=h(I,$,Y,M,j,4,c[44]),M=h(M,I,$,Y,L,11,c[45]),Y=h(Y,M,I,$,se,16,c[46]),$=h($,Y,M,I,x,23,c[47]),I=g(I,$,Y,M,S,6,c[48]),M=g(M,I,$,Y,N,10,c[49]),Y=g(Y,M,I,$,te,15,c[50]),$=g($,Y,M,I,T,21,c[51]),I=g(I,$,Y,M,L,6,c[52]),M=g(M,I,$,Y,E,10,c[53]),Y=g(Y,M,I,$,A,15,c[54]),$=g($,Y,M,I,v,21,c[55]),I=g(I,$,Y,M,z,6,c[56]),M=g(M,I,$,Y,se,10,c[57]),Y=g(Y,M,I,$,V,15,c[58]),$=g($,Y,M,I,U,21,c[59]),I=g(I,$,Y,M,_,6,c[60]),M=g(M,I,$,Y,B,10,c[61]),Y=g(Y,M,I,$,x,15,c[62]),$=g($,Y,M,I,j,21,c[63]),C[0]=C[0]+I|0,C[1]=C[1]+$|0,C[2]=C[2]+Y|0,C[3]=C[3]+M|0},_doFinalize:function(){var m=this._data,w=m.words,k=this._nDataBytes*8,b=m.sigBytes*8;w[b>>>5]|=128<<24-b%32;var y=a.floor(k/4294967296),C=k;w[(b+64>>>9<<4)+15]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,w[(b+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,m.sigBytes=(w.length+1)*4,this._process();for(var S=this._hash,v=S.words,x=0;x<4;x++){var E=v[x];v[x]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return S},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});function p(m,w,k,b,y,C,S){var v=m+(w&k|~w&b)+y+S;return(v<<C|v>>>32-C)+w}function u(m,w,k,b,y,C,S){var v=m+(w&b|k&~b)+y+S;return(v<<C|v>>>32-C)+w}function h(m,w,k,b,y,C,S){var v=m+(w^k^b)+y+S;return(v<<C|v>>>32-C)+w}function g(m,w,k,b,y,C,S){var v=m+(k^(w|~b))+y+S;return(v<<C|v>>>32-C)+w}r.MD5=s._createHelper(f),r.HmacMD5=s._createHmacHelper(f)})(Math),o.MD5})})),ff=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return(function(){var a=o,r=a.lib,i=r.WordArray,l=r.Hasher,s=a.algo,d=[],c=s.SHA1=l.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,p){for(var u=this._hash.words,h=u[0],g=u[1],m=u[2],w=u[3],k=u[4],b=0;b<80;b++){if(b<16)d[b]=f[p+b]|0;else{var y=d[b-3]^d[b-8]^d[b-14]^d[b-16];d[b]=y<<1|y>>>31}var C=(h<<5|h>>>27)+k+d[b];b<20?C+=(g&m|~g&w)+1518500249:b<40?C+=(g^m^w)+1859775393:b<60?C+=(g&m|g&w|m&w)-1894007588:C+=(g^m^w)-899497514,k=w,w=m,m=g<<30|g>>>2,g=h,h=C}u[0]=u[0]+h|0,u[1]=u[1]+g|0,u[2]=u[2]+m|0,u[3]=u[3]+w|0,u[4]=u[4]+k|0},_doFinalize:function(){var f=this._data,p=f.words,u=this._nDataBytes*8,h=f.sigBytes*8;return p[h>>>5]|=128<<24-h%32,p[(h+64>>>9<<4)+14]=Math.floor(u/4294967296),p[(h+64>>>9<<4)+15]=u,f.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var f=l.clone.call(this);return f._hash=this._hash.clone(),f}});a.SHA1=l._createHelper(c),a.HmacSHA1=l._createHmacHelper(c)})(),o.SHA1})})),pf=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){(function(){var a=o,r=a.lib.Base,i=a.enc.Utf8,l=a.algo;l.HMAC=r.extend({init:function(s,d){s=this._hasher=new s.init,typeof d=="string"&&(d=i.parse(d));var c=s.blockSize,f=c*4;d.sigBytes>f&&(d=s.finalize(d)),d.clamp();for(var p=this._oKey=d.clone(),u=this._iKey=d.clone(),h=p.words,g=u.words,m=0;m<c;m++)h[m]^=1549556828,g[m]^=909522486;p.sigBytes=u.sigBytes=f,this.reset()},reset:function(){var s=this._hasher;s.reset(),s.update(this._iKey)},update:function(s){return this._hasher.update(s),this},finalize:function(s){var d=this._hasher,c=d.finalize(s);return d.reset(),d.finalize(this._oKey.clone().concat(c))}})})()})})),Ki=Rt(((e,t)=>{(function(o,a,r){typeof e=="object"?t.exports=e=a(jt(),ff(),pf()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],a):a(o.CryptoJS)})(e,function(o){return(function(){var a=o,r=a.lib,i=r.Base,l=r.WordArray,s=a.algo,d=s.MD5,c=s.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:d,iterations:1}),init:function(f){this.cfg=this.cfg.extend(f)},compute:function(f,p){for(var u,h=this.cfg,g=h.hasher.create(),m=l.create(),w=m.words,k=h.keySize,b=h.iterations;w.length<k;){u&&g.update(u),u=g.update(f).finalize(p),g.reset();for(var y=1;y<b;y++)u=g.finalize(u),g.reset();m.concat(u)}return m.sigBytes=k*4,m}});a.EvpKDF=function(f,p,u){return c.create(u).compute(f,p)}})(),o.EvpKDF})})),qi=Rt(((e,t)=>{(function(o,a,r){typeof e=="object"?t.exports=e=a(jt(),Ki()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],a):a(o.CryptoJS)})(e,function(o){o.lib.Cipher||(function(a){var r=o,i=r.lib,l=i.Base,s=i.WordArray,d=i.BufferedBlockAlgorithm,c=r.enc;c.Utf8;var f=c.Base64,p=r.algo.EvpKDF,u=i.Cipher=d.extend({cfg:l.extend(),createEncryptor:function(_,T){return this.create(this._ENC_XFORM_MODE,_,T)},createDecryptor:function(_,T){return this.create(this._DEC_XFORM_MODE,_,T)},init:function(_,T,V){this.cfg=this.cfg.extend(V),this._xformMode=_,this._key=T,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(_){return this._append(_),this._process()},finalize:function(_){return _&&this._append(_),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function _(T){return typeof T=="string"?E:S}return function(T){return{encrypt:function(V,N,z){return _(N).encrypt(T,V,N,z)},decrypt:function(V,N,z){return _(N).decrypt(T,V,N,z)}}}})()});i.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=r.mode={},g=i.BlockCipherMode=l.extend({createEncryptor:function(_,T){return this.Encryptor.create(_,T)},createDecryptor:function(_,T){return this.Decryptor.create(_,T)},init:function(_,T){this._cipher=_,this._iv=T}}),m=h.CBC=(function(){var _=g.extend();_.Encryptor=_.extend({processBlock:function(V,N){var z=this._cipher,j=z.blockSize;T.call(this,V,N,j),z.encryptBlock(V,N),this._prevBlock=V.slice(N,N+j)}}),_.Decryptor=_.extend({processBlock:function(V,N){var z=this._cipher,j=z.blockSize,A=V.slice(N,N+j);z.decryptBlock(V,N),T.call(this,V,N,j),this._prevBlock=A}});function T(V,N,z){var j,A=this._iv;A?(j=A,this._iv=a):j=this._prevBlock;for(var B=0;B<z;B++)V[N+B]^=j[B]}return _})(),w=r.pad={},k=w.Pkcs7={pad:function(_,T){for(var V=T*4,N=V-_.sigBytes%V,z=N<<24|N<<16|N<<8|N,j=[],A=0;A<N;A+=4)j.push(z);var B=s.create(j,N);_.concat(B)},unpad:function(_){var T=_.words[_.sigBytes-1>>>2]&255;_.sigBytes-=T}};i.BlockCipher=u.extend({cfg:u.cfg.extend({mode:m,padding:k}),reset:function(){var _;u.reset.call(this);var T=this.cfg,V=T.iv,N=T.mode;this._xformMode==this._ENC_XFORM_MODE?_=N.createEncryptor:(_=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==_?this._mode.init(this,V&&V.words):(this._mode=_.call(N,this,V&&V.words),this._mode.__creator=_)},_doProcessBlock:function(_,T){this._mode.processBlock(_,T)},_doFinalize:function(){var _,T=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(T.pad(this._data,this.blockSize),_=this._process(!0)):(_=this._process(!0),T.unpad(_)),_},blockSize:128/32});var b=i.CipherParams=l.extend({init:function(_){this.mixIn(_)},toString:function(_){return(_||this.formatter).stringify(this)}}),y=r.format={},C=y.OpenSSL={stringify:function(_){var T,V=_.ciphertext,N=_.salt;return N?T=s.create([1398893684,1701076831]).concat(N).concat(V):T=V,T.toString(f)},parse:function(_){var T,V=f.parse(_),N=V.words;return N[0]==1398893684&&N[1]==1701076831&&(T=s.create(N.slice(2,4)),N.splice(0,4),V.sigBytes-=16),b.create({ciphertext:V,salt:T})}},S=i.SerializableCipher=l.extend({cfg:l.extend({format:C}),encrypt:function(_,T,V,N){N=this.cfg.extend(N);var z=_.createEncryptor(V,N),j=z.finalize(T),A=z.cfg;return b.create({ciphertext:j,key:V,iv:A.iv,algorithm:_,mode:A.mode,padding:A.padding,blockSize:_.blockSize,formatter:N.format})},decrypt:function(_,T,V,N){return N=this.cfg.extend(N),T=this._parse(T,N.format),_.createDecryptor(V,N).finalize(T.ciphertext)},_parse:function(_,T){return typeof _=="string"?T.parse(_,this):_}}),v=r.kdf={},x=v.OpenSSL={execute:function(_,T,V,N,z){if(N||(N=s.random(64/8)),z)var j=p.create({keySize:T+V,hasher:z}).compute(_,N);else var j=p.create({keySize:T+V}).compute(_,N);var A=s.create(j.words.slice(T),V*4);return j.sigBytes=T*4,b.create({key:j,iv:A,salt:N})}},E=i.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:x}),encrypt:function(_,T,V,N){N=this.cfg.extend(N);var z=N.kdf.execute(V,_.keySize,_.ivSize,N.salt,N.hasher);N.iv=z.iv;var j=S.encrypt.call(this,_,T,z.key,N);return j.mixIn(z),j},decrypt:function(_,T,V,N){N=this.cfg.extend(N),T=this._parse(T,N.format);var z=N.kdf.execute(V,_.keySize,_.ivSize,T.salt,N.hasher);return N.iv=z.iv,S.decrypt.call(this,_,T,z.key,N)}})})()})})),hf=Rt(((e,t)=>{(function(o,a,r){typeof e=="object"?t.exports=e=a(jt(),Yi(),Gi(),Ki(),qi()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],a):a(o.CryptoJS)})(e,function(o){return(function(){var a=o,r=a.lib.BlockCipher,i=a.algo,l=[],s=[],d=[],c=[],f=[],p=[],u=[],h=[],g=[],m=[];(function(){for(var b=[],y=0;y<256;y++)y<128?b[y]=y<<1:b[y]=y<<1^283;for(var C=0,S=0,y=0;y<256;y++){var v=S^S<<1^S<<2^S<<3^S<<4;v=v>>>8^v&255^99,l[C]=v,s[v]=C;var x=b[C],E=b[x],_=b[E],T=b[v]*257^v*16843008;d[C]=T<<24|T>>>8,c[C]=T<<16|T>>>16,f[C]=T<<8|T>>>24,p[C]=T;var T=_*16843009^E*65537^x*257^C*16843008;u[v]=T<<24|T>>>8,h[v]=T<<16|T>>>16,g[v]=T<<8|T>>>24,m[v]=T,C?(C=x^b[b[b[_^x]]],S^=b[b[S]]):C=S=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],k=i.AES=r.extend({_doReset:function(){var b;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var y=this._keyPriorReset=this._key,C=y.words,S=y.sigBytes/4,v=((this._nRounds=S+6)+1)*4,x=this._keySchedule=[],E=0;E<v;E++)E<S?x[E]=C[E]:(b=x[E-1],E%S?S>6&&E%S==4&&(b=l[b>>>24]<<24|l[b>>>16&255]<<16|l[b>>>8&255]<<8|l[b&255]):(b=b<<8|b>>>24,b=l[b>>>24]<<24|l[b>>>16&255]<<16|l[b>>>8&255]<<8|l[b&255],b^=w[E/S|0]<<24),x[E]=x[E-S]^b);for(var _=this._invKeySchedule=[],T=0;T<v;T++){var E=v-T;if(T%4)var b=x[E];else var b=x[E-4];T<4||E<=4?_[T]=b:_[T]=u[l[b>>>24]]^h[l[b>>>16&255]]^g[l[b>>>8&255]]^m[l[b&255]]}}},encryptBlock:function(b,y){this._doCryptBlock(b,y,this._keySchedule,d,c,f,p,l)},decryptBlock:function(b,y){var C=b[y+1];b[y+1]=b[y+3],b[y+3]=C,this._doCryptBlock(b,y,this._invKeySchedule,u,h,g,m,s);var C=b[y+1];b[y+1]=b[y+3],b[y+3]=C},_doCryptBlock:function(b,y,C,S,v,x,E,_){for(var T=this._nRounds,V=b[y]^C[0],N=b[y+1]^C[1],z=b[y+2]^C[2],j=b[y+3]^C[3],A=4,B=1;B<T;B++){var L=S[V>>>24]^v[N>>>16&255]^x[z>>>8&255]^E[j&255]^C[A++],U=S[N>>>24]^v[z>>>16&255]^x[j>>>8&255]^E[V&255]^C[A++],te=S[z>>>24]^v[j>>>16&255]^x[V>>>8&255]^E[N&255]^C[A++],se=S[j>>>24]^v[V>>>16&255]^x[N>>>8&255]^E[z&255]^C[A++];V=L,N=U,z=te,j=se}var L=(_[V>>>24]<<24|_[N>>>16&255]<<16|_[z>>>8&255]<<8|_[j&255])^C[A++],U=(_[N>>>24]<<24|_[z>>>16&255]<<16|_[j>>>8&255]<<8|_[V&255])^C[A++],te=(_[z>>>24]<<24|_[j>>>16&255]<<16|_[V>>>8&255]<<8|_[N&255])^C[A++],se=(_[j>>>24]<<24|_[V>>>16&255]<<16|_[N>>>8&255]<<8|_[z&255])^C[A++];b[y]=L,b[y+1]=U,b[y+2]=te,b[y+3]=se},keySize:256/32});a.AES=r._createHelper(k)})(),o.AES})})),gf=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return o.enc.Utf8})})),mf=Rt(((e,t)=>{(function(o,a,r){typeof e=="object"?t.exports=e=a(jt(),qi()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],a):a(o.CryptoJS)})(e,function(o){return o.pad.Pkcs7})})),yf=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return(function(a){var r=o,i=r.lib,l=i.WordArray,s=i.Hasher,d=r.algo,c=[],f=[];(function(){function h(k){for(var b=a.sqrt(k),y=2;y<=b;y++)if(!(k%y))return!1;return!0}function g(k){return(k-(k|0))*4294967296|0}for(var m=2,w=0;w<64;)h(m)&&(w<8&&(c[w]=g(a.pow(m,1/2))),f[w]=g(a.pow(m,1/3)),w++),m++})();var p=[],u=d.SHA256=s.extend({_doReset:function(){this._hash=new l.init(c.slice(0))},_doProcessBlock:function(h,g){for(var m=this._hash.words,w=m[0],k=m[1],b=m[2],y=m[3],C=m[4],S=m[5],v=m[6],x=m[7],E=0;E<64;E++){if(E<16)p[E]=h[g+E]|0;else{var _=p[E-15],T=(_<<25|_>>>7)^(_<<14|_>>>18)^_>>>3,V=p[E-2],N=(V<<15|V>>>17)^(V<<13|V>>>19)^V>>>10;p[E]=T+p[E-7]+N+p[E-16]}var z=C&S^~C&v,j=w&k^w&b^k&b,A=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),B=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),L=x+B+z+f[E]+p[E],U=A+j;x=v,v=S,S=C,C=y+L|0,y=b,b=k,k=w,w=L+U|0}m[0]=m[0]+w|0,m[1]=m[1]+k|0,m[2]=m[2]+b|0,m[3]=m[3]+y|0,m[4]=m[4]+C|0,m[5]=m[5]+S|0,m[6]=m[6]+v|0,m[7]=m[7]+x|0},_doFinalize:function(){var h=this._data,g=h.words,m=this._nDataBytes*8,w=h.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+64>>>9<<4)+14]=a.floor(m/4294967296),g[(w+64>>>9<<4)+15]=m,h.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});r.SHA256=s._createHelper(u),r.HmacSHA256=s._createHmacHelper(u)})(Math),o.SHA256})})),vf=Rt(((e,t)=>{(function(o,a){typeof e=="object"?t.exports=e=a(jt()):typeof define=="function"&&define.amd?define(["./core"],a):a(o.CryptoJS)})(e,function(o){return(function(a){var r=o,i=r.lib,l=i.Base,s=i.WordArray,d=r.x64={};d.Word=l.extend({init:function(c,f){this.high=c,this.low=f}}),d.WordArray=l.extend({init:function(c,f){c=this.words=c||[],f!=a?this.sigBytes=f:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,f=c.length,p=[],u=0;u<f;u++){var h=c[u];p.push(h.high),p.push(h.low)}return s.create(p,this.sigBytes)},clone:function(){for(var c=l.clone.call(this),f=c.words=this.words.slice(0),p=f.length,u=0;u<p;u++)f[u]=f[u].clone();return c}})})(),o})})),bf=Rt(((e,t)=>{(function(o,a,r){typeof e=="object"?t.exports=e=a(jt(),vf()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],a):a(o.CryptoJS)})(e,function(o){return(function(){var a=o,r=a.lib.Hasher,i=a.x64,l=i.Word,s=i.WordArray,d=a.algo;function c(){return l.create.apply(l,arguments)}var f=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],p=[];(function(){for(var h=0;h<80;h++)p[h]=c()})();var u=d.SHA512=r.extend({_doReset:function(){this._hash=new s.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(h,g){for(var m=this._hash.words,w=m[0],k=m[1],b=m[2],y=m[3],C=m[4],S=m[5],v=m[6],x=m[7],E=w.high,_=w.low,T=k.high,V=k.low,N=b.high,z=b.low,j=y.high,A=y.low,B=C.high,L=C.low,U=S.high,te=S.low,se=v.high,I=v.low,$=x.high,Y=x.low,M=E,oe=_,me=T,ce=V,Be=N,Te=z,q=j,ge=A,we=B,Se=L,lt=U,Qe=te,Ae=se,kt=I,Ht=$,St=Y,ct=0;ct<80;ct++){var dt,$e,yt=p[ct];if(ct<16)$e=yt.high=h[g+ct*2]|0,dt=yt.low=h[g+ct*2+1]|0;else{var Qt=p[ct-15],W=Qt.high,ne=Qt.low,X=(W>>>1|ne<<31)^(W>>>8|ne<<24)^W>>>7,Q=(ne>>>1|W<<31)^(ne>>>8|W<<24)^(ne>>>7|W<<25),le=p[ct-2],Ce=le.high,Ee=le.low,Le=(Ce>>>19|Ee<<13)^(Ce<<3|Ee>>>29)^Ce>>>6,ot=(Ee>>>19|Ce<<13)^(Ee<<3|Ce>>>29)^(Ee>>>6|Ce<<26),We=p[ct-7],en=We.high,tn=We.low,Pn=p[ct-16],Co=Pn.high,he=Pn.low;dt=Q+tn,$e=X+en+(dt>>>0<Q>>>0?1:0),dt=dt+ot,$e=$e+Le+(dt>>>0<ot>>>0?1:0),dt=dt+he,$e=$e+Co+(dt>>>0<he>>>0?1:0),yt.high=$e,yt.low=dt}var xe=we<^~we&Ae,ze=Se&Qe^~Se&kt,ut=M&me^M&Be^me&Be,ue=oe&ce^oe&Te^ce&Te,qe=(M>>>28|oe<<4)^(M<<30|oe>>>2)^(M<<25|oe>>>7),Et=(oe>>>28|M<<4)^(oe<<30|M>>>2)^(oe<<25|M>>>7),gt=(we>>>14|Se<<18)^(we>>>18|Se<<14)^(we<<23|Se>>>9),mt=(Se>>>14|we<<18)^(Se>>>18|we<<14)^(Se<<23|we>>>9),Mt=f[ct],Me=Mt.high,fn=Mt.low,et=St+mt,Xe=Ht+gt+(et>>>0<St>>>0?1:0),et=et+ze,Xe=Xe+xe+(et>>>0<ze>>>0?1:0),et=et+fn,Xe=Xe+Me+(et>>>0<fn>>>0?1:0),et=et+dt,Xe=Xe+$e+(et>>>0<dt>>>0?1:0),wt=Et+ue,zt=qe+ut+(wt>>>0<Et>>>0?1:0);Ht=Ae,St=kt,Ae=lt,kt=Qe,lt=we,Qe=Se,Se=ge+et|0,we=q+Xe+(Se>>>0<ge>>>0?1:0)|0,q=Be,ge=Te,Be=me,Te=ce,me=M,ce=oe,oe=et+wt|0,M=Xe+zt+(oe>>>0<et>>>0?1:0)|0}_=w.low=_+oe,w.high=E+M+(_>>>0<oe>>>0?1:0),V=k.low=V+ce,k.high=T+me+(V>>>0<ce>>>0?1:0),z=b.low=z+Te,b.high=N+Be+(z>>>0<Te>>>0?1:0),A=y.low=A+ge,y.high=j+q+(A>>>0<ge>>>0?1:0),L=C.low=L+Se,C.high=B+we+(L>>>0<Se>>>0?1:0),te=S.low=te+Qe,S.high=U+lt+(te>>>0<Qe>>>0?1:0),I=v.low=I+kt,v.high=se+Ae+(I>>>0<kt>>>0?1:0),Y=x.low=Y+St,x.high=$+Ht+(Y>>>0<St>>>0?1:0)},_doFinalize:function(){var h=this._data,g=h.words,m=this._nDataBytes*8,w=h.sigBytes*8;return g[w>>>5]|=128<<24-w%32,g[(w+128>>>10<<5)+30]=Math.floor(m/4294967296),g[(w+128>>>10<<5)+31]=m,h.sigBytes=g.length*4,this._process(),this._hash.toX32()},clone:function(){var h=r.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:1024/32});a.SHA512=r._createHelper(u),a.HmacSHA512=r._createHmacHelper(u)})(),o.SHA512})})),wf=vt(hf(),1),Xi=vt(gf(),1),Cf=vt(mf(),1),Zi=vt(Yi(),1),xf=vt(Gi(),1),kf=vt(yf(),1),Sf=vt(bf(),1),{decrypt:Qi,encrypt:Ef}=wf.default,da=Xi.default,el=Xi.default.parse,tl=(e,t=32)=>{const{length:o}=e;if(o<t){for(let a=0,r=t-o;a<r;a++)e+="0";return e}return o>t?e.substring(0,t):e},_f=class{key;iv;constructor({key:e,iv:t}){this.key=el(tl(e)),this.iv=el(tl(t||"1234567890000000",16))}get getOptions(){return{padding:Cf.default,iv:this.iv}}encrypt(e){return Ef(e,this.key,this.getOptions).toString()}decrypt(e){return Qi(e,this.key,this.getOptions).toString(da)}},Bf=class Zo{static instance;constructor(){}static getInstance(){return Zo.instance||(Zo.instance=new Zo),Zo.instance}encrypt(t){return da.parse(t).toString(Zi.default)}decrypt(t){return Zi.default.parse(t).toString(da)}},Rf=class Qo{static instance;constructor(){}static getInstance(){return Qo.instance||(Qo.instance=new Qo),Qo.instance}hash(t){return(0,xf.default)(t).toString()}},Tf=class ea{static instance;constructor(){}static getInstance(){return ea.instance||(ea.instance=new ea),ea.instance}hash(t){return(0,kf.default)(t).toString()}},Vf=class ta{static instance;constructor(){}static getInstance(){return ta.instance||(ta.instance=new ta),ta.instance}hash(t){return(0,Sf.default)(t).toString()}},nl=class{static createAesEncryption(e){return new _f(e)}static createBase64Encryption(){return Bf.getInstance()}},Mf=class{static createMD5Hashing(){return Rf.getInstance()}static createSHA256Hashing(){return Tf.getInstance()}static createSHA512Hashing(){return Vf.getInstance()}},Af=(e,t)=>Qi(e,t).toString(da);function ol(e,t){function o(){(0,n.nextTick)(()=>{e=(0,n.unref)(e),e&&or.default.create(e,{animation:100,delay:400,delayOnTouchOnly:!0,...t})})}return{initSortable:o}}var al=async e=>new Promise((t,o)=>{if(typeof window.BMap<"u"){t(window.BMap);return}window.onBMapCallback=function(){t(window.BMap)};const a=document.createElement("script");a.type="text/javascript",a.src=`https://api.map.baidu.com/api?v=3.0&ak=${e||"dPHQKHyFl1GmMBjGVbVCSs6GSrswTuPQ"}&callback=onBMapCallback`,a.onerror=o,document.head.appendChild(a)}),mr=class{events=new Map;on(e,t){this.events.has(e)||this.events.set(e,new Set),this.events.get(e).add(t)}once(e,t){const o=(...a)=>{t(...a),this.off(e,o)};this.on(e,o)}emit(e,...t){const o=this.events.get(e);if(o)for(const a of o)return a(...t)}off(e,t){if(!t){this.events.delete(e);return}const o=this.events.get(e);o&&(o.delete(t),o.size===0&&this.events.delete(e))}clear(){this.events.clear()}},Nf=new mr,pt={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",COMP_PROVIDE:"jcode_comp_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide",PAGE_PROVIDE:"jcode_page_provide"};function Ut(e,t){return(0,n.inject)(e,t)}function Jt(e,t){(0,n.provide)(e,t)}function Ye(){return Ut(pt.APP_PROVIDE,{t:(e,...t)=>{if(!e)return"";if(typeof e!="string")return e;let o=e||"";return t.length>0&&t.forEach((a,r)=>{o=o.replace(new RegExp(`\\{${r}\\}`,"g"),a)}),o.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:e,config:t})=>{if(e==null||e==="")return"";if(t?.dataType==="options"){let o=[e];typeof e=="string"&&e.split&&(o=e.split(","));const a=(t.options||[]).filter(r=>o.includes(r[t.valueKey||"value"])).map(r=>r[t.labelKey||"label"]);return String(a)||e}return e},getObjectList:({value:e,config:t})=>{if(e==null||e==="")return[];if(t?.dataType==="options"){let o=[e];return typeof e=="string"&&e.split&&(o=e.split(",")),(t.options||[]).filter(a=>o.includes(a[t.valueKey||"value"]))||[]}return[]}})})}function jf(e){Jt(pt.APP_PROVIDE,e)}function gn(){return Ut(pt.FORM_PROVIDE,{})}function yr(e){Jt(pt.FORM_PROVIDE,e)}function ua(){return Ut(pt.TABLE_PROVIDE,{})}function _o(e){Jt(pt.TABLE_PROVIDE,e)}function rl(){return Ut(pt.COMP_PROVIDE,{})}function vr(e){Jt(pt.COMP_PROVIDE,e)}function to(){return Ut(pt.MENU_PROVIDE,{})}function il(e){Jt(pt.MENU_PROVIDE,e)}function ll(){return Ut(pt.H_MENU_PROVIDE,{})}function sl(e){Jt(pt.H_MENU_PROVIDE,e)}function cl(){return Ut(pt.AUTH_PAGE_PROVIDE,{getPageName:()=>""})}function dl(e){Jt(pt.AUTH_PAGE_PROVIDE,e)}function Pf(){return Ut(pt.LAYER_PROVIDE,{})}function ul(e){Jt(pt.LAYER_PROVIDE,e)}function fl(){return Ut(pt.PAGE_PROVIDE,{})}function pl(e){Jt(pt.PAGE_PROVIDE,e)}var Hf=(0,n.defineComponent)({name:"JDynamicLayer",__name:"dynamic-layer",setup(e,{expose:t}){const o=(0,n.ref)(),a=(0,n.ref)(600),r=(0,n.ref)(400),i=(0,n.ref)(!0),l=(0,n.ref)(!0),s=(0,n.ref)(!0),d=(0,n.ref)(""),c=(0,n.ref)([]),f=(0,n.ref)(!0),p=(0,n.ref)(),u=(0,n.shallowRef)(),h=(0,n.ref)(),{getPageName:g}=cl(),m=()=>{const z=g();return z||(typeof u.value=="string"?u.value:"")},w=(0,n.ref)(!1),k=(0,n.ref)([]),b=async z=>{if(p.value?.validateSteps){hn(!0);const j=p.value.validateSteps(z);return hn(!1),j}return!0},y=()=>p.value?.beforeClose?p.value.beforeClose():!0;let C,S,v,x=0;const E=async z=>{if(p.value){if(x=0,p.value.getConfig){const j=p.value.getConfig();c.value=j.buttons||[],w.value=j.isStep,k.value=j.steps||[]}else c.value=[],w.value=!1,k.value=[];if(p.value.open)try{const{buttons:j}=await p.value.open(z,o.value,()=>{C&&C()})||{};if(j&&j.length>0){const A=[];A.push(...c.value),A.push(...j),c.value=A}}catch(j){o.value.close(),console.error(j)}o.value.hideLoading()}else{if(x>600){console.warn("表单组件加载超时"),o.value.hideLoading();return}x++,setTimeout(async()=>{await E(z)},100)}},_=z=>{u.value=z?.name,a.value=z?.width||600,r.value=z?.height||400,i.value=z?.hasBtns!==!1,l.value=z?.hasSaveBtn!==!1,s.value=z?.hasHeader!==!1,z?.destroyOnClose!==!1&&(f.value=!0),h.value=z?.config||{},d.value=z?.btnText||"保存",C=z?.afterOk||null,S=z?.afterClose||null,v=z?.afterCancel||null,o.value.open(z.title,z.type,z.subtitle),(0,n.nextTick)(async()=>{o.value.showLoading("加载中"),await E(z.param||{})})},T=async()=>{if(p.value?.ok){hn(!0);const z=await p.value.ok();z&&(o.value.close(),C&&await C(z)),hn(!1)}},V=()=>{p.value?.closed&&p.value.closed(),S&&S()},N=()=>{v&&v()};return dl({getPageName:m}),t({open:_}),(z,j)=>{const A=(0,n.resolveComponent)("j-layer");return(0,n.openBlock)(),(0,n.createBlock)(A,{ref_key:"layerRef",ref:o,width:a.value,height:r.value,"before-close":y,"validate-steps":b,"is-step":w.value,steps:k.value,"has-btns":i.value,buttons:c.value,"btn-text":d.value,"destroy-on-close":f.value,"has-save-btn":l.value,"has-header":s.value,onOk:T,onClosed:V,onCancel:N},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(u.value),(0,n.mergeProps)({ref_key:"componentRef",ref:p},h.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}}),hl=Hf,zf=(e,t,o)=>{const a=document.createElement("div"),r=(0,n.createVNode)(hl,{});t&&(r.appContext=t,o&&(r.appContext.provides=o)),(0,n.render)(r,a);const i=e.afterClose;e.afterClose=()=>{i&&i(),(0,n.render)(null,a)},r.component&&r.component.exposed&&r.component.exposed.open(e)};function zn(){const e=(0,n.getCurrentInstance)(),t=e?.appContext,o=e?.provides;return{openLayer:r=>{zf(r,t,o)}}}var gl=fe(hl),Of=(0,n.defineComponent)({name:"JButtons",__name:"index",props:{list:{type:Array||Object,default:()=>[]},size:{type:String,default:"default"},isLink:Boolean},setup(e){const t=e,o=(0,n.computed)(()=>{if(!Array.isArray(t.list)&&Object.keys(t.list).length>0)return t.list;const i={},l=Vt(t.list),s=l.length;for(let d=0;d<s;d++){const c=l[d];c.groupId=c.groupId||ia(),i[c.groupId]=i[c.groupId]||[],i[c.groupId].push(c)}return i}),{openLayer:a}=zn(),r=i=>{i.config?.disabled||i.click&&i.click({openLayer:a})};return(i,l)=>{const s=(0,n.resolveComponent)("j-button"),d=(0,n.resolveComponent)("el-space"),c=(0,n.resolveComponent)("el-dropdown");return(0,n.openBlock)(),(0,n.createBlock)(d,{size:e.isLink?0:8},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(o.value,(f,p)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({key:p},{ref_for:!0},i.$attrs),[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(f,(u,h)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:h},[u.children?.length&&u.children?.length>0?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0},{dropdown:(0,n.withCtx)(()=>[(0,n.createVNode)(d,{direction:"vertical",fill:!0},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(u.children||[],g=>((0,n.openBlock)(),(0,n.createBlock)(s,(0,n.mergeProps)({key:g.id},{ref_for:!0},g.config,{block:"",type:"text",label:g.label,size:e.size,onClick:(0,n.withModifiers)(m=>r(g),["stop"]),style:{"text-align":"left","justify-content":"flex-start"}}),null,16,["label","size","onClick"]))),128))]),_:2},1024)]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(s,(0,n.mergeProps)({ref_for:!0},u.config,{label:u.label,size:e.size,type:e.isLink?"link":u.config?.type,compact:!0,"last-compact-item":h===f.length-1,"first-compact-item":h===0,onClick:(0,n.withModifiers)(g=>r(u),["stop"])}),null,16,["label","size","type","last-compact-item","first-compact-item","onClick"])]),_:2},1024)):((0,n.openBlock)(),(0,n.createBlock)(s,(0,n.mergeProps)({key:1,ref_for:!0},u.config,{label:u.label,size:e.size,type:e.isLink?"link":u.config?.type,compact:!0,"last-compact-item":h===f.length-1,"first-compact-item":h===0,onClick:(0,n.withModifiers)(g=>r(u),["stop"])}),null,16,["label","size","type","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128))]),_:1},8,["size"])}}}),Lf=Of,ml=fe(Lf),Df=(0,n.defineComponent)({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},prepend:{},prependStyle:{default:()=>({})},append:{},appendStyle:{default:()=>({})},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{},autoFocus:{type:Boolean}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(),i=(0,n.computed)({get(){return o.modelValue},set(p){a("update:modelValue",p)}}),l=p=>{a("input",p)},s=p=>{a("focus",p)},d=p=>{a("blur",p)},c=()=>{a("clear")},f=p=>{a("change",p)};return(0,n.onMounted)(()=>{o.autoFocus&&!o.readonly&&r.value.focus()}),(p,u)=>{const h=(0,n.resolveComponent)("j-icon"),g=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createBlock)(g,(0,n.mergeProps)({ref_key:"inputRef",ref:r,modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=m=>i.value=m),type:e.type,"model-modifiers":e.modelModifiers,maxlength:e.maxlength,minlength:e.minlength,"show-word-limit":e.showWordLimit,"word-limit-position":e.wordLimitPosition,placeholder:e.placeholder,clearable:e.clearable,"clear-icon":e.clearIcon,formatter:e.formatter,parser:e.parser,"show-password":e.showPassword,disabled:e.disabled,size:e.size,rows:e.rows,autosize:e.autosize,autocomplete:e.autocomplete,name:e.name,readonly:e.readonly,max:e.max,min:e.min,step:e.step,resize:e.resize,autofocus:e.autofocus,form:e.form,"aria-label":e.ariaLabel,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle,label:e.label,inputmode:e.inputmode},p.$attrs,{onInput:l,onFocus:s,onBlur:d,onClear:c,onChange:f}),(0,n.createSlots)({_:2},[e.prefixIcon?{name:"prefix",fn:(0,n.withCtx)(()=>[(0,n.createVNode)(h,{icon:e.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,e.suffixIcon?{name:"suffix",fn:(0,n.withCtx)(()=>[(0,n.createVNode)(h,{icon:e.suffixIcon},null,8,["icon"])]),key:"1"}:void 0,e.prepend?{name:"prepend",fn:(0,n.withCtx)(()=>[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(e.prependStyle)},(0,n.toDisplayString)(e.prepend),5)]),key:"2"}:void 0,e.append?{name:"append",fn:(0,n.withCtx)(()=>[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(e.appendStyle)},(0,n.toDisplayString)(e.append),5)]),key:"3"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}}),If=Df,yl=fe(If),Ff=(0,n.defineComponent)({name:"JDate",__name:"date",props:{modelValue:{},selectType:{default:"date"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},size:{default:"default"},placeholder:{default:""},startPlaceholder:{default:""},endPlaceholder:{default:""},format:{},rangeSeparator:{},defaultValue:{},defaultTime:{},shortcuts:{},disabledDate:{},teleported:{type:Boolean,default:!0},prefixIcon:{},clearIcon:{},id:{default:void 0}},emits:["update:modelValue","change","blur","focus","calendar-change","panel-change","visible-change"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l=(0,n.computed)({get(){return a.selectType?.indexOf("range")>-1?typeof a.modelValue=="string"?(console.log(a.modelValue,"props.modelValue"),a.modelValue?a.modelValue.split(","):["",""]):a.modelValue||["",""]:a.modelValue},set(m){if(a.selectType?.indexOf("range")>-1){if(m===null){r("update:modelValue","");return}if(Array.isArray(m)){const w=m.join(",");console.log(w,"strVal"),r("update:modelValue",w);return}}m!==void 0&&r("update:modelValue",m)}}),s=(0,n.computed)(()=>{if(a.format)return a.format;switch(a.selectType){case"date":case"dates":case"daterange":return"YYYY-MM-DD";case"datetime":case"datetimerange":return"YYYY-MM-DD HH:mm:ss";case"month":case"monthrange":return"YYYY-MM";case"year":return"YYYY";case"week":return"gggg[w]ww";default:return"YYYY-MM-DD"}}),d=(0,n.computed)(()=>a.selectType?.indexOf("range")>-1&&typeof a.id=="string"?[a.id+"-start",a.id+"-end"]:a.id||void 0),c=m=>{if(a.selectType?.indexOf("range")>-1){if(m===null){r("change","");return}if(Array.isArray(m)){r("change",m.join(","));return}}r("change",m)},f=m=>{r("blur",m)},p=m=>{r("focus",m)},u=m=>{r("calendar-change",m)},h=(m,w,k)=>{r("panel-change",m,w,k)},g=m=>{r("visible-change",m)};return t({ref:i}),(m,w)=>{const k=(0,n.resolveComponent)("el-date-picker");return(0,n.openBlock)(),(0,n.createBlock)(k,(0,n.mergeProps)({ref_key:"dateRef",ref:i},m.$attrs,{modelValue:l.value,"onUpdate:modelValue":w[0]||(w[0]=b=>l.value=b),type:e.selectType,readonly:e.readonly,disabled:e.disabled,editable:e.editable,clearable:e.clearable,size:e.size,placeholder:e.placeholder,"start-placeholder":e.startPlaceholder,"end-placeholder":e.endPlaceholder,format:s.value,"value-format":s.value,"range-separator":e.rangeSeparator,"default-value":e.defaultValue,"default-time":e.defaultTime,shortcuts:e.shortcuts,"disabled-date":e.disabledDate,teleported:e.teleported,"prefix-icon":e.prefixIcon,"clear-icon":e.clearIcon,id:d.value,onChange:c,onBlur:f,onFocus:p,onCalendarChange:u,onPanelChange:h,onVisibleChange:g}),null,16,["modelValue","type","readonly","disabled","editable","clearable","size","placeholder","start-placeholder","end-placeholder","format","value-format","range-separator","default-value","default-time","shortcuts","disabled-date","teleported","prefix-icon","clear-icon","id"])}}}),$f=Ff,vl=fe($f),Wf=(0,n.defineComponent)({name:"JTime",__name:"time",props:{modelValue:{default:""},isRange:{type:Boolean,default:!1},arrowControl:{type:Boolean,default:!1},format:{default:"HH:mm:ss"},rangeSeparator:{default:"-"},selectableRange:{},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:""},startPlaceholder:{default:""},endPlaceholder:{default:""},id:{default:void 0}},emits:["update:modelValue","change","blur","focus","clear","visible-change"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l=(0,n.computed)({get(){return a.isRange?typeof a.modelValue=="string"?a.modelValue?a.modelValue.split(","):["",""]:a.modelValue||["",""]:a.modelValue},set(g){if(a.isRange){if(g===null){r("update:modelValue","");return}if(Array.isArray(g)){r("update:modelValue",g.join(","));return}}g!==void 0&&r("update:modelValue",g)}}),s=(0,n.computed)(()=>a.isRange&&typeof a.id=="string"?[a.id+"-start",a.id+"-end"]:a.id||void 0),d=g=>{if(a.isRange){if(g===null){r("change","");return}if(Array.isArray(g)){r("change",g.join(","));return}}r("change",g)},c=g=>{r("blur",g)},f=g=>{r("focus",g)},p=g=>{r("visible-change",g)};return t({ref:i,handleOpen:()=>{i.value?.handleOpen()},handleClose:()=>{i.value?.handleClose()}}),(g,m)=>{const w=(0,n.resolveComponent)("el-time-picker");return(0,n.openBlock)(),(0,n.createBlock)(w,{ref_key:"timeRef",ref:i,class:"j-time-picker",modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=k=>l.value=k),format:e.format,valueFormat:e.format,placeholder:e.placeholder,startPlaceholder:e.startPlaceholder,endPlaceholder:e.endPlaceholder,"arrow-control":e.arrowControl,rangeSeparator:e.rangeSeparator,clearable:e.clearable,readonly:e.readonly,disabled:e.disabled,isRange:e.isRange,size:e.size,id:s.value,"picker-options":{selectableRange:e.selectableRange},onChange:d,onBlur:c,onFocus:f,onVisibleChange:p},null,8,["modelValue","format","valueFormat","placeholder","startPlaceholder","endPlaceholder","arrow-control","rangeSeparator","clearable","readonly","disabled","isRange","size","id","picker-options"])}}}),Uf=Wf,bl=fe(Uf),Jf=(0,n.defineComponent)({name:"JNowTime",__name:"now-time",props:{modelValue:{type:[String],default:void 0},readonly:Boolean,size:{type:String},mode:{type:String,default:"create"},isEditState:Boolean},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(""),i=l=>{a("update:modelValue",l),a("change",{value:l})};return(0,n.watch)(()=>o.modelValue,l=>{if((xt(l)||o.mode==="modify")&&!o.readonly&&(o.mode==="create"&&!o.isEditState||o.mode==="modify")){r.value=ca(new Date),i(r.value);return}r.value=l},{immediate:!0}),(l,s)=>{const d=(0,n.resolveComponent)("j-icon"),c=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createBlock)(c,{size:e.size,readonly:"",value:r.value},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(d,{icon:"mdi:calendar-blank-outline"})]),_:1},8,["size","value"])}}}),Yf=Jf,wl=fe(Yf),Cl=fe(Hn),Gf={key:1},Kf=(0,n.defineComponent)({name:"JRadio",__name:"radio",props:{modelValue:{type:[String,Number],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get(){let l=o.options;if(!xt(o.modelValue)&&l&&l.length>0){let s=o.modelValue+"",d=o.options.find(c=>c.value+""===s);if(d)return d.value}return o.modelValue},set(l){a("update:modelValue",l)}}),i=(0,n.computed)(()=>o.isColor&&o.colors&&o.colors.length>0?o.colors.map(l=>l.color):[]);return(l,s)=>{const d=(0,n.resolveComponent)("el-radio-button"),c=(0,n.resolveComponent)("el-tag"),f=(0,n.resolveComponent)("el-radio"),p=(0,n.resolveComponent)("el-radio-group");return(0,n.openBlock)(),(0,n.createBlock)(p,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=u=>r.value=u),disabled:e.readonly},{default:(0,n.withCtx)(()=>[e.isButton?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(e.options,u=>((0,n.openBlock)(),(0,n.createBlock)(d,{key:u.value,value:u.value,size:e.size},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(u.label),1)]),_:2},1032,["value","size"]))),128)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(e.options,(u,h)=>((0,n.openBlock)(),(0,n.createBlock)(f,{key:u.value,value:u.value,size:e.size},{default:(0,n.withCtx)(()=>[e.isColor?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,color:i.value[h]||u.color||"",size:e.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(u.label),1)]),_:2},1032,["color","size"])):((0,n.openBlock)(),(0,n.createElementBlock)("span",Gf,(0,n.toDisplayString)(u.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}}),qf=Kf,xl=fe(qf),Xf={class:"j-select-input-label-wrapper"},Zf={class:"j-select-option-wrapper"},Qf={class:"j-select-option-wrapper"},ep=(0,n.defineComponent)({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(),i=(0,n.computed)({get(){return o.multiple&&typeof o.modelValue=="string"?o.modelValue?.split(",")||[]:o.modelValue},set(p){o.multiple&&Array.isArray(p)&&(p=p?.join(",")||[]),a("update:modelValue",p)}}),l=(0,n.computed)(()=>!xt(i.value)&&!o.multiple&&o.options.filter(p=>i.value==p.value).map(p=>p.label).join(",")||""),s=(0,n.computed)(()=>!xt(i.value)&&!o.multiple?o.options.find(p=>p.value===i.value)?.icon:""),d=(0,n.computed)(()=>typeof o.selectData=="string"?o.selectData?.split(",")||[]:[]),c=(0,n.computed)(()=>{let p=[];if(o.isSelectOnlyone?p=o.options.map(u=>({...u,disabled:d.value.includes(u.value)})):p=o.options,o.isGroup){const u=[],h={};return p.forEach(g=>{let m={};const w=g[o.groupKey||""]||"";h[w]||(m.value=w,m.label=w,h[w]=[],m.children=h[w],u.push(m));const k={value:g.value,label:g.label,icon:g.icon,disabled:g.disabled};h[w].push(k)}),u}return p}),f=p=>{if(o.multiple){if(p.length==0){a("change",void 0);return}const u=[];p.forEach(h=>{const g=o.options.find(m=>m.value==h);g&&u.push(g)}),a("change",u)}else{if(p==""||p==null||p==null){a("change",void 0);return}a("change",o.options.find(u=>u.value==p))}};return(0,n.onMounted)(()=>{o.autoFocus&&!o.readonly&&setTimeout(()=>{r.value.toggleMenu()},50)}),(p,u)=>{const h=(0,n.resolveComponent)("el-tooltip"),g=(0,n.resolveComponent)("el-option"),m=(0,n.resolveComponent)("el-option-group"),w=(0,n.resolveComponent)("el-select");return(0,n.openBlock)(),(0,n.createBlock)(w,(0,n.mergeProps)({ref_key:"selectRef",ref:r},p.$attrs,{modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=k=>i.value=k),class:[{"no-border":e.noBorder,"rows-background":e.isRows}],teleported:e.teleported,size:e.size,disabled:e.disabled||e.readonly,multiple:e.multiple,clearable:e.clearable,filterable:e.filterable,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,placeholder:e.placeholder,onChange:f}),(0,n.createSlots)({default:(0,n.withCtx)(()=>[e.isGroup?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(c.value,k=>((0,n.openBlock)(),(0,n.createBlock)(m,{key:k.label,label:k.label},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(k.children,b=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:b.value,label:b.label,value:b.value||" ",disabled:!!b.disabled},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",Zf,[b.icon?((0,n.openBlock)(),(0,n.createBlock)(Hn,{key:0,class:"j-select-option-icon",icon:b.icon},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(b.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(c.value,k=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:k.value,label:k.label,value:k.value+"",disabled:!!k.disabled},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",Qf,[k.icon?((0,n.openBlock)(),(0,n.createBlock)(Hn,{key:0,class:"j-select-option-icon",icon:k.icon},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(k.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[e.multiple?void 0:{name:"label",fn:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",Xf,[s.value?((0,n.openBlock)(),(0,n.createBlock)(Hn,{key:0,class:"j-select-option-icon",icon:s.value},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",null,[e.isShowTooltip?((0,n.openBlock)(),(0,n.createBlock)(h,{key:0,content:l.value,placement:"top"},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(l.value),1)]),_:1},8,["content"])):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createTextVNode)((0,n.toDisplayString)(l.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}}),tp=ep,kl=fe(tp),np=(0,n.defineComponent)({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:o}){const a=e,r=(0,n.ref)(null),i=o;t({getCheckedNodes:(p=!1)=>r.value?.getCheckedNodes(p),clearCheckedNodes:()=>{r.value?.cascaderPanelRef?.value?.clearCheckedNodes()}});const d=(0,n.computed)({get(){return xt(a.modelValue)?[]:a.modelValue?.split(",")||[]},set(p){i("update:modelValue",xt(p)?"":p.join(","))}}),c=(p,u)=>{d.value=p,i("change",{value:xt(p)?"":p.join(","),data:u})},f=(0,n.computed)(()=>({checkStrictly:a.checkStrictly,expandTrigger:a.expandTrigger,multiple:a.multiple,emitPath:a.emitPath,lazy:a.lazy,lazyLoad:a.lazyLoad,hoverThreshold:a.hoverThreshold,checkOnClickNode:a.checkOnClickNode,checkOnClickLeaf:a.checkOnClickLeaf,showPrefix:a.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return(0,n.onMounted)(()=>{a.autoFocus&&!a.readonly&&setTimeout(()=>{r.value.togglePopperVisible()},50)}),(p,u)=>{const h=(0,n.resolveComponent)("el-cascader");return(0,n.openBlock)(),(0,n.createBlock)(h,{ref_key:"cascaderRef",ref:r,modelValue:d.value,"onUpdate:modelValue":u[0]||(u[0]=g=>d.value=g),props:f.value,options:e.options,placeholder:e.placeholder,disabled:e.disabled||e.readonly,clearable:e.clearable,"collapse-tags":e.collapseTags,"max-collapse-tags":e.maxCollapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,filterable:e.filterable,"show-all-levels":e.showAllLevels,separator:e.separator,size:e.size,onChange:c},null,8,["modelValue","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}}),op=np,Sl=fe(op),ap=(0,n.defineComponent)({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"var(--j-color-primary)"},fill:{default:"var(--j-color-bg-container)"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get(){return o.modelValue},set(l){a("update:modelValue",l)}}),i=l=>{a("change",l)};return(l,s)=>{const d=(0,n.resolveComponent)("el-checkbox"),c=(0,n.resolveComponent)("el-checkbox-button"),f=(0,n.resolveComponent)("el-checkbox-group");return(0,n.openBlock)(),(0,n.createBlock)(f,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=p=>r.value=p),disabled:e.disabled||e.readonly,size:e.size,min:e.min,max:e.max,"text-color":e.textColor,fill:e.fill,tag:e.tag,"validate-event":e.validateEvent,label:e.label,type:e.type,onChange:i},{default:(0,n.withCtx)(()=>[e.type==="checkbox"?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(e.options,p=>((0,n.openBlock)(),(0,n.createBlock)(d,{key:p.value,value:p.value,disabled:p.disabled,size:e.size,label:p.label},null,8,["value","disabled","size","label"]))),128)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(e.options,p=>((0,n.openBlock)(),(0,n.createBlock)(c,{key:p.value,class:(0,n.normalizeClass)({"j-checkbox-notFillOrColor":!e.fill&&!e.textColor}),value:p.value,disabled:p.disabled,size:e.size,label:p.label},null,8,["class","value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}}),rp=ap,El=fe(rp),ip=(0,n.defineComponent)({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},controlsPosition:{default:"right"},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},label:{},inputmode:{},align:{default:"left"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{},autoFocus:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(e,{expose:t,emit:o}){const a=e,r=(0,n.ref)(),i=o,l=(0,n.computed)({get(){return a.modelValue},set(u){i("update:modelValue",u)}}),s=u=>{i("change",u)},d=()=>{i("blur")},c=()=>{i("focus")};return t({blur:()=>{r.value?.blur()},focus:()=>{r.value?.focus()}}),(0,n.onMounted)(()=>{a.autoFocus&&!a.readonly&&r.value?.focus()}),(u,h)=>{const g=(0,n.resolveComponent)("j-icon"),m=(0,n.resolveComponent)("el-input-number");return(0,n.openBlock)(),(0,n.createBlock)(m,{id:e.id,ref_key:"inputNumberRef",ref:r,modelValue:l.value,"onUpdate:modelValue":h[0]||(h[0]=w=>l.value=w),min:e.min,max:e.max,step:e.step,"step-strictly":e.stepStrictly,precision:e.precision,size:e.size,readonly:e.readonly||e.disabled,disabled:e.disabled||e.readonly,controls:e.controls,"controls-position":e.controlsPosition,"aria-label":e.ariaLabel,placeholder:e.placeholder,"value-on-clear":e.valueOnClear,label:e.label,inputmode:e.inputmode,align:e.align,"disabled-scientific":e.disabledScientific,onChange:s,onBlur:d,onFocus:c},(0,n.createSlots)({"decrease-icon":(0,n.withCtx)(()=>[e.decreaseIcon?((0,n.openBlock)(),(0,n.createBlock)(g,{key:0,icon:e.decreaseIcon},null,8,["icon"])):(0,n.createCommentVNode)("",!0)]),"increase-icon":(0,n.withCtx)(()=>[e.increaseIcon?((0,n.openBlock)(),(0,n.createBlock)(g,{key:0,icon:e.increaseIcon},null,8,["icon"])):(0,n.createCommentVNode)("",!0)]),_:2},[e.prefix?{name:"prefix",fn:(0,n.withCtx)(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.prefix),1)]),key:"0"}:void 0,e.suffix?{name:"suffix",fn:(0,n.withCtx)(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.suffix),1)]),key:"1"}:void 0]),1032,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","label","inputmode","align","disabled-scientific"])}}}),lp=ip,_l=fe(lp),sp=(0,n.defineComponent)({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},dataType:{default:""},dataCode:{default:""},labelKey:{default:"label"},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","select","change","focus","blur"],setup(e,{expose:t,emit:o}){const a=e,r=(0,n.ref)(null),i=o,l=(0,n.computed)({get(){return a.modelValue||""},set(y){i("update:modelValue",y)}}),{useData:s}=Ye(),{getDataByComp:d}=s(),c=(0,n.computed)(()=>d?d({type:"j-autocomplete",config:a})||[]:[]),f=(0,n.computed)(()=>a.options?a.options:a.dataCode||a.dataType?c.value:[]),p=(y,C)=>{if(a.fetchSuggestions){a.fetchSuggestions(y,C);return}C(y?f.value.filter(u(y)):f.value)},u=y=>C=>C?.[a.valueKey]?.toLowerCase().indexOf(y.toLowerCase())===0,h=y=>{i("select",y)},g=y=>{i("change",y)},m=()=>{i("focus")},w=()=>{i("blur")};return t({focus:()=>{r.value?.focus()},blur:()=>{r.value?.blur()}}),(0,n.onMounted)(()=>{a.autoFocus&&!a.readonly&&setTimeout(()=>{r.value.focus()},50)}),(y,C)=>{const S=(0,n.resolveComponent)("el-autocomplete");return(0,n.openBlock)(),(0,n.createBlock)(S,{ref_key:"autocompleteRef",ref:r,modelValue:l.value,"onUpdate:modelValue":C[0]||(C[0]=v=>l.value=v),"fetch-suggestions":p,placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled||e.readonly,size:e.size,"value-key":e.valueKey,debounce:e.debounce,placement:e.placement,"trigger-on-focus":e.triggerOnFocus,"select-when-unmatched":e.selectWhenUnmatched,"aria-label":e.ariaLabel,"hide-loading":e.hideLoading,"popper-class":e.popperClass,"popper-style":e.popperStyle,teleported:e.teleported,"append-to":e.appendTo,"highlight-first-item":e.highlightFirstItem,"fit-input-width":e.fitInputWidth,"loop-navigation":e.loopNavigation,onSelect:h,onChange:g,onFocus:m,onBlur:w},(0,n.createSlots)({default:(0,n.withCtx)(({item:v})=>[(0,n.renderSlot)(y.$slots,"default",{item:v},()=>[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(v[e.valueKey]||""),1)])]),_:2},[y.$slots.prefix?{name:"prefix",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"prefix")]),key:"0"}:void 0,y.$slots.suffix?{name:"suffix",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"suffix")]),key:"1"}:void 0,y.$slots.header?{name:"header",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"header")]),key:"2"}:void 0,y.$slots.footer?{name:"footer",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"footer")]),key:"3"}:void 0,y.$slots.prepend?{name:"prepend",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"prepend")]),key:"4"}:void 0,y.$slots.append?{name:"append",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"append")]),key:"5"}:void 0,y.$slots.loading?{name:"loading",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(y.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","size","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}}),cp=sp,Bl=fe(cp),dp={class:"j-block"},up={key:1,class:"j-layout--container"},fp={class:"j-block"},pp={class:"j-block"},hp={class:"j-block"},gp=(0,n.defineComponent)({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(e){const t=e,o=(0,n.useSlots)(),a=(0,n.ref)(),r=(0,n.ref)(),i=(0,n.ref)(-1),l=(0,n.ref)(-1),s=(0,n.ref)(-1),d=(0,n.ref)(-1),c=(0,n.ref)(0),f=(0,n.ref)(!1),p=(0,n.reactive)({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),u=(0,n.computed)({get(){return i.value!==-1?i.value:t.left},set(j){i.value=j}}),h=(0,n.computed)({get(){return l.value!==-1?l.value:t.right},set(j){l.value=j}}),g=(0,n.computed)({get(){return s.value!==-1?s.value:t.top},set(j){s.value=j}}),m=(0,n.computed)({get(){return d.value!==-1?d.value:t.bottom},set(j){d.value=j}}),w=(0,n.computed)(()=>o.left),k=(0,n.computed)(()=>o.right),b=(0,n.computed)(()=>o.top),y=(0,n.computed)(()=>o.bottom),C=(0,n.computed)(()=>w.value?f.value&&t.hideMidWhenNarrow&&k.value?"50%":f.value&&t.hideMidWhenNarrow&&!k.value?"100%":typeof u.value=="number"?u.value+"px":u.value:"0"),S=(0,n.computed)(()=>k.value?f.value&&t.hideMidWhenNarrow&&w.value?"50%":f.value&&t.hideMidWhenNarrow&&!w.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),v=(0,n.computed)(()=>b.value?typeof g.value=="number"?g.value+"px":g.value:"0"),x=(0,n.computed)(()=>y.value?typeof m.value=="number"?m.value+"px":m.value:"0"),E=(0,n.computed)(()=>({minWidth:t.midMinWidth+"px",minHeight:t.midMinHeight+"px"})),_=(j,A)=>{p.type=j,p.isMove=!0,p.pageX=A.pageX,p.pageY=A.pageY,p.h=r.value.clientHeight,p.w=r.value.clientWidth;const B=a.value.clientWidth,L=a.value.clientHeight;switch(j){case"left":{const U=u.value;p.size=typeof U=="string"&&U.includes("%")?parseFloat(U)/100*B:Number(U);break}case"right":{const U=h.value;p.size=typeof U=="string"&&U.includes("%")?parseFloat(U)/100*B:Number(U);break}case"top":{const U=g.value;p.size=typeof U=="string"&&U.includes("%")?parseFloat(U)/100*L:Number(U);break}case"bottom":{const U=m.value;p.size=typeof U=="string"&&U.includes("%")?parseFloat(U)/100*L:Number(U);break}}document.onmouseup=V,document.onmousemove=T},T=j=>{if(p.isMove)switch(p.type){case"left":{const A=j.pageX-p.pageX;let B=p.size+A;B<0?B=4:B>p.size+p.w-t.midMinWidth&&(B=p.size+p.w-t.midMinWidth),u.value=B;break}case"right":{const A=j.pageX-p.pageX;let B=p.size-A;B<0?B=4:B>p.size+p.w-t.midMinWidth&&(B=p.size+p.w-t.midMinWidth),h.value=B;break}case"top":{const A=j.pageY-p.pageY;let B=p.size+A;B<0?B=4:B>p.size+p.h-t.midMinHeight&&(B=p.size+p.h-t.midMinHeight),g.value=B;break}case"bottom":{const A=j.pageY-p.pageY;let B=p.size-A;B<0?B=4:B>p.size+p.h-t.midMinHeight&&(B=p.size+p.h-t.midMinHeight),m.value=B;break}}},V=()=>{p.isMove=!1,document.onmouseup=null,document.onmousemove=null},N=()=>{if(!t.hideMidWhenNarrow||!a.value){f.value=!1;return}c.value=a.value.clientWidth;let j=0,A=0;if(w.value){const B=u.value;j=typeof B=="string"&&B.includes("%")?parseFloat(B)/100*c.value:Number(B)}if(k.value){const B=h.value;A=typeof B=="string"&&B.includes("%")?parseFloat(B)/100*c.value:Number(B)}f.value=c.value-j-A<t.midMinWidth};let z=null;return(0,n.onMounted)(()=>{t.hideMidWhenNarrow&&a.value&&typeof window<"u"&&window.ResizeObserver&&(N(),z=new ResizeObserver(()=>{N()}),z.observe(a.value))}),(0,n.onUnmounted)(()=>{z&&z.disconnect()}),(j,A)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"layout",ref:a,class:(0,n.normalizeClass)(["j-layout",{"j-layout-not-hidden":e.notHidden}])},[w.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--left",style:(0,n.normalizeStyle)({width:C.value})},[(0,n.createElementVNode)("div",dp,[(0,n.renderSlot)(j.$slots,"left")]),e.leftMove?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:A[0]||(A[0]=B=>_("left",B))},null,32)):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0),f.value?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",up,[b.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--top",style:(0,n.normalizeStyle)({height:v.value})},[(0,n.createElementVNode)("div",fp,[(0,n.renderSlot)(j.$slots,"top")]),e.topMove?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:A[1]||(A[1]=B=>_("top",B))},null,32)):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",{ref_key:"mid",ref:r,class:"j-layout--wrapper",style:(0,n.normalizeStyle)(E.value)},[(0,n.renderSlot)(j.$slots,"default")],4),y.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"j-layout--bottom",style:(0,n.normalizeStyle)({height:x.value})},[(0,n.createElementVNode)("div",pp,[(0,n.renderSlot)(j.$slots,"bottom")]),e.bottomMove?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:A[2]||(A[2]=B=>_("bottom",B))},null,32)):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0)])),k.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:"j-layout--right",style:(0,n.normalizeStyle)({width:S.value})},[(0,n.createElementVNode)("div",hp,[(0,n.renderSlot)(j.$slots,"right")]),e.rightMove?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:A[3]||(A[3]=B=>_("right",B))},null,32)):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0)],2))}}),mp=gp,Rl=fe(mp);function Tl(e,t){return typeof e=="number"&&typeof t=="number"?e===t:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((o,a)=>o===t[a])):typeof e=="number"&&Array.isArray(t)?t.length===1&&t[0]===e:!(!Array.isArray(e)||typeof t!="number")&&e.length===1&&e[0]===t}function yp(e,t){return e.some((o=>Tl(o,t)))}function vp(e,t){return e.findIndex((o=>Tl(o,t)))}function br(e){if(e==null)return[10,10,10,10];if(typeof e=="number")return[e,e,e,e];if(Array.isArray(e)){if(e.length===2){const[t,o]=e;return[t,o,t,o]}if(e.length===4)return e}return[10,10,10,10]}function Ze(e){return e.internalProps}function no(e,t){return e.dataSource.getRaw(t)}function Tt(e,t){var o;return((o=Ze(e).originalRowHeights)===null||o===void 0?void 0:o.get(t))||0}var Vl=new WeakMap;function Bo(e,t){let o=Vl.get(e);if(o||(o=new Map,Vl.set(e,o)),o.has(t))return o.get(t);for(let a=0;a<e.colCount;a++)if(e.getHeaderField(a,0)===t)return o.set(t,a),a;return o.set(t,-1),-1}function fa(e,t,o,a){const r=a.scenegraph.getCell(e,t);r&&r.forEachChildren((i=>{const l=i;(l.name==="checkbox-icon"||l.name==="checkbox"||l.type==="checkbox"||l.attribute&&l.attribute.type==="checkbox")&&l.setAttributes&&(o==="indeterminate"?l.setAttributes({checked:!1,indeterminate:!0}):l.setAttributes({checked:o,indeterminate:!1}))}))}var bp=class{constructor(e,t){this.pluginOptions=e,this.table=t,this.isRowExpanded=()=>!1,this.childrenKey=e.childrenKey||"children"}getChildrenKey(){return this.childrenKey}setExpandRowCallback(e){this.expandRowCallback=e}ensureChildrenAlias(e){if(this.childrenKey!=="children"&&e&&typeof e=="object"){const t=e,o=this.childrenKey,a=Object.getOwnPropertyDescriptor(t,"children");if(a&&a.get)return;Object.defineProperty(t,"children",{get(){return this[o]},set(r){this[o]=r},enumerable:!1,configurable:!0})}}hasChildren(e){const t=this.childrenKey;if(e&&typeof e=="object"&&t in e){const o=e[t];return Array.isArray(o)&&o.length>0}return!1}injectMasterDetailOptions(e){e.masterDetail=!0,e.customConfig||(e.customConfig={}),e.customConfig.scrollEventAlwaysTrigger=!0;const t=e.customComputeRowHeight;if(e.customComputeRowHeight=o=>{var a;const{row:r,table:i}=o;if(this.isRowExpanded(r)){const l=i.getRowHeight(r);return Array.isArray(l)?(a=l[0])!==null&&a!==void 0?a:"auto":l}if(t){const l=t(o);if(l!=null)return l}},e.columns&&e.columns.length>0&&(e.columns[0].tree=!0),this.setupInitializedListener(),this.pluginOptions.detailTableOptions){const o=this.pluginOptions.detailTableOptions;typeof o=="function"?e.getDetailGridOptions=o:e.detailTableOptions=o}this.disableRefreshHierarchyState()}disableRefreshHierarchyState(){setTimeout((()=>{const e=this.table;e&&typeof e._refreshHierarchyState=="function"&&(e._originalRefreshHierarchyState=e._refreshHierarchyState,e._refreshHierarchyState=()=>{})}),0)}setupInitializedListener(){this.table.on("initialized",(()=>{const e=this.table.dataSource.records;this.processRecordsHierarchyStates(e),this.table.renderWithRecreateCells()}))}processRecordsHierarchyStates(e){const t=Ve.TYPES.HierarchyState,o=this.table.options.hierarchyExpandLevel||this.table.options.headerExpandLevel;(a=>{a.forEach((r=>{if(r&&typeof r=="object"){const i=r;this.ensureChildrenAlias(r),(this.hasChildren(r)||i[this.childrenKey]===!0)&&(i.hierarchyState==="expand"?i.hierarchyState=t.expand:i.hierarchyState==="collapse"?i.hierarchyState=t.collapse:i.hierarchyState||(i.hierarchyState=o&&o>1?t.expand:t.collapse))}}))})(e),this.performInitialExpansion()}performInitialExpansion(){const e=this.getExpandableRecords();e.length!==0&&this.startAsyncExpansion(e)}getExpandableRecords(){const e=this.table.dataSource,t=e.source||e._source||this.table.dataSource.records,o=Ve.TYPES.HierarchyState,a=[],r=this.table;r.internalProps.expandedRecordIndices||(r.internalProps.expandedRecordIndices=[]);const i=r.internalProps.expandedRecordIndices;for(let l=0;l<t.length;l++){const s=t[l];if(s&&typeof s=="object"){const d=s;if((this.hasChildren(s)||d[this.childrenKey]===!0)&&d.hierarchyState===o.expand){i.includes(l)||i.push(l);try{const c=this.table.getBodyRowIndexByRecordIndex(l);if(c>=0){const f=c+this.table.columnHeaderLevelCount;a.push({recordIndex:l,actualRowIndex:f,record:s})}}catch{}}}}return a}startAsyncExpansion(e){let t=0;const o=()=>{if(t>=e.length)return;const{actualRowIndex:a}=e[t];this.isCellGroupCreated(a)?(this.expandRowCallback&&this.expandRowCallback(a),t++,setTimeout(o,0)):setTimeout(o,16)};setTimeout(o,0)}isCellGroupCreated(e){try{const t=this.table.scenegraph.getCell(0,e);return t&&t.role==="cell"}catch{return!1}}getDetailConfigForRecord(e,t){const o=this.pluginOptions.detailTableOptions;return o?typeof o=="function"?o({data:e,bodyRowIndex:t}):o:null}setRowExpandedChecker(e){this.isRowExpanded=e}release(){this.isRowExpanded=()=>!1,this.table=null,this.pluginOptions=null}},wp=class{constructor(e,t="children"){this.table=e,this.expandedRows=[],this.eventHandlers=[],this.allExpandedRowsBeforeMove=new Set,this.isCleanedUp=!1,this.childrenKey=t}bindEventHandlers(){const e=()=>this.onUpdateSubTablePositions(),t=()=>this.onUpdateSubTablePositionsForRow();this.table.on(Ve.TABLE_EVENT_TYPE.SCROLL,e),this.table.on(Ve.TABLE_EVENT_TYPE.RESIZE_ROW,t),this.eventHandlers.push({type:Ve.TABLE_EVENT_TYPE.SCROLL,handler:e},{type:Ve.TABLE_EVENT_TYPE.RESIZE_ROW,handler:t}),this.wrapTableResizeMethod(),this.bindTreeHierarchyStateChange(),this.bindRowMoveEvents()}wrapTableResizeMethod(){const e=this.table.resize.bind(this.table);this.originalResize=e,this.table.resize=()=>{e(),this.onUpdateSubTablePositions()}}handleAfterUpdateCellContentWidth(e){var t;const{col:o,row:a,cellGroup:r,cellHeight:i,padding:l,textBaseline:s}=e;if(this.isCustomMergeCell(o,a))return void this.fixCustomMergeCellTextPosition(r,l);let d=i;if(r.col!==void 0&&r.row!==void 0)try{const c=this.table.getRecordShowIndexByCell(r.col,r.row);if(c!==void 0){const f=((t=this.getOriginalRowHeight)===null||t===void 0?void 0:t.call(this,c))||0;if(f>0){d=f;const p=d-(l[0]+l[2]);r.forEachChildren((u=>{u.type!=="rect"&&u.type!=="chart"&&u.name!==Ve.CUSTOM_CONTAINER_NAME&&(u.name==="mark"?u.setAttribute("y",0):s==="middle"?u.setAttribute("y",l[0]+(p-u.AABBBounds.height())/2):s==="bottom"?u.setAttribute("y",l[0]+p-u.AABBBounds.height()):u.setAttribute("y",l[0]))}))}}}catch{}}fixCustomMergeCellTextPosition(e,t){const{col:o,row:a}=e,r=this.table,i=r.getCustomMerge(o,a);if(!i||!i.style||!i.range)return;const l=i.style.textAlign||"left",{start:s,end:d}=i.range;let c=0,f=0;for(let p=s.col;p<=d.col;p++)c+=r.getColWidth(p);for(let p=0;p<s.col;p++)f+=r.getColWidth(p);e.forEachChildren((p=>{if(p.name==="text"||p.name==="content"){let u;u=l==="center"?f+t[3]+(c-t[1]-t[3])/2:l==="right"?f+c-t[1]:f+t[3],p.setAttribute("x",u),p.setAttribute("textAlign",l)}}))}isCustomMergeCell(e,t){try{const o=this.table;if(o&&o.getCustomMerge)return!!o.getCustomMerge(e,t)}catch{}return!1}handleAfterUpdateSelectBorderHeight(e){var t,o;const{startRow:a,endRow:r,selectComp:i}=e,l=a===r,s=this.expandedRows.includes(r);if(l){const d=a-(this.table.columnHeaderLevelCount||0),c=((t=this.getOriginalRowHeight)===null||t===void 0?void 0:t.call(this,d))||0;if(c>0&&c!==e.currentHeight&&(i.rect.setAttributes({height:c}),i.fillhandle)){const f=i.rect.attribute.y;i.fillhandle.setAttributes({y:f+c})}}else if(s){const d=r-(this.table.columnHeaderLevelCount||0),c=((o=this.getOriginalRowHeight)===null||o===void 0?void 0:o.call(this,d))||0;if(c>0){const f=this.table.getRowHeight(r),p=e.currentHeight-f+c;if(i.rect.setAttributes({height:p}),i.fillhandle){const u=i.rect.attribute.y;i.fillhandle.setAttributes({y:u+p})}}}}executeMasterDetailBeforeSort(){const e=this.table;e.internalProps.expandedRecordIndices&&e.internalProps.expandedRecordIndices.length>0&&(e.internalProps._tempExpandedRecordIndices=[...e.internalProps.expandedRecordIndices]),this.expandedRows.length>0&&[...this.expandedRows].forEach((t=>{var o,a;try{const r=e.options;r&&r.pagination?(o=this.onCollapseRowToNoRealRecordIndex)===null||o===void 0||o.call(this,t):(a=this.onCollapseRow)===null||a===void 0||a.call(this,t)}catch{}}))}executeMasterDetailAfterSort(){const e=this.table,t=e.internalProps._tempExpandedRecordIndices;t&&t.length>0&&([...t].forEach((o=>{var a;const r=e.getBodyRowIndexByRecordIndex(o);if(r>=0)try{const i=r+e.columnHeaderLevelCount;(a=this.onExpandRow)===null||a===void 0||a.call(this,i)}catch{}})),delete e.internalProps._tempExpandedRecordIndices)}getExpandedRows(){return this.expandedRows}setExpandedRows(e){this.expandedRows=e}addExpandedRow(e){this.expandedRows.includes(e)||this.expandedRows.push(e)}removeExpandedRow(e){const t=this.expandedRows.indexOf(e);t>-1&&this.expandedRows.splice(t,1)}isRowExpanded(e){return this.expandedRows.includes(e)}bindTreeHierarchyStateChange(){const e=t=>{var o;const{col:a,row:r}=t,i=this.getRecordByRowIndex(r-this.table.columnHeaderLevelCount);i&&typeof i=="object"&&this.childrenKey in i&&i[this.childrenKey]===!0||(o=this.onToggleRowExpand)===null||o===void 0||o.call(this,r,a)};this.table.on(Ve.TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,e),this.eventHandlers.push({type:Ve.TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,handler:e})}getRecordByRowIndex(e){try{const t=this.table,o=t.getRecordShowIndexByCell(0,e+t.columnHeaderLevelCount);return t.dataSource.get(o)}catch{return null}}bindRowMoveEvents(){const e=a=>{var r,i;if(!a||typeof a.col!="number"||typeof a.row!="number")return;const{col:l,row:s}=a;if(!(this.table.getCellLocation(l,s)==="rowHeader"||!((i=(r=this.table.internalProps.layoutMap).isSeriesNumberInBody)===null||i===void 0)&&i.call(r,l,s)))return;this.allExpandedRowsBeforeMove.clear();const d=[...this.expandedRows];d.forEach((c=>{this.allExpandedRowsBeforeMove.add(c)})),d.forEach((c=>{var f;(f=this.onCollapseRow)===null||f===void 0||f.call(this,c)}))},t=a=>{var r;if(this.allExpandedRowsBeforeMove.size===0)return;const{colSource:i,rowSource:l,colTarget:s,rowTarget:d}=(r=this.table.stateManager)===null||r===void 0?void 0:r.columnMove;setTimeout((()=>{const c=l,f=d,p=f>c?"down":"up";this.allExpandedRowsBeforeMove.forEach((u=>{var h;let g=u;c===u?g=f:p==="down"?u<=f&&u>c&&(g=u-1):p==="up"&&u>=f&&u<c&&(g=u+1),(h=this.onExpandRow)===null||h===void 0||h.call(this,g)})),this.allExpandedRowsBeforeMove.clear()}),0)},o=a=>{this.allExpandedRowsBeforeMove.size!==0&&setTimeout((()=>{this.allExpandedRowsBeforeMove.forEach((r=>{var i;(i=this.onExpandRow)===null||i===void 0||i.call(this,r)})),this.allExpandedRowsBeforeMove.clear()}),0)};this.table.on(Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START,e),this.table.on(Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION,t),this.table.on(Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,o),this.eventHandlers.push({type:Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START,handler:e},{type:Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION,handler:t},{type:Ve.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,handler:o})}cleanup(){if(!this.isCleanedUp){if(this.isCleanedUp=!0,this.expandedRows.length=0,this.allExpandedRowsBeforeMove.clear(),this.originalResize&&this.table)try{this.table.resize=this.originalResize,this.originalResize=void 0}catch{}try{this.table&&(this.eventHandlers.forEach((({type:e,handler:t})=>{try{this.table.off(e,t)}catch{}})),this.eventHandlers.length=0)}catch{}this.onUpdateSubTablePositions=void 0,this.onUpdateSubTablePositionsForRow=void 0,this.onExpandRow=void 0,this.onCollapseRow=void 0,this.onCollapseRowToNoRealRecordIndex=void 0,this.onToggleRowExpand=void 0,this.getOriginalRowHeight=void 0,this.table=null}}setCallbacks(e){this.onUpdateSubTablePositions=e.onUpdateSubTablePositions,this.onUpdateSubTablePositionsForRow=e.onUpdateSubTablePositionsForRow,this.onExpandRow=e.onExpandRow,this.onCollapseRow=e.onCollapseRow,this.onCollapseRowToNoRealRecordIndex=e.onCollapseRowToNoRealRecordIndex,this.onToggleRowExpand=e.onToggleRowExpand,this.getOriginalRowHeight=e.getOriginalRowHeight}},Cp=function(e,t){var o={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(o[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(o[a[r]]=e[a[r]])}return o},xp=class{constructor(e,t=!0){this.table=e,this.enableCheckboxCascade=t,this.timers=new Set,this.columnRangeCache=null}saveSubTableCheckboxState(e,t){if(!t.stateManager)return;const o=Ze(this.table);o.subTableCheckboxStates||(o.subTableCheckboxStates=new Map);const a={checkedState:Object.fromEntries(Array.from(t.stateManager.checkedState.entries()).map((([r,i])=>[r,Object.assign({},i)]))),headerCheckedState:Object.assign({},t.stateManager.headerCheckedState)};o.subTableCheckboxStates.set(e,a)}restoreSubTableCheckboxState(e,t){var o;let a=(o=Ze(this.table).subTableCheckboxStates)===null||o===void 0?void 0:o.get(e);if(t.stateManager){if(a||(a={checkedState:{},headerCheckedState:{}}),a.checkedState&&Object.keys(a.checkedState).forEach((r=>{const i=a.checkedState[r];t.stateManager.checkedState.set(r,i)})),a.headerCheckedState&&Object.keys(a.headerCheckedState).forEach((r=>{t.stateManager.headerCheckedState[r]=a.headerCheckedState[r]})),this.enableCheckboxCascade){const r=e+this.table.columnHeaderLevelCount;if(no(this.table,e)&&this.table.stateManager){const i=this.table.getRecordIndexByCell(0,r);if(i!=null){const l=i.toString(),s=this.table.stateManager.checkedState.get(l);s&&Object.keys(s).forEach((d=>{const c=s[d];(c===!0||c===!1)&&(t.stateManager.headerCheckedState[d]=c,(t.records||[]).forEach(((f,p)=>{const u=p.toString();let h=t.stateManager.checkedState.get(u);h||(h={},t.stateManager.checkedState.set(u,h)),h[d]=c,f[d]=c})))}))}}}this.safeSetTimeout((()=>{this.updateSubTableCheckboxVisualState(t)}),0)}}safeSetTimeout(e,t){const o=setTimeout((()=>{this.timers.delete(o);try{e()}catch{}}),t);return this.timers.add(o),o}cleanupAllTimers(){this.timers.forEach((e=>clearTimeout(e))),this.timers.clear()}updateSubTableCheckboxVisualState(e,t){if(!e.stateManager)return;const o=t?.headerCheckedState||e.stateManager.headerCheckedState,a=t?.checkedState||{};Object.keys(o).forEach((r=>{const i=o[r],l=Bo(e,r);l!==-1&&e.isHeader(l,0)&&e.scenegraph.updateHeaderCheckboxCellState(l,0,i)})),t?.checkedState?Object.keys(a).forEach((r=>{const i=a[r],l=Number(r);Object.keys(i).forEach((s=>{const d=i[s],c=Bo(e,s);if(c!==-1){for(let f=e.columnHeaderLevelCount;f<e.rowCount;f++)if(e.getRecordIndexByCell(c,f)===l){fa(c,f,d,e);break}}}))})):e.stateManager.checkedState.forEach(((r,i)=>{const l=Number(i);Object.keys(r).forEach((s=>{const d=r[s],c=Bo(e,s);if(c!==-1){for(let f=e.columnHeaderLevelCount;f<e.rowCount;f++)if(e.getRecordIndexByCell(c,f)===l){fa(c,f,d,e);break}}}))}))}renderSubTable(e,t,o){var a;const r=Ze(this.table),i=no(this.table,e);if(!i||!t||t.length===0)return;const l=o(i,e),s=this.calculateSubTableViewBox(e,l);if(!s)return;const d=s.x2-s.x1,c=s.y2-s.y1,f=this.table.options,p={viewBox:s,canvas:this.table.canvas,records:t,columns:l?.columns||[],widthMode:"adaptive",showHeader:!0,canvasWidth:d,canvasHeight:c,theme:f.theme},u=l||{},{style:h}=u,g=Cp(u,["style"]),m=Object.assign(Object.assign({},p),g),w=new Ve.ListTable(this.table.container,m);r.subTableInstances.set(e,w),this.restoreSubTableCheckboxState(e,w);const k=()=>{r.subTableInstances&&r.subTableInstances.has(e)&&w.render()};this.table.on("after_render",k),w.__afterRenderHandler=k,this.setupScrollEventIsolation(w),this.setupUnifiedSelectionManagement(e,w),this.setupSubTableCanvasClipping(w,e),this.setupAntiFlickerMechanism(w),this.setupSubTableEventForwarding(e,w),w.render(),((a=l?.style)===null||a===void 0?void 0:a.height)==="auto"&&this.handleAutoHeightAfterRender(e,w,l)}handleAutoHeightAfterRender(e,t,o){var a;try{const r=this.calculateSubTableContentHeight(t),[i,,l]=br((a=o?.style)===null||a===void 0?void 0:a.margin),s=r+i+l;this.onAutoHeightCalculated&&this.onAutoHeightCalculated(e,s)}catch{}}calculateSubTableContentHeight(e){try{const t=e.getAllRowsHeight();let o=0;const a=e.theme;if(a?.frameStyle){const r=a.frameStyle;let i=0,l=0;if(r.borderLineWidth){if(typeof r.borderLineWidth=="number")i=l=r.borderLineWidth;else if(Array.isArray(r.borderLineWidth)){const c=r.borderLineWidth;i=c[0]||0,l=c[2]||0}}let s=0,d=0;if(r.shadowBlur){if(typeof r.shadowBlur=="number")s=d=r.shadowBlur;else if(Array.isArray(r.shadowBlur)){const c=r.shadowBlur;s=c[0]||0,d=c[2]||0}}r.innerBorder||(o=i+l+s+d)}return t+o}catch{return 300}}setAutoHeightCallback(e){this.onAutoHeightCalculated=e}getColumnRange(){if(this.columnRangeCache)return this.columnRangeCache;const e=this.table.frozenColCount||0,t=this.table.rightFrozenColCount||0,o=this.table.colCount;let a=e,r=o-t-1;return e===0&&t===0&&(a=0,r=o-1),a>=o||r<a?null:(this.columnRangeCache={startCol:a,endCol:r},this.columnRangeCache)}calculateSubTableViewBox(e,t,o){var a,r,i;const l=e+this.table.columnHeaderLevelCount,s=this.table.getCellRangeRelativeRect({col:0,row:l});if(!s)return null;const d=((a=Ze(this.table).originalRowHeights)===null||a===void 0?void 0:a.get(e))||0,c=this.getColumnRange();if(!c)return null;const{startCol:f,endCol:p}=c,u=this.table.getCellRangeRelativeRect({col:f,row:l}),h=this.table.getCellRangeRelativeRect({col:p,row:l});if(!u||!h)return null;const[g,m,w,k]=br((r=t?.style)===null||r===void 0?void 0:r.margin),b=o||((i=t?.style)===null||i===void 0?void 0:i.height)||300;let y;if(y=b==="auto"?300:typeof b=="number"?b:300,y<=g+w)return{x1:u.left+k,y1:s.top+d,x2:h.right-m,y2:s.top+d};const C={x1:u.left+k,y1:s.top+d+g,x2:h.right-m,y2:s.top+d-w+y};return C.x2<=C.x1||C.y2<=C.y1?null:C}removeSubTable(e){var t;const o=Ze(this.table),a=(t=o.subTableInstances)===null||t===void 0?void 0:t.get(e);if(a){if(this.saveSubTableCheckboxState(e,a),this.cleanupSubTableEventHandlers(a),typeof a.release=="function")try{a.release()}catch{}o.subTableInstances.delete(e)}}cleanupSubTableEventHandlers(e){var t,o,a,r;this.cleanupSubTableEventForwarding(e);const i=e.__afterRenderHandler;i&&(this.table.off("after_render",i),delete e.__afterRenderHandler);const l=e.__selectionHandler;l&&(e.off("click_cell",l),delete e.__selectionHandler);const s=e;!((o=(t=e.scenegraph)===null||t===void 0?void 0:t.stage)===null||o===void 0)&&o.defaultLayer&&s.__originalRenderMethod&&(e.scenegraph.stage.defaultLayer.render=s.__originalRenderMethod,delete s.__originalRenderMethod),!((r=(a=e.scenegraph)===null||a===void 0?void 0:a.stage)===null||r===void 0)&&r.defaultLayer&&s.__originalDrawMethod&&(e.scenegraph.stage.defaultLayer.draw=s.__originalDrawMethod,delete s.__originalDrawMethod);const d=s.__scrollHandler;d&&(this.table.off("can_scroll",d),delete s.__scrollHandler);const c=s.__subTableScrollHandler;c&&(e.off("can_scroll",c),delete s.__subTableScrollHandler);const f=s.__clipInterval;f&&(clearInterval(f),delete s.__clipInterval);const p=s.__antiFlickerHandler;p&&(this.table.off("after_render",p),delete s.__antiFlickerHandler);const u=s.__checkboxHandler;u&&(e.off("checkbox_state_change",u),delete s.__checkboxHandler)}setupScrollEventIsolation(e){const t=s=>{const d=this.table.canvas.getBoundingClientRect(),c=s.clientX-d.left,f=s.clientY-d.top,p=e.options.viewBox;return p?c>=p.x1&&c<=p.x2&&f>=p.y1&&f<=p.y2:!1},o=s=>{if(!(s&&s instanceof WheelEvent))return!0;const d=s.deltaY,c=d>0,f=d<0;return!(e.scrollTop<=0&&f)&&(!(()=>{const p=e.getAllRowsHeight(),u=e.scenegraph.height,h=e.scrollTop;if(p<=u)return!0;const g=p-u;return Math.abs(h-g)<=1})()||!c)};let a=!1;const r=s=>{const d=s;return d.event&&t(d.event)&&o(d.event)?(a=!0,!1):(a=!1,!0)};this.table.on("can_scroll",r);const i=s=>s.event===void 0||a;e.on("can_scroll",i);const l=e;l.__scrollHandler=r,l.__subTableScrollHandler=i}setupUnifiedSelectionManagement(e,t){const o=()=>{this.clearAllSelectionsExcept(e)};t.on("click_cell",o),t.__selectionHandler=o}calculateGroupLevelOffset(e){try{const t=this.table.getRecordShowIndexByCell(0,e),o=this.table.dataSource.getIndexKey(t);if(!Array.isArray(o)||o.length<=1)return 0;let a=0;for(let r=this.table.columnHeaderLevelCount;r<e;r++)try{const i=this.table.getRecordByCell(0,r);if(i&&typeof i=="object"&&"vtableMergeName"in i){const l=this.table.getRecordShowIndexByCell(0,r),s=this.table.dataSource.getIndexKey(l),d=Array.isArray(s)?s:[s];this.isAncestorGroup(d,o)&&(a+=this.table.getRowHeight(r))}}catch{}return a}catch{return 0}}isAncestorGroup(e,t){if(e.length>=t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}setupSubTableCanvasClipping(e,t){var o;if(!(!((o=e.scenegraph)===null||o===void 0)&&o.stage))return;const a=e.scenegraph.stage,r=e,i=()=>{var c;try{const f=t+this.table.columnHeaderLevelCount,p=this.table.getFrozenRowsHeight(),u=this.table.getFrozenColsWidth(),h=this.table.getRightFrozenColsWidth(),g=this.table.getBottomFrozenRowsHeight(),m=this.table.tableNoFrameWidth,w=this.table.tableNoFrameHeight,k=f<this.table.frozenRowCount&&f>=this.table.columnHeaderLevelCount,b=f>=this.table.rowCount-this.table.bottomFrozenRowCount,y=this.calculateGroupLevelOffset(f),C=no(this.table,t),S=C&&this.getDetailConfigForRecord?this.getDetailConfigForRecord(C,t):null,[,v,,x]=br((c=S?.style)===null||c===void 0?void 0:c.margin);let E=0,_=w;return k?(E=y,_=w-g-y):b?(E=y,_=w-y):(E=p+y,_=w-p-g-y),{clipX:u+x,clipY:E,clipWidth:m-u-h-x/2-v/2,clipHeight:_}}catch{return null}},l=a.window;if(!l||typeof l.getContext!="function")return;const s=l.getContext();if(!s)return;const d=(c,f,p)=>{const u=c[f];typeof u=="function"&&(r[p]=u,c[f]=function(...h){s.save();try{const g=i();if(g&&g.clipWidth>0&&g.clipHeight>0){const m=l.dpr||l.devicePixelRatio||1;s.beginPath(),s.rect(g.clipX*m,g.clipY*m,g.clipWidth*m,g.clipHeight*m),s.clip()}return u.apply(this,h)}finally{s.restore()}})};a.defaultLayer&&(d(a.defaultLayer,"render","__originalRenderMethod"),d(a.defaultLayer,"draw","__originalDrawMethod"))}setupAntiFlickerMechanism(e){var t;try{const o=(t=e.scenegraph)===null||t===void 0?void 0:t.updateNextFrame;if(!o)return;const a=this.table,r=()=>{e&&o&&o.call(e.scenegraph)};a.on("after_render",r),e.__antiFlickerHandler=r}catch{}}updateSubTablePositionsForRowResize(){const e=Ze(this.table);e.subTableInstances&&(e.subTableInstances.forEach(((t,o)=>{try{const a=o+this.table.columnHeaderLevelCount,r=this.table.scenegraph;let i=null;r&&typeof r.highPerformanceGetCell=="function"?i=r.highPerformanceGetCell(0,a):r&&typeof r.getCell=="function"&&(i=r.getCell(0,a));const l=i&&i.attribute&&typeof i.attribute.height=="number"?i.attribute.height:-1;e.originalRowHeights&&typeof l=="number"&&l!==-1&&e.originalRowHeights.set(o,l)}catch{}})),this.recalculateAllSubTablePositions())}recalculateAllSubTablePositions(e,t,o){var a;this.columnRangeCache=null;const r=Ze(this.table);(a=r.subTableInstances)===null||a===void 0||a.forEach(((i,l)=>{var s,d;if(e!==void 0&&l<e||t!==void 0&&l>t)return;const c=no(this.table,l),f=o?o(c,l):this.getDetailConfigForRecord?this.getDetailConfigForRecord(c,l):null,p=l+this.table.columnHeaderLevelCount,u=((s=r.originalRowHeights)===null||s===void 0?void 0:s.get(l))||0,h=this.table.getRowHeight(p)-u,g=this.calculateSubTableViewBox(l,f,h);if(g){const m=g.x2-g.x1,w=g.y2-g.y1;i.options.viewBox=g;const k=i.options;k.canvasWidth===m&&k.canvasHeight===w||(k.canvasWidth=m,k.canvasHeight=w,i.resize()),!((d=i.scenegraph)===null||d===void 0)&&d.stage&&i.scenegraph.stage.setViewBox(g,!1)}}))}cleanup(){if(!this.table)return;this.cleanupAllTimers();const e=Ze(this.table);e&&e.subTableInstances&&(e.subTableInstances.forEach(((t,o)=>{this.removeSubTable(o)})),e.subTableInstances.clear()),this.columnRangeCache=null,this.getDetailConfigForRecord=void 0,this.table=null}getAllSubTableInstances(){return Ze(this.table).subTableInstances}getSubTableInstance(e){var t;return((t=Ze(this.table).subTableInstances)===null||t===void 0?void 0:t.get(e))||null}setCallbacks(e){this.getDetailConfigForRecord=e.getDetailConfigForRecord}setupSubTableEventForwarding(e,t){const o=e+this.table.columnHeaderLevelCount;Object.values(Ve.TABLE_EVENT_TYPE).forEach((a=>{var r;if(a){const i=(...d)=>{this.forwardSubTableEvent(a,e,o,t,d)};t.on(a,i);const l=t;l.__eventHandlers||(l.__eventHandlers=new Map);const s=l.__eventHandlers;s.has(a)||s.set(a,[]),(r=s.get(a))===null||r===void 0||r.push(i)}}))}forwardSubTableEvent(e,t,o,a,r){const i={eventType:e,masterBodyRowIndex:t,masterRowIndex:o,subTable:a,originalEventArgs:r};this.table.fireListeners(Ve.TABLE_EVENT_TYPE.PLUGIN_EVENT,{plugin:{name:"Master Detail Plugin"},event:r[0],pluginEventInfo:i})}clearMainTableSelectionInternal(){typeof this.table.clearSelected=="function"&&this.table.clearSelected()}clearAllSelectionsExcept(e){var t;this.clearMainTableSelectionInternal(),(t=Ze(this.table).subTableInstances)===null||t===void 0||t.forEach(((o,a)=>{a!==e&&o&&typeof o.clearSelected=="function"&&o.clearSelected()}))}cleanupSubTableEventForwarding(e){const t=e;if(t.__eventHandlers){for(const[o,a]of t.__eventHandlers)for(const r of a)e.off(o,r);delete t.__eventHandlers}}},kp=class{constructor(e,t,o,a){this.currentMouseX=0,this.currentMouseY=0,this.isDragging=!1,this.dragStartIsPluginUnderline=!1,this.table=e,this.configManager=t,this.eventManager=o,this.callbacks=a,this.initMouseTracking()}initMouseTracking(){this.mouseEventListener=e=>{try{const t=this.table;if(t&&t.internalProps&&t.internalProps.canvas){const o=t.internalProps.canvas.getBoundingClientRect();this.currentMouseX=e.clientX-o.left,this.currentMouseY=e.clientY-o.top}}catch{}e.type==="mouseup"&&(this.isDragging=!1,this.dragStartIsPluginUnderline=!1)};try{const e=this.table;if(e&&e.internalProps&&e.internalProps.canvas){const t=e.internalProps.canvas;t.addEventListener("mousemove",this.mouseEventListener),t.addEventListener("mousedown",this.mouseEventListener),t.addEventListener("mouseup",this.mouseEventListener)}}catch{}}extendTableAPI(){this.extendUpdateCellContent(),this.extendUpdateResizeRow(),this.extendDealHeightMode(),this.extendUpdatePagination(),this.extendToggleHierarchyState(),this.extendUpdateFilterRules(),this.extendUpdateChartSizeForResizeColWidth(),this.extendUpdateChartSizeForResizeRowHeight(),this.extendGetRowY(),this.extendUpdateRowHeight(),this.extendGetResizeColAt()}extendUpdateCellContent(){const e=this.table;this.originalUpdateCellContent=e.scenegraph.updateCellContent.bind(e.scenegraph),e.scenegraph.updateCellContent=(t,o,a=!1)=>{var r,i,l,s;if(this.eventManager.isRowExpanded(o)){const d=o-this.table.columnHeaderLevelCount,c=Tt(this.table,d),f=this.table.getRowHeight(o);if(c>0&&f!==c){this.table._setRowHeight(o,c,!1);const p=this.table.scenegraph.getCell(t,o),u=(r=p?.attribute)===null||r===void 0?void 0:r.y,h=(i=this.originalUpdateCellContent)===null||i===void 0?void 0:i.call(this,t,o,a);if(this.table._setRowHeight(o,f,!1),u!==void 0){const m=this.table.scenegraph.getCell(t,o);m&&m.attribute.y!==u&&m.setAttribute("y",u)}const g=this.table.scenegraph.getCell(t,o);return g&&(o!==this.table.rowCount-1&&this.callbacks.addUnderlineToCell(g,c),this.eventManager.handleAfterUpdateCellContentWidth({col:t,row:o,cellHeight:((l=g.attribute)===null||l===void 0?void 0:l.height)||0,cellGroup:g,padding:[0,0,0,0],textBaseline:"middle"})),h}}return(s=this.originalUpdateCellContent)===null||s===void 0?void 0:s.call(this,t,o,a)}}extendUpdateResizeRow(){const e=this.table;this.originalUpdateResizeRow=e.stateManager.updateResizeRow.bind(e.stateManager),e.stateManager.updateResizeRow=(t,o)=>{const a=e.stateManager;t=Math.ceil(t),o=Math.ceil(o);let r=a.rowResize.isBottomFrozen?a.rowResize.y-o:o-a.rowResize.y;if(Math.abs(r)<1)return;const i=a.rowResize.row,l=this.eventManager.isRowExpanded(i),s=a.table.internalProps.limitMinHeight;let d=s;if(l){const f=i-this.table.columnHeaderLevelCount,p=Tt(this.table,f),u=this.table.getRowHeight(i)-p;d=this.dragStartIsPluginUnderline?s+u:p+s}let c=a.table.getRowHeight(a.rowResize.row)+r;if(c<d&&(c=d,r=c-a.table.getRowHeight(a.rowResize.row)),a.table.heightMode==="adaptive"&&a.rowResize.row<a.table.rowCount-1){let f=a.table.getRowHeight(a.rowResize.row+1);f-=r;let p=s;const u=a.rowResize.row+1;if(this.eventManager.isRowExpanded(u)){const h=u-this.table.columnHeaderLevelCount,g=Tt(this.table,h);p=s+(this.table.getRowHeight(u)-g)}f-r<p&&(r=f-p)}r=Math.ceil(r),a.rowResize.row<a.table.columnHeaderLevelCount||a.rowResize.row>=a.table.rowCount-a.table.bottomFrozenRowCount?this.updateResizeColForRow(r,a):a.table.internalProps.rowResizeType==="all"?this.updateResizeColForAll(r,a):this.updateResizeColForRow(r,a),a.rowResize.y=o,a.table.scenegraph.component.updateResizeRow(a.rowResize.row,t,a.rowResize.isBottomFrozen),a.table.scenegraph.updateNextFrame()}}updateResizeColForRow(e,t){t.table.heightMode==="adaptive"&&t.rowResize.row<t.table.rowCount-1?(t.table.scenegraph.updateRowHeight(t.rowResize.row,e),t.table.scenegraph.updateRowHeight(t.rowResize.row+1,-e),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row+1)):(t.table.scenegraph.updateRowHeight(t.rowResize.row,e),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row))}updateResizeColForAll(e,t){for(let o=t.table.frozenRowCount;o<t.table.rowCount-t.table.bottomFrozenRowCount;o++)t.table.scenegraph.updateRowHeight(o,e),t.table.internalProps._heightResizedRowMap.add(o)}extendDealHeightMode(){const e=this.table.scenegraph;this.originalDealHeightMode=e.dealHeightMode.bind(e),e.dealHeightMode=()=>{if(this.table.heightMode!=="adaptive")return this.originalDealHeightMode();const t=this.eventManager.getExpandedRows(),o=this.table,a=o;o._clearRowRangeHeightsMap();let r,i;if((a.heightAdaptiveMode||"only-body")==="all")r=0,i=o.tableNoFrameHeight;else{const u=o.getRowsHeight(0,o.columnHeaderLevelCount-1),h=o.isPivotChart()?o.getBottomFrozenRowsHeight():0;r=o.columnHeaderLevelCount,i=o.tableNoFrameHeight-u-h}const l=o.isPivotChart()?o.rowCount-o.bottomFrozenRowCount:o.rowCount;if(t.length===0){let u=0;for(let h=r;h<l;h++)u+=o.getRowHeight(h);if(u>0){const h=i/u;for(let g=r;g<l;g++){const m=o.getRowHeight(g),w=Math.max(Math.round(m*h),20);e.setRowHeight(g,w)}}return}const s=new Map;let d=0;for(const u of t)if(u>=o.columnHeaderLevelCount&&u<l){const h=Tt(o,u-o.columnHeaderLevelCount),g=o.getRowHeight(u),m=g-h;s.set(u,{baseHeight:h>0?h:g,detailHeight:m}),d+=m}let c=0;for(let u=r;u<l;u++)if(s.has(u)){const h=s.get(u);h&&(c+=h.baseHeight)}else c+=o.getRowHeight(u);const f=(i-d)/c;for(let u=r;u<l;u++){let h;if(s.has(u)){const g=s.get(u);if(g){const m=Math.round(g.baseHeight*f);h=m+g.detailHeight,s.set(u,{baseHeight:m,detailHeight:g.detailHeight})}else h=Math.round(o.getRowHeight(u)*f)}else{const g=o.getRowHeight(u);h=Math.round(g*f)}e.setRowHeight(u,h)}const p=[];for(let u=r;u<l;u++)p.push(u);if(p.length>0){const u=p.reduce(((h,g)=>h+o.getRowHeight(g)),0);if(Math.abs(u-i)>1){const h=p[p.length-1],g=i-p.slice(0,-1).reduce(((m,w)=>m+o.getRowHeight(w)),0);if(s.has(h)){const m=s.get(h);if(m){const w=m.detailHeight,k=Math.max(g,w);e.setRowHeight(h,k),s.set(h,{baseHeight:k-m.detailHeight,detailHeight:m.detailHeight})}}else e.setRowHeight(h,g)}}this.callbacks.updateOriginalHeightsAfterAdaptive(s),this.callbacks.updateSubTablePositions()}}extendUpdatePagination(){const e=this.table;this.originalUpdatePagination=e.updatePagination.bind(e),e.updatePagination=t=>{[...this.eventManager.getExpandedRows()].forEach((a=>{this.callbacks.collapseRowToNoRealRecordIndex(a)}));const o=this.originalUpdatePagination(t);return this.waitForRenderComplete((()=>{this.callbacks.restoreExpandedStatesAfter()})),o}}extendToggleHierarchyState(){const e=this.table;this.originalToggleHierarchyState=e.toggleHierarchyState.bind(e),e.toggleHierarchyState=(t,o,a=!0)=>{if(this.table.isHeader(t,o)){[...this.eventManager.getExpandedRows()].forEach((i=>{this.callbacks.collapseRowToNoRealRecordIndex(i)}));const r=this.originalToggleHierarchyState(t,o,a);return this.waitForRenderComplete((()=>{this.callbacks.restoreExpandedStatesAfter()})),r}return this.originalToggleHierarchyState(t,o,a)}}extendUpdateFilterRules(){const e=this.table;this.originalUpdateFilterRules=e.updateFilterRules.bind(e),e.updateFilterRules=t=>([...this.eventManager.getExpandedRows()].forEach((o=>{this.callbacks.collapseRow(o)})),this.originalUpdateFilterRules(t))}extendUpdateChartSizeForResizeColWidth(){const e=this.table;this.originalUpdateChartSizeForResizeColWidth=e.scenegraph.updateChartSizeForResizeColWidth.bind(e.scenegraph),e.scenegraph.updateChartSizeForResizeColWidth=t=>{const o=e.getRowHeight.bind(e);e.getRowHeight=r=>{if(this.eventManager.isRowExpanded(r)){const i=r-this.table.columnHeaderLevelCount,l=Tt(this.table,i);return l>0?l:o(r)}return o(r)};const a=this.originalUpdateChartSizeForResizeColWidth(t);return e.getRowHeight=o,a}}extendUpdateChartSizeForResizeRowHeight(){const e=this.table;this.originalUpdateChartSizeForResizeRowHeight=e.scenegraph.updateChartSizeForResizeRowHeight.bind(e.scenegraph),e.scenegraph.updateChartSizeForResizeRowHeight=t=>{const o=e.getRowHeight.bind(e);e.getRowHeight=r=>{if(this.eventManager.isRowExpanded(r)){const i=r-this.table.columnHeaderLevelCount,l=Tt(this.table,i);return l>0?l:o(r)}return o(r)};const a=this.originalUpdateChartSizeForResizeRowHeight(t);return e.getRowHeight=o,a}}extendGetRowY(){var e;const t=this.table.scenegraph;if(t.component){const o=t.component.showResizeRow.bind(t.component);o&&(t.component.showResizeRow=(r,i,l)=>this.protectedShowResizeRow(o,r,i,l));const a=(e=t.component.updateResizeRow)===null||e===void 0?void 0:e.bind(t.component);a&&(t.component.updateResizeRow=(r,i,l)=>this.protectedUpdateResizeRow(a,r,i,l))}}extendUpdateRowHeight(){const e=this.table.scenegraph;this.originalUpdateRowHeight=e.updateRowHeight.bind(e),e.updateRowHeight=(t,o,a)=>{if(!this.eventManager.isRowExpanded(t)||!this.isDragging||this.dragStartIsPluginUnderline)return this.originalUpdateRowHeight(t,o,a);o=Math.round(o),this.callbacks.updateRowHeightForExpand(t,o),e.updateContainerHeight(t,o)}}extendGetResizeColAt(){const e=this.table.scenegraph;this.originalGetResizeColAt=e.getResizeColAt.bind(e),e.getResizeColAt=(t,o,a)=>{if(!a){const r=this.table.getCellAtRelativePosition(t,o);if(r&&r.row>=0&&this.eventManager.isRowExpanded(r.row))return{col:-1,row:-1}}return this.originalGetResizeColAt(t,o,a)}}isMouseInPluginUnderlineArea(e){var t,o,a,r;try{const i=((o=(t=this.table.stateManager)===null||t===void 0?void 0:t.scroll)===null||o===void 0?void 0:o.verticalBarPos)||0,l=this.table.getRowsHeight(0,e-1)+this.table.getRowHeight(e)-i+(((r=(a=this.table.theme)===null||a===void 0?void 0:a.frameStyle)===null||r===void 0?void 0:r.shadowBlur)||0),s=this.currentMouseY>=l-(this.table.internalProps.limitMinHeight-1)&&this.currentMouseY<=l+(this.table.internalProps.limitMinHeight-1),d=this.eventManager.isRowExpanded(e);return!(s&&d)}catch{return!1}}protectedShowResizeRow(e,t,o,a){if(this.isDragging||(this.isDragging=!0,this.dragStartIsPluginUnderline=this.isMouseInPluginUnderlineArea(t)),this.dragStartIsPluginUnderline){const r=this.table.getRowsHeight.bind(this.table);this.table.getRowsHeight=(l,s)=>this.getRowsHeightWithOriginalHeight(l,s);const i=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=l=>{if(l===t&&this.eventManager.isRowExpanded(l)){const s=l-this.table.columnHeaderLevelCount,d=Tt(this.table,s);return d>0?d:i(l)}return i(l)};try{return e(t,o,a)}finally{this.table.getRowsHeight=r,this.table.getRowHeight=i}}else{const r=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=i=>{if(i===t&&this.eventManager.isRowExpanded(i)){const l=i-this.table.columnHeaderLevelCount,s=Tt(this.table,l);return r(i)-s}return r(i)};try{return e(t,o,a)}finally{this.table.getRowHeight=r}}}protectedUpdateResizeRow(e,t,o,a){if(this.dragStartIsPluginUnderline){const r=this.table.getRowsHeight.bind(this.table);this.table.getRowsHeight=(l,s)=>this.getRowsHeightWithOriginalHeight(l,s);const i=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=l=>{if(l===t&&this.eventManager.isRowExpanded(l)){const s=l-this.table.columnHeaderLevelCount,d=Tt(this.table,s);return d>0?d:i(l)}return i(l)};try{return e(t,o,a)}finally{this.table.getRowsHeight=r,this.table.getRowHeight=i}}else{const r=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=i=>{if(i===t&&this.eventManager.isRowExpanded(i)){const l=i-this.table.columnHeaderLevelCount,s=Tt(this.table,l);return r(i)-s}return r(i)};try{return e(t,o,a)}finally{this.table.getRowHeight=r}}}getRowsHeightWithOriginalHeight(e,t){let o=0;for(let a=e;a<=t;a++)if(this.eventManager.isRowExpanded(a)&&a===t){const r=a-this.table.columnHeaderLevelCount,i=Tt(this.table,r);o+=i>0?i:this.table.getRowHeight(a)}else o+=this.table.getRowHeight(a);return o}waitForRenderComplete(e){const t=()=>{this.table.off(Ve.TABLE_EVENT_TYPE.AFTER_RENDER,t),e()};this.table.on(Ve.TABLE_EVENT_TYPE.AFTER_RENDER,t)}cleanup(){if(this.mouseEventListener){try{const e=this.table;if(e&&e.internalProps&&e.internalProps.canvas){const t=e.internalProps.canvas;t.removeEventListener("mousemove",this.mouseEventListener),t.removeEventListener("mousedown",this.mouseEventListener),t.removeEventListener("mouseup",this.mouseEventListener)}}catch{}this.mouseEventListener=void 0}if(this.originalUpdateCellContent&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateCellContent&&(e.scenegraph.updateCellContent=this.originalUpdateCellContent),this.originalUpdateCellContent=void 0}if(this.originalUpdateResizeRow&&this.table){const e=this.table;e.stateManager&&e.stateManager.updateResizeRow&&(e.stateManager.updateResizeRow=this.originalUpdateResizeRow),this.originalUpdateResizeRow=void 0}if(this.originalDealHeightMode&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.dealHeightMode&&(e.scenegraph.dealHeightMode=this.originalDealHeightMode),this.originalDealHeightMode=void 0}if(this.originalUpdatePagination&&this.table){const e=this.table;e.updatePagination&&(e.updatePagination=this.originalUpdatePagination),this.originalUpdatePagination=void 0}if(this.originalToggleHierarchyState&&this.table){const e=this.table;e.toggleHierarchyState&&(e.toggleHierarchyState=this.originalToggleHierarchyState),this.originalToggleHierarchyState=void 0}if(this.originalUpdateFilterRules&&this.table){const e=this.table;e.updateFilterRules&&(e.updateFilterRules=this.originalUpdateFilterRules),this.originalUpdateFilterRules=void 0}if(this.originalUpdateChartSizeForResizeColWidth&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateChartSizeForResizeColWidth&&(e.scenegraph.updateChartSizeForResizeColWidth=this.originalUpdateChartSizeForResizeColWidth),this.originalUpdateChartSizeForResizeColWidth=void 0}if(this.originalUpdateChartSizeForResizeRowHeight&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateChartSizeForResizeRowHeight&&(e.scenegraph.updateChartSizeForResizeRowHeight=this.originalUpdateChartSizeForResizeRowHeight),this.originalUpdateChartSizeForResizeRowHeight=void 0}if(this.originalUpdateRowHeight&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateRowHeight&&(e.scenegraph.updateRowHeight=this.originalUpdateRowHeight),this.originalUpdateRowHeight=void 0}if(this.originalGetResizeColAt&&this.table){const e=this.table.scenegraph;e&&e.getResizeColAt&&(e.getResizeColAt=this.originalGetResizeColAt),this.originalGetResizeColAt=void 0}this.isDragging=!1,this.dragStartIsPluginUnderline=!1,this.currentMouseX=0,this.currentMouseY=0,this.callbacks=null,this.table=null,this.configManager=null,this.eventManager=null}};function Sp(e,t){const o=i=>{var l;const{col:s,row:d,checked:c,field:f}=i;if(e.isHeader(s,d)){const g=Ze(e);t.getExpandedRows().forEach((m=>{var w;const k=m-e.columnHeaderLevelCount,b=(w=g.subTableInstances)===null||w===void 0?void 0:w.get(k);b&&f&&Ml(b,typeof f=="string"?f:String(f),c)}));return}const p=d;if(!t.isRowExpanded(p))return;const u=d-e.columnHeaderLevelCount,h=(l=Ze(e).subTableInstances)===null||l===void 0?void 0:l.get(u);h&&f&&Ml(h,typeof f=="string"?f:String(f),c)},a=e.stateManager.updateHeaderCheckedState;e.stateManager.updateHeaderCheckedState=function(i,l,s){const d=this;let c,f=!0,p=!0,u=!1,h=!1;return d.checkedState.forEach(((g,m)=>{var w;m=m.includes(",")?m.split(",").map((S=>Number(S))):Number(m);const k=d.table.getTableIndexByRecordIndex(m),b=d.table.transpose?d.table.getCustomMerge(k,s):d.table.getCustomMerge(l,k),y=(w=d.table.dataSource)===null||w===void 0?void 0:w.get(m);if(b||!d.table.internalProps.enableCheckboxCascade&&y?.vtableMerge)return;const C=g?.[i];C==="indeterminate"?(h=!0,u=!0,f=!1,p=!1):C!==!0?f=!1:(p=!1,u=!0)})),c=h?"indeterminate":!!f||!p&&!!u&&"indeterminate",d.headerCheckedState[i]=c,c},e.on("checkbox_state_change",o);const r=Ep(e);return()=>{e.off("checkbox_state_change",o),e.stateManager.updateHeaderCheckedState=a,r()}}function Ep(e){const t=Ze(e),o=t.subTableInstances.set;return o&&t.subTableInstances?(t.subTableInstances.set=function(a,r){const i=o.call(this,a,r),l=s=>{const{field:d}=s;_p(e,r,a,d)};return r.on("checkbox_state_change",l),r.__checkboxHandler=l,i},()=>{t.subTableInstances&&o&&(t.subTableInstances.set=o)}):()=>{}}function _p(e,t,o,a){const r=o+e.columnHeaderLevelCount;let i=!1;const l=t.stateManager.headerCheckedState[a];l!==void 0&&(i=l);const s=Bo(e,a);if(s!==-1&&e.stateManager&&(e.stateManager.setCheckedState(s,r,a,i),e.getCellType(s,r)==="checkbox"&&fa(s,r,i,e),e.internalProps.enableCheckboxCascade)){const d=e.stateManager.headerCheckedState[a],c=e.stateManager.updateHeaderCheckedState(a,s,0);d!==c&&e.isHeader(s,0)&&e.scenegraph.updateHeaderCheckboxCellState(s,0,c)}}function Ml(e,t,o){if(!e.stateManager)return;e.stateManager.headerCheckedState[t]=o,(e.records||[]).forEach(((r,i)=>{const l=i.toString();r[t]=o;let s=e.stateManager.checkedState.get(l);s||(s={},e.stateManager.checkedState.set(l,s)),s[t]=o}));const a=Bo(e,t);if(a>=0){e.scenegraph.updateHeaderCheckboxCellState(a,0,o);for(let r=e.columnHeaderLevelCount;r<e.rowCount;r++)fa(a,r,o,e)}}var Bp=class{constructor(e={}){this.id="Master Detail Plugin",this.name="Master Detail Plugin",this.runTime=[Ve.TABLE_EVENT_TYPE.BEFORE_INIT,Ve.TABLE_EVENT_TYPE.INITIALIZED,Ve.TABLE_EVENT_TYPE.SORT_CLICK,Ve.TABLE_EVENT_TYPE.AFTER_SORT,Ve.TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH,Ve.TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT],this.pluginOptions=e}run(...e){const t=e[0],o=e[1],a=e[2];if(o===Ve.TABLE_EVENT_TYPE.BEFORE_INIT)this.table=a,this.initializeManagers(),this.configManager.injectMasterDetailOptions(t.options);else if(o===Ve.TABLE_EVENT_TYPE.INITIALIZED)this.setupMasterDetailFeatures();else{if(o===Ve.TABLE_EVENT_TYPE.SORT_CLICK)return this.eventManager.executeMasterDetailBeforeSort(),!0;o===Ve.TABLE_EVENT_TYPE.AFTER_SORT?this.eventManager.executeMasterDetailAfterSort():o===Ve.TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH?this.eventManager.handleAfterUpdateCellContentWidth(t):o===Ve.TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT&&this.eventManager.handleAfterUpdateSelectBorderHeight(t)}}initializeManagers(){var e;this.configManager=new bp(this.pluginOptions,this.table),this.eventManager=new wp(this.table,this.configManager.getChildrenKey());const t=(e=this.pluginOptions.enableCheckboxCascade)===null||e===void 0||e;this.subTableManager=new xp(this.table,t),this.configManager.setRowExpandedChecker((o=>this.eventManager.isRowExpanded(o))),this.configManager.setExpandRowCallback((o=>this.expandRow(o))),this.eventManager.setCallbacks({onUpdateSubTablePositions:()=>this.subTableManager.recalculateAllSubTablePositions(),onUpdateSubTablePositionsForRow:()=>this.subTableManager.updateSubTablePositionsForRowResize(),onExpandRow:(o,a)=>this.expandRow(o,a),onCollapseRow:(o,a)=>this.collapseRow(o,a),onCollapseRowToNoRealRecordIndex:o=>this.collapseRowToNoRealRecordIndex(o),onToggleRowExpand:(o,a)=>this.toggleRowExpand(o,a),getOriginalRowHeight:o=>Tt(this.table,o)}),this.subTableManager.setCallbacks({getDetailConfigForRecord:(o,a)=>this.configManager.getDetailConfigForRecord(o,a)}),this.subTableManager.setAutoHeightCallback(((o,a)=>{this.handleAutoHeightUpdate(o,a)}))}setupMasterDetailFeatures(){this.initInternalProps(),this.eventManager.bindEventHandlers(),this.setupUnifiedSelectionManagement(),this.extendTableAPI(),this.initCheckboxCascade()}setupUnifiedSelectionManagement(){this.mainTableClickHandler=()=>{this.clearAllSubTableVisibleSelections()},this.table.on("click_cell",this.mainTableClickHandler)}initCheckboxCascade(){var e;((e=this.pluginOptions.enableCheckboxCascade)===null||e===void 0||e)&&(this.checkboxCascadeCleanup=Sp(this.table,this.eventManager))}initInternalProps(){const e=Ze(this.table);e.expandedRecordIndices=[],e.subTableInstances=new Map,e.originalRowHeights=new Map,e.subTableCheckboxStates=new Map}extendTableAPI(){this.tableAPIExtensions=new kp(this.table,this.configManager,this.eventManager,{addUnderlineToCell:e=>this.addUnderlineToCell(e),updateOriginalHeightsAfterAdaptive:e=>this.updateOriginalHeightsAfterAdaptive(e),collapseRowToNoRealRecordIndex:e=>this.collapseRowToNoRealRecordIndex(e),expandRow:e=>this.expandRow(e),restoreExpandedStatesAfter:()=>this.restoreExpandedStatesAfter(),collapseRow:e=>this.collapseRow(e),updateSubTablePositions:()=>this.subTableManager.recalculateAllSubTablePositions(),updateRowHeightForExpand:(e,t)=>this.updateRowHeightForExpand(e,t)}),this.tableAPIExtensions.extendTableAPI()}updateOriginalHeightsAfterAdaptive(e){const t=Ze(this.table);for(const[o,a]of e){const r=o-this.table.columnHeaderLevelCount;t.originalRowHeights&&t.originalRowHeights.set(r,a.baseHeight)}}restoreExpandedStatesAfter(){const e=Ze(this.table);!e.expandedRecordIndices||e.expandedRecordIndices.length===0||this.table.dataSource._currentPagerIndexedData&&e.expandedRecordIndices.forEach((t=>{try{const o=this.table.getBodyRowIndexByRecordIndex(t);if(o>=0){const a=o+this.table.columnHeaderLevelCount;this.expandRow(a)}}catch{}}))}expandRow(e,t){var o;const a=e-this.table.columnHeaderLevelCount,r=Ze(this.table);if(this.eventManager.isRowExpanded(e))return;const i=this.table.getRecordIndexByCell(0,e);if(i==null)return;r.expandedRecordIndices&&(yp(r.expandedRecordIndices,i)||r.expandedRecordIndices.push(i)),this.eventManager.addExpandedRow(e);const l=this.table.getRowHeight(e);r.originalRowHeights&&(this.table.scenegraph.getCell(t,e),r.originalRowHeights.set(a,l));const s=no(this.table,a),d=this.configManager.getDetailConfigForRecord(s,a),c=((o=d?.style)===null||o===void 0?void 0:o.height)||300,f=this.configManager.getChildrenKey(),p=Array.isArray(s[f])?s[f]:[],u=c==="auto"?300:typeof c=="number"?c:300;this.updateRowHeightForExpand(e,u),this.table.scenegraph.updateContainerHeight(e,u),r._heightResizedRowMap.add(e),this.subTableManager.renderSubTable(a,p,((h,g)=>this.configManager.getDetailConfigForRecord(h,g))),e!==this.table.rowCount-1&&this.drawUnderlineForRow(e),this.refreshRowIcon(e,t),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}handleAutoHeightUpdate(e,t){var o;try{const a=e+this.table.columnHeaderLevelCount,r=t-(this.table.getRowHeight(a)-(((o=Ze(this.table).originalRowHeights)===null||o===void 0?void 0:o.get(e))||0));this.updateRowHeightForExpand(a,r),this.table.scenegraph.updateContainerHeight(a,r)}catch{}}collapseRow(e,t){const o=e-this.table.columnHeaderLevelCount,a=Ze(this.table);if(!this.eventManager.isRowExpanded(e))return;const r=this.table.getRecordIndexByCell(0,e);if(r==null)return;if(this.subTableManager.removeSubTable(o),a.expandedRecordIndices){const l=vp(a.expandedRecordIndices,r);l>-1&&a.expandedRecordIndices.splice(l,1)}this.eventManager.removeExpandedRow(e);const i=this.table.getRowHeight(e)-Tt(this.table,o);this.updateRowHeightForExpand(e,-i),a._heightResizedRowMap.delete(e),this.table.scenegraph.updateContainerHeight(e,-i),a.originalRowHeights&&a.originalRowHeights.delete(o),e!==this.table.rowCount-1&&this.removeUnderlineFromRow(e),this.refreshRowIcon(e,t),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}collapseRowToNoRealRecordIndex(e){const t=e-this.table.columnHeaderLevelCount,o=Ze(this.table);if(!this.eventManager.isRowExpanded(e))return;this.subTableManager.removeSubTable(t),this.eventManager.removeExpandedRow(e);const a=this.table.getRowHeight(e)-Tt(this.table,t);this.updateRowHeightForExpand(e,-a),o._heightResizedRowMap.delete(e),this.table.scenegraph.updateContainerHeight(e,-a),o.originalRowHeights&&o.originalRowHeights.delete(t),e!==this.table.rowCount-1&&this.removeUnderlineFromRow(e),this.refreshRowIcon(e),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}toggleRowExpand(e,t){this.eventManager.isRowExpanded(e)?this.collapseRow(e,t):this.expandRow(e,t)}updateRowHeightForExpand(e,t){this.table._setRowHeight(e,this.table.getRowHeight(e)+t,!0);const o=e+1;let a=0;a=e<this.table.frozenRowCount?this.table.frozenRowCount-1:e>=this.table.rowCount-this.table.bottomFrozenRowCount?this.table.rowCount-1:Math.min(this.table.scenegraph.proxy.rowEnd,this.table.rowCount-this.table.bottomFrozenRowCount-1);for(let r=0;r<this.table.colCount;r++)for(let i=o;i<=a;i++){const l=this.table.scenegraph.highPerformanceGetCell(r,i);l.role==="cell"&&l.setAttribute("y",l.attribute.y+t)}}drawUnderlineForRow(e){if(!this.table.scenegraph)return;const t=this.getRowCells(e);t.length!==0&&(t.forEach(((o,a)=>{o&&o.attribute&&this.addUnderlineToCell(o)})),this.table.scenegraph.updateNextFrame())}getRowCells(e){const t=[];for(let o=0;o<this.table.colCount;o++){const a=this.table.scenegraph.getCell(o,e);a&&a.role==="cell"&&t.push(a)}return t}addUnderlineToCell(e){var t;const o=e.attribute,a=o.strokeArrayWidth||(o.lineWidth?[o.lineWidth,o.lineWidth,o.lineWidth,o.lineWidth]:[1,1,1,1]),r=o.strokeArrayColor||(o.stroke?[o.stroke,o.stroke,o.stroke,o.stroke]:["transparent","transparent","transparent","transparent"]);e._hasUnderline||(e._originalStrokeArrayWidth=[...a],e._originalStrokeArrayColor=[...r],e._hasUnderline=!0);const i=e._originalStrokeArrayWidth||a,l=e._originalStrokeArrayColor||r,s=[...i],d=[...l];if(s[2]=2*(.75*(i[2]||1)+.75*(i[0]||1)),l[2]!=="transparent"&&l[2])d[2]=l[2];else{const c=this.table.theme;d[2]=((t=c?.bodyStyle)===null||t===void 0?void 0:t.borderColor)||"#e1e4e8"}e.setAttributes({strokeArrayWidth:s,strokeArrayColor:d,stroke:!0})}removeUnderlineFromRow(e){this.getRowCells(e).forEach(((t,o)=>{t&&t._hasUnderline&&this.removeUnderlineFromCell(t)})),this.table.scenegraph.updateNextFrame()}removeUnderlineFromCell(e){e._hasUnderline&&(e._originalStrokeArrayWidth&&e._originalStrokeArrayColor&&(e.setAttributes({strokeArrayWidth:e._originalStrokeArrayWidth,strokeArrayColor:e._originalStrokeArrayColor}),delete e._originalStrokeArrayWidth,delete e._originalStrokeArrayColor),e._hasUnderline=!1)}refreshRowIcon(e,t){let o;typeof t=="number"?o=t:o=this.table.options.rowSeriesNumber?1:0;const a=this.table.getCellOriginRecord(o,e);if(a&&typeof a=="object"){const r=a,i=Ve.TYPES.HierarchyState;r.hierarchyState=this.eventManager.isRowExpanded(e)?i.expand:i.collapse,this.table.scenegraph.updateHierarchyIcon(o,e)}}setRecordChildren(e,t,o){const a=this.table.getCellOriginRecord(t,o);a&&(a[this.configManager.getChildrenKey()]=e,this.expandRow(o,t),this.table.scenegraph.updateCellContent(t,o))}release(){var e,t,o,a,r;const i=Ze(this.table);i&&(i._isReleasing=!0);try{if(this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.checkboxCascadeCleanup){try{this.checkboxCascadeCleanup()}catch{}this.checkboxCascadeCleanup=void 0}if(this.eventManager)try{this.eventManager.cleanup()}catch{}if(this.subTableManager)try{this.subTableManager.cleanup()}catch{}if(this.configManager)try{this.configManager.release()}catch{}if(this.cleanupMasterDetailFeatures(),this.table&&i)try{(e=i.expandedRecordIndices)===null||e===void 0||e.splice(0),(t=i.subTableInstances)===null||t===void 0||t.clear(),(o=i.originalRowHeights)===null||o===void 0||o.clear(),(a=i.subTableCheckboxStates)===null||a===void 0||a.clear(),(r=i._heightResizedRowMap)===null||r===void 0||r.clear()}catch{}}catch{}finally{try{this.configManager=null,this.eventManager=null,this.subTableManager=null,this.tableAPIExtensions=null,this.table=null,this.pluginOptions=null}catch{}}}clearAllSubTableVisibleSelections(){var e;(e=Ze(this.table).subTableInstances)===null||e===void 0||e.forEach((t=>{t&&typeof t.clearSelected=="function"&&t.clearSelected()}))}getAllSubTableInstances(){return this.subTableManager.getAllSubTableInstances()}getSubTableByRowIndex(e){const t=e-this.table.columnHeaderLevelCount;return this.subTableManager.getSubTableInstance(t)}getSubTableByBodyRowIndex(e){return this.subTableManager.getSubTableInstance(e)}filterSubTables(e){const t=[],o=this.subTableManager.getAllSubTableInstances();if(!o)return t;for(const[a,r]of o)try{e(a,r,no(this.table,a))&&t.push({bodyRowIndex:a,subTable:r})}catch{}return t}updateFrozenColumnShadowHeight(){try{const e=this.table.frozenColCount;e>0&&this.table.scenegraph.component.setFrozenColumnShadow(e-1)}catch{}}cleanupMasterDetailFeatures(){this.mainTableClickHandler&&(this.table.off("click_cell",this.mainTableClickHandler),this.mainTableClickHandler=void 0),this.tableAPIExtensions&&(this.tableAPIExtensions.cleanup(),this.tableAPIExtensions=void 0)}},pa={cellInnerBorder:!1,defaultStyle:{bgColor:"#fff",borderColor:"#e5e6eb",color:"#1d2129",fontSize:14,fontFamily:"Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif"},headerStyle:{bgColor:"#f2f3f5",fontWeight:500,padding:[0,8,0,8],lineHeight:14},bodyStyle:{padding:[0,8,0,8],lineHeight:14},frameStyle:{},scrollStyle:{barToSide:!0,width:10,visible:"always",hoverOn:!1}},Rp=(0,n.defineComponent)({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>({})},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},isNotCol:{type:Boolean,default:!1}},setup(e){const t=new Set(["j-input-cards","j-input-rows","j-table"]),o=e,{formData:a,errorFields:r,span:i,labelWidth:l}=gn(),{getTableData:s,row:d,pRowData:c}=ua(),{t:f}=Ye(),p=(0,n.ref)(0);(0,n.watch)(a,()=>{p.value++},{deep:!0});const u=(0,n.computed)(()=>(p.value,(o.getCompType?o.getCompType({config:o.config,formData:a,row:d,getTableData:s,pRowData:c}):o.type)||"")),h=(0,n.computed)(()=>{p.value;const C=Nt({config:o.config||{},getCompConfig:o.getCompConfig,formData:a,row:d,getTableData:s,pRowData:c});return C.needFormItem===void 0&&t.has(u.value)?{...C,needFormItem:!1}:C}),g=(0,n.computed)(()=>h.value.display!==!1),m=(0,n.computed)(()=>({id:o.id,type:u.value,config:h.value,children:o.children})),w=(0,n.computed)(()=>la(u.value)&&!h.value?.notInput||h.value?.isInput),k=(0,n.computed)(()=>h.value?.labelWidth||l.value),b=(0,n.computed)(()=>(h.value?.rule||[]).some(C=>C.required===!0)),y=(0,n.computed)(()=>r?.value?.[o.id]?.msg||"");return(C,S)=>{const v=(0,n.resolveComponent)("j-comp"),x=(0,n.resolveComponent)("el-form-item"),E=(0,n.resolveComponent)("el-col");return g.value&&!e.isNotCol?((0,n.openBlock)(),(0,n.createBlock)(E,{key:0,span:h.value.span||(0,n.unref)(i),style:(0,n.normalizeStyle)({...h.value.colStyle||{}}),class:(0,n.normalizeClass)(h.value.colClass||{})},{default:(0,n.withCtx)(()=>[w.value&&h.value.needFormItem!==!1?((0,n.openBlock)(),(0,n.createBlock)(x,{key:0,label:(0,n.unref)(f)(h.value.notShowLabel?"":h.value.label||""),"label-position":h.value.labelPosition,"label-width":k.value,required:b.value,error:(0,n.unref)(f)(y.value),class:(0,n.normalizeClass)(`${u.value}-form-item`)},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(v,(0,n.normalizeProps)((0,n.guardReactiveProps)(m.value)),null,16)]),_:1},8,["label","label-position","label-width","required","error","class"])):((0,n.openBlock)(),(0,n.createBlock)(v,(0,n.normalizeProps)((0,n.mergeProps)({key:1},m.value)),null,16))]),_:1},8,["span","style","class"])):g.value?((0,n.openBlock)(),(0,n.createBlock)(v,(0,n.normalizeProps)((0,n.mergeProps)({key:1},m.value)),null,16)):(0,n.createCommentVNode)("",!0)}}}),Al=Rp,Tp=(0,n.defineComponent)({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},row:{type:Object,default:void 0},isTableCell:{type:Boolean,default:!1},colNum:{type:Number,default:void 0},rowNum:{type:Number,default:void 0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,{useData:r}=Ye(),{loadDataByComp:i,getDataByComp:l,getLabel:s}=r(),{contextType:d}=rl(),{formData:c,formChange:f,gutter:p,runFlow:u,runFlowByNotRunActions:h}=gn(),g=(0,n.computed)(()=>p?.value||16),{registerMethod:m,runFlow:w,runFlowByNotRunActions:k}=fl(),{getTableData:b,row:y,rowChange:C,pRowData:S}=ua(),v=o.row||y;_o({getTableData:b,row:v,rowChange:C,pRowData:S});const x=(0,n.computed)(()=>la(j.value)&&!V.value?.notInput||V.value?.isInput||j.value==="j-tabs"||j.value==="j-collapse"||j.value==="j-table"),E=(0,n.computed)(()=>{if(["j-select","j-tree-select","j-checkbox"].includes(o.type)){const M={...o.config||{}};return!(o.type==="j-select"&&!M.multiple||o.type==="j-tree-select"&&!M.multiple)}return!1}),_=(0,n.computed)({get(){let M;if(v?M=v[o.id]:c?M=c[o.id]:M=o.modelValue,M===void 0&&j.value==="j-tabs"){if(V.value?.defaultValue)return V.value.defaultValue;const oe=o.children.findIndex(me=>me.config?.active);return oe>-1?"_tab"+oe:"_tab0"}if(M===void 0&&j.value==="j-collapse"){if(V.value?.defaultValue)return V.value.defaultValue;const oe=o.children.map((me,ce)=>({item:me,index:ce})).filter(({item:me})=>me.config?.active);return V.value?.accordion?oe.length>0?"_collapse"+oe[0].index:"":oe.map(({index:me})=>"_collapse"+me)}return E.value?M?M.split(","):[]:M},set(M){M&&E.value&&(M=String(M||[])),v?v[o.id]=M:c&&(c[o.id]=M),a("update:modelValue",M)}}),T=(0,n.ref)(0);(0,n.watch)([()=>c,()=>v],()=>T.value++,{deep:!0});const V=(0,n.computed)(()=>(T.value,Nt({config:o.config,getCompConfig:o.getCompConfig,formData:c||{},row:v,getTableData:b,pRowData:S}))),N=(0,n.computed)(()=>(T.value,sa({type:o.type,getCompType:o.getCompType,config:V.value,formData:c||{},row:v,getTableData:b,pRowData:S})||"")),z=(0,n.computed)(()=>{if(j.value!=="j-tree")return l?l({type:j.value,config:V.value,formData:c||{},row:v,getTableData:b})||[]:V.value.options||[]}),j=(0,n.computed)(()=>o.isTableCell&&(N.value==="j-radio"||N.value==="j-checkbox")?"j-select":N.value==="j-textarea"?"j-input":((N.value==null||N.value==="")&&console.warn("组件类型不能为空"),N.value)),A=M=>s({value:M,config:L.value||{},formData:c||{},row:v,getTableData:b}),B=async M=>i?await i({type:j.value,config:L.value,formData:c||{},row:v,getTableData:b,params:M}):[],L=(0,n.computed)(()=>{const M={...V.value};return j.value==="j-layer-form"&&(M.schema=o.children),j.value==="el-collapse-item"&&M.label&&(M.title=M.label,delete M.label),["j-input-cards","j-input-rows","j-table"].includes(N.value)&&(M.columns=o.children.map(oe=>{const me=oe.config?.parentTableId;return me&&oe.id&&oe.id.startsWith(me+".")?{...oe,id:oe.id.slice(me.length+1)}:oe})),o.isTableCell&&(N.value==="j-checkbox"&&(M.multiple=!0),N.value==="j-select"&&M.multiple&&(M.collapseTags=!0,M.collapseTagsTooltip=!0),N.value==="j-switch"&&(M.size="small"),N.value==="j-textarea"&&(M.type="textarea")),["j-button-layer","j-input-layer"].includes(o.type)&&(M.loadLayerData=B,M.getText=A),M.dataType&&(M.options=z.value),M}),U=(0,n.computed)(()=>{if(j.value==="j-layer-form"||j.value==="j-input-rows"||j.value==="j-input-cards")return{};const M={};return o.children.forEach((oe,me)=>{let ce=oe;j.value==="j-tabs"&&(ce={...oe,type:"el-tab-pane",config:{...oe.config||{},name:"_tab"+me}},d=="form"&&(ce.config.needRow=ce.config.needRow!==!1,ce.config.needFormItem=ce.config.needFormItem!==!1)),j.value==="j-collapse"&&(ce={...oe,type:"el-collapse-item",config:{...oe.config||{},name:"_collapse"+me}},d=="form"&&(ce.config.needRow=ce.config.needRow!==!1,ce.config.needFormItem=ce.config.needFormItem!==!1)),ce.slot?(M[ce.slot]=M[ce.slot]||[],M[ce.slot].push(ce)):(M.default=M.default||[],M.default.push(ce))}),M}),te=M=>{const oe={...M,id:o.id,formData:c,row:v,getTableData:b,config:V.value,type:"change",colNum:o.colNum,rowNum:o.rowNum};V.value?.change&&V.value?.change(oe),C&&C(oe),f&&f(oe),a("change",oe)},se=(0,n.ref)(),I=(0,n.ref)([]),$=(M,...oe)=>{if(se.value&&typeof se.value[M]=="function")return se.value[M](...oe);console.warn(`方法 ${M} 不存在或不是函数`)},Y=()=>{if(I.value.forEach(oe=>oe()),I.value=[],!m)return;const M=m(o.id,$);I.value.push(M)};return(0,n.watch)(()=>se.value,()=>{Y()}),(0,n.onMounted)(()=>{Y(),o.id&&h&&h(o.id),o.id&&k&&k(o.id)}),(0,n.onBeforeUnmount)(()=>{I.value.forEach(M=>M()),I.value=[]}),(M,oe)=>{const me=(0,n.resolveComponent)("JComp"),ce=(0,n.resolveComponent)("el-row");return L.value.display!=!1&&x.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(j.value),(0,n.mergeProps)({key:0,ref_key:"compRef",ref:se},L.value,{modelValue:_.value,"onUpdate:modelValue":oe[0]||(oe[0]=Be=>_.value=Be),"run-flow":(0,n.unref)(u),onChange:te}),(0,n.createSlots)({_:2},[(0,n.renderList)(U.value,(Be,Te)=>({name:Te,fn:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(Be,q=>((0,n.openBlock)(),(0,n.createBlock)(me,(0,n.mergeProps)({key:q.id},{ref_for:!0},q),null,16))),128))])}))]),1040,["modelValue","run-flow"])):L.value.display!=!1?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(j.value),(0,n.mergeProps)({key:1,ref_key:"compRef",ref:se},L.value,{"run-flow":(0,n.unref)(u)||(0,n.unref)(w),onChange:te}),(0,n.createSlots)({_:2},[(0,n.renderList)(U.value,(Be,Te)=>({name:Te,fn:(0,n.withCtx)(()=>[L.value.needRow===!0||L.value.needRow?.[Te]===!0?((0,n.openBlock)(),(0,n.createBlock)(ce,{key:0,gutter:g.value},{default:(0,n.withCtx)(()=>[L.value.needFormItem===!0||L.value.needFormItem?.[Te]===!0?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(Be,q=>((0,n.openBlock)(),(0,n.createBlock)(Al,(0,n.mergeProps)({key:q.id},{ref_for:!0},q),null,16))),128)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(Be,q=>((0,n.openBlock)(),(0,n.createBlock)(me,(0,n.mergeProps)({key:q.id},{ref_for:!0},q),null,16))),128))]),_:2},1032,["gutter"])):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(Be,q=>((0,n.openBlock)(),(0,n.createBlock)(me,(0,n.mergeProps)({key:q.id},{ref_for:!0},q),null,16))),128))])}))]),1040,["run-flow"])):(0,n.createCommentVNode)("",!0)}}}),Nl=Tp,Vp=class{wrapContainer=null;container=null;currentValue=null;async onStart(e){const{value:t}=e;await this.createElement(e)&&t!=null&&this.setValue(t)}findColumnByField(e,t){for(const o of e){if(o.field===t)return o;if(o.columns){const a=this.findColumnByField(o.columns,t);if(a)return a}}return null}async createElement(e){return await this.createEditor(e)}async createEditor(e){const{container:t,referencePosition:o,col:a,row:r,table:i}=e,l=i.getBodyField(a,r),s=i.options?.columns||[],d=this.findColumnByField(s,l),c=d?._compConfig||{},f=(0,n.ref)(i.getCellOriginRecord(a,r)||{});if(!t)return!1;let p=d?._compType;if(f.value._compTypeByRender&&f.value._compTypeByRender[l]&&(p=f.value._compTypeByRender[l],!Pl(p)))return this.currentValue=f.value[l],!1;const u=document.createElement("div");u.style.position="absolute",u.style.width="100%",u.style.height="100%",u.style.boxSizing="border-box";const{bgColor:h}=i.getCellStyle(a,r)||{};if(u.style.backgroundColor=h||"#FFFFFF",p==="j-switch"){const m=d?.style?.textAlign;u.style.display="flex",u.style.alignItems="center",u.style.justifyContent=m==="center"?"center":m==="right"?"flex-end":"flex-start",u.style.paddingLeft=m==="center"?"0":"11px"}this.wrapContainer=u,this.container=t,this.container&&this.container.appendChild(u),c.autoFocus=!0,this.currentValue=void 0;const g=(0,n.h)(Nl,{id:l,type:p,config:c,getCompConfig:d._getCompConfig,getCompType:d._getCompType,row:f.value||{},isTableCell:!0,class:"j-comp-editor","onUpdate:modelValue":m=>{this.currentValue=m},colNum:a,rowNum:r});return g.appContext=i._getAppContext(),g.appContext.provides=i._getProvides(),(0,n.render)(g,u),o?.rect&&this.adjustPosition(o.rect),!0}getValue(){return this.currentValue}setValue(e){this.currentValue=e}adjustPosition(e){this.wrapContainer&&(this.wrapContainer.style.top=`${e.top}px`,this.wrapContainer.style.left=`${e.left}px`,this.wrapContainer.style.width=`${e.width-1}px`,this.wrapContainer.style.height=`${e.height-1}px`)}onEnd(){const e=this.wrapContainer;if(e){try{(0,n.render)(null,e)}catch{}try{e.isConnected?e.remove():this.container&&e.parentNode===this.container&&this.container.removeChild(e)}catch{}this.wrapContainer=null,this.container=null}}isEditorElement(e){return this.wrapContainer?.contains(e)?!0:this.isClickPopUp(e)}isClickPopUp(e){let t=e;for(;t;){if(t.classList){for(const o of["el-select-dropdown","el-popper","el-picker-panel","el-cascader-panel","el-autocomplete-suggestion","el-date-picker","el-time-picker"])if(t.classList.contains(o))return!0}t=t.parentNode}return!1}},jl=new Map;function Mp(){if(!jl.has("j-comp-editor")){const e=new Vp;pn.register.editor("j-comp-editor",e),jl.set("j-comp-editor",e)}}function Ap(e){if(Wi(e))return"j-comp-editor"}function Pl(e){if(e)return Ap(e)}function Np(){Mp()}var jp={class:"j-table-footer"},Pp={key:0,class:"j-table-pagination"},Hp=["onClick"],Lt=40,zp=(0,n.defineComponent)({name:"JTable",__name:"table",props:{id:{type:String,default:""},modelValue:{type:Array,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,default:()=>[]},isTree:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!1},parentKey:{type:String,default:""},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},selectStateKey:{type:String,default:""},isPage:{type:Boolean,default:!1},pageLayoutSimple:{type:Boolean,default:!1},pageSizes:Array,pageTotal:{type:Number,default:0},tablePage:{type:Number,default:1},pageSize:{type:Number,default:100},rowKey:{type:String,default:"id"},actions:{type:Array,default:()=>[]},actionFilter:{type:Function,default:null},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},isAnimationAppear:{type:Boolean,default:!1},heightMode:{type:String,default:"full"},maxHeight:{type:[String,Number],default:void 0},highlightMode:{type:String,default:"row"},editConfig:{type:Object,default:()=>({})},emptyTipText:{type:String,default:"暂无数据"},subColumns:{type:Array,default:()=>[]},isSubShowNumber:{type:Boolean,default:!0},subActions:{type:Array,default:()=>[]},loadChildren:{type:Function,default:null}},emits:["ready","selectionChanged","selectRecordsChanged","update:tablePage","update:pageSize","loadPageData","rowChange","update:modelValue","change"],setup(e,{expose:t,emit:o}){const a=(0,n.getCurrentInstance)(),r=e,i=o,{formData:l}=gn(),{useData:s}=Ye(),{getLabel:d,getCode:c,loadDataState:f,getObjectList:p}=s(),{openLayer:u}=zn(),h=(0,n.computed)(()=>r.heightMode==="auto"?{height:"auto"}:{}),g=(0,n.reactive)({}),m=()=>{Object.keys(g).forEach(O=>{delete g[O]})},w=(0,n.ref)(40),k=(0,n.computed)(()=>{const O={};return r.heightMode==="auto"&&(r.emptyTipText&&w.value<200?O.height="200px":O.height=w.value+"px",O.flex="none",r.maxHeight&&(O.maxHeight=typeof r.maxHeight=="number"?`${r.maxHeight}px`:r.maxHeight)),O}),b=(0,n.ref)(null);let y=null,C=null,S=0,v=0,x=!1;const E=(0,n.ref)(0);let _=r.records.length,T=45;const V=(0,n.ref)(!1),N=(0,n.ref)({}),z=(0,n.ref)([]),j=(0,n.ref)(null),A=(0,n.ref)(0);let B=null,L=!1,U=!1;const te=(O,D,J,Z,F)=>{z.value=O,j.value=D,A.value=J,N.value={left:`${Z}px`,top:`${F}px`},V.value=!0,L=!1,document.addEventListener("wheel",oe,{passive:!1})},se=()=>{V.value=!1,L=!1,U=!1,$(),document.removeEventListener("wheel",oe)},I=()=>{$(),B=setTimeout(()=>{!L&&!U&&se()},100)},$=()=>{B&&(clearTimeout(B),B=null)},Y=()=>{L=!0,$()},M=()=>{L=!1,I()},oe=O=>{O.preventDefault()},me=O=>{O.config?.disabled||(j.value&&O.click&&O.click({data:j.value,openLayer:u}),se())},ce=O=>{let D=O.action.config?.display!==!1,J=O.action.config?.disabled===!0;const Z=r.actionFilter;if(Z)try{const F=Z(O);typeof F=="boolean"?D=F:F&&typeof F=="object"&&(typeof F.display=="boolean"&&(D=F.display),typeof F.disabled=="boolean"&&(J=F.disabled))}catch{D=O.action.config?.display!==!1,J=O.action.config?.disabled===!0}return{display:D,disabled:J}},Be=(O,D)=>D.disabled?{...O,config:{...O.config||{},disabled:!0}}:O,Te=O=>{const{Group:D,Text:J}=pn.CustomLayout,Z=r.actionsMaxCount,F=O.filter(re=>re.config?.display!==!1),K=F.length>Z,ee=K?F.slice(0,Z-1):F;let ie=0;if(ee.forEach((re,pe)=>{const ye=At(re.config?.label||re.label||"")||0;ie+=ye+(pe===0?24:12)}),K){const re=(At("更多")||0)+12;ie+=re}const ae=Math.max(80,ie)+"px";return{field:"__actions__",title:r.actionsLabel,width:ae,maxWidth:ae,minWidth:ae,disableColumnResize:!0,disableSelect:!0,customLayout:re=>{const{table:pe,row:ye,col:ke}=re,ve=pe.getCellOriginRecord(ke,ye),Ne=pe.getRecordIndexByCell(ke,ye),_e=F.map(de=>{const Ue=ce({action:de,record:ve,recordIndex:Ne,col:ke,row:ye,table:pe});return{action:Be(de,{disabled:Ue.disabled}),display:Ue.display}}).filter(de=>de.display).map(de=>de.action),be=r.actionsMaxCount,je=_e.length>be,Pe=je?_e.slice(0,be-1):_e,Fe=je?_e.slice(be-1):[],He=new D({height:40,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap"});if(Pe.forEach((de,Ue)=>{const Re=de.config?.disabled===!0,ft=Re?"#c9cdd4":de.config?.danger?"#f53f3f":"#165dff",Ot=new J({text:de.label,fontSize:14,fill:ft,boundsPadding:[0,12,0,Ue==0?12:0],cursor:Re?"not-allowed":"pointer"});Ot.addEventListener("click",()=>{!Re&&de.click&&de.click({data:ve,openLayer:u})}),Ot.addEventListener("mouseenter",Ft=>{Re||(Ft.target.setAttribute("fill",X(ft,-20)),pe.scenegraph.stage.renderNextFrame())}),Ot.addEventListener("mouseleave",Ft=>{Re||(Ft.target.setAttribute("fill",ft),pe.scenegraph.stage.renderNextFrame())}),He.add(Ot)}),je&&Fe.length>0){const de="#1677ff",Ue=new J({text:"更多",fontSize:14,fill:de,boundsPadding:[0,0,0,0],cursor:"pointer"});Ue.addEventListener("mouseenter",Re=>{Re.target.setAttribute("fill",X(de,-20)),pe.scenegraph.stage.renderNextFrame();const ft=b.value?.getBoundingClientRect();ft&&te(Fe,ve,Ne,Re.canvasX+ft.left-64,Re.canvasY+ft.top+8),U=!0,$()}),Ue.addEventListener("mouseleave",Re=>{Re.target.setAttribute("fill",de),pe.scenegraph.stage.renderNextFrame(),U=!1,I()}),He.add(Ue)}return{rootContainer:He,renderDefault:!1}}}},q=(O,D)=>{const{dataValue:J,table:Z,col:F,row:K,value:ee}=O,ie=O.rect??Z?.getCellRect?.(F,K)??{width:0,height:0},ae=Z?.getBodyField?.(F,K),re=Z?.options?.columns||[],pe=(ae?$e(re,ae):null)?.style?.textAlign||"left",ye=8,ke=Math.max(0,ie.width-ye*2);let ve=ee??J;ve==null&&(ve="");const Ne=Qe(typeof ve=="object"?JSON.stringify(ve):String(ve),ke);let _e=ye,be="left";return pe==="center"?(_e=ie.width/2,be="center"):pe==="right"&&(_e=Math.max(ye,ie.width-ye),be="right"),{elements:[{type:"text",text:Ne,x:_e,y:ie.height/2,fontSize:14,fill:"#1d2129",textAlign:be,textBaseline:"middle"}],expectedHeight:Lt}},ge=(O,D)=>{const{dataValue:J,rect:Z,table:F,col:K,row:ee}=O;let ie="mdi:toggle-switch",ae="#165dff";J||(ie="mdi:toggle-switch-off",ae="#e5e6eb");const re=(0,an.getIcon)(ie),pe=re?.body?.replace(/currentColor/g,ae),ye=[],ke=F?.getBodyField?.(K,ee),ve=F?.options?.columns||[],Ne=ke?$e(ve,ke):null,_e=8,be=40;let je=_e;return Ne?.style?.textAlign==="center"?je=Math.max(_e,(Z.width-be)/2):Ne?.style?.textAlign==="right"&&(je=Math.max(_e,Z.width-be-_e)),ye.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${be}" height="${be}" viewBox="0 0 ${re?.width} ${re?.height}" >${pe}</svg>`,x:je,y:(Z.height-be)/2,width:be,height:be}),{elements:ye,expectedHeight:Lt}},we=(O,D)=>{const{dataValue:J,rect:Z}=O,F=Number(J)||0,K=5,ee=20,ie=4,ae=8,re=(Z.height-ee)/2,pe=[],ye=(0,an.getIcon)("mdi:star"),ke=(0,an.getIcon)("mdi:star-half-full"),ve=(0,an.getIcon)("mdi:star-outline"),Ne="#f7ba2a",_e="#e5e6eb";for(let be=0;be<K;be++){const je=ae+be*(ee+ie),Pe=re;if(F>=be+1){const Fe=ye?.body?.replace(/currentColor/g,Ne);pe.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ee}" height="${ee}" viewBox="0 0 ${ye?.width} ${ye?.height}">${Fe}</svg>`,x:je,y:Pe,width:ee,height:ee})}else if(F>be&&F<be+1){const Fe=ke?.body?.replace(/currentColor/g,Ne);pe.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ee}" height="${ee}" viewBox="0 0 ${ke?.width} ${ke?.height}">${Fe}</svg>`,x:je,y:Pe,width:ee,height:ee})}else{const Fe=ve?.body?.replace(/currentColor/g,_e);pe.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ee}" height="${ee}" viewBox="0 0 ${ve?.width} ${ve?.height}">${Fe}</svg>`,x:je,y:Pe,width:ee,height:ee})}}return{elements:pe,expectedHeight:Lt}},Se=(O,D)=>{const{dataValue:J,rect:Z,table:F,col:K,row:ee}=O,ie=F.getBodyField(K,ee),ae=$e(F.options?.columns||[],ie),re=F.getCellOriginRecord?.(K,ee)||F.getRecordByCell?.(K,ee)||{},pe=D||Nt({config:ae?._compConfig,getCompConfig:ae?._getCompConfig,formData:l||{},getTableData:ze,row:re})||{},ye=Number(pe.min)||0,ke=Number(pe.max)||100,ve=Number(J)||0,Ne=ke-ye,_e=Ne===0?0:Math.max(0,Math.min(100,(ve-ye)/Ne*100)),be=4,je=8,Pe=8,Fe=(Z.height-be)/2,He=String(ve),de=At(He)||0,Ue=je,Re=Fe,ft=Z.width-je*2-de-Pe,Ot=ft*_e/100,Ft=[],$t=(Ct,Ie,st)=>{const Je=Math.min(st,Ie/2,Ct/2);return`M ${Je} 0 L ${Ct-Je} 0 Q ${Ct} 0 ${Ct} ${Je} L ${Ct} ${Ie-Je} Q ${Ct} ${Ie} ${Ct-Je} ${Ie} L ${Je} ${Ie} Q 0 ${Ie} 0 ${Ie-Je} L 0 ${Je} Q 0 0 ${Je} 0 Z`},Xo=(Ct,Ie,st)=>{const Je=Math.min(st,Ie/2,Ct/2);return Ct<=Je*2?$t(Ct,Ie,st):`M ${Je} 0 L ${Ct} 0 L ${Ct} ${Ie} L ${Je} ${Ie} Q 0 ${Ie} 0 ${Ie-Je} L 0 ${Je} Q 0 0 ${Je} 0 Z`},er=$t(ft,be,be/2);if(Ft.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ft}" height="${be}" viewBox="0 0 ${ft} ${be}"><path d="${er}" fill="#e5e6eb"/></svg>`,x:Ue,y:Re,width:ft,height:be}),Ot>0){const Ct=Xo(Ot,be,be/2);Ft.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${Ot}" height="${be}" viewBox="0 0 ${Ot} ${be}"><path d="${Ct}" fill="#165dff"/></svg>`,x:Ue,y:Re,width:Ot,height:be})}const tr=Ue+ft+Pe,Ti=Z.height/2;return Ft.push({type:"text",text:He,x:tr,y:Ti,fontSize:14,fill:"#333333",textAlign:"left",textBaseline:"middle"}),{elements:Ft,expectedHeight:Lt}},lt=O=>String(O).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Qe=(O,D)=>{if(!O)return"";if((At(O)||0)<=D)return O;const J="...",Z=At(J)||0;if(Z>=D)return"";let F=0,K=O.length;for(;F<K;){const ee=Math.ceil((F+K)/2);(At(O.slice(0,ee))||0)+Z<=D?F=ee:K=ee-1}return O.slice(0,F)+J},Ae=(O,D)=>{const{value:J,rect:Z,table:F,col:K,row:ee}=O;if(!J)return{elements:[],expectedHeight:Lt};const ie=F.getBodyField(K,ee),ae=$e(F.options?.columns||[],ie),re=F.getCellOriginRecord?.(K,ee)||F.getRecordByCell?.(K,ee)||{},pe=D||Nt({config:ae?._compConfig,getCompConfig:ae?._getCompConfig,formData:l||{},getTableData:ze,row:re})||{},ye=Number(pe.size)||16,ke=pe.color,ve=(Z.width-ye)/2,Ne=(Z.height-ye)/2;let _e=String(J).trim();if(!_e)return{elements:[],expectedHeight:Lt};if(_e.startsWith("<svg")){const be=_e.match(/<svg\b([^>]*)>([\s\S]*?)<\/svg>/i);if(be){const je=be[1]||"",Pe=be[2]||"";let Fe=je.match(/\bviewBox\s*=\s*["']([^"']+)["']/i)?.[1];if(!Fe){const He=je.match(/\bwidth\s*=\s*["']?([0-9.]+)[^"']*["']?/i)?.[1],de=je.match(/\bheight\s*=\s*["']?([0-9.]+)[^"']*["']?/i)?.[1];Fe=He&&de?`0 0 ${He} ${de}`:"0 0 24 24"}_e=`<svg xmlns="http://www.w3.org/2000/svg" width="${ye}" height="${ye}" viewBox="${Fe}">${Pe}</svg>`}else _e=`<svg xmlns="http://www.w3.org/2000/svg" width="${ye}" height="${ye}" viewBox="0 0 24 24"></svg>`}else{const be=(0,an.getIcon)(_e);if(be){const{body:je,width:Pe,height:Fe}=be;_e=`<svg xmlns="http://www.w3.org/2000/svg" width="${ye}" height="${ye}" viewBox="0 0 ${Pe} ${Fe}">${je}</svg>`}}return ke&&(_e=_e.replace(/currentColor/g,ke)),{elements:[{type:"icon",svg:_e,x:ve,y:Ne,width:ye,height:ye}],expectedHeight:Math.max(Lt,ye)}},kt=(O,D)=>{const{dataValue:J,rect:Z,table:F,col:K,row:ee,value:ie}=O,ae=F.getBodyField(K,ee),re=$e(F.options?.columns||[],ae),pe=F.getCellOriginRecord?.(K,ee)||F.getRecordByCell?.(K,ee)||{},ye=D||Nt({config:re?._compConfig,getCompConfig:re?._getCompConfig,formData:l||{},getTableData:ze,row:pe})||{},ke=re?.style?.textAlign||"left",ve=p({config:ye,row:pe,value:re._fieldFormat?ie:J});if(ve.length===0)return{elements:[],expectedHeight:Lt};const Ne=14,_e=28,be=2,je=12,Pe=8,Fe=6;let He=8,de=Math.max(0,Z.width-He*2),Ue=Math.max(0,de-je*2);const Re=[],ft=Ie=>{const st=At(Qe(Ie,Ue))||0;return Math.min(de,st+je*2)},Ot=(Ie,st,Je,nn,on)=>{const qn=Qe(Je,Ue),Xn=lt(qn),nr=At(qn)||0,xo=Math.min(de,nr+je*2),gx=nn||"#f2f3f5",mx=on||"#1d2129",yx=_e/2+Ne*.35,vx=`<svg xmlns="http://www.w3.org/2000/svg" width="${xo}" height="${_e}" viewBox="0 0 ${xo} ${_e}"><rect x="0" y="0" width="${xo}" height="${_e}" rx="${be}" ry="${be}" fill="${gx}"/><text x="${xo/2}" y="${yx}" text-anchor="middle" font-size="${Ne}" fill="${mx}">${Xn}</text></svg>`;return Re.push({type:"icon",svg:vx,x:Ie,y:st,width:xo,height:_e}),{tagWidth:xo}},Ft=()=>{const Ie=[];let st=[],Je=0;for(let nn=0;nn<ve.length;nn++){const on=ve[nn],qn=on.label,Xn=ft(qn),nr={label:qn,bg:on.color||"#f2f3f5",text:on.textColor||Ht(on.color||"#f2f3f5"),width:Xn};st.length>0&&Je+Pe+Xn>de?(Ie.push({items:st,lineWidth:Je}),st=[nr],Je=Xn):(st.push(nr),Je+=st.length>1?Pe+Xn:Xn)}return st.length>0&&Ie.push({items:st,lineWidth:Je}),{lines:Ie,needsWrap:Ie.length>1}};let{lines:$t,needsWrap:Xo}=Ft();He!==0&&Xo&&(He=0,de=Math.max(0,Z.width-He*2),Ue=Math.max(0,de-je*2),{lines:$t,needsWrap:Xo}=Ft());const er=$t.length*_e+($t.length>1?($t.length-1)*Fe:0);let tr=Math.max(0,(Z.height-er)/2);const Ti=Xo;for(let Ie=0;Ie<$t.length;Ie++){const st=$t[Ie];let Je=Ti?He:ke==="center"?He+Math.max(0,(de-st.lineWidth)/2):ke==="right"?He+Math.max(0,de-st.lineWidth):He;for(let nn=0;nn<st.items.length;nn++){const on=st.items[nn],{tagWidth:qn}=Ot(Je,tr,on.label,on.bg,on.text);Je+=qn+(nn<st.items.length-1?Pe:0)}tr+=_e+(Ie<$t.length-1?Fe:0)}const Ct=Math.min(Z.width,Math.max(0,...$t.map(Ie=>Ie.lineWidth))+He*2);return{elements:Re,expectedHeight:Math.max(Lt,er),expectedWidth:Ct}},Ht=O=>{if(!O)return"#1d2129";O=O.replace("#",""),O.length===3&&(O=O.split("").map(F=>F+F).join(""));const D=parseInt(O.substring(0,2),16),J=parseInt(O.substring(2,4),16),Z=parseInt(O.substring(4,6),16);if((D*299+J*587+Z*114)/1e3>=128){const F=D/255,K=J/255,ee=Z/255,ie=Math.max(F,K,ee),ae=Math.min(F,K,ee);let re=0,pe=0;const ye=(ie+ae)/2;if(ie!==ae){const Pe=ie-ae;switch(pe=ye>.5?Pe/(2-ie-ae):Pe/(ie+ae),ie){case F:re=(K-ee)/Pe+(K<ee?6:0);break;case K:re=(ee-F)/Pe+2;break;case ee:re=(F-K)/Pe+4;break}re/=6}const ke=.3,ve=pe;let Ne,_e,be;if(ve===0)Ne=_e=be=ke;else{const Pe=(de,Ue,Re)=>(Re<0&&(Re+=1),Re>1&&(Re-=1),Re<.16666666666666666?de+(Ue-de)*6*Re:Re<.5?Ue:Re<.6666666666666666?de+(Ue-de)*(.6666666666666666-Re)*6:de),Fe=ke<.5?ke*(1+ve):ke+ve-ke*ve,He=2*ke-Fe;Ne=Pe(He,Fe,re+1/3),_e=Pe(He,Fe,re),be=Pe(He,Fe,re-1/3)}const je=Pe=>Math.round(Pe*255).toString(16).padStart(2,"0");return`#${je(Ne)}${je(_e)}${je(be)}`}return"#ffffff"},St=O=>{const{table:D,row:J,col:Z,rect:F,value:K}=O,{Group:ee,Text:ie}=pn.CustomLayout,ae=D.getBodyField(Z,J),re=$e(D.options?.columns||[],ae),pe=re?._compConfig||{},ye=new ee({height:F.height,width:F.width,display:"flex",alignItems:"center",justifyContent:re.style?.textAlign==="center"?"center":re.style?.textAlign==="right"?"flex-end":"flex-start"}),ke="#165dff",ve=new ie({text:String(K??""),fontSize:14,fill:ke,cursor:"pointer",boundsPadding:[0,8,0,8]});return ve.addEventListener("click",()=>{if(pe.click){const Ne=D.getCellOriginRecord(Z,J);pe.click({row:Ne,column:re,openLayer:u})}}),ve.addEventListener("mouseenter",Ne=>{Ne.target.setAttribute("fill",X(ke,-20)),D.scenegraph.stage.renderNextFrame()}),ve.addEventListener("mouseleave",Ne=>{Ne.target.setAttribute("fill",ke),D.scenegraph.stage.renderNextFrame()}),ye.add(ve),{rootContainer:ye,renderDefault:!1}},ct=O=>{const{table:D,row:J,col:Z,rect:F}=O,{height:K,width:ee}=F??D.getCellRect(Z,J),{Group:ie,CheckBox:ae}=pn.CustomLayout,re=D.getBodyField(Z,J),pe=$e(D.options?.columns||[],re),ye=D.getCellOriginRecord(Z,J)||{},ke=pe?.style?.textAlign==="right"?"flex-end":pe?.style?.textAlign==="center"?"center":"flex-start",ve=pe?.style?.textAlign==="right"?"flex-end":pe?.style?.textAlign==="center"?"center":"flex-start",Ne=(He,de)=>{const Ue=ye?.[re];ye[re]=(Array.isArray(Ue)?Ue:[]).map((Re,ft)=>ft!==He?Re:Re&&typeof Re=="object"?{...Re,...de}:{...de})},_e=()=>{D.renderWithRecreateCells()},be=new ie({width:ee,height:Math.max(K||0,40),display:"flex",flexDirection:"column",alignItems:ke,justifyContent:"center",flexWrap:"nowrap"}),je=ye?.[re];if(!Array.isArray(je))return{rootContainer:be,renderDefault:!1};const Pe=je,Fe=new ie({width:ee,display:"flex",flexDirection:"row",flexWrap:"wrap",boundsPadding:[0,4,0,4],justifyContent:ve,alignItems:"center"});be.add(Fe);for(let He=0;He<Pe.length;He++){const de=Pe[He],Ue=de&&typeof de=="object"?de.label??de.value??"":de??"",Re=new ae({text:{text:String(Ue),fontSize:12},checked:!!(de&&typeof de=="object"&&de.checked),disabled:!!(de&&typeof de=="object"&&de.disabled),spaceBetweenTextAndIcon:2,boundsPadding:[4,4,4,4]});Re.render?.(),Fe.add(Re),Re.addEventListener("checkbox_state_change",()=>{const ft=!!Re.attribute?.checked;Ne(He,{checked:ft}),_e()})}return{rootContainer:be,renderDefault:!1}},dt=O=>{const{table:D,row:J,col:Z}=O,F=D.getBodyField(Z,J),K=$e(D.options?.columns||[],F),ee=K?._compConfig||{};if(K?._customLayout)return K._customLayout({...O,config:ee,customLayout:pn.CustomLayout})},$e=(O,D)=>{for(const J of O){if(J.field===D)return J;if(J.columns){const Z=$e(J.columns,D);if(Z)return Z}}return null},yt=O=>{const{table:D,col:J,row:Z}=O,F=D.getBodyField(J,Z),K=$e(D.options?.columns||[],F);if(!K)return{elements:[],expectedHeight:Lt};const ee=D.getCellOriginRecord?.(J,Z)||D.getRecordByCell?.(J,Z)||{},ie=Nt({config:K._compConfig,getCompConfig:K._getCompConfig,formData:l||{},getTableData:ze,row:ee}),ae=sa({type:K._compType,getCompType:K._getCompType,config:ie,formData:l||{},getTableData:ze,row:ee});ee._compTypeByRender=ee._compTypeByRender||{},ee._compTypeByRender[F]=ae;const re={text:q,"j-switch":ge,"j-rate":we,"j-slider":Se,"j-tag":kt,"j-input-tag":kt,"j-icon":Ae}[ae]||q;return re?re(O,ie):{elements:[],expectedHeight:Lt}},Qt=(O,D,J,Z)=>{const F=Z.getBodyField(D,J),K=$e(Z.options?.columns||[],F);if(K._fieldFormat)return K._fieldFormat(O,D,J,Z);if(K._compType==="dateTime"){const ae=K._compConfig?.format||"YYYY-MM-DD HH:mm:ss";return ca(O[F],ae)}const ee=Ui(O[F],d,{type:K._compType,getCompType:K._getCompType,getCompConfig:K._getCompConfig,config:K._compConfig,formData:l,getTableData:ze,row:O});if(O[F]&&O[F]==ee.label&&ee.config.dataType&&ee.config.dataType!="options"&&!ee.config.options&&ee.type!="j-autocomplete"&&d&&c){var ie=c(ee.config.dataType,ee.config.dataCode,{value:O[F]});g[ie]=!0}return ee.label},W=()=>{if(!f?.value)return!1;const O=Object.keys(g);return O.length===0?!1:O.every(D=>f.value?.[D]===9)};(0,n.watch)(()=>W(),O=>{O&&y&&y.renderWithRecreateCells()});const ne=O=>{const D=O.filter(J=>J.config?.display!==!1).map(J=>{const{id:Z,type:F,config:K,getCompConfig:ee,getCompType:ie,children:ae,customLayout:re}=J,{label:pe,width:ye,minWidth:ke,maxWidth:ve,align:Ne,headerAlign:_e,fieldFormat:be,editor:je,frozen:Pe,...Fe}=K||{},He=_e??Ne,de={field:Z,title:pe,width:ye,minWidth:ke,maxWidth:ve,...He?{headerStyle:{textAlign:He}}:{},style:{textAlign:Ne},_customLayout:re,_fieldFormat:be,_compType:F,_compConfig:{...Fe},_getCompConfig:ee,_getCompType:ie,frozen:Pe},Ue=typeof ie=="function",Re=Pl(F);return(Re||Ue)&&(de.editor=Re||"j-comp-editor",x=!0),Ue?de.customRender=yt:(F==="j-switch"&&(de.customRender=ge),F==="j-rate"&&(de.customRender=we),F==="j-slider"&&(de.customRender=Se),(F==="j-tag"||F==="j-input-tag")&&(de.customRender=kt),F==="j-icon"&&(de.customRender=Ae)),F==="link"&&(de.customLayout=St),F==="checkbox"&&(de.customLayout=ct),F==="j-switch"&&(de.minWidth=de.minWidth||ye,de.maxWidth=de.maxWidth||ye),re&&(de.customLayout=dt),de.fieldFormat=Qt,ae&&ae.length>0&&(de.columns=ne(ae)),de});return r.isTree&&D.length>0&&(D[0].tree=!0),D},X=(O,D)=>{const J=O.replace("#",""),Z=parseInt(J,16),F=Math.min(255,Math.max(0,(Z>>16)+D)),K=Math.min(255,Math.max(0,(Z>>8&255)+D)),ee=Math.min(255,Math.max(0,(Z&255)+D));return`#${(F<<16|K<<8|ee).toString(16).padStart(6,"0")}`},Q=()=>{let O=_;r.isPage&&(O=Et.value+_);let D=At(String(O))||0;return r.subColumns&&r.subColumns.length>0&&(D=D+32),Math.max(45,D+18)},le=O=>{let D=(J,Z,F,K)=>{const ee=K.getRecordIndexByCell(Z,F);return r.isPage&&!O?Et.value+ee+1:ee+1};return O&&(D=(J,Z,F,K)=>K.getRecordIndexByCell(Z,F)+1),{field:"__sequence__",title:"序号",width:T,minWidth:T,maxWidth:T,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:D,_getCompConfig:void 0,_getCompType:void 0}},Ce=()=>({field:"__placeholder__",title:"",width:"auto",minWidth:60,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:()=>"",_getCompConfig:void 0,_getCompType:void 0}),Ee=O=>{if(O.frozen)return O.frozen;if(O.columns)for(const D of O.columns){const J=Ee(D);if(J)return J}},Le=O=>{const D=[];return O.forEach(J=>{if(J.frozen){D.push(J);return}if(!J.columns||J.columns.length===0){D.push(J);return}const Z=Le(J.columns),F=[],K=[],ee=[];if(Z.forEach(ie=>{const ae=Ee(ie);ae==="left"?F.push(ie):ae==="right"?K.push(ie):ee.push(ie)}),(F.length>0?1:0)+(K.length>0?1:0)+(ee.length>0?1:0)<=1){J.columns=Z,D.push(J);return}F.length&&D.push({...J,columns:F}),ee.length&&D.push({...J,columns:ee}),K.length&&D.push({...J,columns:K})}),D},ot=O=>{let D=0,J=0;return O.forEach(Z=>{if(Z.columns&&Z.columns.length>0){const F=ot(Z.columns);D+=F.left,J+=F.right}else Z.frozen==="left"?D++:Z.frozen==="right"&&J++}),{left:D,right:J}},We=(O,D,J,Z)=>{S=0,v=0,x=!1;const F={};let K=ne(O);K.length===0&&(K=[Ce()]),K=Le(K);const ee=[],ie=[],ae=[];K.forEach(ke=>{const ve=Ee(ke);ve==="left"?ee.push(ke):ve==="right"?ie.push(ke):ae.push(ke)});const re=ot(ee),pe=ot(ie);v+=re.left,S+=pe.right,K=[...ee,...ae,...ie],D&&(K.unshift(le(Z)),v++),J.length>0&&(K.push(Te(J)),S++),x&&(F.editCellTrigger="click",F.keyboardOptions={copySelected:!0,cutSelected:!0,pasteValueToCell:!0,selectAllOnCtrlA:!0});const ye=ke=>{for(const ve of ke)if(ve?._compType==="checkbox"||ve?.customRender===yt||ve?.customRender===kt||Array.isArray(ve?.columns)&&ye(ve.columns))return!0;return!1};return ye(K)&&!(r.subColumns&&r.subColumns.length>0)&&(F.defaultRowHeight="auto",F.defaultHeaderRowHeight=40),{columns:K,option:F}},en=()=>{const O=We(r.columns,r.isShowNumber&&!r.isTree,r.actions);It.value&&v++;const D={records:[],columns:O.columns,autoFillWidth:!0,enableCheckboxCascade:It.value,enableHeaderCheckboxCascade:It.value,rightFrozenColCount:S,frozenColCount:v,tooltip:{isShowOverflowTextTooltip:!0},hover:{highlightMode:r.highlightMode},select:{highlightMode:r.highlightMode},...O.option};return r.isTree&&r.defaultExpandAll&&!r.loadChildren&&(D.hierarchyExpandLevel=Number.POSITIVE_INFINITY),r.emptyTipText&&(D.emptyTip={text:r.emptyTipText}),r.isAnimationAppear&&(D.animationAppear={duration:100,delay:0,type:"one-by-one",direction:"row"}),It.value&&(D.rowSeriesNumber={width:40,minWidth:40,maxWidth:40,disableColumnResize:!0,format:()=>"",field:"_checkState",cellType:"checkbox",headerType:"checkbox",headerStyle:{textAlign:"center"},style:{textAlign:"center"}}),D.theme=pa,r.heightMode==="auto"&&(D.theme={...pa,scrollStyle:{...pa.scrollStyle,hoverOn:!0,width:8}}),r.subColumns&&r.subColumns.length>0&&(C=new Bp({detailTableOptions:{columns:We(r.subColumns,r.isSubShowNumber,r.subActions,!0).columns,style:{margin:[8,8,8,0],height:"auto"},theme:pa,...O.option}}),D.plugins=[C]),D},tn=O=>!r.isTree||!r.parentKey||O.some(D=>Array.isArray(D?.children)&&D.children.length>0)?O:Oi(O,(r.rowKey||"").split(",")[0]?.trim()||"id",r.parentKey),Pn=O=>{if(!b.value)return;m(),T=Q(),Np();const D=en(),J=Vu();O&&O.length>=0?D.records=tn(O):J.length>0?D.records=tn(J):(D.records=tn(r.records),i("update:modelValue",D.records)),y=new pn.ListTable(b.value,D),y._getAppContext=()=>a?.appContext;const Z=a?.provides;y._getProvides=()=>Z,r.loadChildren&&y.on(pn.ListTable.EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,async F=>{if(F.hierarchyState===pn.TYPES.HierarchyState.expand&&F.originData?.children===!0){y.setLoadingHierarchyState(F.col,F.row);try{const K=await r.loadChildren(F.originData);r.isTree&&y&&typeof y.setRecordChildren=="function"?y.setRecordChildren(K,F.col,F.row):C&&typeof C.setRecordChildren=="function"?C.setRecordChildren(K,F.col,F.row):y&&typeof y.setRecordChildren=="function"&&y.setRecordChildren(K,F.col,F.row)}catch(K){console.error("Failed to load detail data:",K),y.setLoadingHierarchyState(F.col,F.row)}}}),y.on("click_cell",F=>{const{col:K,row:ee,cellType:ie,originData:ae}=F,re=ae||{children:y.records};if(It.value){if(ie==="checkbox"&&K==0){if(re.__checkState=F.target.attribute.checked,ee===0&&re.__checkState===!1){const ye=ke=>{!Array.isArray(ke)||ke.length===0||ke.forEach(ve=>{ve&&(ve.__checkState=!1,Array.isArray(ve.children)&&ve.children.length>0&&ye(ve.children))})};ye(re.children)}const pe=mt();pe.length==0&&y.setCellCheckboxState(0,0,!1),E.value=pe.length,i("selectionChanged",{isMultiple:!0,selections:pe,record:re,checked:re.__checkState}),y.renderWithRecreateCells()}}else setTimeout(()=>{const pe=mt();E.value=pe.length,i("selectionChanged",{isMultiple:!1,selections:pe,record:re,checked:!0})},0)}),w.value=y.getAllRowsHeight(),i("ready",y)},Co=()=>{y&&(y.release(),y=null)},he=()=>y,xe=O=>{if(m(),E.value=0,y){y.setScrollTop(0),_=O.length;const D=tn(O);if(r.subColumns&&r.subColumns.length>0)setTimeout(()=>{Co(),Pn(D)});else{const J=Q();J!==T?(T=J,r.subColumns&&r.subColumns.length>0?(Co(),Pn(D)):et(D)):y.setRecords(D)}if(r.selectStateKey&&r.isMultiple){const J=O.filter(Z=>Z[r.selectStateKey]);Me(J),E.value=J.length,i("selectRecordsChanged",J),i("selectionChanged",{isMultiple:!0,selections:J,record:{children:y.records},checked:J.length>0})}}},ze=()=>y?y.records:[];(0,n.onMounted)(()=>{Pn()}),(0,n.onBeforeUnmount)(()=>{Co(),$(),document.removeEventListener("wheel",oe)});const ut=(0,n.computed)({get(){return r.tablePage},set(O){i("update:tablePage",O)}}),ue=(0,n.ref)(0),qe=(0,n.computed)({get(){return ue.value!==0?ue.value:r.pageSize},set(O){ue.value=O,i("update:pageSize",O)}}),Et=(0,n.computed)(()=>(ut.value-1)*qe.value),gt=(O,D)=>{i("loadPageData",{rows:D,page:O})},mt=()=>{if(!y)return[];if(!It.value){const O=y.getSelectedCellInfos();if(O&&O.length>0){const D=O[0][0];return D?.originData?[D.originData]:[]}return[]}if(y.stateManager&&y.stateManager.checkedState){const O=[],D=new Set,J=ie=>{if(!ie)return;const ae=Mt(ie);if(ae){if(D.has(ae))return;D.add(ae);const re={};ie.__checkState=!0,ko(re,ie,["children"]),O.push(re)}else console.warn("key is empty")},Z=ie=>{const ae=ie?.children;!Array.isArray(ae)||ae.length===0||ae.forEach(re=>{J(re),Z(re)})},F=y.stateManager.checkedState,K=y.records,ee=(ie,ae,re)=>{const pe=re[ae[ie]];return ie<ae.length-1&&pe?.children&&pe.children.length>0?ee(ie+1,ae,pe.children||[]):pe};return F.forEach((ie,ae)=>{const re=ie?._checkState;if(re==="indeterminate"||re===!0){const pe=ee(0,(ae+"").split(",").map(Number),K);J(pe),re===!0&&Z(pe)}}),O}return[]},Mt=O=>r.editConfig.isRemoveBtn?O._i:r.rowKey?r.rowKey.split(",").map(D=>O[D.trim()]).join("::"):"",Me=O=>{if(y)if(It.value||y.clearSelected(),r.rowKey){const D=new Set(O.map(Mt)),J="__checkState";if(!It.value){const ie=y.records;for(let ae=0;ae<ie.length;ae++){const re=ie[ae];if(!D.has(Mt(re)))continue;const pe=y.getTableIndexByRecordIndex(ae);y.selectRow(pe);break}return}const Z=ie=>{ie.forEach(ae=>{if(Array.isArray(ae?.children)&&ae.children.length>0){Z(ae.children);const re=ae.children,pe=re.filter(ke=>ke?.[J]===!0),ye=re.filter(ke=>ke?.[J]===!1);pe.length==re.length?ae[J]=!0:ye.length==re.length?ae[J]=!1:ae[J]="indeterminate",ae[J]==="indeterminate"&&(ae.hierarchyState="expand")}else ae[J]=!!D.has(Mt(ae))})},F=y.records;r.isTree?Z(F):F.forEach(ie=>{ie[J]=D.has(Mt(ie))});const K=en();K.records=F,y.updateOption(K,{clearColWidthCache:!1,clearRowHeightCache:!1}),r.heightMode==="auto"&&(w.value=y.getAllRowsHeight());const ee=y.getAllBodyCells(1);for(let ie=0;ie<ee.length;ie++)ee[ie][0].originData[J]==!0&&y.setCellCheckboxState(0,ie+1,!0);y.renderWithRecreateCells()}else console.warn("Warning: rowKey is not defined. Please set rowKey to enable row selection.")},fn=O=>{i("rowChange",O),y.renderWithRecreateCells()},et=O=>{if(!y)return;const D=mt();if(D.length>0){Me(D);return}const J=en();J.records=O||y.records,y.updateOption(J,{clearColWidthCache:!1,clearRowHeightCache:!1}),r.heightMode==="auto"&&(w.value=y.getAllRowsHeight()),E.value=0},Xe=()=>{y.renderWithRecreateCells()},wt=(0,n.computed)(()=>r.editConfig.isAddBtn),zt=(0,n.computed)(()=>r.editConfig.addBtnText||"添加"),Bt=(0,n.computed)(()=>r.editConfig.isRemoveBtn),qo=(0,n.computed)(()=>r.editConfig.readonly),It=(0,n.computed)(()=>r.isMultiple||Bt.value),Vu=()=>{const O=r.modelValue||[];return O.forEach(D=>{D._i||(D._i=ln())}),O};(0,n.watch)(()=>r.modelValue,()=>{xe(Vu())});const ux=(0,n.computed)(()=>{const O=D=>{const J=[];return D.forEach(Z=>{Z.children&&Z.children.length>0?J.push(...O(Z.children)):J.push(Z)}),J};return O(r.columns)}),fx=()=>{const O={};O._i=ln(),ux.value.forEach(D=>{const J=D.config?.valueRowKey||D.id||"";J&&(O[J]=Vt(D.config?.defaultValue))}),y&&(y.addRecord(O),r.heightMode==="auto"&&et(),y.scrollToCell({col:0,row:y.records.length})),i("change",{id:r.id,value:O,data:O,formData:l,tableData:y.records,type:"add"})},px=(0,n.computed)(()=>E.value>0),hx=()=>{if(!y)return;const O=mt();O.length!==0&&Mu.ElMessageBox.confirm(`确定要删除选中的 ${O.length} 条记录吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const D=y.records,J=new Set(O.map(F=>F._i)),Z=D.filter(F=>!J.has(F._i));et(Z),i("update:modelValue",Z),O.forEach(F=>{i("change",{id:r.id,value:F,data:F,formData:l,tableData:Z,type:"delete"})}),E.value=0}).catch(()=>{})};return(0,n.watch)(()=>r.columns,(O,D)=>{JSON.stringify(O)!==JSON.stringify(D)&&et()}),(0,n.watch)(()=>[r.isTree,r.defaultExpandAll,r.isMultiple,r.isShowNumber,r.isPage,r.isAnimationAppear,r.actionsMaxCount,r.actionsLabel,r.actionFilter,r.heightMode,r.highlightMode,r.pageTotal,r.subColumns,r.isSubShowNumber,r.subActions,Bt.value],()=>{et()}),(0,n.watch)(()=>r.actions,()=>{et()},{deep:!0}),_o({getTableData:ze,rowChange:fn}),t({getInstance:he,setRecords:xe,getRecords:ze,getSelection:mt,setSelection:Me,renderTable:Xe}),(O,D)=>{const J=(0,n.resolveComponent)("j-button"),Z=(0,n.resolveComponent)("el-space"),F=(0,n.resolveComponent)("el-pagination");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-table",{"j-table-auto":e.heightMode==="auto"}]),style:(0,n.normalizeStyle)(h.value)},[(0,n.createElementVNode)("div",{class:"j-table-wrapper",style:(0,n.normalizeStyle)(k.value)},[(0,n.createElementVNode)("div",{ref_key:"tableContainer",ref:b,class:(0,n.normalizeClass)("j-block")},null,512)],4),(0,n.createElementVNode)("div",jp,[e.isPage||!qo.value&&(wt.value||Bt.value)?((0,n.openBlock)(),(0,n.createElementBlock)("div",Pp,[(0,n.createVNode)(Z,null,{default:(0,n.withCtx)(()=>[wt.value?((0,n.openBlock)(),(0,n.createBlock)(J,{key:0,type:"link",label:zt.value,icon:"mdi:add",onClick:fx},null,8,["label"])):(0,n.createCommentVNode)("",!0),Bt.value?((0,n.openBlock)(),(0,n.createBlock)(J,{key:1,type:"link",label:"删除",icon:"mdi:delete-outline",danger:"",disabled:!px.value,onClick:hx},null,8,["disabled"])):(0,n.createCommentVNode)("",!0)]),_:1}),D[2]||(D[2]=(0,n.createElementVNode)("div",null,null,-1)),e.isPage?((0,n.openBlock)(),(0,n.createBlock)(F,{key:0,"current-page":ut.value,"onUpdate:currentPage":D[0]||(D[0]=K=>ut.value=K),"page-size":qe.value,"onUpdate:pageSize":D[1]||(D[1]=K=>qe.value=K),"page-sizes":e.pageSizes||[100,200,500,1e3],total:e.pageTotal,layout:"total, prev, pager, next,sizes",onChange:gt},null,8,["current-page","page-size","page-sizes","total"])):(0,n.createCommentVNode)("",!0)])):(0,n.createCommentVNode)("",!0)]),V.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-table-dropdown",style:(0,n.normalizeStyle)(N.value),onMouseenter:Y,onMouseleave:M},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(z.value,K=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:K.id,class:"j-table-dropdown-item",style:(0,n.normalizeStyle)({color:K.config?.disabled?"var(--j-color-text-disabled)":K.config?.danger?"var(--j-color-danger)":"var(--j-color-primary)",cursor:K.config?.disabled?"not-allowed":"pointer",opacity:K.config?.disabled?.7:1}),onClick:ee=>me(K)},(0,n.toDisplayString)(K.label),13,Hp))),128))],36)):(0,n.createCommentVNode)("",!0)],6)}}}),Op=zp,Hl=fe(Op),Lp=["title"],Dp={key:0,style:{"margin-left":"8px"}},Ip={key:0,class:"j-dialog-steps"},Fp={class:"j-block j-overflow-y"},$p={key:1,class:"j-dialog-btns"},Wp=(0,n.defineComponent)({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const a=e,r=o,{t:i}=Ye(),l=(0,n.ref)(!1),s=(0,n.ref)(!1),d=(0,n.ref)(""),c=(0,n.ref)(!1),f=(0,n.ref)(!0),p=(0,n.ref)(!1),u=(0,n.ref)(!0),h=(0,n.ref)(-1),g=(0,n.reactive)({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),m=(0,n.ref)(0),w=(0,n.ref)(),k=(0,n.ref)(48),b=(0,n.ref)(0),y=(0,n.ref)(0);(0,n.watch)(()=>a.visible,M=>{m.value=1,m.value=0,l.value=M,M===!0&&a.zoomControls&&(0,n.nextTick)(()=>{typeof document<"u"&&(w.value=document.querySelector(".j-dialog"),w.value&&(w.value.onmousemove=$))})},{immediate:!0});const C=(0,n.computed)(()=>{let M=a.height+m.value;return typeof window<"u"&&M+40>window.innerHeight&&(M=window.innerHeight-32-40),M}),S=(0,n.computed)(()=>{let M=0+m.value;return typeof document<"u"&&document.body&&(M=(document.body.clientWidth-x.value)/2),M}),v=(0,n.computed)(()=>{let M=0+m.value;return typeof window<"u"&&(M=(window.innerHeight-C.value-40)/2),M}),x=(0,n.computed)(()=>{let M=0+m.value;return M=a.width,typeof document<"u"&&document.body&&M>document.body.clientWidth&&(M=document.body.clientWidth-32),M}),E=M=>{d.value=M||"保存数据中...",s.value=!0},_=()=>{s.value=!1},T=()=>{a.beforeClose&&a.beforeClose()===!1||(l.value=!1,r("update:visible",!1),r("cancel"))},V=()=>{r("ok",E,_)},N=()=>{g.left=0,g.top=0,y.value=0,b.value=0,a.isStep&&(z.value=0,(0,n.nextTick)(()=>{L()})),r("closed")},z=(0,n.computed)({get(){return h.value!==-1?h.value:a.stepActive},set(M){h.value=M,r("update:stepActive",M)}}),j=()=>{z.value>0&&z.value--,(0,n.nextTick)(()=>{L()})},A=async()=>{await B()&&(z.value<a.steps.length-1&&(z.value+=1),(0,n.nextTick)(()=>{L()}))},B=async()=>{if(c.value=!0,a.validateSteps){const M=await a.validateSteps(a.stepActive,E,_);return c.value=!1,M}return c.value=!1,!0},L=()=>{switch(u.value=!0,p.value=!0,f.value=!0,z.value){case 0:p.value=!1;break;case a.steps.length-1:f.value=!1,u.value=!1;break;default:f.value=!1,p.value=!1;break}},U=(0,n.computed)(()=>a.steps.map(M=>({title:M,disabled:!0}))),te=function(M){a.autoHeight||(g.pageX=M.pageX,g.pageY=M.pageY,g._left=g.left,g._top=g.top,g.isMove=!0,typeof document<"u"&&(document.onmouseup=se,document.onmousemove=I))},se=()=>{g.isMove=!1,typeof document<"u"&&(document.onmouseup=null,document.onmousemove=null)},I=M=>{if(g.isMove){const oe=M.pageX-g.pageX,me=M.pageY-g.pageY;let ce=g._left+oe,Be=g._top+me;ce+S.value<0&&(ce=-S.value),typeof document<"u"&&document.body&&(b.value?ce+b.value+S.value>document.body.clientWidth&&(ce=document.body.clientWidth-b.value-S.value):ce+x.value+S.value>document.body.clientWidth&&(ce=document.body.clientWidth-x.value-S.value)),Be+v.value<0&&(Be=-v.value),typeof window<"u"&&(y.value?Be+y.value+v.value+40>window.innerHeight&&(Be=window.innerHeight-y.value-v.value-40):Be+C.value+v.value+40>window.innerHeight&&(Be=window.innerHeight-C.value-v.value-40)),g.left=ce,g.top=Be}},$=M=>{const oe=w.value.offsetLeft,me=w.value.offsetTop,ce=w.value.clientWidth,Be=w.value.clientHeight,Te=Be-k.value,q=w.value.scrollTop;if(M.clientX>oe+ce-10&&q+M.clientY>me+Be-10||q+M.clientY<me+5&&oe+10>M.clientX)w.value.style.cursor="se-resize";else if(oe+10>M.clientX&&q+M.clientY>me+Be-10||M.clientX>oe+ce-10&&q+M.clientY<me+5)w.value.style.cursor="sw-resize";else if(M.clientX>oe+ce-10||oe+10>M.clientX)w.value.style.cursor="w-resize";else if(q+M.clientY>me+Be-10||q+M.clientY<me+5)w.value.style.cursor="s-resize";else{w.value.style.cursor="default",w.value.onmousedown=null;return}w.value.onmousedown=ge=>{const{clientX:we}=ge,{clientY:Se}=ge,lt=g.left+S.value,Qe=g.top+v.value;g._left=g.left,g._top=g.top,y.value||(y.value=Te),b.value||(b.value=ce),we>lt+10&&we<lt+ce-10&&Se>Qe+5&&Se<Qe+47||(typeof document<"u"&&(document.onmousemove=function(Ae){Ae.preventDefault(),we>lt&&we<lt+10&&(we>Ae.clientX&&(b.value=ce+(we-Ae.clientX),g.left=g._left-(we-Ae.clientX)),we<Ae.clientX&&b.value>a.minWidth&&(b.value=ce-(Ae.clientX-we),g.left=g._left+Ae.clientX-we)),we>lt+ce-10&&we<lt+ce&&(we>Ae.clientX&&b.value>a.minWidth&&(b.value=ce-(we-Ae.clientX)),we<Ae.clientX&&typeof document<"u"&&document.body&&S.value+g.left+b.value<document.body.clientWidth&&(b.value=ce+(Ae.clientX-we))),Se>Qe&&Se<Qe+5&&(Se>Ae.clientY&&(y.value=Te+Se-Ae.clientY,g.top=g._top-(Se-Ae.clientY)),Se<Ae.clientY&&y.value>a.minHeight&&(y.value=Te-(Ae.clientY-Se),g.top=g._top+Ae.clientY-Se)),q+Se>Qe+Te+38&&q+Se<Qe+Te+48&&(Se>Ae.clientY&&y.value>a.minHeight&&(y.value=Te-(Se-Ae.clientY)),Se<Ae.clientY&&typeof window<"u"&&v.value+g.top+y.value+48<window.innerHeight&&(y.value=Te+Ae.clientY-Se))}),typeof document<"u"&&(document.onmouseup=function(){typeof document<"u"&&(document.onmousemove=null,document.onmouseup=null)}))}},Y=async M=>{M.click&&await M.click()};return t({showLoading:E,hideLoading:_}),(M,oe)=>{const me=(0,n.resolveComponent)("j-button"),ce=(0,n.resolveComponent)("el-space"),Be=(0,n.resolveComponent)("el-step"),Te=(0,n.resolveComponent)("el-steps"),q=(0,n.resolveComponent)("el-dialog");return(0,n.openBlock)(),(0,n.createBlock)(q,{modelValue:l.value,"onUpdate:modelValue":oe[0]||(oe[0]=ge=>l.value=ge),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":e.destroyOnClose,"show-close":!1,modal:e.mask,"modal-penetrable":!e.mask,"close-on-click-modal":!1,width:`${b.value||x.value}px`,style:(0,n.normalizeStyle)({position:"fixed",left:`${S.value+g.left}px`,top:`${v.value+g.top}px`,"pointer-events":e.mask?"":"none"}),onClosed:N},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",{class:"j-dialog-header",onMousedown:te},[(0,n.createElementVNode)("div",{class:"j-dialog-header-left",title:(0,n.unref)(i)(e.title||""),style:(0,n.normalizeStyle)({cursor:e.autoHeight?"":"move"})},[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)((0,n.unref)(i)(e.title||"")),1),e.subtitle?((0,n.openBlock)(),(0,n.createElementBlock)("span",Dp,[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.subtitle())))])):(0,n.createCommentVNode)("",!0)],12,Lp),e.showCloseBtn?((0,n.openBlock)(),(0,n.createBlock)(ce,{key:0,size:0},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(me,{type:"text",icon:"mdi:close",onClick:T})]),_:1})):(0,n.createCommentVNode)("",!0)],32),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-dialog-window",{"j-dialog-window-hasBtns":e.hasBtns},{"j-dialog-window-hasSteps":e.isStep}]),style:(0,n.normalizeStyle)({height:e.autoHeight?"auto":(y.value>0?y.value:C.value)+"px"})},[e.isStep?((0,n.openBlock)(),(0,n.createElementBlock)("div",Ip,[(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)({maxWidth:`${200*U.value.length}px`,width:"100%"})},[(0,n.createVNode)(Te,{simple:"",active:z.value,space:160,"finish-status":"success"},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(U.value,(ge,we)=>((0,n.openBlock)(),(0,n.createBlock)(Be,{key:we,title:(0,n.unref)(i)(ge.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",Fp,[(0,n.renderSlot)(M.$slots,"default")]),e.hasBtns?((0,n.openBlock)(),(0,n.createElementBlock)("div",$p,[(0,n.createVNode)(ce,{size:8},{default:(0,n.withCtx)(()=>[e.isStep?((0,n.openBlock)(),(0,n.createBlock)(me,{key:0,size:"mini",disabled:f.value,label:(0,n.unref)(i)("上一步"),onClick:j},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0),e.isStep?((0,n.openBlock)(),(0,n.createBlock)(me,{key:1,size:"mini",disabled:p.value,loading:c.value,label:(0,n.unref)(i)("下一步"),onClick:A},null,8,["disabled","loading","label"])):(0,n.createCommentVNode)("",!0),!e.isStep&&e.showCloseBtn?((0,n.openBlock)(),(0,n.createBlock)(me,{key:2,size:"mini",label:(0,n.unref)(i)("取消"),onClick:T},null,8,["label"])):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.buttons,ge=>((0,n.openBlock)(),(0,n.createBlock)(me,(0,n.mergeProps)({ref_for:!0},ge.config,{key:ge.id,label:ge.label,onClick:we=>Y(ge)}),null,16,["label","onClick"]))),128)),e.hasSaveBtn?((0,n.openBlock)(),(0,n.createBlock)(me,{key:3,size:"mini",type:"primary",disabled:u.value&&e.isStep,label:(0,n.unref)(i)(e.btnText),onClick:V},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0)]),_:1})])):(0,n.createCommentVNode)("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}}),Up=Wp,zl=fe(Up),Jp=["element-loading-text"],Yp={key:0,class:"j-dialog-full-header"},Gp={class:"j-dialog-full-header-left"},Kp=["src"],qp={class:"j-dialog-full-title-text"},Xp={style:{height:"28px","line-height":"32px","margin-left":"8px"}},Zp={class:"j-dialog-full-header-right"},Qp={class:"j-dialog-full-body"},eh=(0,n.defineComponent)({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(e,{expose:t,emit:o}){const a=e,r=o,{logoImg:i,t:l}=Ye(),s=(0,n.ref)(!1),d=(0,n.ref)(!1),c=(0,n.ref)(""),f=(0,n.ref)(!1),p=(0,n.ref)(!0),u=(0,n.ref)(!1),h=(0,n.ref)(!0),g=(0,n.ref)(-1);(0,n.watch)(()=>a.visible,V=>{s.value=V},{immediate:!0});const m=(0,n.computed)({get(){return g.value!==-1?g.value:a.stepActive},set(V){g.value=V,r("update:stepActive",V)}}),w=()=>{a.beforeClose&&a.beforeClose()===!1||(s.value=!1,r("update:visible",!1),r("cancel"))},k=()=>{r("ok",y,C)},b=()=>{a.isStep&&(m.value=0,(0,n.nextTick)(()=>{E()})),r("closed")},y=V=>{c.value=V||"保存数据中...",d.value=!0},C=()=>{d.value=!1},S=()=>{m.value>0&&m.value--,(0,n.nextTick)(()=>{E()})},v=async()=>{await x()&&(m.value<a.steps.length-1&&(m.value+=1),(0,n.nextTick)(()=>{E()}))},x=async()=>{if(f.value=!0,a.validateSteps){const V=await a.validateSteps(a.stepActive,y,C);return f.value=!1,V}return f.value=!1,!0},E=()=>{switch(h.value=!0,u.value=!0,p.value=!0,m.value){case 0:u.value=!1;break;case a.steps.length-1:p.value=!1,h.value=!1;break;default:p.value=!1,u.value=!1;break}},_=(0,n.computed)(()=>a.steps.map(V=>({title:V,disabled:!0}))),T=async V=>{V.click&&await V.click()};return t({showLoading:y,hideLoading:C}),(V,N)=>{const z=(0,n.resolveComponent)("el-step"),j=(0,n.resolveComponent)("el-steps"),A=(0,n.resolveComponent)("j-button"),B=(0,n.resolveComponent)("el-space"),L=(0,n.resolveComponent)("el-divider"),U=(0,n.resolveComponent)("el-dialog"),te=(0,n.resolveDirective)("loading");return(0,n.openBlock)(),(0,n.createBlock)(U,{modelValue:s.value,"onUpdate:modelValue":N[0]||(N[0]=se=>s.value=se),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":e.destroyOnClose,onClosed:b},{default:(0,n.withCtx)(()=>[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"j-block j-dialog-full-window","element-loading-text":(0,n.unref)(l)(c.value)},[e.hasHeader?((0,n.openBlock)(),(0,n.createElementBlock)("div",Yp,[(0,n.createElementVNode)("div",Gp,[(0,n.unref)(i)?((0,n.openBlock)(),(0,n.createElementBlock)("img",{key:0,class:"j-dialog-full-header-logo",src:(0,n.unref)(i)},null,8,Kp)):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("span",qp,(0,n.toDisplayString)((0,n.unref)(l)(e.title)),1),(0,n.createElementVNode)("span",Xp,[e.subtitle?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.subtitle()),{key:0})):(0,n.createCommentVNode)("",!0)])]),(0,n.createElementVNode)("div",{class:"j-dialog-full-header-mid",style:(0,n.normalizeStyle)({maxWidth:`${200*_.value.length}px`})},[e.isStep?((0,n.openBlock)(),(0,n.createBlock)(j,{key:0,simple:"",active:m.value,space:160,"finish-status":"success"},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(_.value,(se,I)=>((0,n.openBlock)(),(0,n.createBlock)(z,{key:I,title:(0,n.unref)(l)(se.title)},null,8,["title"]))),128))]),_:1},8,["active"])):(0,n.createCommentVNode)("",!0)],4),(0,n.createElementVNode)("div",Zp,[(0,n.createVNode)(B,{size:0},{default:(0,n.withCtx)(()=>[e.hasBtns?((0,n.openBlock)(),(0,n.createBlock)(B,{key:0},{default:(0,n.withCtx)(()=>[e.isStep?((0,n.openBlock)(),(0,n.createBlock)(A,{key:0,size:"mini",disabled:p.value,label:(0,n.unref)(l)("上一步"),onClick:S},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0),e.isStep?((0,n.openBlock)(),(0,n.createBlock)(A,{key:1,size:"mini",disabled:u.value,loading:f.value,label:(0,n.unref)(l)("下一步"),onClick:v},null,8,["disabled","loading","label"])):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.buttons,se=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:se.id},[se.config?.display!==!1?((0,n.openBlock)(),(0,n.createBlock)(A,(0,n.mergeProps)({key:0,ref_for:!0},se.config,{label:se.label,onClick:I=>T(se)}),null,16,["label","onClick"])):(0,n.createCommentVNode)("",!0)],64))),128)),e.hasSaveBtn?((0,n.openBlock)(),(0,n.createBlock)(A,{key:2,size:"mini",type:"primary",disabled:h.value&&e.isStep,label:(0,n.unref)(l)(e.btnText),onClick:k},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0)]),_:1})):(0,n.createCommentVNode)("",!0),e.showCloseBtn&&e.hasBtns?((0,n.openBlock)(),(0,n.createBlock)(L,{key:1,type:"vertical",style:{margin:"0 8px"}})):(0,n.createCommentVNode)("",!0),e.showCloseBtn?((0,n.openBlock)(),(0,n.createBlock)(A,{key:2,type:"text",icon:"mdi:close",onClick:w})):(0,n.createCommentVNode)("",!0)]),_:1})])])):e.showCloseBtn?((0,n.openBlock)(),(0,n.createBlock)(A,{key:1,type:"primary",icon:"mdi:close",shape:"circle",onClick:w,class:"j-fixed-close"})):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",Qp,[(0,n.renderSlot)(V.$slots,"default")])],8,Jp)),[[te,d.value]])]),_:3},8,["modelValue","destroy-on-close"])}}}),th=eh,Ol=fe(th),nh=["element-loading-text"],oh={class:"j-block"},ah={key:0,class:"j-drawer-bottom-btns"},rh={class:"j-drawer--header"},ih={class:"j-drawer--title"},lh={style:{height:"28px","line-height":"32px","margin-left":"8px"}},sh={key:0,class:"j-drawer--btns"},ch={key:0,class:"j-drawer-steps"},dh=(0,n.defineComponent)({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(e,{expose:t,emit:o}){const a=e,{t:r}=Ye(),i=o,l=(0,n.ref)(!1),s=(0,n.ref)(""),d=(0,n.computed)(()=>["ltr","rtl"].indexOf(a.direction)!==-1?`${a.width}px`:`${a.height}px`),c=(0,n.computed)({get(){return a.visible},set(V){i("update:visible",!!V)}}),f=V=>{s.value=V||"保存数据中...",l.value=!0},p=()=>{l.value=!1},u=()=>{a.isStep&&(S.value=0,(0,n.nextTick)(()=>{_()})),i("closed")},h=()=>{i("ok",f,p)},g=()=>{a.beforeClose&&a.beforeClose()===!1||(c.value=!1,i("update:visible",!1),i("cancel"))},m=async V=>{V.click&&await V.click()},w=(0,n.ref)(!1),k=(0,n.ref)(!0),b=(0,n.ref)(!1),y=(0,n.ref)(!0),C=(0,n.ref)(-1),S=(0,n.computed)({get(){return C.value!==-1?C.value:a.stepActive},set(V){C.value=V,i("update:stepActive",V)}}),v=()=>{S.value>0&&S.value--,(0,n.nextTick)(()=>{_()})},x=async()=>{await E()&&(S.value<a.steps.length-1&&(S.value+=1),(0,n.nextTick)(()=>{_()}))},E=async()=>{if(w.value=!0,a.validateSteps){const V=await a.validateSteps(a.stepActive,f,p);return w.value=!1,V}return w.value=!1,!0},_=()=>{switch(y.value=!0,b.value=!0,k.value=!0,S.value){case 0:b.value=!1;break;case a.steps.length-1:k.value=!1,y.value=!1;break;default:k.value=!1,b.value=!1;break}},T=(0,n.computed)(()=>a.steps.map(V=>({title:V,disabled:!0})));return t({showLoading:f,hideLoading:p}),(V,N)=>{const z=(0,n.resolveComponent)("el-input"),j=(0,n.resolveComponent)("j-button"),A=(0,n.resolveComponent)("el-space"),B=(0,n.resolveComponent)("el-step"),L=(0,n.resolveComponent)("el-steps"),U=(0,n.resolveComponent)("el-drawer"),te=(0,n.resolveDirective)("loading");return(0,n.openBlock)(),(0,n.createBlock)(U,{modelValue:c.value,"onUpdate:modelValue":N[0]||(N[0]=se=>c.value=se),class:"j-drawer","append-to-body":!0,direction:e.direction,size:d.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":e.destroyOnClose,modal:e.mask,"before-close":e.beforeClose,"close-on-click-modal":!0,onClosed:u},{default:(0,n.withCtx)(()=>[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":e.isStep}]),"element-loading-text":s.value},[(0,n.createElementVNode)("div",{class:"j-drawer--body",style:(0,n.normalizeStyle)({"padding-bottom":e.showCloseBtn||e.hasSaveBtn||e.buttons.length>0?"48px":"0"})},[(0,n.createVNode)(z,{style:{position:"absolute",top:"-200px"}}),(0,n.createElementVNode)("div",oh,[(0,n.renderSlot)(V.$slots,"default")]),e.hasBtns?((0,n.openBlock)(),(0,n.createElementBlock)("div",ah,[(0,n.createVNode)(A,{size:8},{default:(0,n.withCtx)(()=>[e.isStep?((0,n.openBlock)(),(0,n.createBlock)(j,{key:0,size:"mini",disabled:k.value,label:(0,n.unref)(r)("上一步"),onClick:v},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0),e.isStep?((0,n.openBlock)(),(0,n.createBlock)(j,{key:1,size:"mini",disabled:b.value,loading:w.value,label:(0,n.unref)(r)("下一步"),onClick:x},null,8,["disabled","loading","label"])):(0,n.createCommentVNode)("",!0),!e.isStep&&e.showCloseBtn?((0,n.openBlock)(),(0,n.createBlock)(j,{key:2,size:"mini",label:(0,n.unref)(r)("取消"),onClick:g},null,8,["label"])):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.buttons,se=>((0,n.openBlock)(),(0,n.createBlock)(j,(0,n.mergeProps)({key:se.id},{ref_for:!0},se.config,{label:se.label,onClick:I=>m(se)}),null,16,["label","onClick"]))),128)),e.hasSaveBtn?((0,n.openBlock)(),(0,n.createBlock)(j,{key:3,size:"mini",type:"primary",disabled:y.value&&e.isStep,label:(0,n.unref)(r)(e.btnText),onClick:h},null,8,["disabled","label"])):(0,n.createCommentVNode)("",!0)]),_:1})])):(0,n.createCommentVNode)("",!0)],4),(0,n.createElementVNode)("div",rh,[(0,n.createElementVNode)("div",ih,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)((0,n.unref)(r)(e.title)),1),(0,n.createElementVNode)("span",lh,[e.subtitle?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.subtitle()),{key:0})):(0,n.createCommentVNode)("",!0)])]),e.showCloseBtn?((0,n.openBlock)(),(0,n.createElementBlock)("div",sh,[(0,n.createVNode)(j,{type:"text",icon:"mdi:close",onClick:g})])):(0,n.createCommentVNode)("",!0)]),e.isStep?((0,n.openBlock)(),(0,n.createElementBlock)("div",ch,[(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)({maxWidth:`${200*T.value.length}px`,width:"100%"})},[(0,n.createVNode)(L,{simple:"",active:S.value,space:160,"finish-status":"success"},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(T.value,(se,I)=>((0,n.openBlock)(),(0,n.createBlock)(B,{key:I,title:(0,n.unref)(r)(se.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):(0,n.createCommentVNode)("",!0)],10,nh)),[[te,l.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}}),uh=dh,Ll=fe(uh),fh=(0,n.defineComponent)({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(e,{expose:t,emit:o}){const a=o,r=(0,n.ref)(!1),i=(0,n.ref)(""),l=(0,n.ref)(),s=(0,n.ref)(0),d=(0,n.ref)(""),c=(0,n.ref)(),f=(k,b,y)=>{i.value=k,c.value=y,d.value=b||"modal",r.value=!0},p=()=>{r.value=!1},u=(k,b)=>{a("ok",k,b)},h=()=>{s.value=0,a("closed")},g=()=>{a("cancel")},m=k=>{l.value&&l.value.showLoading(k)},w=()=>{l.value&&l.value.hideLoading()};return ul({stepActive:s}),t({open:f,close:p,showLoading:m,hideLoading:w}),(k,b)=>{const y=(0,n.resolveComponent)("j-dialog-full"),C=(0,n.resolveComponent)("j-drawer"),S=(0,n.resolveComponent)("j-dialog");return d.value==="full"?((0,n.openBlock)(),(0,n.createBlock)(y,{key:0,ref_key:"modalRef",ref:l,visible:r.value,"onUpdate:visible":b[0]||(b[0]=v=>r.value=v),"step-active":s.value,"onUpdate:stepActive":b[1]||(b[1]=v=>s.value=v),title:i.value,"before-close":e.beforeClose,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:u,onClosed:h,onCancel:g},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(k.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):d.value==="drawer"?((0,n.openBlock)(),(0,n.createBlock)(C,{key:1,ref_key:"modalRef",ref:l,visible:r.value,"onUpdate:visible":b[2]||(b[2]=v=>r.value=v),"step-active":s.value,"onUpdate:stepActive":b[3]||(b[3]=v=>s.value=v),"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:c.value,onOk:u,onClosed:h,onCancel:g},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(k.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):((0,n.openBlock)(),(0,n.createBlock)(S,{key:2,ref_key:"modalRef",ref:l,visible:r.value,"onUpdate:visible":b[4]||(b[4]=v=>r.value=v),"step-active":s.value,"onUpdate:stepActive":b[5]||(b[5]=v=>s.value=v),width:e.width,height:e.height,title:i.value,"before-close":e.beforeClose,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,subtitle:c.value,onOk:u,onClosed:h,onCancel:g},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(k.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}}),ph=fh,wr=fe(ph),hh=(0,n.defineComponent)({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(),i=(0,n.computed)(()=>xt(o.modelValue)?[]:o.modelValue?.split(",")||[]),l=(0,n.computed)(()=>o.isStyleLoop?i.value?.map((p,u)=>{let h=o.colors[u%o.colors.length]||{};return h={...h,borderWidth:(h.borderWidth||0)+"px"},h})||[]:o.colors),s=p=>{c(),a("select",p)},d=p=>{p.preventDefault(),p.stopPropagation()},c=()=>{if(r.value){const p=[...i.value,r.value];r.value="",a("update:modelValue",p.join(",")),a("change",{value:p.join(",")})}},f=p=>{const u=[...i.value];u.splice(p,1),a("update:modelValue",u.join(",")),a("change",{value:u.join(",")})};return(p,u)=>{const h=(0,n.resolveComponent)("el-tag"),g=(0,n.resolveComponent)("el-space"),m=(0,n.resolveComponent)("j-autocomplete");return(0,n.openBlock)(),(0,n.createBlock)(m,{modelValue:r.value,"onUpdate:modelValue":u[0]||(u[0]=w=>r.value=w),class:"j-input-tag",options:e.options,style:{width:"100%"},readonly:e.readonly,placeholder:e.placeholder,size:e.size,onSelect:s,onKeyup:(0,n.withKeys)((0,n.withModifiers)(c,["stop"]),["enter"]),onKeydown:(0,n.withKeys)((0,n.withModifiers)(d,["stop"]),["enter"])},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(g,null,{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i.value,(w,k)=>((0,n.openBlock)(),(0,n.createBlock)(h,{key:k,type:"info",closable:!e.readonly,style:(0,n.normalizeStyle)(l.value[k]||{}),size:e.size,onClose:(0,n.withModifiers)(b=>f(k),["prevent"])},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(w),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size","onKeyup","onKeydown"])}}}),gh=hh,Dl=fe(gh),mh=(0,n.defineComponent)({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get(){return Number(o.modelValue)},set(d){a("update:modelValue",d),a("change",{value:d})}}),i=(0,n.computed)(()=>o.texts?.map(d=>d.value)||[]),l=(0,n.ref)(0),s=d=>{l.value=d};return(d,c)=>{const f=(0,n.resolveComponent)("el-rate");return(0,n.openBlock)(),(0,n.createBlock)(f,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=p=>r.value=p),size:e.size,max:e.max,"allow-half":e.allowHalf,clearable:e.allowClear,disabled:e.readonly,"show-text":e.showText,texts:i.value,"show-score":e.showScore,onHoverChange:s},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}}),yh=mh,Il=fe(yh),vh=(0,n.defineComponent)({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get(){return Number(o.modelValue)},set(i){a("update:modelValue",i),a("change",{value:i})}});return(i,l)=>{const s=(0,n.resolveComponent)("el-slider");return(0,n.openBlock)(),(0,n.createBlock)(s,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=d=>r.value=d),min:e.min,max:e.max,disabled:e.readonly,step:e.step,"show-input":e.showInput,"show-input-controls":e.showInputControls,size:e.size,"input-size":e.size,"show-stops":e.showStops,"show-tooltip":e.showTooltip,"format-tooltip":e.formatTooltip,range:e.range,vertical:e.vertical,height:e.height,"aria-label":e.ariaLabel,"range-start-label":e.rangeStartLabel,"range-end-label":e.rangeEndLabel,"format-value-text":e.formatValueText,"tooltip-class":e.tooltipClass,placement:e.placement,marks:e.marks,"validate-event":e.validateEvent,persistent:e.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}}),bh=vh,Fl=fe(bh),ha=e=>e<1024?So(e)+" B":e>=1024&&e<1048576?So(e/1024)+" KB":e>=1048576&&e<1073741824?So(e/1024/1024)+" MB":e>=1073741824?So(e/1024/1024/1024)+" GB":"",wh=e=>{const t=window.open("_blank");t&&(t.location=e)},Ch={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},xh=["src"],kh={class:"j-upload-dragItem-content"},Sh={class:"j-upload-dragItem-mask"},Eh=["src"],_h={class:"j-upload-imgItem-mask"},Bh={class:"j-upload-item-content"},Rh=(0,n.defineComponent)({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(e){const{t}=Ye();return(o,a)=>{const r=(0,n.resolveComponent)("j-icon"),i=(0,n.resolveComponent)("el-text"),l=(0,n.resolveComponent)("j-button"),s=(0,n.resolveComponent)("el-progress"),d=(0,n.resolveComponent)("el-link");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-upload-list",{"j-upload-image-list":e.isUploadImg,"j-upload-drag-list":e.drag}])},[e.drag?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[e.showFileList?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:0},(0,n.renderList)(e.list,c=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:c.id,class:"j-upload-dragItem"},[e.isUploadImg?((0,n.openBlock)(),(0,n.createElementBlock)("div",Ch,[(0,n.createElementVNode)("img",{src:c.url,style:{width:"100%"},alt:""},null,8,xh)])):((0,n.openBlock)(),(0,n.createBlock)(r,{key:0,icon:"file-text",style:(0,n.normalizeStyle)({color:c.color?`var(${c.color})`:void 0}),size:72},null,8,["style"])),(0,n.createElementVNode)("div",kh,[(0,n.createVNode)(i,{ellipsis:""},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(`${(0,n.unref)(t)(c.name)}${c.status==="unUpload"?"("+(0,n.unref)(t)("未传")+")":""}`),1)]),_:2},1024),(0,n.createElementVNode)("div",null,[c.status==="uploading"?((0,n.openBlock)(),(0,n.createBlock)(i,{key:0},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(ha)(c.uploadSize))+"/",1)]),_:2},1024)):(0,n.createCommentVNode)("",!0),(0,n.createVNode)(i,null,{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(ha)(c.size)),1)]),_:2},1024)])]),(0,n.withDirectives)((0,n.createElementVNode)("div",Sh,[c.status==="done"||c.status==="unUpload"?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,icon:"mdi:eye",type:"link",onClick:(0,n.withModifiers)(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):(0,n.createCommentVNode)("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?((0,n.openBlock)(),(0,n.createBlock)(l,{key:1,icon:"mdi:delete",type:"link",danger:"",onClick:(0,n.withModifiers)(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):(0,n.createCommentVNode)("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?((0,n.openBlock)(),(0,n.createBlock)(s,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:c.percent,"show-text":!1},null,8,["percent"])):(0,n.createCommentVNode)("",!0)]))),128)):(0,n.createCommentVNode)("",!0),(0,n.renderSlot)(o.$slots,"default")],64)):e.isUploadImg?((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(e.list,c=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:c.id,class:"j-upload-imgItem"},[c.status==="done"||c.status==="unUpload"?((0,n.openBlock)(),(0,n.createElementBlock)("img",{key:0,src:c.url,style:{width:"100%"},alt:""},null,8,Eh)):(0,n.createCommentVNode)("",!0),(0,n.withDirectives)((0,n.createElementVNode)("div",_h,[c.status==="done"||c.status==="unUpload"?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,type:"link",icon:"mdi:eye",onClick:(0,n.withModifiers)(f=>e.previewFile(c),["stop"])},null,8,["onClick"])):(0,n.createCommentVNode)("",!0),!e.readonly&&(c.status==="done"||c.status==="unUpload")?((0,n.openBlock)(),(0,n.createBlock)(l,{key:1,type:"link",danger:"",icon:"mdi:delete",onClick:(0,n.withModifiers)(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])):(0,n.createCommentVNode)("",!0)],512),[[n.vShow,c.status==="error"]]),c.status==="uploading"?((0,n.openBlock)(),(0,n.createBlock)(s,{key:1,"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):(0,n.createCommentVNode)("",!0)]))),128)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:2},(0,n.renderList)(e.list,c=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:c.id,class:"j-upload-item"},[(0,n.createVNode)(r,{icon:"file-text",style:(0,n.normalizeStyle)({color:c.color?`var(${c.color})`:void 0}),size:16},null,8,["style"]),(0,n.createElementVNode)("div",Bh,[(0,n.createVNode)(d,{type:"primary",underline:"never",onClick:(0,n.withModifiers)(f=>e.previewFile(c),["stop"])},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(`${(0,n.unref)(t)(c.name)}${c.status==="unUpload"?"("+(0,n.unref)(t)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),c.status==="uploading"?((0,n.openBlock)(),(0,n.createBlock)(i,{key:0},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(ha)(c.uploadSize))+"/",1)]),_:2},1024)):(0,n.createCommentVNode)("",!0),(0,n.createVNode)(i,null,{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)((0,n.unref)(ha)(c.size)),1)]),_:2},1024),c.status==="done"&&e.isShowSuccessIcon?((0,n.openBlock)(),(0,n.createBlock)(r,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):(0,n.createCommentVNode)("",!0),e.readonly?(0,n.createCommentVNode)("",!0):(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createBlock)(r,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:(0,n.withModifiers)(f=>e.deleteFile(c),["stop","prevent"])},null,8,["onClick"])),[[n.vShow,c.status==="error"]]),c.status==="uploading"?((0,n.openBlock)(),(0,n.createBlock)(s,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:c.percent,"show-text":!1},null,8,["percent"])):(0,n.createCommentVNode)("",!0)]))),128))],2)}}}),$l=Rh,Th={class:"j-upload"},Vh={key:0},Mh={style:{"margin-top":"8px"}},Ah={key:0,style:{"margin-top":"4px"}},Nh={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},jh=["src"],Ph={key:1,class:"j-block"},Hh=["src"],zh=(0,n.defineComponent)({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(e,{emit:t}){const o=e,a=t,{warning:r,error:i,createConfirm:l,t:s,apiUrl:d,token:c,useFile:f}=Ye(),{fileChunkedUpload:p,deleteFile:u}=f(),h=(0,n.computed)(()=>o.isUploadImg?o.accept||"image/*":o.accept),g=(0,n.computed)(()=>{if(o.limit!==-1)return o.limit}),m=(0,n.computed)(()=>o.limit===-1?"":`,${s("上传数量")}${o.limit}`),w=(0,n.ref)(""),k=(0,n.computed)(()=>({folderId:o.modelValue||w.value,maxSize:o.maxSize,sizeType:o.sizeType})),b=(0,n.ref)([]),y=()=>{b.value=[...b.value]},C=q=>{if(o.maxSize&&o.sizeType){let ge=q;switch(o.sizeType){case"GB":ge=1024*1024*1024*o.maxSize;break;case"MB":ge=1024*1024*o.maxSize;break;case"KB":ge=1024*o.maxSize;break;default:ge=o.maxSize;break}if(ge<q)return!1}return!0},S={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},v=q=>{if(q){const ge=q.split(".");return ge[ge.length-1]}return""},x=(q,ge)=>{if(ge&&ge.indexOf("image")>-1)return"file-image";const we=v(q);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(we)?"file-image":S[we]||"file-ufo"},E=q=>{q.status=o.autoUpload?"uploading":"unUpload",q.uploadSize=0,q.icon=x(q.name,q.type),p||(q.icon="file-text"),q.id=q.uid,q.url=window.URL.createObjectURL(q),q.date=Eo(),q.param=k.value},_=q=>{a("start",{file:q,list:b.value})},T=(q,ge,we)=>{q.percent=we,q.uploadSize=ge,y()},V=q=>{q.status="done",q.id+="1",q.uid+="1",y(),a("success",{file:q,list:b.value}),o.modelValue||(a("update:modelValue",w.value),a("change",{value:w.value}))},N=(q,ge)=>{console.error(ge,"简搭提醒您:文件上传错误!"),q.status="error",y(),a("error",{file:q,list:b.value})},z=q=>{if(b.value.push(q),q.status==="unUpload"){a("notUploadChange",{value:q.url});return}!o.isNotApi&&o.upload?o.upload(q):!o.isNotApi&&p?p(q,{onStart:_,onProgress:T,onSuccess:V,onError:N,uploadCallback:o.uploadCallback}):V(q)},j=q=>{if(!C(q.size))return i&&i("上传文件超出大小了"),!1},A=q=>{E(q.file),z(q.file)},B=q=>new Promise(ge=>{l?l({title:"提示",iconType:"warning",content:`您确定删除【${q.name}】?`,onOk:()=>{ge(!0)},onCancel:()=>{ge(!1)}}):(L(q),ge(!0))}),L=q=>{if(!o.isNotApi){const ge=q.response?.fileId||q.id;u&&u(ge)}b.value=b.value.filter(ge=>ge.id!==q.id),b.value.length===0&&(a("update:modelValue",""),a("change",{value:""})),a("delete",{file:q,list:b.value})},U=async q=>{await B(q)&&L(q)},te=(0,n.ref)(!1),se=(0,n.ref)(""),I=(0,n.ref)(""),$=(0,n.ref)(!1),Y=(0,n.ref)(!1);let M=null;const oe=(0,n.ref)(Eo(new Date,"YYYY-MM-DD")),me=q=>{if(q.isPreview===!1&&!o.isUploadImg){r&&r("无权限预览!");return}const ge=q.name.split(".")[q.name.split(".").length-1];switch(M=q,te.value=!1,se.value=q.name,ge.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":te.value=!0,I.value=q.url,Y.value=!1,$.value=!0;break;default:if(o.isNotApi){r&&r("预览表单中,不支持预览!");return}if(q.status!=="done"){r&&r("当前文件还没上传成功,不支持预览!");return}if(I.value=ce(q),I.value===""){r&&r("当前文件不支持预览!");return}Y.value=!0,$.value=!0;break}oe.value=Eo(new Date,"YYYY-MM-DD HH:mm:ss")},ce=q=>{const ge=q.response?.fileId||q.id;if(!d)return"";const we=Eo(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+ge;return`${d}/system/annexesfile/preview/${nl.createAesEncryption({key:"jianda"}).encrypt(we).replace(/\//g,"|")}?token=${c?.value}`},Be=()=>{M.isDown===!1&&r&&r("无权限下载!"),wh(`${d}/system/annexesfile/${M.response?.fileId||M.id}?token=${c?.value}`)},Te=()=>{if(o.limit!==-1&&o.limit<=b.value.length)return r&&r(`当前限制选择${o.limit}个文件`),!1};return(q,ge)=>{const we=(0,n.resolveComponent)("j-icon"),Se=(0,n.resolveComponent)("j-button"),lt=(0,n.resolveComponent)("el-popover"),Qe=(0,n.resolveComponent)("el-button"),Ae=(0,n.resolveComponent)("el-upload"),kt=(0,n.resolveComponent)("el-text"),Ht=(0,n.resolveComponent)("j-dialog-full"),St=(0,n.resolveDirective)("loading");return(0,n.openBlock)(),(0,n.createElementBlock)("div",Th,[(0,n.createVNode)(Ae,{action:"",drag:e.drag,disabled:e.readonly,"show-file-list":e.isUploadImg&&!e.isLayer&&e.showFileList,"list-type":e.isUploadImg&&!e.isLayer?"picture-card":void 0,accept:h.value,limit:g.value,multiple:e.multiple,"before-upload":j,"http-request":A,"file-list":b.value,"before-remove":B,"on-remove":L,"on-preview":me,"on-exceed":Te},{default:(0,n.withCtx)(()=>[e.isUploadImg&&!e.isLayer&&!e.readonly?((0,n.openBlock)(),(0,n.createElementBlock)("div",Vh,[(0,n.createVNode)(we,{icon:"mdi:add"}),(0,n.createElementVNode)("div",Mh,(0,n.toDisplayString)((0,n.unref)(s)(e.placeholder)),1)])):e.isLayer&&e.showFileList&&b.value.length>0&&!$.value?((0,n.openBlock)(),(0,n.createBlock)(lt,{key:1,placement:"bottom",title:e.isUploadImg?(0,n.unref)(s)("图片列表"):(0,n.unref)(s)("文件列表")},{content:(0,n.withCtx)(()=>[(0,n.createVNode)($l,{style:(0,n.normalizeStyle)({width:e.isUploadImg?void 0:"400px"}),list:b.value,"preview-file":me,"delete-file":U,"is-upload-img":e.isUploadImg,readonly:e.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(Se,{type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.readonly?(0,n.unref)(s)(e.btnText):e.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):e.readonly?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createBlock)(Qe,{key:2,type:e.btnType,size:e.btnSize},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(we,{icon:"mdi:tray-upload"}),(0,n.createTextVNode)(" "+(0,n.toDisplayString)(e.placeholder),1)]),_:1},8,["type","size"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),e.isTip?((0,n.openBlock)(),(0,n.createElementBlock)("div",Ah,[(0,n.createVNode)(kt,null,{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(`${(0,n.unref)(s)("只能上传不超过{0}的{1}文件",`${e.maxSize}${e.sizeType}`,`${h.value||""}`)},${m.value}`),1)]),_:1})])):(0,n.createCommentVNode)("",!0),!e.isLayer&&!e.isUploadImg&&e.showFileList&&b.value.length>0?((0,n.openBlock)(),(0,n.createBlock)($l,{key:1,style:{"margin-top":"4px"},list:b.value,"preview-file":me,"delete-file":U,readonly:e.readonly,"is-show-success-icon":e.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):(0,n.createCommentVNode)("",!0),(0,n.createVNode)(Ht,{visible:$.value,"onUpdate:visible":ge[1]||(ge[1]=ct=>$.value=ct),"btn-text":"下载",title:`${(0,n.unref)(s)("文件预览")}【${se.value}】`,"destroy-on-close":!0,"has-btns":!!(0,n.unref)(d),onOk:Be},{default:(0,n.withCtx)(()=>[te.value&&I.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",Nh,[(0,n.createElementVNode)("img",{width:"100%",style:{"max-width":"1024px"},src:I.value,alt:""},null,8,jh)])):I.value!=""?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",Ph,[(0,n.createElementVNode)("iframe",{ref:"iframe",src:I.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:ge[0]||(ge[0]=ct=>Y.value=!1)},null,40,Hh)])),[[St,Y.value]]):(0,n.createCommentVNode)("",!0)]),_:1},8,["visible","title","has-btns"])])}}}),Oh=zh,Wl=fe(Oh),Lh=(0,n.defineComponent)({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l=(0,n.shallowRef)();let s=null,d=null;const c=async()=>{i.value&&(l.value=ar.init(i.value,a.theme,a.initOptions),f(a.option),l.value&&l.value.on("click",g=>{r("click",g)}),typeof window<"u"&&window.ResizeObserver&&(s=new ResizeObserver(()=>{l.value?.resize()}),s.observe(i.value)),l.value&&r("ready",l.value))},f=g=>{l.value&&(d&&clearTimeout(d),a.updateDelay>0?d=setTimeout(()=>{l.value?.setOption(g,a.notMerge)},a.updateDelay):l.value.setOption(g,a.notMerge))};return(0,n.watch)(()=>a.option,g=>{f(g)},{deep:!0}),(0,n.onMounted)(()=>{c()}),(0,n.onUnmounted)(()=>{d&&clearTimeout(d),s&&i.value&&(s.unobserve(i.value),s.disconnect(),s=null),l.value&&(l.value.dispose(),l.value=void 0)}),t({getInstance:()=>l.value,resize:g=>{l.value?.resize(g)},clear:()=>{l.value?.clear()}}),(g,m)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"chartRef",ref:i,class:"j-echarts"},null,512))}}),Ul=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},Dh=Ul(Lh,[["__scopeId","data-v-69ad659b"]]),Jl=fe(Dh),Ih=["innerHTML"],Fh={key:1,class:"j-barcode-error"},$h=(0,n.defineComponent)({name:"JBarcode",inheritAttrs:!1,__name:"barcode",props:{bcid:{type:String,required:!0},modelValue:{type:String,required:!0},scale:{type:Number,default:2},scaleX:{type:Number,default:null},scaleY:{type:Number,default:null},height:{type:Number,default:10},width:{type:Number,default:void 0},rotate:{type:String,default:"N"},barcolor:{type:String,default:"000000"},backgroundcolor:{type:String,default:""},padding:{type:Number,default:0},paddingwidth:{type:Number,default:null},paddingheight:{type:Number,default:null},inkspread:{type:Number,default:0},includetext:{type:Boolean,default:!0},alttext:{type:String,default:""},textfont:{type:String,default:"OCR-B"},textsize:{type:Number,default:10},textxalign:{type:String,default:"center"},textyalign:{type:String,default:void 0},textxoffset:{type:Number,default:0},textyoffset:{type:Number,default:0},textcolor:{type:String,default:""},includecheck:{type:Boolean,default:!1},includecheckintext:{type:Boolean,default:!1},parse:{type:Boolean,default:!1},parsefnc:{type:Boolean,default:!1},guardwhitespace:{type:Boolean,default:!1},guardwidth:{type:Number,default:null},eclevel:{type:[String,Number],default:"M"},version:{type:[Number,String],default:""},format:{type:String,default:""},columns:{type:Number,default:null},rows:{type:Number,default:null},errorlevel:{type:Number,default:null}},setup(e){const t=e,o=(0,n.ref)(""),a=(0,n.ref)(""),r=f=>{if(f.length!==13)throw new Error("GTIN must be 13 digits for checksum calculation");let p=0;for(let u=12;u>=0;u--){const h=parseInt(f[u]),g=(13-u)%2===1?3:1;p+=h*g}return(10-p%10)%10},i=f=>{const p=/\(01\)(\d{14})/,u=f.match(p);if(!u)return f;const h=u[1],g=h.substring(0,13),m=parseInt(h[13]),w=r(g);if(m!==w){const k=g+w;return f.replace(p,`(01)${k}`)}return f},l=f=>{if(!/^\d+$/.test(f))return f;const p={11:10,45:18,59:18,62:25},u=Object.keys(p);let h=null;for(const k of u)if(f.startsWith(k)){h=k;break}let g=f,m=!1;if(!h){const k=f.length;if(k<=8)g="11"+f.substring(0,8),m=!0,h="11";else if(k<=16){const b=f.substring(0,8),y=f.substring(8,16);g="59"+b+y,m=!0,h="59"}else{const b=f.substring(0,23),y=b.substring(0,8),C=b.substring(8,23);g="62"+y+C,g.length!==25&&(g=g.substring(0,25)),m=!0,h="62"}}if(h&&!m){const k=p[h];g.length>k&&(g=g.substring(0,k))}let w=null;for(const k of u)if(g.startsWith(k)){w=k;break}if(w){const k=p[w];g.length>k&&(g=g.substring(0,k))}else console.error("AUSPOST: 无法检测到有效的FCC,结果:",g);return/^\d+$/.test(g)?(g.length>25&&(console.error("AUSPOST: 返回值长度超过25位:",g.length,g),g=g.substring(0,25)),g):(console.error("AUSPOST: 返回值不是纯数字:",g),f)},s=f=>{if(!/^\d+$/.test(f))throw new Error("PZN must contain only digits");if(f.length===7){const p=f.substring(0,6);let u=0;for(let g=0;g<6;g++){const m=parseInt(p[g]),w=g+2;u+=m*w}const h=u%11;return h===10?null:h}else if(f.length===8){const p=f.substring(0,7);let u=0;for(let g=0;g<7;g++){const m=parseInt(p[g]),w=g+1;u+=m*w}const h=u%11;return h===10?null:h}else throw new Error("PZN must be 7 or 8 digits")},d=f=>{if(!/^\d+$/.test(f)||f.length!==7&&f.length!==8)return f;try{const p=s(f);if(p===null)return f;if(f.length===7){const u=f.substring(0,6);if(parseInt(f[6])!==p)return u+p}else if(f.length===8){const u=f.substring(0,7);if(parseInt(f[7])!==p)return u+p}}catch(p){console.warn("PZN checksum calculation failed:",p.message)}return f},c=()=>{try{a.value="";const f={...t};Object.keys(f).forEach(h=>{(f[h]===null||f[h]===""||f[h]===void 0)&&delete f[h]}),f.bcid==="codabar"&&(f.bcid="rationalizedCodabar"),f.bcid==="uspsonecode"&&(f.bcid="onecode"),f.bcid==="datamatrixrect"&&(f.bcid="datamatrix",f.format||(f.format="rectangle")),f.bcid==="datamatrix"&&f.format==="rect"&&(f.format="rectangle");const p=["offleft","left","center","right","offright"];if(f.textxalign&&!p.includes(f.textxalign)&&(console.warn(`Invalid textxalign value: ${f.textxalign}. Using default 'center'. Valid values: ${p.join(", ")}`),f.textxalign="center"),(f.bcid==="pdf417"||f.bcid==="micropdf417")&&delete f.eclevel,(f.bcid==="qrcode"||f.bcid==="microqrcode")&&delete f.errorlevel,f.bcid==="azteccode"&&(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"&&/^[LMQH]$/i.test(f.eclevel)&&delete f.eclevel),f.bcid==="hanxin")if(delete f.errorlevel,f.eclevel&&typeof f.eclevel=="string"){const h={L:"L1",M:"L2",Q:"L3",H:"L4"},g=f.eclevel.toUpperCase();h[g]?f.eclevel=h[g]:/^L[1-4]$/i.test(f.eclevel)||(f.eclevel="L1")}else f.eclevel||(f.eclevel="L1");let u=f.modelValue;if(t.bcid==="gs1-128"&&typeof u=="string")try{u=i(u),u!==f.modelValue&&console.warn(`GS1-128 AI 01 checksum corrected: ${f.modelValue} -> ${u}`)}catch(h){console.warn("GS1 checksum validation failed:",h.message)}if(t.bcid==="auspost"&&typeof u=="string")try{const h=u;if(u=l(u),u!==h){const g=h.length>u.length,m=u.match(/^(11|45|59|62)/),w=m?m[1]:"unknown";console.warn(g?`AUSPOST 值已调整: ${h} -> ${u} (长度: ${h.length} -> ${u.length}, FCC: ${w})`:`AUSPOST FCC 已添加: ${h} -> ${u} (FCC: ${w}, 长度: ${u.length})`)}}catch(h){console.error("[AUSPOST] FCC validation failed:",h),console.warn("AUSPOST FCC validation failed:",h.message)}if(t.bcid==="pzn"&&typeof u=="string")try{const h=u;u=d(u),u!==h&&console.warn(`PZN checksum corrected: ${h} -> ${u}`)}catch(h){console.warn("PZN checksum validation failed:",h.message)}f.text=u,delete f.modelValue,t.bcid==="auspost"&&typeof u=="string"&&u.match(/^(11|45|59|62)/)&&(u.length>20?(f.custinfoenc="numeric",console.log(`[AUSPOST] 值长度 ${u.length} > 20,使用数字编码 (custinfoenc=numeric)`)):/^\d+$/.test(u)&&(f.custinfoenc="numeric",console.log("[AUSPOST] 值全是数字,使用数字编码 (custinfoenc=numeric)"))),t.scaleX||(f.scaleX=t.scale),t.scaleY||(f.scaleY=f.scaleX),["qrcode","microqrcode","datamatrix","datamatrixrect","pdf417","micropdf417","azteccode","hanxin"].includes(f.bcid)&&(f.width||(f.width=f.height)),o.value=rr.default.toSVG(f)}catch(f){console.error("BWIP-JS Render Error:",f);let p=f.message||"条码数据或参数错误";f.message&&f.message.includes("Bad checksum")&&t.bcid==="gs1-128"?p=`GS1-128 校验位错误: ${f.message}。请确保 AI 01 的14位数字包含正确的校验位。`:f.message&&f.message.includes("GS1badChecksum")?p=`GS1 校验位错误: ${f.message}。请检查应用标识符 (AI) 的数据格式和校验位是否正确。`:f.message&&f.message.includes("auspostBadFCC")&&t.bcid==="auspost"?p=`AUSPOST FCC 错误: ${f.message}。AUSPOST 条码必须以有效的 FCC (Format Control Code) 开头:11, 45, 59 或 62。如果值未以有效的 FCC 开头,系统会自动添加合适的 FCC。`:f.message&&f.message.includes("auspostTooLong")&&t.bcid==="auspost"?p=`AUSPOST 长度错误: ${f.message}。AUSPOST 条码长度限制:FCC 11 (10位), FCC 59 (18位), FCC 62 (25位,最大容量)。如果值超过限制,系统会自动截断并使用合适的 FCC。`:f.message&&f.message.includes("pznBadCheckDigit")&&t.bcid==="pzn"&&(p=`PZN 校验位错误: ${f.message}。PZN (德国医药产品编号) 必须是7位或8位数字,包含正确的校验位。如果校验位不正确,系统会自动修复。`),a.value=p,o.value=""}};return(0,n.watchEffect)(c),(f,p)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[o.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-barcode",innerHTML:o.value},null,8,Ih)):(0,n.createCommentVNode)("",!0),a.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",Fh,(0,n.toDisplayString)(a.value),1)):(0,n.createCommentVNode)("",!0)],64))}}),Wh=$h,Yl=fe(Wh),Uh=(0,n.defineComponent)({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=(...v)=>{v=v.flat();let x=0;for(let E=0;E<v.length;E++)x+=v[E];return x/v.length},r=(v,x)=>x<0?-Math.ceil(v/Math.abs(x))*x||0:Math.ceil(v/x)*x||0,i=(...v)=>(v=v.flat(),v.length),l=(v,x)=>{let E=0;if(Array.isArray(v))if(/[><=]/.test(x)){const _=x.match(/^([><=]+)(.+)$/);if(_){const T=_[1],V=Number(_[2]);for(let N=0;N<v.length;N++)try{const z=Number(v[N]);let j=!1;switch(T){case">":j=z>V;break;case"<":j=z<V;break;case">=":j=z>=V;break;case"<=":j=z<=V;break;case"==":case"===":j=z===V;break;case"!=":case"!==":j=z!==V;break}j&&E++}catch{console.log("计算失败");break}}}else for(let _=0;_<v.length;_++)v[_]===x&&E++;return E},s=(v,x)=>v.toFixed(x),d=(v,x)=>x<0?-Math.floor(v/Math.abs(x))*x||0:Math.floor(v/x)*x||0,c=(v,x)=>{if(Array.isArray(v))return v.sort((E,_)=>_-E),v[x-1]},f=(v,x)=>{if(Array.isArray(v))return v.sort((E,_)=>E-_),v[x-1]},p=(v,x)=>Math.log(v)/Math.log(x),u=(v,x)=>v%x,h=(...v)=>{v=v.flat();let x=1;for(let E=0;E<v.length;E++)x*=v[E];return x},g=(v,x)=>{const E=v.toFixed(x);return Number(E)},m=(...v)=>{v=v.flat();let x=0;for(let E=0;E<v.length;E++)x+=Number(v[E]);return x},w=(...v)=>v[0].map((x,E)=>{let _=x;for(let T=1;T<v.length;T++)_*=v[T][E]||0;return _}).reduce((x,E)=>x+E,0),k=t,{getValue:b}=gn(),y=v=>{const x=b({id:v});if(aa(x)){const _=[];return x.forEach(T=>{const V=Number(T);Number.isNaN(V)?_.push(0):_.push(V)}),_}const E=Number(x);return Number.isNaN(E)?0:E},C=(0,n.computed)(()=>{if(!b)return"";const v=JSON.parse(o.formatJson||"[]");let x="";for(let T=0;T<v.length;T++){const V=v[T];if(V.type==="fun"&&V.value!=="("&&V.value!==")")if(["abs","max","min","sqrt"].includes(V.value))x+=`Math.${V.value}`;else if(["int","power","rand"].includes(V.value))switch(V.value){case"int":x+="Math.floor";break;case"power":x+="Math.pow";break;case"rand":x+="Math.random";break}else x+=`${V.value}Fun`;else V.type==="comp"?x+=`getCompValue('${V.value}')`:V.value==="i"&&o.tableIndex!==void 0?x+=o.tableIndex:x+=V.value}if(!x)return"";x=`(
|
|
1
|
+
(function(z,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@iconify/vue"),require("dayjs"),require("sortablejs"),require("@visactor/vtable"),require("element-plus"),require("echarts"),require("@bwip-js/browser"),require("countup.js"),require("sql-formatter"),require("codemirror"),require("@codemirror/view"),require("@codemirror/state"),require("@codemirror/lang-javascript"),require("@codemirror/lang-css"),require("@codemirror/lang-html"),require("@codemirror/lang-json"),require("@codemirror/lang-sql"),require("@codemirror/lang-xml"),require("@codemirror/lang-python"),require("@codemirror/lang-markdown"),require("@codemirror/lang-java"),require("@codemirror/autocomplete"),require("@codemirror/commands"),require("@codemirror/language"),require("@vueuse/core"),require("async-validator"),require("@wangeditor/editor"),require("diagram-js"),require("min-dom"),require("min-dash"),require("tiny-svg"),require("inherits"),require("diagram-js-direct-editing")):typeof define=="function"&&define.amd?define(["exports","vue","@iconify/vue","dayjs","sortablejs","@visactor/vtable","element-plus","echarts","@bwip-js/browser","countup.js","sql-formatter","codemirror","@codemirror/view","@codemirror/state","@codemirror/lang-javascript","@codemirror/lang-css","@codemirror/lang-html","@codemirror/lang-json","@codemirror/lang-sql","@codemirror/lang-xml","@codemirror/lang-python","@codemirror/lang-markdown","@codemirror/lang-java","@codemirror/autocomplete","@codemirror/commands","@codemirror/language","@vueuse/core","async-validator","@wangeditor/editor","diagram-js","min-dom","min-dash","tiny-svg","inherits","diagram-js-direct-editing"],s):(z=typeof globalThis<"u"?globalThis:z||self,s(z.SimCodeUI={},z.Vue,z.IconifyVue,z.dayjs,z.Sortable,z.VTable,z.ElementPlus,z.echarts,z.bwipjs,z.CountUp,z.SqlFormatter,z.CodeMirror,z.CodeMirrorView,z.CodeMirrorState,z.CodeMirrorLangJavaScript,z.CodeMirrorLangCSS,z.CodeMirrorLangHTML,z.CodeMirrorLangJSON,z.CodeMirrorLangSQL,z.CodeMirrorLangXML,z.CodeMirrorLangPython,z.CodeMirrorLangMarkdown,z.CodeMirrorLangJava,z.CodeMirrorAutocomplete,z.CodeMirrorCommands,z.CodeMirrorLanguage,z.VueUse,z.AsyncValidator,z.WangEditor,z.Diagram,z.minDom,z.minDash,z.tinySvg,z.inherits,z.DiagramJsDirectEditing))})(this,function(z,s,Ar,gs,Yu,We,xS,Gu,qu,ES,kS,TS,lr,Ju,Li,RS,MS,BS,DS,AS,PS,NS,LS,Xu,Ku,Ii,Zu,Qu,hg,vs,te,P,V,Pr,ed){Object.defineProperties(z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var IS=Object.create,pg=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,VS=Object.getOwnPropertyNames,zS=Object.getPrototypeOf,HS=Object.prototype.hasOwnProperty,wn=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),FS=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=VS(t),i=0,o=a.length,l;i<o;i++)l=a[i],!HS.call(e,l)&&l!==n&&pg(e,l,{get:(c=>t[c]).bind(null,l),enumerable:!(r=OS(t,l))||r.enumerable});return e},en=(e,t,n)=>(n=e!=null?IS(zS(e)):{},FS(t||!e||!e.__esModule?pg(n,"default",{value:e,enumerable:!0}):n,e));gs=en(gs,1),Yu=en(Yu,1);let ta=en(We,1);We=en(We),Gu=en(Gu,1),qu=en(qu,1),Qu=en(Qu,1),vs=en(vs,1),Pr=en(Pr,1),ed=en(ed,1);var be=e=>(e.install=t=>{t.component(e.name,e)},e);function ms(e){return e&&Array.isArray(e)}function gg(e,t){return toString.call(e)===`[object ${t}]`}function jS(e){return e!==null&&gg(e,"Object")}var ln=e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0),$S=(0,s.defineComponent)({name:"JIcon",inheritAttrs:!1,__name:"icon",props:{icon:{},size:{default:16},color:{default:void 0},rotate:{default:void 0},isDiv:{type:Boolean,default:!0}},setup(e){const t=e,n=(0,s.computed)(()=>{const a=t.icon;if(a.indexOf(":")===-1)return(0,Ar.getIcon)(`jcode:${t.icon}`)==null,`jcode:${t.icon}`;const i=`jcode:${a.split(":")[1]}`;return(0,Ar.getIcon)(i)!=null?i:a}),r=(0,s.computed)(()=>({size:t.size,color:t.color,icon:n.value}));return(a,i)=>e.isDiv?((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({key:0},a.$attrs,{class:"j-icon jicon",style:{height:`${e.size}px`}}),[(0,s.createVNode)((0,s.unref)(Ar.Icon),(0,s.mergeProps)(r.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16)):((0,s.openBlock)(),(0,s.createElementBlock)("span",(0,s.mergeProps)({key:1},a.$attrs,{class:"jicon"}),[(0,s.createVNode)((0,s.unref)(Ar.Icon),(0,s.mergeProps)(r.value,{height:`${e.size}px`,width:`${e.size}px`,mode:"svg",style:`transform:rotate(${e.rotate||0}deg)`}),null,16,["height","width","style"])],16))}}),Na=$S,WS=["disabled"],US={key:2},YS=(0,s.defineComponent)({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},shape:{default:"default"},ghost:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},loading:{type:[Boolean,Object],default:!1},icon:{default:""},href:{default:""},target:{default:"_self"},label:{default:""},notLabel:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},lastCompactItem:{type:Boolean,default:!1},firstCompactItem:{type:Boolean,default:!1}},emits:["click"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=h=>{!d.value&&!r.disabled&&(a("click",h),r.href&&window.open(r.href,r.target?r.target:"_self"))},o=(0,s.shallowRef)(null),l=()=>{o.value?.focus()},c=()=>{o.value?.blur()},u=(0,s.computed)(()=>r.notLabel||!r.label),d=(0,s.ref)(!1);(0,s.watch)(()=>r.loading,h=>{if(typeof h=="boolean")d.value=h;else if(ln(h?.delay))d.value=!1;else{const p=setTimeout(()=>{d.value=!0},h.delay);return()=>clearTimeout(p)}},{immediate:!0});const f=(0,s.computed)(()=>r.label||"");return t({focus:l,blur:c}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("button",{ref_key:"buttonNodeRef",ref:o,type:"button",class:(0,s.normalizeClass)(["j-button",{"j-button-primary":e.type=="primary","j-button-success":e.type=="success","j-button-default":e.type=="default","j-button-dashed":e.type=="dashed","j-button-link":e.type=="link","j-button-text":e.type=="text","j-button-ghost":e.ghost==!0,"j-button-danger":e.danger==!0,"j-button-lg":e.size=="large","j-button-sm":e.size=="small","j-button-circle":e.shape=="circle","j-button-round":e.shape=="round","j-button-block":e.block==!0,"j-button-loading":d.value==!0,"j-button-icon-only":u.value==!0,"j-button-compact":e.compact==!0,"j-button-last-compact-item":e.lastCompactItem==!0,"j-button-first-compact-item":e.firstCompactItem==!0}]),disabled:e.disabled,onClick:(0,s.withModifiers)(i,["stop"])},[d.value?((0,s.openBlock)(),(0,s.createBlock)(Na,{key:0,icon:"mdi:loading",size:e.size=="large"?14:12,class:"loading-spin j-button-loading-icon"},null,8,["size"])):e.icon?((0,s.openBlock)(),(0,s.createBlock)(Na,{key:1,icon:e.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),e.notLabel?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",US,(0,s.toDisplayString)(f.value),1)),(0,s.renderSlot)(h.$slots,"iconAfter")],10,WS))}}),GS=YS,ys=be(GS);function Oi(e){Object.keys(e||{}).forEach(t=>{delete e[t]})}function vg(e){const{toString:t}=Object.prototype,n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"};return typeof Element<"u"&&e instanceof Element?"element":n[t.call(e)]}function Mn(e){const t=vg(e);let n;if(t==="array")n=[];else if(t==="object")n={};else return e;if(t==="array")for(let r=0,a=e.length;r<a;r++)e[r]=(e[r]===0,e[r]),e[r]&&delete e[r].$parent,n.push(Mn(e[r]));else t==="object"&&Object.keys(e).forEach(r=>{e&&delete e.$parent,n[r]=Mn(e[r])});return n}function Go(e,t,n=[]){Object.keys(t).forEach(r=>{n.indexOf(r)===-1&&(e[r]=t[r])})}var Nr=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),td=0;function _s(e=""){const t=Date.now(),n=Math.floor(Math.random()*1e9);return td++,e?e+"_"+n+td+String(t):n+td+String(t)}var nd=e=>{if(e)try{const t=new Function("return "+e)();return typeof t=="function"?{res:!0,msg:"ok",fn:t}:(console.warn("此方法不是一个函数",e),{res:!1,msg:"此方法不是一个函数"})}catch(t){return console.warn(t,e),{res:!1,msg:t}}else return{res:!1,msg:"没设置脚本函数"}};function rd(e,t,n){if(!e||typeof e!="object")return e;const r=Array.isArray(t)?t:t.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);if(r.length===0)return e;let a=e;for(let i=0;i<r.length-1;i++){const o=r[i],l=r[i+1];(!(o in a)||typeof a[o]!="object"||a[o]===null)&&(a[o]=/^\d+$/.test(l)?[]:{}),a=a[o]}return a[r[r.length-1]]=n,e}var qo=e=>{let t=parseFloat(e);return isNaN(t)?0:(t=Math.round(e*100)/100,t)},qS=function(e,t,n){const r=(e-1)*t;return r+t>=n.length?n.slice(r,n.length):n.slice(r,r+t)},JS=function(e,t){const n=(e.page-1)*e.rows,r=n+e.rows>=t.length?t.slice(n,t.length):t.slice(n,n+e.rows);return{rows:r,total:t.length,page:e.page,records:r.length}},XS=function(e){return e.filter((t,n,r)=>r.indexOf(t,0)===n)},mg=e=>{if(!/^\d*(\.\d*)?$/.test(e))return"Number is wrong!";const t=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","十","百","千","万","亿","点",""],r=(""+e).replace(/(^0*)/g,"").split(".");let a=0,i="";for(let o=r[0].length-1;o>=0;o--){switch(a){case 0:i=n[7]+i;break;case 4:new RegExp("0{4}\\d{"+(r[0].length-o-1)+"}$").test(r[0])||(i=n[4]+i);break;case 8:i=n[5]+i,n[7]=n[5],a=0;break}a%4===2&&r[0].charAt(o+2)!=="0"&&r[0].charAt(o+1)==="0"&&(i=t[0]+i),r[0].charAt(o)!=="0"&&(i=t[Number(r[0].charAt(o))]+n[a%4]+i),a++}if(r.length>1){i+=n[6];for(let o=0;o<r[1].length;o++)i+=t[Number(r[1].charAt(o))]}return i},yg=e=>{const t=(e+"").split("."),n=t[0]+"",r=t[1]||"",a=n.length%3;let i=n.substring(0,a);for(let o=0;o<Math.floor(n.length/3);o++)i+=","+n.substring(a+o*3,a+(o+1)*3);return a===0&&(i=i.substring(1)),e=i+(r?"."+r:""),e},Ln=e=>{if(!e)return;if(typeof document>"u"||!document.body)return e.length*7;const t=document.createElement("span");t.style.fontSize="14px",t.style.visibility="hidden",t.style.position="absolute",t.innerText=e,document.body.appendChild(t);const n=t.offsetWidth;return document.body.removeChild(t),n};function _g(e){return e==null||e===void 0||e===""?"":e===e.toUpperCase()?e.split("_").map(t=>(t=t.toLowerCase(),t.slice(0,1).toUpperCase()+t.slice(1))).join(""):e.slice(0,1).toUpperCase()+e.slice(1)}function KS(e,t=!0){if(e==null||e===void 0||e==="")return"";t&&(e=_g(e));let n="";for(let r=0,a=e.length;r<a&&(n+=e[r].toLowerCase(),!(r<a-1&&e[r+1]===e[r+1].toLowerCase()||r<a-2&&e[r+2]===e[r+2].toLowerCase()));r++);if(n.length<e.length)for(let r=n.length,a=e.length;r<a;r++)n+=e[r];return n}function wt(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");if(typeof Object.assign=="function")return Object.assign(e,...t);const n=Object(e);for(let r=0;r<t.length;r++){const a=t[r];if(a!=null)for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])}return n}function wg(e,t,n){const r={},a={};return e.forEach(i=>{r[i[n]]=r[i[n]]||[],r[i[n]].push(i),a[i[t]]=i}),{group:r,map:a}}function ad(e,t,n,r,a,i){const o=[];return e==null?Object.keys(t.group).forEach(l=>{(!i||!i.includes(l))&&(t.map[l]||t.group[l].forEach(c=>{(!i||!i.includes(c[n]))&&(r&&(c.value=c[r]),a&&(c.label=c[a]),t.group[c[n]]&&t.group[c[n]].length>0&&(c.children=ad(t.group[c[n]],t,n,r,a,i)),o.push(c))}))}):e.forEach(l=>{(!i||!i.includes(l[n]))&&(r&&(l.value=l[r]),a&&(l.label=l[a]),t.group[l[n]]&&t.group[l[n]].length>0&&(l.children=ad(t.group[l[n]],t,n,r,a,i)),o.push(l))}),o}function bg(e,t,n,r,a,i){if(e.length===0||!t&&!e[0]._id)return e;const o=t||"_id";n=n||"_pid";const l=[];let c={};if(r?e.forEach(u=>{c[u[r]]||(c[u[r]]=!0,l.push(Mn(u)))}):e.forEach(u=>{l.push(Mn(u))}),c={},o===n){const u=[];return l.forEach(d=>{(!i||!i.includes(d[o]))&&(r&&(d.value=d[r]),a&&(d.label=d[a]),u.push(d))}),u}return ad(null,wg(l,o,n),o,r,a,i)}var Cg=(e,t,n,r)=>{n=n||[];for(let a=0,i=n.length;a<i;a++){const o=n[a],l={};l._id=o.prop||`${t}_${a}`,l._pid=t,Object.keys(o).forEach(u=>{(!r||r.indexOf(u)===-1)&&(l[u]=o[u])}),e.push(l);const c=o.children||[];c.length>0&&(l._hasChildren=!0,Cg(e,l._id,c))}},Sg=(e,t)=>{const n=[];return Cg(n,"0",e,t),n},xg=(e,t,n,r)=>{t=t||[];for(let a=0,i=t.length;a<i;a++){const o=t[a],l={value:o[n],label:o[r]};e.push(l);const c=o.children||[];c.length>0&&(l.children=[],xg(l.children,c,n,r))}},ZS=(e,t,n)=>{const r=[];return xg(r,e,t||"value",n||"label"),r},Eg=(e,t,n,r="",a)=>{t=t||[];for(let i=0,o=t.length;i<o;i++){const l=t[i],c=n(l),u=r?`${r}.${c}`:c,d=l.children||[];if(d.length>0)Eg(e,d,n,u,a);else{const f={};Object.keys(l).forEach(h=>{(!a||a.indexOf(h)===-1)&&(f[h]=l[h])}),f.label=u,e.push(f)}}},kg=(e,t,n)=>{const r=[];return Eg(r,e,t,"",n),r},ws=e=>["j-autocomplete","j-checkbox","j-count","j-cascader-select","j-date","j-guid","j-input","j-number","j-now-time","j-radio","j-rate","j-textarea","j-tree-select","j-time","j-select","j-switch","j-slider-captcha","j-slider","j-barcode"].includes(e)||e.indexOf("j-input")!=-1,Tg=e=>["j-input","j-textarea","j-select","j-radio","j-checkbox","j-switch","j-number","j-cascader-select","j-autocomplete","j-rate","j-slider"].includes(e)||e.indexOf("j-input")!=-1,In=e=>{const t={...e.config||{}};if(e.getCompConfig){const n=e.getCompConfig({config:t,formData:e.formData,row:e.row,getTableData:e.getTableData,pRowData:e.pRowData})||{};for(const r in n)t[r]=n[r];return t}return t},bs=e=>e.getCompType?e.getCompType({config:e.config,formData:e.formData,row:e.row,getTableData:e.getTableData,pRowData:e.pRowData}):e.type,Rg=(e,t,n)=>{const r=In(n),a=bs({...n,config:r}),i={label:e,config:r,type:a};if(a==="j-autocomplete")return i;if(r&&r.options)if(e?.split){const o=e.split(","),l=Sg(r.options);i.label=o.map(c=>l.find(u=>u.value===c)?.label).join(a==="j-cascader-select"?"/":",")}else i.label=r.options.find(o=>o.value===e)?.label;else t&&(i.label=t({value:e,type:a,config:r,row:n.row}));return i},QS="YYYY-MM-DD HH:mm:ss",ex="YYYY-MM-DD";function Cs(e,t=QS){return e==null||e===""?"":(0,gs.default)(e).format(t)}function Jo(e,t=ex){return e==null||e===""?"":(0,gs.default)(e).format(t)}var tx=e=>{let t;if(e instanceof Date)t=e;else if(typeof e=="string"){if(t=new Date(e),isNaN(t))throw new Error("Invalid date string")}else if(e===void 0)t=new Date;else throw new TypeError("dateParam must be a Date object or a date string");return"日一二三四五六".charAt(t.getDay())};function Mg(e){const t="j-loading-spin",n=document.querySelector(`.${t}`);if(e){if(!n){document.body.style.overflow="hidden";const r=new DocumentFragment,a=document.createElement("div");a.className=t;const i=document.createElement("span");i.className="j-loading-spin-dot";for(let o=0;o<4;o++){const l=document.createElement("i");i.appendChild(l)}a.appendChild(i),r.appendChild(a),document.body.appendChild(r)}}else n&&n.parentNode&&(document.body.style.overflow="",n.parentNode.removeChild(n))}var nx=(()=>{let e=null,t=0;return n=>{n?(t++,e&&clearTimeout(e),Mg(!0),e=null):(t=Math.max(0,t-1),t===0&&(e&&clearTimeout(e),e=setTimeout(()=>{Mg(!1),e=null},400)))}})();function na(e){nx(e)}var rx=wn(((e,t)=>{t.exports={}})),On=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r():typeof define=="function"&&define.amd?define([],r):n.CryptoJS=r()})(e,function(){var n=n||(function(r,a){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof require=="function")try{i=rx()}catch{}var o=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||(function(){function y(){}return function(w){var C;return y.prototype=w,C=new y,y.prototype=null,C}})(),c={},u=c.lib={},d=u.Base=(function(){return{extend:function(y){var w=l(this);return y&&w.mixIn(y),(!w.hasOwnProperty("init")||this.init===w.init)&&(w.init=function(){w.$super.init.apply(this,arguments)}),w.init.prototype=w,w.$super=this,w},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var w in y)y.hasOwnProperty(w)&&(this[w]=y[w]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),f=u.WordArray=d.extend({init:function(y,w){y=this.words=y||[],w!=a?this.sigBytes=w:this.sigBytes=y.length*4},toString:function(y){return(y||p).stringify(this)},concat:function(y){var w=this.words,C=y.words,S=this.sigBytes,b=y.sigBytes;if(this.clamp(),S%4)for(var x=0;x<b;x++){var E=C[x>>>2]>>>24-x%4*8&255;w[S+x>>>2]|=E<<24-(S+x)%4*8}else for(var k=0;k<b;k+=4)w[S+k>>>2]=C[k>>>2];return this.sigBytes+=b,this},clamp:function(){var y=this.words,w=this.sigBytes;y[w>>>2]&=4294967295<<32-w%4*8,y.length=r.ceil(w/4)},clone:function(){var y=d.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var w=[],C=0;C<y;C+=4)w.push(o());return new f.init(w,y)}}),h=c.enc={},p=h.Hex={stringify:function(y){for(var w=y.words,C=y.sigBytes,S=[],b=0;b<C;b++){var x=w[b>>>2]>>>24-b%4*8&255;S.push((x>>>4).toString(16)),S.push((x&15).toString(16))}return S.join("")},parse:function(y){for(var w=y.length,C=[],S=0;S<w;S+=2)C[S>>>3]|=parseInt(y.substr(S,2),16)<<24-S%8*4;return new f.init(C,w/2)}},g=h.Latin1={stringify:function(y){for(var w=y.words,C=y.sigBytes,S=[],b=0;b<C;b++){var x=w[b>>>2]>>>24-b%4*8&255;S.push(String.fromCharCode(x))}return S.join("")},parse:function(y){for(var w=y.length,C=[],S=0;S<w;S++)C[S>>>2]|=(y.charCodeAt(S)&255)<<24-S%4*8;return new f.init(C,w)}},v=h.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=v.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var w,C=this._data,S=C.words,b=C.sigBytes,x=this.blockSize,E=b/(x*4);y?E=r.ceil(E):E=r.max((E|0)-this._minBufferSize,0);var k=E*x,T=r.min(k*4,b);if(k){for(var R=0;R<k;R+=x)this._doProcessBlock(S,R);w=S.splice(0,k),C.sigBytes-=T}return new f.init(w,T)},clone:function(){var y=d.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){return y&&this._append(y),this._doFinalize()},blockSize:16,_createHelper:function(y){return function(w,C){return new y.init(C).finalize(w)}},_createHmacHelper:function(y){return function(w,C){return new _.HMAC.init(y,C).finalize(w)}}});var _=c.algo={};return c})(Math);return n})})),Bg=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return(function(){var r=n,a=r.lib.WordArray,i=r.enc;i.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,d=this._map;l.clamp();for(var f=[],h=0;h<u;h+=3)for(var p=c[h>>>2]>>>24-h%4*8&255,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,v=c[h+2>>>2]>>>24-(h+2)%4*8&255,m=p<<16|g<<8|v,_=0;_<4&&h+_*.75<u;_++)f.push(d.charAt(m>>>6*(3-_)&63));var y=d.charAt(64);if(y)for(;f.length%4;)f.push(y);return f.join("")},parse:function(l){var c=l.length,u=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f<u.length;f++)d[u.charCodeAt(f)]=f}var h=u.charAt(64);if(h){var p=l.indexOf(h);p!==-1&&(c=p)}return o(l,c,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(l,c,u){for(var d=[],f=0,h=0;h<c;h++)if(h%4){var p=u[l.charCodeAt(h-1)]<<h%4*2|u[l.charCodeAt(h)]>>>6-h%4*2;d[f>>>2]|=p<<24-f%4*8,f++}return a.create(d,f)}})(),n.enc.Base64})})),Dg=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return(function(r){var a=n,i=a.lib,o=i.WordArray,l=i.Hasher,c=a.algo,u=[];(function(){for(var v=0;v<64;v++)u[v]=r.abs(r.sin(v+1))*4294967296|0})();var d=c.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,m){for(var _=0;_<16;_++){var y=m+_,w=v[y];v[y]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var C=this._hash.words,S=v[m+0],b=v[m+1],x=v[m+2],E=v[m+3],k=v[m+4],T=v[m+5],R=v[m+6],D=v[m+7],A=v[m+8],L=v[m+9],N=v[m+10],M=v[m+11],I=v[m+12],$=v[m+13],ee=v[m+14],oe=v[m+15],j=C[0],U=C[1],H=C[2],B=C[3];j=f(j,U,H,B,S,7,u[0]),B=f(B,j,U,H,b,12,u[1]),H=f(H,B,j,U,x,17,u[2]),U=f(U,H,B,j,E,22,u[3]),j=f(j,U,H,B,k,7,u[4]),B=f(B,j,U,H,T,12,u[5]),H=f(H,B,j,U,R,17,u[6]),U=f(U,H,B,j,D,22,u[7]),j=f(j,U,H,B,A,7,u[8]),B=f(B,j,U,H,L,12,u[9]),H=f(H,B,j,U,N,17,u[10]),U=f(U,H,B,j,M,22,u[11]),j=f(j,U,H,B,I,7,u[12]),B=f(B,j,U,H,$,12,u[13]),H=f(H,B,j,U,ee,17,u[14]),U=f(U,H,B,j,oe,22,u[15]),j=h(j,U,H,B,b,5,u[16]),B=h(B,j,U,H,R,9,u[17]),H=h(H,B,j,U,M,14,u[18]),U=h(U,H,B,j,S,20,u[19]),j=h(j,U,H,B,T,5,u[20]),B=h(B,j,U,H,N,9,u[21]),H=h(H,B,j,U,oe,14,u[22]),U=h(U,H,B,j,k,20,u[23]),j=h(j,U,H,B,L,5,u[24]),B=h(B,j,U,H,ee,9,u[25]),H=h(H,B,j,U,E,14,u[26]),U=h(U,H,B,j,A,20,u[27]),j=h(j,U,H,B,$,5,u[28]),B=h(B,j,U,H,x,9,u[29]),H=h(H,B,j,U,D,14,u[30]),U=h(U,H,B,j,I,20,u[31]),j=p(j,U,H,B,T,4,u[32]),B=p(B,j,U,H,A,11,u[33]),H=p(H,B,j,U,M,16,u[34]),U=p(U,H,B,j,ee,23,u[35]),j=p(j,U,H,B,b,4,u[36]),B=p(B,j,U,H,k,11,u[37]),H=p(H,B,j,U,D,16,u[38]),U=p(U,H,B,j,N,23,u[39]),j=p(j,U,H,B,$,4,u[40]),B=p(B,j,U,H,S,11,u[41]),H=p(H,B,j,U,E,16,u[42]),U=p(U,H,B,j,R,23,u[43]),j=p(j,U,H,B,L,4,u[44]),B=p(B,j,U,H,I,11,u[45]),H=p(H,B,j,U,oe,16,u[46]),U=p(U,H,B,j,x,23,u[47]),j=g(j,U,H,B,S,6,u[48]),B=g(B,j,U,H,D,10,u[49]),H=g(H,B,j,U,ee,15,u[50]),U=g(U,H,B,j,T,21,u[51]),j=g(j,U,H,B,I,6,u[52]),B=g(B,j,U,H,E,10,u[53]),H=g(H,B,j,U,N,15,u[54]),U=g(U,H,B,j,b,21,u[55]),j=g(j,U,H,B,A,6,u[56]),B=g(B,j,U,H,oe,10,u[57]),H=g(H,B,j,U,R,15,u[58]),U=g(U,H,B,j,$,21,u[59]),j=g(j,U,H,B,k,6,u[60]),B=g(B,j,U,H,M,10,u[61]),H=g(H,B,j,U,x,15,u[62]),U=g(U,H,B,j,L,21,u[63]),C[0]=C[0]+j|0,C[1]=C[1]+U|0,C[2]=C[2]+H|0,C[3]=C[3]+B|0},_doFinalize:function(){var v=this._data,m=v.words,_=this._nDataBytes*8,y=v.sigBytes*8;m[y>>>5]|=128<<24-y%32;var w=r.floor(_/4294967296),C=_;m[(y+64>>>9<<4)+15]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,m[(y+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,v.sigBytes=(m.length+1)*4,this._process();for(var S=this._hash,b=S.words,x=0;x<4;x++){var E=b[x];b[x]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return S},clone:function(){var v=l.clone.call(this);return v._hash=this._hash.clone(),v}});function f(v,m,_,y,w,C,S){var b=v+(m&_|~m&y)+w+S;return(b<<C|b>>>32-C)+m}function h(v,m,_,y,w,C,S){var b=v+(m&y|_&~y)+w+S;return(b<<C|b>>>32-C)+m}function p(v,m,_,y,w,C,S){var b=v+(m^_^y)+w+S;return(b<<C|b>>>32-C)+m}function g(v,m,_,y,w,C,S){var b=v+(_^(m|~y))+w+S;return(b<<C|b>>>32-C)+m}a.MD5=l._createHelper(d),a.HmacMD5=l._createHmacHelper(d)})(Math),n.MD5})})),ax=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return(function(){var r=n,a=r.lib,i=a.WordArray,o=a.Hasher,l=r.algo,c=[],u=l.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,f){for(var h=this._hash.words,p=h[0],g=h[1],v=h[2],m=h[3],_=h[4],y=0;y<80;y++){if(y<16)c[y]=d[f+y]|0;else{var w=c[y-3]^c[y-8]^c[y-14]^c[y-16];c[y]=w<<1|w>>>31}var C=(p<<5|p>>>27)+_+c[y];y<20?C+=(g&v|~g&m)+1518500249:y<40?C+=(g^v^m)+1859775393:y<60?C+=(g&v|g&m|v&m)-1894007588:C+=(g^v^m)-899497514,_=m,m=v,v=g<<30|g>>>2,g=p,p=C}h[0]=h[0]+p|0,h[1]=h[1]+g|0,h[2]=h[2]+v|0,h[3]=h[3]+m|0,h[4]=h[4]+_|0},_doFinalize:function(){var d=this._data,f=d.words,h=this._nDataBytes*8,p=d.sigBytes*8;return f[p>>>5]|=128<<24-p%32,f[(p+64>>>9<<4)+14]=Math.floor(h/4294967296),f[(p+64>>>9<<4)+15]=h,d.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});r.SHA1=o._createHelper(u),r.HmacSHA1=o._createHmacHelper(u)})(),n.SHA1})})),ix=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){(function(){var r=n,a=r.lib.Base,i=r.enc.Utf8,o=r.algo;o.HMAC=a.extend({init:function(l,c){l=this._hasher=new l.init,typeof c=="string"&&(c=i.parse(c));var u=l.blockSize,d=u*4;c.sigBytes>d&&(c=l.finalize(c)),c.clamp();for(var f=this._oKey=c.clone(),h=this._iKey=c.clone(),p=f.words,g=h.words,v=0;v<u;v++)p[v]^=1549556828,g[v]^=909522486;f.sigBytes=h.sigBytes=d,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var c=this._hasher,u=c.finalize(l);return c.reset(),c.finalize(this._oKey.clone().concat(u))}})})()})})),Ag=wn(((e,t)=>{(function(n,r,a){typeof e=="object"?t.exports=e=r(On(),ax(),ix()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],r):r(n.CryptoJS)})(e,function(n){return(function(){var r=n,a=r.lib,i=a.Base,o=a.WordArray,l=r.algo,c=l.MD5,u=l.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:c,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,f){for(var h,p=this.cfg,g=p.hasher.create(),v=o.create(),m=v.words,_=p.keySize,y=p.iterations;m.length<_;){h&&g.update(h),h=g.update(d).finalize(f),g.reset();for(var w=1;w<y;w++)h=g.finalize(h),g.reset();v.concat(h)}return v.sigBytes=_*4,v}});r.EvpKDF=function(d,f,h){return u.create(h).compute(d,f)}})(),n.EvpKDF})})),Pg=wn(((e,t)=>{(function(n,r,a){typeof e=="object"?t.exports=e=r(On(),Ag()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],r):r(n.CryptoJS)})(e,function(n){n.lib.Cipher||(function(r){var a=n,i=a.lib,o=i.Base,l=i.WordArray,c=i.BufferedBlockAlgorithm,u=a.enc;u.Utf8;var d=u.Base64,f=a.algo.EvpKDF,h=i.Cipher=c.extend({cfg:o.extend(),createEncryptor:function(k,T){return this.create(this._ENC_XFORM_MODE,k,T)},createDecryptor:function(k,T){return this.create(this._DEC_XFORM_MODE,k,T)},init:function(k,T,R){this.cfg=this.cfg.extend(R),this._xformMode=k,this._key=T,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(k){return this._append(k),this._process()},finalize:function(k){return k&&this._append(k),this._doFinalize()},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function k(T){return typeof T=="string"?E:S}return function(T){return{encrypt:function(R,D,A){return k(D).encrypt(T,R,D,A)},decrypt:function(R,D,A){return k(D).decrypt(T,R,D,A)}}}})()});i.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var p=a.mode={},g=i.BlockCipherMode=o.extend({createEncryptor:function(k,T){return this.Encryptor.create(k,T)},createDecryptor:function(k,T){return this.Decryptor.create(k,T)},init:function(k,T){this._cipher=k,this._iv=T}}),v=p.CBC=(function(){var k=g.extend();k.Encryptor=k.extend({processBlock:function(R,D){var A=this._cipher,L=A.blockSize;T.call(this,R,D,L),A.encryptBlock(R,D),this._prevBlock=R.slice(D,D+L)}}),k.Decryptor=k.extend({processBlock:function(R,D){var A=this._cipher,L=A.blockSize,N=R.slice(D,D+L);A.decryptBlock(R,D),T.call(this,R,D,L),this._prevBlock=N}});function T(R,D,A){var L,N=this._iv;N?(L=N,this._iv=r):L=this._prevBlock;for(var M=0;M<A;M++)R[D+M]^=L[M]}return k})(),m=a.pad={},_=m.Pkcs7={pad:function(k,T){for(var R=T*4,D=R-k.sigBytes%R,A=D<<24|D<<16|D<<8|D,L=[],N=0;N<D;N+=4)L.push(A);var M=l.create(L,D);k.concat(M)},unpad:function(k){var T=k.words[k.sigBytes-1>>>2]&255;k.sigBytes-=T}};i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:v,padding:_}),reset:function(){var k;h.reset.call(this);var T=this.cfg,R=T.iv,D=T.mode;this._xformMode==this._ENC_XFORM_MODE?k=D.createEncryptor:(k=D.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==k?this._mode.init(this,R&&R.words):(this._mode=k.call(D,this,R&&R.words),this._mode.__creator=k)},_doProcessBlock:function(k,T){this._mode.processBlock(k,T)},_doFinalize:function(){var k,T=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(T.pad(this._data,this.blockSize),k=this._process(!0)):(k=this._process(!0),T.unpad(k)),k},blockSize:128/32});var y=i.CipherParams=o.extend({init:function(k){this.mixIn(k)},toString:function(k){return(k||this.formatter).stringify(this)}}),w=a.format={},C=w.OpenSSL={stringify:function(k){var T,R=k.ciphertext,D=k.salt;return D?T=l.create([1398893684,1701076831]).concat(D).concat(R):T=R,T.toString(d)},parse:function(k){var T,R=d.parse(k),D=R.words;return D[0]==1398893684&&D[1]==1701076831&&(T=l.create(D.slice(2,4)),D.splice(0,4),R.sigBytes-=16),y.create({ciphertext:R,salt:T})}},S=i.SerializableCipher=o.extend({cfg:o.extend({format:C}),encrypt:function(k,T,R,D){D=this.cfg.extend(D);var A=k.createEncryptor(R,D),L=A.finalize(T),N=A.cfg;return y.create({ciphertext:L,key:R,iv:N.iv,algorithm:k,mode:N.mode,padding:N.padding,blockSize:k.blockSize,formatter:D.format})},decrypt:function(k,T,R,D){return D=this.cfg.extend(D),T=this._parse(T,D.format),k.createDecryptor(R,D).finalize(T.ciphertext)},_parse:function(k,T){return typeof k=="string"?T.parse(k,this):k}}),b=a.kdf={},x=b.OpenSSL={execute:function(k,T,R,D,A){if(D||(D=l.random(64/8)),A)var L=f.create({keySize:T+R,hasher:A}).compute(k,D);else var L=f.create({keySize:T+R}).compute(k,D);var N=l.create(L.words.slice(T),R*4);return L.sigBytes=T*4,y.create({key:L,iv:N,salt:D})}},E=i.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:x}),encrypt:function(k,T,R,D){D=this.cfg.extend(D);var A=D.kdf.execute(R,k.keySize,k.ivSize,D.salt,D.hasher);D.iv=A.iv;var L=S.encrypt.call(this,k,T,A.key,D);return L.mixIn(A),L},decrypt:function(k,T,R,D){D=this.cfg.extend(D),T=this._parse(T,D.format);var A=D.kdf.execute(R,k.keySize,k.ivSize,T.salt,D.hasher);return D.iv=A.iv,S.decrypt.call(this,k,T,A.key,D)}})})()})})),ox=wn(((e,t)=>{(function(n,r,a){typeof e=="object"?t.exports=e=r(On(),Bg(),Dg(),Ag(),Pg()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(n.CryptoJS)})(e,function(n){return(function(){var r=n,a=r.lib.BlockCipher,i=r.algo,o=[],l=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],v=[];(function(){for(var y=[],w=0;w<256;w++)w<128?y[w]=w<<1:y[w]=w<<1^283;for(var C=0,S=0,w=0;w<256;w++){var b=S^S<<1^S<<2^S<<3^S<<4;b=b>>>8^b&255^99,o[C]=b,l[b]=C;var x=y[C],E=y[x],k=y[E],T=y[b]*257^b*16843008;c[C]=T<<24|T>>>8,u[C]=T<<16|T>>>16,d[C]=T<<8|T>>>24,f[C]=T;var T=k*16843009^E*65537^x*257^C*16843008;h[b]=T<<24|T>>>8,p[b]=T<<16|T>>>16,g[b]=T<<8|T>>>24,v[b]=T,C?(C=x^y[y[y[k^x]]],S^=y[y[S]]):C=S=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],_=i.AES=a.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var w=this._keyPriorReset=this._key,C=w.words,S=w.sigBytes/4,b=((this._nRounds=S+6)+1)*4,x=this._keySchedule=[],E=0;E<b;E++)E<S?x[E]=C[E]:(y=x[E-1],E%S?S>6&&E%S==4&&(y=o[y>>>24]<<24|o[y>>>16&255]<<16|o[y>>>8&255]<<8|o[y&255]):(y=y<<8|y>>>24,y=o[y>>>24]<<24|o[y>>>16&255]<<16|o[y>>>8&255]<<8|o[y&255],y^=m[E/S|0]<<24),x[E]=x[E-S]^y);for(var k=this._invKeySchedule=[],T=0;T<b;T++){var E=b-T;if(T%4)var y=x[E];else var y=x[E-4];T<4||E<=4?k[T]=y:k[T]=h[o[y>>>24]]^p[o[y>>>16&255]]^g[o[y>>>8&255]]^v[o[y&255]]}}},encryptBlock:function(y,w){this._doCryptBlock(y,w,this._keySchedule,c,u,d,f,o)},decryptBlock:function(y,w){var C=y[w+1];y[w+1]=y[w+3],y[w+3]=C,this._doCryptBlock(y,w,this._invKeySchedule,h,p,g,v,l);var C=y[w+1];y[w+1]=y[w+3],y[w+3]=C},_doCryptBlock:function(y,w,C,S,b,x,E,k){for(var T=this._nRounds,R=y[w]^C[0],D=y[w+1]^C[1],A=y[w+2]^C[2],L=y[w+3]^C[3],N=4,M=1;M<T;M++){var I=S[R>>>24]^b[D>>>16&255]^x[A>>>8&255]^E[L&255]^C[N++],$=S[D>>>24]^b[A>>>16&255]^x[L>>>8&255]^E[R&255]^C[N++],ee=S[A>>>24]^b[L>>>16&255]^x[R>>>8&255]^E[D&255]^C[N++],oe=S[L>>>24]^b[R>>>16&255]^x[D>>>8&255]^E[A&255]^C[N++];R=I,D=$,A=ee,L=oe}var I=(k[R>>>24]<<24|k[D>>>16&255]<<16|k[A>>>8&255]<<8|k[L&255])^C[N++],$=(k[D>>>24]<<24|k[A>>>16&255]<<16|k[L>>>8&255]<<8|k[R&255])^C[N++],ee=(k[A>>>24]<<24|k[L>>>16&255]<<16|k[R>>>8&255]<<8|k[D&255])^C[N++],oe=(k[L>>>24]<<24|k[R>>>16&255]<<16|k[D>>>8&255]<<8|k[A&255])^C[N++];y[w]=I,y[w+1]=$,y[w+2]=ee,y[w+3]=oe},keySize:256/32});r.AES=a._createHelper(_)})(),n.AES})})),lx=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return n.enc.Utf8})})),sx=wn(((e,t)=>{(function(n,r,a){typeof e=="object"?t.exports=e=r(On(),Pg()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],r):r(n.CryptoJS)})(e,function(n){return n.pad.Pkcs7})})),cx=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return(function(r){var a=n,i=a.lib,o=i.WordArray,l=i.Hasher,c=a.algo,u=[],d=[];(function(){function p(_){for(var y=r.sqrt(_),w=2;w<=y;w++)if(!(_%w))return!1;return!0}function g(_){return(_-(_|0))*4294967296|0}for(var v=2,m=0;m<64;)p(v)&&(m<8&&(u[m]=g(r.pow(v,1/2))),d[m]=g(r.pow(v,1/3)),m++),v++})();var f=[],h=c.SHA256=l.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(p,g){for(var v=this._hash.words,m=v[0],_=v[1],y=v[2],w=v[3],C=v[4],S=v[5],b=v[6],x=v[7],E=0;E<64;E++){if(E<16)f[E]=p[g+E]|0;else{var k=f[E-15],T=(k<<25|k>>>7)^(k<<14|k>>>18)^k>>>3,R=f[E-2],D=(R<<15|R>>>17)^(R<<13|R>>>19)^R>>>10;f[E]=T+f[E-7]+D+f[E-16]}var A=C&S^~C&b,L=m&_^m&y^_&y,N=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),M=(C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25),I=x+M+A+d[E]+f[E],$=N+L;x=b,b=S,S=C,C=w+I|0,w=y,y=_,_=m,m=I+$|0}v[0]=v[0]+m|0,v[1]=v[1]+_|0,v[2]=v[2]+y|0,v[3]=v[3]+w|0,v[4]=v[4]+C|0,v[5]=v[5]+S|0,v[6]=v[6]+b|0,v[7]=v[7]+x|0},_doFinalize:function(){var p=this._data,g=p.words,v=this._nDataBytes*8,m=p.sigBytes*8;return g[m>>>5]|=128<<24-m%32,g[(m+64>>>9<<4)+14]=r.floor(v/4294967296),g[(m+64>>>9<<4)+15]=v,p.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var p=l.clone.call(this);return p._hash=this._hash.clone(),p}});a.SHA256=l._createHelper(h),a.HmacSHA256=l._createHmacHelper(h)})(Math),n.SHA256})})),ux=wn(((e,t)=>{(function(n,r){typeof e=="object"?t.exports=e=r(On()):typeof define=="function"&&define.amd?define(["./core"],r):r(n.CryptoJS)})(e,function(n){return(function(r){var a=n,i=a.lib,o=i.Base,l=i.WordArray,c=a.x64={};c.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),c.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=r?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,f=[],h=0;h<d;h++){var p=u[h];f.push(p.high),f.push(p.low)}return l.create(f,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),f=d.length,h=0;h<f;h++)d[h]=d[h].clone();return u}})})(),n})})),dx=wn(((e,t)=>{(function(n,r,a){typeof e=="object"?t.exports=e=r(On(),ux()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],r):r(n.CryptoJS)})(e,function(n){return(function(){var r=n,a=r.lib.Hasher,i=r.x64,o=i.Word,l=i.WordArray,c=r.algo;function u(){return o.create.apply(o,arguments)}var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var p=0;p<80;p++)f[p]=u()})();var h=c.SHA512=a.extend({_doReset:function(){this._hash=new l.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(p,g){for(var v=this._hash.words,m=v[0],_=v[1],y=v[2],w=v[3],C=v[4],S=v[5],b=v[6],x=v[7],E=m.high,k=m.low,T=_.high,R=_.low,D=y.high,A=y.low,L=w.high,N=w.low,M=C.high,I=C.low,$=S.high,ee=S.low,oe=b.high,j=b.low,U=x.high,H=x.low,B=E,W=k,X=T,K=R,ne=D,he=A,O=L,Z=N,ue=M,se=I,we=$,Te=ee,Ee=oe,Ye=j,_t=U,$e=H,Re=0;Re<80;Re++){var Oe,Ne,nt=f[Re];if(Re<16)Ne=nt.high=p[g+Re*2]|0,Oe=nt.low=p[g+Re*2+1]|0;else{var Qt=f[Re-15],J=Qt.high,de=Qt.low,re=(J>>>1|de<<31)^(J>>>8|de<<24)^J>>>7,ie=(de>>>1|J<<31)^(de>>>8|J<<24)^(de>>>7|J<<25),fe=f[Re-2],ke=fe.high,Le=fe.low,Ie=(ke>>>19|Le<<13)^(ke<<3|Le>>>29)^ke>>>6,Tt=(Le>>>19|ke<<13)^(Le<<3|ke>>>29)^(Le>>>6|ke<<26),rt=f[Re-7],Rr=rt.high,Mr=rt.low,Pa=f[Re-16],Uo=Pa.high,xe=Pa.low;Oe=ie+Mr,Ne=re+Rr+(Oe>>>0<ie>>>0?1:0),Oe=Oe+Tt,Ne=Ne+Ie+(Oe>>>0<Tt>>>0?1:0),Oe=Oe+xe,Ne=Ne+Uo+(Oe>>>0<xe>>>0?1:0),nt.high=Ne,nt.low=Oe}var Ae=ue&we^~ue&Ee,at=se&Te^~se&Ye,Ft=B&X^B&ne^X&ne,_e=W&K^W&he^K&he,St=(B>>>28|W<<4)^(B<<30|W>>>2)^(B<<25|W>>>7),fn=(W>>>28|B<<4)^(W<<30|B>>>2)^(W<<25|B>>>7),Gt=(ue>>>14|se<<18)^(ue>>>18|se<<14)^(ue<<23|se>>>9),qt=(se>>>14|ue<<18)^(se>>>18|ue<<14)^(se<<23|ue>>>9),Nn=d[Re],Ue=Nn.high,ea=Nn.low,Rt=$e+qt,xt=_t+Gt+(Rt>>>0<$e>>>0?1:0),Rt=Rt+at,xt=xt+Ae+(Rt>>>0<at>>>0?1:0),Rt=Rt+ea,xt=xt+Ue+(Rt>>>0<ea>>>0?1:0),Rt=Rt+Oe,xt=xt+Ne+(Rt>>>0<Oe>>>0?1:0),an=fn+_e,Jn=St+Ft+(an>>>0<fn>>>0?1:0);_t=Ee,$e=Ye,Ee=we,Ye=Te,we=ue,Te=se,se=Z+Rt|0,ue=O+xt+(se>>>0<Z>>>0?1:0)|0,O=ne,Z=he,ne=X,he=K,X=B,K=W,W=Rt+an|0,B=xt+Jn+(W>>>0<Rt>>>0?1:0)|0}k=m.low=k+W,m.high=E+B+(k>>>0<W>>>0?1:0),R=_.low=R+K,_.high=T+X+(R>>>0<K>>>0?1:0),A=y.low=A+he,y.high=D+ne+(A>>>0<he>>>0?1:0),N=w.low=N+Z,w.high=L+O+(N>>>0<Z>>>0?1:0),I=C.low=I+se,C.high=M+ue+(I>>>0<se>>>0?1:0),ee=S.low=ee+Te,S.high=$+we+(ee>>>0<Te>>>0?1:0),j=b.low=j+Ye,b.high=oe+Ee+(j>>>0<Ye>>>0?1:0),H=x.low=H+$e,x.high=U+_t+(H>>>0<$e>>>0?1:0)},_doFinalize:function(){var p=this._data,g=p.words,v=this._nDataBytes*8,m=p.sigBytes*8;return g[m>>>5]|=128<<24-m%32,g[(m+128>>>10<<5)+30]=Math.floor(v/4294967296),g[(m+128>>>10<<5)+31]=v,p.sigBytes=g.length*4,this._process(),this._hash.toX32()},clone:function(){var p=a.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});r.SHA512=a._createHelper(h),r.HmacSHA512=a._createHmacHelper(h)})(),n.SHA512})})),fx=en(ox(),1),Ng=en(lx(),1),hx=en(sx(),1),Lg=en(Bg(),1),px=en(Dg(),1),gx=en(cx(),1),vx=en(dx(),1),{decrypt:Ig,encrypt:mx}=fx.default,Ss=Ng.default,Og=Ng.default.parse,Vg=(e,t=32)=>{const{length:n}=e;if(n<t){for(let r=0,a=t-n;r<a;r++)e+="0";return e}return n>t?e.substring(0,t):e},yx=class{key;iv;constructor({key:e,iv:t}){this.key=Og(Vg(e)),this.iv=Og(Vg(t||"1234567890000000",16))}get getOptions(){return{padding:hx.default,iv:this.iv}}encrypt(e){return mx(e,this.key,this.getOptions).toString()}decrypt(e){return Ig(e,this.key,this.getOptions).toString(Ss)}},_x=class ds{static instance;constructor(){}static getInstance(){return ds.instance||(ds.instance=new ds),ds.instance}encrypt(t){return Ss.parse(t).toString(Lg.default)}decrypt(t){return Lg.default.parse(t).toString(Ss)}},bx=class fs{static instance;constructor(){}static getInstance(){return fs.instance||(fs.instance=new fs),fs.instance}hash(t){return(0,px.default)(t).toString()}},Cx=class hs{static instance;constructor(){}static getInstance(){return hs.instance||(hs.instance=new hs),hs.instance}hash(t){return(0,gx.default)(t).toString()}},Sx=class ps{static instance;constructor(){}static getInstance(){return ps.instance||(ps.instance=new ps),ps.instance}hash(t){return(0,vx.default)(t).toString()}},zg=class{static createAesEncryption(e){return new yx(e)}static createBase64Encryption(){return _x.getInstance()}},xx=class{static createMD5Hashing(){return bx.getInstance()}static createSHA256Hashing(){return Cx.getInstance()}static createSHA512Hashing(){return Sx.getInstance()}},Ex=(e,t)=>Ig(e,t).toString(Ss);function Hg(e,t){function n(){(0,s.nextTick)(()=>{e=(0,s.unref)(e),e&&Yu.default.create(e,{animation:100,delay:400,delayOnTouchOnly:!0,...t})})}return{initSortable:n}}var Fg=async e=>new Promise((t,n)=>{if(typeof window.BMap<"u"){t(window.BMap);return}window.onBMapCallback=function(){t(window.BMap)};const r=document.createElement("script");r.type="text/javascript",r.src=`https://api.map.baidu.com/api?v=3.0&ak=${e||"dPHQKHyFl1GmMBjGVbVCSs6GSrswTuPQ"}&callback=onBMapCallback`,r.onerror=n,document.head.appendChild(r)}),id=class{events=new Map;on(e,t){this.events.has(e)||this.events.set(e,new Set),this.events.get(e).add(t)}once(e,t){const n=(...r)=>{t(...r),this.off(e,n)};this.on(e,n)}emit(e,...t){const n=this.events.get(e);if(n)for(const r of n)return r(...t)}off(e,t){if(!t){this.events.delete(e);return}const n=this.events.get(e);n&&(n.delete(t),n.size===0&&this.events.delete(e))}clear(){this.events.clear()}},kx=new id,Ut={APP_PROVIDE:"jcode_app_provide",FORM_PROVIDE:"jcode_form_provide",TABLE_PROVIDE:"jcode_table_provide",COMP_PROVIDE:"jcode_comp_provide",MENU_PROVIDE:"jcode_menu_provide",H_MENU_PROVIDE:"jianda_h_menu_provide",AUTH_PAGE_PROVIDE:"jcode_auth_page_provide",LAYER_PROVIDE:"jcode_layer_provide",PAGE_PROVIDE:"jcode_page_provide"};function sr(e,t){return(0,s.inject)(e,t)}function cr(e,t){(0,s.provide)(e,t)}function vt(){return sr(Ut.APP_PROVIDE,{t:(e,...t)=>{if(!e)return"";if(typeof e!="string")return e;let n=e||"";return t.length>0&&t.forEach((r,a)=>{n=n.replace(new RegExp(`\\{${a}\\}`,"g"),r)}),n.replace(/\$.\[^\$\$]*\$/,"")},useFile:()=>({}),useData:()=>({getLabel:({value:e,config:t})=>{if(e==null||e==="")return"";if(t?.dataType==="options"){let n=[e];typeof e=="string"&&e.split&&(n=e.split(","));const r=(t.options||[]).filter(a=>n.includes(a[t.valueKey||"value"])).map(a=>a[t.labelKey||"label"]);return String(r)||e}return e},getObjectList:({value:e,config:t})=>{if(e==null||e==="")return[];if(t?.dataType==="options"){let n=[e];return typeof e=="string"&&e.split&&(n=e.split(",")),(t.options||[]).filter(r=>n.includes(r[t.valueKey||"value"]))||[]}return[]}})})}function Tx(e){cr(Ut.APP_PROVIDE,e)}function ra(){return sr(Ut.FORM_PROVIDE,{})}function od(e){cr(Ut.FORM_PROVIDE,e)}function xs(){return sr(Ut.TABLE_PROVIDE,{})}function Xo(e){cr(Ut.TABLE_PROVIDE,e)}function jg(){return sr(Ut.COMP_PROVIDE,{})}function ld(e){cr(Ut.COMP_PROVIDE,e)}function Vi(){return sr(Ut.MENU_PROVIDE,{})}function $g(e){cr(Ut.MENU_PROVIDE,e)}function Wg(){return sr(Ut.H_MENU_PROVIDE,{})}function Ug(e){cr(Ut.H_MENU_PROVIDE,e)}function Yg(){return sr(Ut.AUTH_PAGE_PROVIDE,{getPageName:()=>""})}function Gg(e){cr(Ut.AUTH_PAGE_PROVIDE,e)}function Rx(){return sr(Ut.LAYER_PROVIDE,{})}function qg(e){cr(Ut.LAYER_PROVIDE,e)}function Jg(){return sr(Ut.PAGE_PROVIDE,{})}function Xg(e){cr(Ut.PAGE_PROVIDE,e)}var Mx=(0,s.defineComponent)({name:"JDynamicLayer",__name:"dynamic-layer",setup(e,{expose:t}){const n=(0,s.ref)(),r=(0,s.ref)(600),a=(0,s.ref)(400),i=(0,s.ref)(!0),o=(0,s.ref)(!0),l=(0,s.ref)(!0),c=(0,s.ref)(""),u=(0,s.ref)([]),d=(0,s.ref)(!0),f=(0,s.ref)(),h=(0,s.shallowRef)(),p=(0,s.ref)(),{getPageName:g}=Yg(),v=()=>{const A=g();return A||(typeof h.value=="string"?h.value:"")},m=(0,s.ref)(!1),_=(0,s.ref)([]),y=async A=>{if(f.value?.validateSteps){na(!0);const L=f.value.validateSteps(A);return na(!1),L}return!0},w=()=>f.value?.beforeClose?f.value.beforeClose():!0;let C,S,b,x=0;const E=async A=>{if(f.value){if(x=0,f.value.getConfig){const L=f.value.getConfig();u.value=L.buttons||[],m.value=L.isStep,_.value=L.steps||[]}else u.value=[],m.value=!1,_.value=[];if(f.value.open)try{const{buttons:L}=await f.value.open(A,n.value,()=>{C&&C()})||{};if(L&&L.length>0){const N=[];N.push(...u.value),N.push(...L),u.value=N}}catch(L){n.value.close(),console.error(L)}n.value.hideLoading()}else{if(x>600){console.warn("表单组件加载超时"),n.value.hideLoading();return}x++,setTimeout(async()=>{await E(A)},100)}},k=A=>{h.value=A?.name,r.value=A?.width||600,a.value=A?.height||400,i.value=A?.hasBtns!==!1,o.value=A?.hasSaveBtn!==!1,l.value=A?.hasHeader!==!1,A?.destroyOnClose!==!1&&(d.value=!0),p.value=A?.config||{},c.value=A?.btnText||"保存",C=A?.afterOk||null,S=A?.afterClose||null,b=A?.afterCancel||null,n.value.open(A.title,A.type,A.subtitle),(0,s.nextTick)(async()=>{n.value.showLoading("加载中"),await E(A.param||{})})},T=async()=>{if(f.value?.ok){na(!0);const A=await f.value.ok();A&&(n.value.close(),C&&await C(A)),na(!1)}},R=()=>{f.value?.closed&&f.value.closed(),S&&S()},D=()=>{b&&b()};return Gg({getPageName:v}),t({open:k}),(A,L)=>{const N=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createBlock)(N,{ref_key:"layerRef",ref:n,width:r.value,height:a.value,"before-close":w,"validate-steps":y,"is-step":m.value,steps:_.value,"has-btns":i.value,buttons:u.value,"btn-text":c.value,"destroy-on-close":d.value,"has-save-btn":o.value,"has-header":l.value,onOk:T,onClosed:R,onCancel:D},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(h.value),(0,s.mergeProps)({ref_key:"componentRef",ref:f},p.value),null,16))]),_:1},8,["width","height","is-step","steps","has-btns","buttons","btn-text","destroy-on-close","has-save-btn","has-header"])}}}),Kg=Mx,Bx=(e,t,n)=>{const r=document.createElement("div"),a=(0,s.createVNode)(Kg,{});t&&(a.appContext=t,n&&(a.appContext.provides=n)),(0,s.render)(a,r);const i=e.afterClose;e.afterClose=()=>{i&&i(),(0,s.render)(null,r)},a.component&&a.component.exposed&&a.component.exposed.open(e)};function La(){const e=(0,s.getCurrentInstance)(),t=e?.appContext,n=e?.provides;return{openLayer:a=>{Bx(a,t,n)}}}var Zg=be(Kg),Dx=(0,s.defineComponent)({name:"JButtons",__name:"index",props:{list:{type:Array||Object,default:()=>[]},size:{type:String,default:"default"},isLink:Boolean},setup(e){const t=e,n=(0,s.computed)(()=>{if(!Array.isArray(t.list)&&Object.keys(t.list).length>0)return t.list;const i={},o=Mn(t.list),l=o.length;for(let c=0;c<l;c++){const u=o[c];u.groupId=u.groupId||_s(),i[u.groupId]=i[u.groupId]||[],i[u.groupId].push(u)}return i}),{openLayer:r}=La(),a=i=>{i.config?.disabled||i.click&&i.click({openLayer:r})};return(i,o)=>{const l=(0,s.resolveComponent)("j-button"),c=(0,s.resolveComponent)("el-space"),u=(0,s.resolveComponent)("el-dropdown");return(0,s.openBlock)(),(0,s.createBlock)(c,{size:e.isLink?0:8},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(n.value,(d,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({key:f},{ref_for:!0},i.$attrs),[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(d,(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:p},[h.children?.length&&h.children?.length>0?((0,s.openBlock)(),(0,s.createBlock)(u,{key:0},{dropdown:(0,s.withCtx)(()=>[(0,s.createVNode)(c,{direction:"vertical",fill:!0},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(h.children||[],g=>((0,s.openBlock)(),(0,s.createBlock)(l,(0,s.mergeProps)({key:g.id},{ref_for:!0},g.config,{block:"",type:"text",label:g.label,size:e.size,onClick:(0,s.withModifiers)(v=>a(g),["stop"]),style:{"text-align":"left","justify-content":"flex-start"}}),null,16,["label","size","onClick"]))),128))]),_:2},1024)]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(l,(0,s.mergeProps)({ref_for:!0},h.config,{label:h.label,size:e.size,type:e.isLink?"link":h.config?.type,compact:!0,"last-compact-item":p===d.length-1,"first-compact-item":p===0,onClick:(0,s.withModifiers)(g=>a(h),["stop"])}),null,16,["label","size","type","last-compact-item","first-compact-item","onClick"])]),_:2},1024)):((0,s.openBlock)(),(0,s.createBlock)(l,(0,s.mergeProps)({key:1,ref_for:!0},h.config,{label:h.label,size:e.size,type:e.isLink?"link":h.config?.type,compact:!0,"last-compact-item":p===d.length-1,"first-compact-item":p===0,onClick:(0,s.withModifiers)(g=>a(h),["stop"])}),null,16,["label","size","type","last-compact-item","first-compact-item","onClick"]))],64))),128))],16))),128))]),_:1},8,["size"])}}}),Ax=Dx,Qg=be(Ax),Px=(0,s.defineComponent)({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},modelModifiers:{},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},wordLimitPosition:{default:"inside"},placeholder:{default:""},clearable:{type:Boolean,default:!1},clearIcon:{},formatter:{},parser:{},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},prefixIcon:{},suffixIcon:{},prepend:{},prependStyle:{default:()=>({})},append:{},appendStyle:{default:()=>({})},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},autocomplete:{default:"off"},name:{},readonly:{type:Boolean,default:!1},max:{},min:{},step:{},resize:{},autofocus:{type:Boolean,default:!1},form:{},ariaLabel:{},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})},label:{},inputmode:{},autoFocus:{type:Boolean}},emits:["update:modelValue","input","focus","blur","clear","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(),i=(0,s.computed)({get(){return n.modelValue},set(f){r("update:modelValue",f)}}),o=f=>{r("input",f)},l=f=>{r("focus",f)},c=f=>{r("blur",f)},u=()=>{r("clear")},d=f=>{r("change",f)};return(0,s.onMounted)(()=>{n.autoFocus&&!n.readonly&&a.value.focus()}),(f,h)=>{const p=(0,s.resolveComponent)("j-icon"),g=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createBlock)(g,(0,s.mergeProps)({ref_key:"inputRef",ref:a,modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=v=>i.value=v),type:e.type,"model-modifiers":e.modelModifiers,maxlength:e.maxlength,minlength:e.minlength,"show-word-limit":e.showWordLimit,"word-limit-position":e.wordLimitPosition,placeholder:e.placeholder,clearable:e.clearable,"clear-icon":e.clearIcon,formatter:e.formatter,parser:e.parser,"show-password":e.showPassword,disabled:e.disabled,size:e.size,rows:e.rows,autosize:e.autosize,autocomplete:e.autocomplete,name:e.name,readonly:e.readonly,max:e.max,min:e.min,step:e.step,resize:e.resize,autofocus:e.autofocus,form:e.form,"aria-label":e.ariaLabel,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle,label:e.label,inputmode:e.inputmode},f.$attrs,{onInput:o,onFocus:l,onBlur:c,onClear:u,onChange:d}),(0,s.createSlots)({_:2},[e.prefixIcon?{name:"prefix",fn:(0,s.withCtx)(()=>[(0,s.createVNode)(p,{icon:e.prefixIcon},null,8,["icon"])]),key:"0"}:void 0,e.suffixIcon?{name:"suffix",fn:(0,s.withCtx)(()=>[(0,s.createVNode)(p,{icon:e.suffixIcon},null,8,["icon"])]),key:"1"}:void 0,e.prepend?{name:"prepend",fn:(0,s.withCtx)(()=>[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(e.prependStyle)},(0,s.toDisplayString)(e.prepend),5)]),key:"2"}:void 0,e.append?{name:"append",fn:(0,s.withCtx)(()=>[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(e.appendStyle)},(0,s.toDisplayString)(e.append),5)]),key:"3"}:void 0]),1040,["modelValue","type","model-modifiers","maxlength","minlength","show-word-limit","word-limit-position","placeholder","clearable","clear-icon","formatter","parser","show-password","disabled","size","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","aria-label","tabindex","validate-event","input-style","label","inputmode"])}}}),Nx=Px,ev=be(Nx),Lx=(0,s.defineComponent)({name:"JDate",__name:"date",props:{modelValue:{},selectType:{default:"date"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},size:{default:"default"},placeholder:{default:""},startPlaceholder:{default:""},endPlaceholder:{default:""},format:{},rangeSeparator:{},defaultValue:{},defaultTime:{},shortcuts:{},disabledDate:{},teleported:{type:Boolean,default:!0},prefixIcon:{},clearIcon:{},id:{default:void 0}},emits:["update:modelValue","change","blur","focus","calendar-change","panel-change","visible-change"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o=(0,s.computed)({get(){return r.selectType?.indexOf("range")>-1?typeof r.modelValue=="string"?(console.log(r.modelValue,"props.modelValue"),r.modelValue?r.modelValue.split(","):["",""]):r.modelValue||["",""]:r.modelValue},set(v){if(r.selectType?.indexOf("range")>-1){if(v===null){a("update:modelValue","");return}if(Array.isArray(v)){const m=v.join(",");console.log(m,"strVal"),a("update:modelValue",m);return}}v!==void 0&&a("update:modelValue",v)}}),l=(0,s.computed)(()=>{if(r.format)return r.format;switch(r.selectType){case"date":case"dates":case"daterange":return"YYYY-MM-DD";case"datetime":case"datetimerange":return"YYYY-MM-DD HH:mm:ss";case"month":case"monthrange":return"YYYY-MM";case"year":return"YYYY";case"week":return"gggg[w]ww";default:return"YYYY-MM-DD"}}),c=(0,s.computed)(()=>r.selectType?.indexOf("range")>-1&&typeof r.id=="string"?[r.id+"-start",r.id+"-end"]:r.id||void 0),u=v=>{if(r.selectType?.indexOf("range")>-1){if(v===null){a("change","");return}if(Array.isArray(v)){a("change",v.join(","));return}}a("change",v)},d=v=>{a("blur",v)},f=v=>{a("focus",v)},h=v=>{a("calendar-change",v)},p=(v,m,_)=>{a("panel-change",v,m,_)},g=v=>{a("visible-change",v)};return t({ref:i}),(v,m)=>{const _=(0,s.resolveComponent)("el-date-picker");return(0,s.openBlock)(),(0,s.createBlock)(_,(0,s.mergeProps)({ref_key:"dateRef",ref:i},v.$attrs,{modelValue:o.value,"onUpdate:modelValue":m[0]||(m[0]=y=>o.value=y),type:e.selectType,readonly:e.readonly,disabled:e.disabled,editable:e.editable,clearable:e.clearable,size:e.size,placeholder:e.placeholder,"start-placeholder":e.startPlaceholder,"end-placeholder":e.endPlaceholder,format:l.value,"value-format":l.value,"range-separator":e.rangeSeparator,"default-value":e.defaultValue,"default-time":e.defaultTime,shortcuts:e.shortcuts,"disabled-date":e.disabledDate,teleported:e.teleported,"prefix-icon":e.prefixIcon,"clear-icon":e.clearIcon,id:c.value,onChange:u,onBlur:d,onFocus:f,onCalendarChange:h,onPanelChange:p,onVisibleChange:g}),null,16,["modelValue","type","readonly","disabled","editable","clearable","size","placeholder","start-placeholder","end-placeholder","format","value-format","range-separator","default-value","default-time","shortcuts","disabled-date","teleported","prefix-icon","clear-icon","id"])}}}),Ix=Lx,tv=be(Ix),Ox=(0,s.defineComponent)({name:"JTime",__name:"time",props:{modelValue:{default:""},isRange:{type:Boolean,default:!1},arrowControl:{type:Boolean,default:!1},format:{default:"HH:mm:ss"},rangeSeparator:{default:"-"},selectableRange:{},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:""},startPlaceholder:{default:""},endPlaceholder:{default:""},id:{default:void 0}},emits:["update:modelValue","change","blur","focus","clear","visible-change"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o=(0,s.computed)({get(){return r.isRange?typeof r.modelValue=="string"?r.modelValue?r.modelValue.split(","):["",""]:r.modelValue||["",""]:r.modelValue},set(g){if(r.isRange){if(g===null){a("update:modelValue","");return}if(Array.isArray(g)){a("update:modelValue",g.join(","));return}}g!==void 0&&a("update:modelValue",g)}}),l=(0,s.computed)(()=>r.isRange&&typeof r.id=="string"?[r.id+"-start",r.id+"-end"]:r.id||void 0),c=g=>{if(r.isRange){if(g===null){a("change","");return}if(Array.isArray(g)){a("change",g.join(","));return}}a("change",g)},u=g=>{a("blur",g)},d=g=>{a("focus",g)},f=g=>{a("visible-change",g)};return t({ref:i,handleOpen:()=>{i.value?.handleOpen()},handleClose:()=>{i.value?.handleClose()}}),(g,v)=>{const m=(0,s.resolveComponent)("el-time-picker");return(0,s.openBlock)(),(0,s.createBlock)(m,{ref_key:"timeRef",ref:i,class:"j-time-picker",modelValue:o.value,"onUpdate:modelValue":v[0]||(v[0]=_=>o.value=_),format:e.format,valueFormat:e.format,placeholder:e.placeholder,startPlaceholder:e.startPlaceholder,endPlaceholder:e.endPlaceholder,"arrow-control":e.arrowControl,rangeSeparator:e.rangeSeparator,clearable:e.clearable,readonly:e.readonly,disabled:e.disabled,isRange:e.isRange,size:e.size,id:l.value,"picker-options":{selectableRange:e.selectableRange},onChange:c,onBlur:u,onFocus:d,onVisibleChange:f},null,8,["modelValue","format","valueFormat","placeholder","startPlaceholder","endPlaceholder","arrow-control","rangeSeparator","clearable","readonly","disabled","isRange","size","id","picker-options"])}}}),Vx=Ox,nv=be(Vx),zx=(0,s.defineComponent)({name:"JNowTime",__name:"now-time",props:{modelValue:{type:[String],default:void 0},readonly:Boolean,size:{type:String},mode:{type:String,default:"create"},isEditState:Boolean},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(""),i=o=>{r("update:modelValue",o),r("change",{value:o})};return(0,s.watch)(()=>n.modelValue,o=>{if((ln(o)||n.mode==="modify")&&!n.readonly&&(n.mode==="create"&&!n.isEditState||n.mode==="modify")){a.value=Cs(new Date),i(a.value);return}a.value=o},{immediate:!0}),(o,l)=>{const c=(0,s.resolveComponent)("j-icon"),u=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createBlock)(u,{size:e.size,readonly:"",value:a.value},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(c,{icon:"mdi:calendar-blank-outline"})]),_:1},8,["size","value"])}}}),Hx=zx,rv=be(Hx),av=be(Na),Fx={key:1},jx=(0,s.defineComponent)({name:"JRadio",__name:"radio",props:{modelValue:{type:[String,Number],default:void 0},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},isButton:{type:Boolean,default:!1},isColor:{type:Boolean,default:!1},colors:{type:Array,default:()=>[]},readonly:Boolean},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get(){let o=n.options;if(!ln(n.modelValue)&&o&&o.length>0){let l=n.modelValue+"",c=n.options.find(u=>u.value+""===l);if(c)return c.value}return n.modelValue},set(o){r("update:modelValue",o)}}),i=(0,s.computed)(()=>n.isColor&&n.colors&&n.colors.length>0?n.colors.map(o=>o.color):[]);return(o,l)=>{const c=(0,s.resolveComponent)("el-radio-button"),u=(0,s.resolveComponent)("el-tag"),d=(0,s.resolveComponent)("el-radio"),f=(0,s.resolveComponent)("el-radio-group");return(0,s.openBlock)(),(0,s.createBlock)(f,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=h=>a.value=h),disabled:e.readonly},{default:(0,s.withCtx)(()=>[e.isButton?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)(e.options,h=>((0,s.openBlock)(),(0,s.createBlock)(c,{key:h.value,value:h.value,size:e.size},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(h.label),1)]),_:2},1032,["value","size"]))),128)):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(e.options,(h,p)=>((0,s.openBlock)(),(0,s.createBlock)(d,{key:h.value,value:h.value,size:e.size},{default:(0,s.withCtx)(()=>[e.isColor?((0,s.openBlock)(),(0,s.createBlock)(u,{key:0,color:i.value[p]||h.color||"",size:e.size,hit:!1,effect:"dark",style:{"border-width":"0"}},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(h.label),1)]),_:2},1032,["color","size"])):((0,s.openBlock)(),(0,s.createElementBlock)("span",Fx,(0,s.toDisplayString)(h.label),1))]),_:2},1032,["value","size"]))),128))]),_:1},8,["modelValue","disabled"])}}}),$x=jx,iv=be($x),Wx={class:"j-select-input-label-wrapper"},Ux={class:"j-select-option-wrapper"},Yx={class:"j-select-option-wrapper"},Gx=(0,s.defineComponent)({name:"JSelect",inheritAttrs:!1,__name:"select",props:{modelValue:{},options:{default:()=>[]},size:{default:"default"},placeholder:{default:"请选择"},teleported:{type:Boolean,default:!0},noBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},isShowTooltip:{type:Boolean,default:!1},isSelectOnlyone:{type:Boolean,default:!1},selectData:{default:""},clearable:{type:Boolean,default:!1},isRows:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},isGroup:{type:Boolean,default:!1},groupKey:{default:""},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(),i=(0,s.computed)({get(){return n.multiple&&typeof n.modelValue=="string"?n.modelValue?.split(",")||[]:n.modelValue},set(f){n.multiple&&Array.isArray(f)&&(f=f?.join(",")||[]),r("update:modelValue",f)}}),o=(0,s.computed)(()=>!ln(i.value)&&!n.multiple&&n.options.filter(f=>i.value==f.value).map(f=>f.label).join(",")||""),l=(0,s.computed)(()=>!ln(i.value)&&!n.multiple?n.options.find(f=>f.value===i.value)?.icon:""),c=(0,s.computed)(()=>typeof n.selectData=="string"?n.selectData?.split(",")||[]:[]),u=(0,s.computed)(()=>{let f=[];if(n.isSelectOnlyone?f=n.options.map(h=>({...h,disabled:c.value.includes(h.value)})):f=n.options,n.isGroup){const h=[],p={};return f.forEach(g=>{let v={};const m=g[n.groupKey||""]||"";p[m]||(v.value=m,v.label=m,p[m]=[],v.children=p[m],h.push(v));const _={value:g.value,label:g.label,icon:g.icon,disabled:g.disabled};p[m].push(_)}),h}return f}),d=f=>{if(n.multiple){if(f.length==0){r("change",void 0);return}const h=[];f.forEach(p=>{const g=n.options.find(v=>v.value==p);g&&h.push(g)}),r("change",h)}else{if(f==""||f==null||f==null){r("change",void 0);return}r("change",n.options.find(h=>h.value==f))}};return(0,s.onMounted)(()=>{n.autoFocus&&!n.readonly&&setTimeout(()=>{a.value.toggleMenu()},50)}),(f,h)=>{const p=(0,s.resolveComponent)("el-tooltip"),g=(0,s.resolveComponent)("el-option"),v=(0,s.resolveComponent)("el-option-group"),m=(0,s.resolveComponent)("el-select");return(0,s.openBlock)(),(0,s.createBlock)(m,(0,s.mergeProps)({ref_key:"selectRef",ref:a},f.$attrs,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=_=>i.value=_),class:[{"no-border":e.noBorder,"rows-background":e.isRows}],teleported:e.teleported,size:e.size,disabled:e.disabled||e.readonly,multiple:e.multiple,clearable:e.clearable,filterable:e.filterable,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,placeholder:e.placeholder,onChange:d}),(0,s.createSlots)({default:(0,s.withCtx)(()=>[e.isGroup?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)(u.value,_=>((0,s.openBlock)(),(0,s.createBlock)(v,{key:_.label,label:_.label},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(_.children,y=>((0,s.openBlock)(),(0,s.createBlock)(g,{key:y.value,label:y.label,value:y.value||" ",disabled:!!y.disabled},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Ux,[y.icon?((0,s.openBlock)(),(0,s.createBlock)(Na,{key:0,class:"j-select-option-icon",icon:y.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)(y.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128)):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(u.value,_=>((0,s.openBlock)(),(0,s.createBlock)(g,{key:_.value,label:_.label,value:_.value+"",disabled:!!_.disabled},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Yx,[_.icon?((0,s.openBlock)(),(0,s.createBlock)(Na,{key:0,class:"j-select-option-icon",icon:_.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)(_.label),1)])]),_:2},1032,["label","value","disabled"]))),128))]),_:2},[e.multiple?void 0:{name:"label",fn:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",Wx,[l.value?((0,s.openBlock)(),(0,s.createBlock)(Na,{key:0,class:"j-select-option-icon",icon:l.value},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",null,[e.isShowTooltip?((0,s.openBlock)(),(0,s.createBlock)(p,{key:0,content:o.value,placement:"top"},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(o.value),1)]),_:1},8,["content"])):((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createTextVNode)((0,s.toDisplayString)(o.value),1)],64))])])]),key:"0"}]),1040,["modelValue","class","teleported","size","disabled","multiple","clearable","filterable","collapse-tags","collapse-tags-tooltip","placeholder"])}}}),qx=Gx,ov=be(qx),Jx=(0,s.defineComponent)({name:"JCascaderSelect",__name:"cascader-select",props:{modelValue:{},options:{default:()=>[]},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},separator:{default:"/"},showAllLevels:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},expandTrigger:{default:"click"},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!1},maxCollapseTags:{default:1},collapseTagsTooltip:{type:Boolean},filterable:{type:[Boolean,Object],default:!1},multiple:{type:Boolean,default:!1},emitPath:{type:Boolean,default:!0},lazy:{type:Boolean,default:!1},lazyLoad:{type:Function,default:()=>Function},hoverThreshold:{default:500},checkOnClickNode:{type:Boolean,default:!1},checkOnClickLeaf:{type:Boolean,default:!0},showPrefix:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,a=(0,s.ref)(null),i=n;t({getCheckedNodes:(f=!1)=>a.value?.getCheckedNodes(f),clearCheckedNodes:()=>{a.value?.cascaderPanelRef?.value?.clearCheckedNodes()}});const c=(0,s.computed)({get(){return ln(r.modelValue)?[]:r.modelValue?.split(",")||[]},set(f){i("update:modelValue",ln(f)?"":f.join(","))}}),u=(f,h)=>{c.value=f,i("change",{value:ln(f)?"":f.join(","),data:h})},d=(0,s.computed)(()=>({checkStrictly:r.checkStrictly,expandTrigger:r.expandTrigger,multiple:r.multiple,emitPath:r.emitPath,lazy:r.lazy,lazyLoad:r.lazyLoad,hoverThreshold:r.hoverThreshold,checkOnClickNode:r.checkOnClickNode,checkOnClickLeaf:r.checkOnClickLeaf,showPrefix:r.showPrefix,value:"value",label:"label",children:"children",disabled:"disabled",leaf:"leaf"}));return(0,s.onMounted)(()=>{r.autoFocus&&!r.readonly&&setTimeout(()=>{a.value.togglePopperVisible()},50)}),(f,h)=>{const p=(0,s.resolveComponent)("el-cascader");return(0,s.openBlock)(),(0,s.createBlock)(p,{ref_key:"cascaderRef",ref:a,modelValue:c.value,"onUpdate:modelValue":h[0]||(h[0]=g=>c.value=g),props:d.value,options:e.options,placeholder:e.placeholder,disabled:e.disabled||e.readonly,clearable:e.clearable,"collapse-tags":e.collapseTags,"max-collapse-tags":e.maxCollapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,filterable:e.filterable,"show-all-levels":e.showAllLevels,separator:e.separator,size:e.size,onChange:u},null,8,["modelValue","props","options","placeholder","disabled","clearable","collapse-tags","max-collapse-tags","collapse-tags-tooltip","filterable","show-all-levels","separator","size"])}}}),Xx=Jx,lv=be(Xx),Kx=(0,s.defineComponent)({name:"JCheckbox",__name:"checkbox",props:{modelValue:{default:()=>[]},options:{default:()=>[]},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:void 0},max:{default:void 0},textColor:{default:"var(--j-color-primary)"},fill:{default:"var(--j-color-bg-container)"},tag:{default:"div"},validateEvent:{type:Boolean,default:!0},label:{default:void 0},type:{default:"checkbox"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get(){return n.modelValue},set(o){r("update:modelValue",o)}}),i=o=>{r("change",o)};return(o,l)=>{const c=(0,s.resolveComponent)("el-checkbox"),u=(0,s.resolveComponent)("el-checkbox-button"),d=(0,s.resolveComponent)("el-checkbox-group");return(0,s.openBlock)(),(0,s.createBlock)(d,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=f=>a.value=f),disabled:e.disabled||e.readonly,size:e.size,min:e.min,max:e.max,"text-color":e.textColor,fill:e.fill,tag:e.tag,"validate-event":e.validateEvent,label:e.label,type:e.type,onChange:i},{default:(0,s.withCtx)(()=>[e.type==="checkbox"?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)(e.options,f=>((0,s.openBlock)(),(0,s.createBlock)(c,{key:f.value,value:f.value,disabled:f.disabled,size:e.size,label:f.label},null,8,["value","disabled","size","label"]))),128)):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(e.options,f=>((0,s.openBlock)(),(0,s.createBlock)(u,{key:f.value,class:(0,s.normalizeClass)({"j-checkbox-notFillOrColor":!e.fill&&!e.textColor}),value:f.value,disabled:f.disabled,size:e.size,label:f.label},null,8,["class","value","disabled","size","label"]))),128))]),_:1},8,["modelValue","disabled","size","min","max","text-color","fill","tag","validate-event","label","type"])}}}),Zx=Kx,sv=be(Zx),Qx=(0,s.defineComponent)({name:"JNumber",__name:"number",props:{modelValue:{},min:{},max:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},precision:{},size:{default:"default"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},controlsPosition:{default:"right"},ariaLabel:{},placeholder:{default:"请输入数字"},id:{},valueOnClear:{},label:{},inputmode:{},align:{default:"left"},disabledScientific:{type:Boolean,default:!1},prefix:{},suffix:{},decreaseIcon:{},increaseIcon:{},autoFocus:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(e,{expose:t,emit:n}){const r=e,a=(0,s.ref)(),i=n,o=(0,s.computed)({get(){return r.modelValue},set(h){i("update:modelValue",h)}}),l=h=>{i("change",h)},c=()=>{i("blur")},u=()=>{i("focus")};return t({blur:()=>{a.value?.blur()},focus:()=>{a.value?.focus()}}),(0,s.onMounted)(()=>{r.autoFocus&&!r.readonly&&a.value?.focus()}),(h,p)=>{const g=(0,s.resolveComponent)("j-icon"),v=(0,s.resolveComponent)("el-input-number");return(0,s.openBlock)(),(0,s.createBlock)(v,{id:e.id,ref_key:"inputNumberRef",ref:a,modelValue:o.value,"onUpdate:modelValue":p[0]||(p[0]=m=>o.value=m),min:e.min,max:e.max,step:e.step,"step-strictly":e.stepStrictly,precision:e.precision,size:e.size,readonly:e.readonly||e.disabled,disabled:e.disabled||e.readonly,controls:e.controls,"controls-position":e.controlsPosition,"aria-label":e.ariaLabel,placeholder:e.placeholder,"value-on-clear":e.valueOnClear,label:e.label,inputmode:e.inputmode,align:e.align,"disabled-scientific":e.disabledScientific,onChange:l,onBlur:c,onFocus:u},(0,s.createSlots)({"decrease-icon":(0,s.withCtx)(()=>[e.decreaseIcon?((0,s.openBlock)(),(0,s.createBlock)(g,{key:0,icon:e.decreaseIcon},null,8,["icon"])):(0,s.createCommentVNode)("",!0)]),"increase-icon":(0,s.withCtx)(()=>[e.increaseIcon?((0,s.openBlock)(),(0,s.createBlock)(g,{key:0,icon:e.increaseIcon},null,8,["icon"])):(0,s.createCommentVNode)("",!0)]),_:2},[e.prefix?{name:"prefix",fn:(0,s.withCtx)(()=>[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)(e.prefix),1)]),key:"0"}:void 0,e.suffix?{name:"suffix",fn:(0,s.withCtx)(()=>[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)(e.suffix),1)]),key:"1"}:void 0]),1032,["id","modelValue","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","aria-label","placeholder","value-on-clear","label","inputmode","align","disabled-scientific"])}}}),eE=Qx,cv=be(eE),tE=(0,s.defineComponent)({name:"JAutocomplete",__name:"autocomplete",props:{modelValue:{},placeholder:{default:"请输入内容"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},dataType:{default:""},dataCode:{default:""},labelKey:{default:"label"},valueKey:{default:"value"},debounce:{default:300},placement:{default:"bottom-start"},options:{default:()=>[]},fetchSuggestions:{},triggerOnFocus:{type:Boolean,default:!0},selectWhenUnmatched:{type:Boolean,default:!1},ariaLabel:{},hideLoading:{type:Boolean,default:!1},popperClass:{},popperStyle:{},teleported:{type:Boolean,default:!0},appendTo:{},highlightFirstItem:{type:Boolean,default:!1},fitInputWidth:{type:Boolean,default:!1},loopNavigation:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","select","change","focus","blur"],setup(e,{expose:t,emit:n}){const r=e,a=(0,s.ref)(null),i=n,o=(0,s.computed)({get(){return r.modelValue||""},set(w){i("update:modelValue",w)}}),{useData:l}=vt(),{getDataByComp:c}=l(),u=(0,s.computed)(()=>c?c({type:"j-autocomplete",config:r})||[]:[]),d=(0,s.computed)(()=>r.options?r.options:r.dataCode||r.dataType?u.value:[]),f=(w,C)=>{if(r.fetchSuggestions){r.fetchSuggestions(w,C);return}C(w?d.value.filter(h(w)):d.value)},h=w=>C=>C?.[r.valueKey]?.toLowerCase().indexOf(w.toLowerCase())===0,p=w=>{i("select",w)},g=w=>{i("change",w)},v=()=>{i("focus")},m=()=>{i("blur")};return t({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()}}),(0,s.onMounted)(()=>{r.autoFocus&&!r.readonly&&setTimeout(()=>{a.value.focus()},50)}),(w,C)=>{const S=(0,s.resolveComponent)("el-autocomplete");return(0,s.openBlock)(),(0,s.createBlock)(S,{ref_key:"autocompleteRef",ref:a,modelValue:o.value,"onUpdate:modelValue":C[0]||(C[0]=b=>o.value=b),"fetch-suggestions":f,placeholder:e.placeholder,clearable:e.clearable,disabled:e.disabled||e.readonly,size:e.size,"value-key":e.valueKey,debounce:e.debounce,placement:e.placement,"trigger-on-focus":e.triggerOnFocus,"select-when-unmatched":e.selectWhenUnmatched,"aria-label":e.ariaLabel,"hide-loading":e.hideLoading,"popper-class":e.popperClass,"popper-style":e.popperStyle,teleported:e.teleported,"append-to":e.appendTo,"highlight-first-item":e.highlightFirstItem,"fit-input-width":e.fitInputWidth,"loop-navigation":e.loopNavigation,onSelect:p,onChange:g,onFocus:v,onBlur:m},(0,s.createSlots)({default:(0,s.withCtx)(({item:b})=>[(0,s.renderSlot)(w.$slots,"default",{item:b},()=>[(0,s.createElementVNode)("div",null,(0,s.toDisplayString)(b[e.valueKey]||""),1)])]),_:2},[w.$slots.prefix?{name:"prefix",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"prefix")]),key:"0"}:void 0,w.$slots.suffix?{name:"suffix",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"suffix")]),key:"1"}:void 0,w.$slots.header?{name:"header",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"header")]),key:"2"}:void 0,w.$slots.footer?{name:"footer",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"footer")]),key:"3"}:void 0,w.$slots.prepend?{name:"prepend",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"prepend")]),key:"4"}:void 0,w.$slots.append?{name:"append",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"append")]),key:"5"}:void 0,w.$slots.loading?{name:"loading",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(w.$slots,"loading")]),key:"6"}:void 0]),1032,["modelValue","placeholder","clearable","disabled","size","value-key","debounce","placement","trigger-on-focus","select-when-unmatched","aria-label","hide-loading","popper-class","popper-style","teleported","append-to","highlight-first-item","fit-input-width","loop-navigation"])}}}),nE=tE,uv=be(nE),rE={class:"j-block"},aE={key:1,class:"j-layout--container"},iE={class:"j-block"},oE={class:"j-block"},lE={class:"j-block"},sE=(0,s.defineComponent)({name:"JLayout",__name:"layout",props:{left:{type:[Number,String],default:240},right:{type:[Number,String],default:240},top:{type:[Number,String],default:60},bottom:{type:[Number,String],default:60},leftMove:{type:Boolean,default:!0},rightMove:{type:Boolean,default:!0},topMove:{type:Boolean,default:!0},bottomMove:{type:Boolean,default:!0},notHidden:{type:Boolean,default:!1},midMinWidth:{type:Number,default:0},midMinHeight:{type:Number,default:0},hideMidWhenNarrow:{type:Boolean,default:!1}},setup(e){const t=e,n=(0,s.useSlots)(),r=(0,s.ref)(),a=(0,s.ref)(),i=(0,s.ref)(-1),o=(0,s.ref)(-1),l=(0,s.ref)(-1),c=(0,s.ref)(-1),u=(0,s.ref)(0),d=(0,s.ref)(!1),f=(0,s.reactive)({type:"",isMove:!1,pageX:0,pageY:0,size:0,h:0,w:0}),h=(0,s.computed)({get(){return i.value!==-1?i.value:t.left},set(L){i.value=L}}),p=(0,s.computed)({get(){return o.value!==-1?o.value:t.right},set(L){o.value=L}}),g=(0,s.computed)({get(){return l.value!==-1?l.value:t.top},set(L){l.value=L}}),v=(0,s.computed)({get(){return c.value!==-1?c.value:t.bottom},set(L){c.value=L}}),m=(0,s.computed)(()=>n.left),_=(0,s.computed)(()=>n.right),y=(0,s.computed)(()=>n.top),w=(0,s.computed)(()=>n.bottom),C=(0,s.computed)(()=>m.value?d.value&&t.hideMidWhenNarrow&&_.value?"50%":d.value&&t.hideMidWhenNarrow&&!_.value?"100%":typeof h.value=="number"?h.value+"px":h.value:"0"),S=(0,s.computed)(()=>_.value?d.value&&t.hideMidWhenNarrow&&m.value?"50%":d.value&&t.hideMidWhenNarrow&&!m.value?"100%":typeof p.value=="number"?p.value+"px":p.value:"0"),b=(0,s.computed)(()=>y.value?typeof g.value=="number"?g.value+"px":g.value:"0"),x=(0,s.computed)(()=>w.value?typeof v.value=="number"?v.value+"px":v.value:"0"),E=(0,s.computed)(()=>({minWidth:t.midMinWidth+"px",minHeight:t.midMinHeight+"px"})),k=(L,N)=>{f.type=L,f.isMove=!0,f.pageX=N.pageX,f.pageY=N.pageY,f.h=a.value.clientHeight,f.w=a.value.clientWidth;const M=r.value.clientWidth,I=r.value.clientHeight;switch(L){case"left":{const $=h.value;f.size=typeof $=="string"&&$.includes("%")?parseFloat($)/100*M:Number($);break}case"right":{const $=p.value;f.size=typeof $=="string"&&$.includes("%")?parseFloat($)/100*M:Number($);break}case"top":{const $=g.value;f.size=typeof $=="string"&&$.includes("%")?parseFloat($)/100*I:Number($);break}case"bottom":{const $=v.value;f.size=typeof $=="string"&&$.includes("%")?parseFloat($)/100*I:Number($);break}}document.onmouseup=R,document.onmousemove=T},T=L=>{if(f.isMove)switch(f.type){case"left":{const N=L.pageX-f.pageX;let M=f.size+N;M<0?M=4:M>f.size+f.w-t.midMinWidth&&(M=f.size+f.w-t.midMinWidth),h.value=M;break}case"right":{const N=L.pageX-f.pageX;let M=f.size-N;M<0?M=4:M>f.size+f.w-t.midMinWidth&&(M=f.size+f.w-t.midMinWidth),p.value=M;break}case"top":{const N=L.pageY-f.pageY;let M=f.size+N;M<0?M=4:M>f.size+f.h-t.midMinHeight&&(M=f.size+f.h-t.midMinHeight),g.value=M;break}case"bottom":{const N=L.pageY-f.pageY;let M=f.size-N;M<0?M=4:M>f.size+f.h-t.midMinHeight&&(M=f.size+f.h-t.midMinHeight),v.value=M;break}}},R=()=>{f.isMove=!1,document.onmouseup=null,document.onmousemove=null},D=()=>{if(!t.hideMidWhenNarrow||!r.value){d.value=!1;return}u.value=r.value.clientWidth;let L=0,N=0;if(m.value){const M=h.value;L=typeof M=="string"&&M.includes("%")?parseFloat(M)/100*u.value:Number(M)}if(_.value){const M=p.value;N=typeof M=="string"&&M.includes("%")?parseFloat(M)/100*u.value:Number(M)}d.value=u.value-L-N<t.midMinWidth};let A=null;return(0,s.onMounted)(()=>{t.hideMidWhenNarrow&&r.value&&typeof window<"u"&&window.ResizeObserver&&(D(),A=new ResizeObserver(()=>{D()}),A.observe(r.value))}),(0,s.onUnmounted)(()=>{A&&A.disconnect()}),(L,N)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"layout",ref:r,class:(0,s.normalizeClass)(["j-layout",{"j-layout-not-hidden":e.notHidden}])},[m.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--left",style:(0,s.normalizeStyle)({width:C.value})},[(0,s.createElementVNode)("div",rE,[(0,s.renderSlot)(L.$slots,"left")]),e.leftMove?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:N[0]||(N[0]=M=>k("left",M))},null,32)):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0),d.value?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",aE,[y.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--top",style:(0,s.normalizeStyle)({height:b.value})},[(0,s.createElementVNode)("div",iE,[(0,s.renderSlot)(L.$slots,"top")]),e.topMove?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:N[1]||(N[1]=M=>k("top",M))},null,32)):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",{ref_key:"mid",ref:a,class:"j-layout--wrapper",style:(0,s.normalizeStyle)(E.value)},[(0,s.renderSlot)(L.$slots,"default")],4),w.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:1,class:"j-layout--bottom",style:(0,s.normalizeStyle)({height:x.value})},[(0,s.createElementVNode)("div",oE,[(0,s.renderSlot)(L.$slots,"bottom")]),e.bottomMove?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:N[2]||(N[2]=M=>k("bottom",M))},null,32)):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0)])),_.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:2,class:"j-layout--right",style:(0,s.normalizeStyle)({width:S.value})},[(0,s.createElementVNode)("div",lE,[(0,s.renderSlot)(L.$slots,"right")]),e.rightMove?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-layout--move",onMousedown:N[3]||(N[3]=M=>k("right",M))},null,32)):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0)],2))}}),cE=sE,dv=be(cE);function fv(e,t){return typeof e=="number"&&typeof t=="number"?e===t:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((n,r)=>n===t[r])):typeof e=="number"&&Array.isArray(t)?t.length===1&&t[0]===e:!(!Array.isArray(e)||typeof t!="number")&&e.length===1&&e[0]===t}function uE(e,t){return e.some((n=>fv(n,t)))}function dE(e,t){return e.findIndex((n=>fv(n,t)))}function sd(e){if(e==null)return[10,10,10,10];if(typeof e=="number")return[e,e,e,e];if(Array.isArray(e)){if(e.length===2){const[t,n]=e;return[t,n,t,n]}if(e.length===4)return e}return[10,10,10,10]}function Et(e){return e.internalProps}function zi(e,t){return e.dataSource.getRaw(t)}function bn(e,t){var n;return((n=Et(e).originalRowHeights)===null||n===void 0?void 0:n.get(t))||0}var hv=new WeakMap;function Ko(e,t){let n=hv.get(e);if(n||(n=new Map,hv.set(e,n)),n.has(t))return n.get(t);for(let r=0;r<e.colCount;r++)if(e.getHeaderField(r,0)===t)return n.set(t,r),r;return n.set(t,-1),-1}function Es(e,t,n,r){const a=r.scenegraph.getCell(e,t);a&&a.forEachChildren((i=>{const o=i;(o.name==="checkbox-icon"||o.name==="checkbox"||o.type==="checkbox"||o.attribute&&o.attribute.type==="checkbox")&&o.setAttributes&&(n==="indeterminate"?o.setAttributes({checked:!1,indeterminate:!0}):o.setAttributes({checked:n,indeterminate:!1}))}))}var fE=class{constructor(e,t){this.pluginOptions=e,this.table=t,this.isRowExpanded=()=>!1,this.childrenKey=e.childrenKey||"children"}getChildrenKey(){return this.childrenKey}setExpandRowCallback(e){this.expandRowCallback=e}ensureChildrenAlias(e){if(this.childrenKey!=="children"&&e&&typeof e=="object"){const t=e,n=this.childrenKey,r=Object.getOwnPropertyDescriptor(t,"children");if(r&&r.get)return;Object.defineProperty(t,"children",{get(){return this[n]},set(a){this[n]=a},enumerable:!1,configurable:!0})}}hasChildren(e){const t=this.childrenKey;if(e&&typeof e=="object"&&t in e){const n=e[t];return Array.isArray(n)&&n.length>0}return!1}injectMasterDetailOptions(e){e.masterDetail=!0,e.customConfig||(e.customConfig={}),e.customConfig.scrollEventAlwaysTrigger=!0;const t=e.customComputeRowHeight;if(e.customComputeRowHeight=n=>{var r;const{row:a,table:i}=n;if(this.isRowExpanded(a)){const o=i.getRowHeight(a);return Array.isArray(o)?(r=o[0])!==null&&r!==void 0?r:"auto":o}if(t){const o=t(n);if(o!=null)return o}},e.columns&&e.columns.length>0&&(e.columns[0].tree=!0),this.setupInitializedListener(),this.pluginOptions.detailTableOptions){const n=this.pluginOptions.detailTableOptions;typeof n=="function"?e.getDetailGridOptions=n:e.detailTableOptions=n}this.disableRefreshHierarchyState()}disableRefreshHierarchyState(){setTimeout((()=>{const e=this.table;e&&typeof e._refreshHierarchyState=="function"&&(e._originalRefreshHierarchyState=e._refreshHierarchyState,e._refreshHierarchyState=()=>{})}),0)}setupInitializedListener(){this.table.on("initialized",(()=>{const e=this.table.dataSource.records;this.processRecordsHierarchyStates(e),this.table.renderWithRecreateCells()}))}processRecordsHierarchyStates(e){const t=We.TYPES.HierarchyState,n=this.table.options.hierarchyExpandLevel||this.table.options.headerExpandLevel;(r=>{r.forEach((a=>{if(a&&typeof a=="object"){const i=a;this.ensureChildrenAlias(a),(this.hasChildren(a)||i[this.childrenKey]===!0)&&(i.hierarchyState==="expand"?i.hierarchyState=t.expand:i.hierarchyState==="collapse"?i.hierarchyState=t.collapse:i.hierarchyState||(i.hierarchyState=n&&n>1?t.expand:t.collapse))}}))})(e),this.performInitialExpansion()}performInitialExpansion(){const e=this.getExpandableRecords();e.length!==0&&this.startAsyncExpansion(e)}getExpandableRecords(){const e=this.table.dataSource,t=e.source||e._source||this.table.dataSource.records,n=We.TYPES.HierarchyState,r=[],a=this.table;a.internalProps.expandedRecordIndices||(a.internalProps.expandedRecordIndices=[]);const i=a.internalProps.expandedRecordIndices;for(let o=0;o<t.length;o++){const l=t[o];if(l&&typeof l=="object"){const c=l;if((this.hasChildren(l)||c[this.childrenKey]===!0)&&c.hierarchyState===n.expand){i.includes(o)||i.push(o);try{const u=this.table.getBodyRowIndexByRecordIndex(o);if(u>=0){const d=u+this.table.columnHeaderLevelCount;r.push({recordIndex:o,actualRowIndex:d,record:l})}}catch{}}}}return r}startAsyncExpansion(e){let t=0;const n=()=>{if(t>=e.length)return;const{actualRowIndex:r}=e[t];this.isCellGroupCreated(r)?(this.expandRowCallback&&this.expandRowCallback(r),t++,setTimeout(n,0)):setTimeout(n,16)};setTimeout(n,0)}isCellGroupCreated(e){try{const t=this.table.scenegraph.getCell(0,e);return t&&t.role==="cell"}catch{return!1}}getDetailConfigForRecord(e,t){const n=this.pluginOptions.detailTableOptions;return n?typeof n=="function"?n({data:e,bodyRowIndex:t}):n:null}setRowExpandedChecker(e){this.isRowExpanded=e}release(){this.isRowExpanded=()=>!1,this.table=null,this.pluginOptions=null}},hE=class{constructor(e,t="children"){this.table=e,this.expandedRows=[],this.eventHandlers=[],this.allExpandedRowsBeforeMove=new Set,this.isCleanedUp=!1,this.childrenKey=t}bindEventHandlers(){const e=()=>this.onUpdateSubTablePositions(),t=()=>this.onUpdateSubTablePositionsForRow();this.table.on(We.TABLE_EVENT_TYPE.SCROLL,e),this.table.on(We.TABLE_EVENT_TYPE.RESIZE_ROW,t),this.eventHandlers.push({type:We.TABLE_EVENT_TYPE.SCROLL,handler:e},{type:We.TABLE_EVENT_TYPE.RESIZE_ROW,handler:t}),this.wrapTableResizeMethod(),this.bindTreeHierarchyStateChange(),this.bindRowMoveEvents()}wrapTableResizeMethod(){const e=this.table.resize.bind(this.table);this.originalResize=e,this.table.resize=()=>{e(),this.onUpdateSubTablePositions()}}handleAfterUpdateCellContentWidth(e){var t;const{col:n,row:r,cellGroup:a,cellHeight:i,padding:o,textBaseline:l}=e;if(this.isCustomMergeCell(n,r))return void this.fixCustomMergeCellTextPosition(a,o);let c=i;if(a.col!==void 0&&a.row!==void 0)try{const u=this.table.getRecordShowIndexByCell(a.col,a.row);if(u!==void 0){const d=((t=this.getOriginalRowHeight)===null||t===void 0?void 0:t.call(this,u))||0;if(d>0){c=d;const f=c-(o[0]+o[2]);a.forEachChildren((h=>{h.type!=="rect"&&h.type!=="chart"&&h.name!==We.CUSTOM_CONTAINER_NAME&&(h.name==="mark"?h.setAttribute("y",0):l==="middle"?h.setAttribute("y",o[0]+(f-h.AABBBounds.height())/2):l==="bottom"?h.setAttribute("y",o[0]+f-h.AABBBounds.height()):h.setAttribute("y",o[0]))}))}}}catch{}}fixCustomMergeCellTextPosition(e,t){const{col:n,row:r}=e,a=this.table,i=a.getCustomMerge(n,r);if(!i||!i.style||!i.range)return;const o=i.style.textAlign||"left",{start:l,end:c}=i.range;let u=0,d=0;for(let f=l.col;f<=c.col;f++)u+=a.getColWidth(f);for(let f=0;f<l.col;f++)d+=a.getColWidth(f);e.forEachChildren((f=>{if(f.name==="text"||f.name==="content"){let h;h=o==="center"?d+t[3]+(u-t[1]-t[3])/2:o==="right"?d+u-t[1]:d+t[3],f.setAttribute("x",h),f.setAttribute("textAlign",o)}}))}isCustomMergeCell(e,t){try{const n=this.table;if(n&&n.getCustomMerge)return!!n.getCustomMerge(e,t)}catch{}return!1}handleAfterUpdateSelectBorderHeight(e){var t,n;const{startRow:r,endRow:a,selectComp:i}=e,o=r===a,l=this.expandedRows.includes(a);if(o){const c=r-(this.table.columnHeaderLevelCount||0),u=((t=this.getOriginalRowHeight)===null||t===void 0?void 0:t.call(this,c))||0;if(u>0&&u!==e.currentHeight&&(i.rect.setAttributes({height:u}),i.fillhandle)){const d=i.rect.attribute.y;i.fillhandle.setAttributes({y:d+u})}}else if(l){const c=a-(this.table.columnHeaderLevelCount||0),u=((n=this.getOriginalRowHeight)===null||n===void 0?void 0:n.call(this,c))||0;if(u>0){const d=this.table.getRowHeight(a),f=e.currentHeight-d+u;if(i.rect.setAttributes({height:f}),i.fillhandle){const h=i.rect.attribute.y;i.fillhandle.setAttributes({y:h+f})}}}}executeMasterDetailBeforeSort(){const e=this.table;e.internalProps.expandedRecordIndices&&e.internalProps.expandedRecordIndices.length>0&&(e.internalProps._tempExpandedRecordIndices=[...e.internalProps.expandedRecordIndices]),this.expandedRows.length>0&&[...this.expandedRows].forEach((t=>{var n,r;try{const a=e.options;a&&a.pagination?(n=this.onCollapseRowToNoRealRecordIndex)===null||n===void 0||n.call(this,t):(r=this.onCollapseRow)===null||r===void 0||r.call(this,t)}catch{}}))}executeMasterDetailAfterSort(){const e=this.table,t=e.internalProps._tempExpandedRecordIndices;t&&t.length>0&&([...t].forEach((n=>{var r;const a=e.getBodyRowIndexByRecordIndex(n);if(a>=0)try{const i=a+e.columnHeaderLevelCount;(r=this.onExpandRow)===null||r===void 0||r.call(this,i)}catch{}})),delete e.internalProps._tempExpandedRecordIndices)}getExpandedRows(){return this.expandedRows}setExpandedRows(e){this.expandedRows=e}addExpandedRow(e){this.expandedRows.includes(e)||this.expandedRows.push(e)}removeExpandedRow(e){const t=this.expandedRows.indexOf(e);t>-1&&this.expandedRows.splice(t,1)}isRowExpanded(e){return this.expandedRows.includes(e)}bindTreeHierarchyStateChange(){const e=t=>{var n;const{col:r,row:a}=t,i=this.getRecordByRowIndex(a-this.table.columnHeaderLevelCount);i&&typeof i=="object"&&this.childrenKey in i&&i[this.childrenKey]===!0||(n=this.onToggleRowExpand)===null||n===void 0||n.call(this,a,r)};this.table.on(We.TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,e),this.eventHandlers.push({type:We.TABLE_EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,handler:e})}getRecordByRowIndex(e){try{const t=this.table,n=t.getRecordShowIndexByCell(0,e+t.columnHeaderLevelCount);return t.dataSource.get(n)}catch{return null}}bindRowMoveEvents(){const e=r=>{var a,i;if(!r||typeof r.col!="number"||typeof r.row!="number")return;const{col:o,row:l}=r;if(!(this.table.getCellLocation(o,l)==="rowHeader"||!((i=(a=this.table.internalProps.layoutMap).isSeriesNumberInBody)===null||i===void 0)&&i.call(a,o,l)))return;this.allExpandedRowsBeforeMove.clear();const c=[...this.expandedRows];c.forEach((u=>{this.allExpandedRowsBeforeMove.add(u)})),c.forEach((u=>{var d;(d=this.onCollapseRow)===null||d===void 0||d.call(this,u)}))},t=r=>{var a;if(this.allExpandedRowsBeforeMove.size===0)return;const{colSource:i,rowSource:o,colTarget:l,rowTarget:c}=(a=this.table.stateManager)===null||a===void 0?void 0:a.columnMove;setTimeout((()=>{const u=o,d=c,f=d>u?"down":"up";this.allExpandedRowsBeforeMove.forEach((h=>{var p;let g=h;u===h?g=d:f==="down"?h<=d&&h>u&&(g=h-1):f==="up"&&h>=d&&h<u&&(g=h+1),(p=this.onExpandRow)===null||p===void 0||p.call(this,g)})),this.allExpandedRowsBeforeMove.clear()}),0)},n=r=>{this.allExpandedRowsBeforeMove.size!==0&&setTimeout((()=>{this.allExpandedRowsBeforeMove.forEach((a=>{var i;(i=this.onExpandRow)===null||i===void 0||i.call(this,a)})),this.allExpandedRowsBeforeMove.clear()}),0)};this.table.on(We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START,e),this.table.on(We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION,t),this.table.on(We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,n),this.eventHandlers.push({type:We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_START,handler:e},{type:We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION,handler:t},{type:We.TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION_FAIL,handler:n})}cleanup(){if(!this.isCleanedUp){if(this.isCleanedUp=!0,this.expandedRows.length=0,this.allExpandedRowsBeforeMove.clear(),this.originalResize&&this.table)try{this.table.resize=this.originalResize,this.originalResize=void 0}catch{}try{this.table&&(this.eventHandlers.forEach((({type:e,handler:t})=>{try{this.table.off(e,t)}catch{}})),this.eventHandlers.length=0)}catch{}this.onUpdateSubTablePositions=void 0,this.onUpdateSubTablePositionsForRow=void 0,this.onExpandRow=void 0,this.onCollapseRow=void 0,this.onCollapseRowToNoRealRecordIndex=void 0,this.onToggleRowExpand=void 0,this.getOriginalRowHeight=void 0,this.table=null}}setCallbacks(e){this.onUpdateSubTablePositions=e.onUpdateSubTablePositions,this.onUpdateSubTablePositionsForRow=e.onUpdateSubTablePositionsForRow,this.onExpandRow=e.onExpandRow,this.onCollapseRow=e.onCollapseRow,this.onCollapseRowToNoRealRecordIndex=e.onCollapseRowToNoRealRecordIndex,this.onToggleRowExpand=e.onToggleRowExpand,this.getOriginalRowHeight=e.getOriginalRowHeight}},pE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},gE=class{constructor(e,t=!0){this.table=e,this.enableCheckboxCascade=t,this.timers=new Set,this.columnRangeCache=null}saveSubTableCheckboxState(e,t){if(!t.stateManager)return;const n=Et(this.table);n.subTableCheckboxStates||(n.subTableCheckboxStates=new Map);const r={checkedState:Object.fromEntries(Array.from(t.stateManager.checkedState.entries()).map((([a,i])=>[a,Object.assign({},i)]))),headerCheckedState:Object.assign({},t.stateManager.headerCheckedState)};n.subTableCheckboxStates.set(e,r)}restoreSubTableCheckboxState(e,t){var n;let r=(n=Et(this.table).subTableCheckboxStates)===null||n===void 0?void 0:n.get(e);if(t.stateManager){if(r||(r={checkedState:{},headerCheckedState:{}}),r.checkedState&&Object.keys(r.checkedState).forEach((a=>{const i=r.checkedState[a];t.stateManager.checkedState.set(a,i)})),r.headerCheckedState&&Object.keys(r.headerCheckedState).forEach((a=>{t.stateManager.headerCheckedState[a]=r.headerCheckedState[a]})),this.enableCheckboxCascade){const a=e+this.table.columnHeaderLevelCount;if(zi(this.table,e)&&this.table.stateManager){const i=this.table.getRecordIndexByCell(0,a);if(i!=null){const o=i.toString(),l=this.table.stateManager.checkedState.get(o);l&&Object.keys(l).forEach((c=>{const u=l[c];(u===!0||u===!1)&&(t.stateManager.headerCheckedState[c]=u,(t.records||[]).forEach(((d,f)=>{const h=f.toString();let p=t.stateManager.checkedState.get(h);p||(p={},t.stateManager.checkedState.set(h,p)),p[c]=u,d[c]=u})))}))}}}this.safeSetTimeout((()=>{this.updateSubTableCheckboxVisualState(t)}),0)}}safeSetTimeout(e,t){const n=setTimeout((()=>{this.timers.delete(n);try{e()}catch{}}),t);return this.timers.add(n),n}cleanupAllTimers(){this.timers.forEach((e=>clearTimeout(e))),this.timers.clear()}updateSubTableCheckboxVisualState(e,t){if(!e.stateManager)return;const n=t?.headerCheckedState||e.stateManager.headerCheckedState,r=t?.checkedState||{};Object.keys(n).forEach((a=>{const i=n[a],o=Ko(e,a);o!==-1&&e.isHeader(o,0)&&e.scenegraph.updateHeaderCheckboxCellState(o,0,i)})),t?.checkedState?Object.keys(r).forEach((a=>{const i=r[a],o=Number(a);Object.keys(i).forEach((l=>{const c=i[l],u=Ko(e,l);if(u!==-1){for(let d=e.columnHeaderLevelCount;d<e.rowCount;d++)if(e.getRecordIndexByCell(u,d)===o){Es(u,d,c,e);break}}}))})):e.stateManager.checkedState.forEach(((a,i)=>{const o=Number(i);Object.keys(a).forEach((l=>{const c=a[l],u=Ko(e,l);if(u!==-1){for(let d=e.columnHeaderLevelCount;d<e.rowCount;d++)if(e.getRecordIndexByCell(u,d)===o){Es(u,d,c,e);break}}}))}))}renderSubTable(e,t,n){var r;const a=Et(this.table),i=zi(this.table,e);if(!i||!t||t.length===0)return;const o=n(i,e),l=this.calculateSubTableViewBox(e,o);if(!l)return;const c=l.x2-l.x1,u=l.y2-l.y1,d=this.table.options,f={viewBox:l,canvas:this.table.canvas,records:t,columns:o?.columns||[],widthMode:"adaptive",showHeader:!0,canvasWidth:c,canvasHeight:u,theme:d.theme},h=o||{},{style:p}=h,g=pE(h,["style"]),v=Object.assign(Object.assign({},f),g),m=new We.ListTable(this.table.container,v);a.subTableInstances.set(e,m),this.restoreSubTableCheckboxState(e,m);const _=()=>{a.subTableInstances&&a.subTableInstances.has(e)&&m.render()};this.table.on("after_render",_),m.__afterRenderHandler=_,this.setupScrollEventIsolation(m),this.setupUnifiedSelectionManagement(e,m),this.setupSubTableCanvasClipping(m,e),this.setupAntiFlickerMechanism(m),this.setupSubTableEventForwarding(e,m),m.render(),((r=o?.style)===null||r===void 0?void 0:r.height)==="auto"&&this.handleAutoHeightAfterRender(e,m,o)}handleAutoHeightAfterRender(e,t,n){var r;try{const a=this.calculateSubTableContentHeight(t),[i,,o]=sd((r=n?.style)===null||r===void 0?void 0:r.margin),l=a+i+o;this.onAutoHeightCalculated&&this.onAutoHeightCalculated(e,l)}catch{}}calculateSubTableContentHeight(e){try{const t=e.getAllRowsHeight();let n=0;const r=e.theme;if(r?.frameStyle){const a=r.frameStyle;let i=0,o=0;if(a.borderLineWidth){if(typeof a.borderLineWidth=="number")i=o=a.borderLineWidth;else if(Array.isArray(a.borderLineWidth)){const u=a.borderLineWidth;i=u[0]||0,o=u[2]||0}}let l=0,c=0;if(a.shadowBlur){if(typeof a.shadowBlur=="number")l=c=a.shadowBlur;else if(Array.isArray(a.shadowBlur)){const u=a.shadowBlur;l=u[0]||0,c=u[2]||0}}a.innerBorder||(n=i+o+l+c)}return t+n}catch{return 300}}setAutoHeightCallback(e){this.onAutoHeightCalculated=e}getColumnRange(){if(this.columnRangeCache)return this.columnRangeCache;const e=this.table.frozenColCount||0,t=this.table.rightFrozenColCount||0,n=this.table.colCount;let r=e,a=n-t-1;return e===0&&t===0&&(r=0,a=n-1),r>=n||a<r?null:(this.columnRangeCache={startCol:r,endCol:a},this.columnRangeCache)}calculateSubTableViewBox(e,t,n){var r,a,i;const o=e+this.table.columnHeaderLevelCount,l=this.table.getCellRangeRelativeRect({col:0,row:o});if(!l)return null;const c=((r=Et(this.table).originalRowHeights)===null||r===void 0?void 0:r.get(e))||0,u=this.getColumnRange();if(!u)return null;const{startCol:d,endCol:f}=u,h=this.table.getCellRangeRelativeRect({col:d,row:o}),p=this.table.getCellRangeRelativeRect({col:f,row:o});if(!h||!p)return null;const[g,v,m,_]=sd((a=t?.style)===null||a===void 0?void 0:a.margin),y=n||((i=t?.style)===null||i===void 0?void 0:i.height)||300;let w;if(w=y==="auto"?300:typeof y=="number"?y:300,w<=g+m)return{x1:h.left+_,y1:l.top+c,x2:p.right-v,y2:l.top+c};const C={x1:h.left+_,y1:l.top+c+g,x2:p.right-v,y2:l.top+c-m+w};return C.x2<=C.x1||C.y2<=C.y1?null:C}removeSubTable(e){var t;const n=Et(this.table),r=(t=n.subTableInstances)===null||t===void 0?void 0:t.get(e);if(r){if(this.saveSubTableCheckboxState(e,r),this.cleanupSubTableEventHandlers(r),typeof r.release=="function")try{r.release()}catch{}n.subTableInstances.delete(e)}}cleanupSubTableEventHandlers(e){var t,n,r,a;this.cleanupSubTableEventForwarding(e);const i=e.__afterRenderHandler;i&&(this.table.off("after_render",i),delete e.__afterRenderHandler);const o=e.__selectionHandler;o&&(e.off("click_cell",o),delete e.__selectionHandler);const l=e;!((n=(t=e.scenegraph)===null||t===void 0?void 0:t.stage)===null||n===void 0)&&n.defaultLayer&&l.__originalRenderMethod&&(e.scenegraph.stage.defaultLayer.render=l.__originalRenderMethod,delete l.__originalRenderMethod),!((a=(r=e.scenegraph)===null||r===void 0?void 0:r.stage)===null||a===void 0)&&a.defaultLayer&&l.__originalDrawMethod&&(e.scenegraph.stage.defaultLayer.draw=l.__originalDrawMethod,delete l.__originalDrawMethod);const c=l.__scrollHandler;c&&(this.table.off("can_scroll",c),delete l.__scrollHandler);const u=l.__subTableScrollHandler;u&&(e.off("can_scroll",u),delete l.__subTableScrollHandler);const d=l.__clipInterval;d&&(clearInterval(d),delete l.__clipInterval);const f=l.__antiFlickerHandler;f&&(this.table.off("after_render",f),delete l.__antiFlickerHandler);const h=l.__checkboxHandler;h&&(e.off("checkbox_state_change",h),delete l.__checkboxHandler)}setupScrollEventIsolation(e){const t=l=>{const c=this.table.canvas.getBoundingClientRect(),u=l.clientX-c.left,d=l.clientY-c.top,f=e.options.viewBox;return f?u>=f.x1&&u<=f.x2&&d>=f.y1&&d<=f.y2:!1},n=l=>{if(!(l&&l instanceof WheelEvent))return!0;const c=l.deltaY,u=c>0,d=c<0;return!(e.scrollTop<=0&&d)&&(!(()=>{const f=e.getAllRowsHeight(),h=e.scenegraph.height,p=e.scrollTop;if(f<=h)return!0;const g=f-h;return Math.abs(p-g)<=1})()||!u)};let r=!1;const a=l=>{const c=l;return c.event&&t(c.event)&&n(c.event)?(r=!0,!1):(r=!1,!0)};this.table.on("can_scroll",a);const i=l=>l.event===void 0||r;e.on("can_scroll",i);const o=e;o.__scrollHandler=a,o.__subTableScrollHandler=i}setupUnifiedSelectionManagement(e,t){const n=()=>{this.clearAllSelectionsExcept(e)};t.on("click_cell",n),t.__selectionHandler=n}calculateGroupLevelOffset(e){try{const t=this.table.getRecordShowIndexByCell(0,e),n=this.table.dataSource.getIndexKey(t);if(!Array.isArray(n)||n.length<=1)return 0;let r=0;for(let a=this.table.columnHeaderLevelCount;a<e;a++)try{const i=this.table.getRecordByCell(0,a);if(i&&typeof i=="object"&&"vtableMergeName"in i){const o=this.table.getRecordShowIndexByCell(0,a),l=this.table.dataSource.getIndexKey(o),c=Array.isArray(l)?l:[l];this.isAncestorGroup(c,n)&&(r+=this.table.getRowHeight(a))}}catch{}return r}catch{return 0}}isAncestorGroup(e,t){if(e.length>=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}setupSubTableCanvasClipping(e,t){var n;if(!(!((n=e.scenegraph)===null||n===void 0)&&n.stage))return;const r=e.scenegraph.stage,a=e,i=()=>{var u;try{const d=t+this.table.columnHeaderLevelCount,f=this.table.getFrozenRowsHeight(),h=this.table.getFrozenColsWidth(),p=this.table.getRightFrozenColsWidth(),g=this.table.getBottomFrozenRowsHeight(),v=this.table.tableNoFrameWidth,m=this.table.tableNoFrameHeight,_=d<this.table.frozenRowCount&&d>=this.table.columnHeaderLevelCount,y=d>=this.table.rowCount-this.table.bottomFrozenRowCount,w=this.calculateGroupLevelOffset(d),C=zi(this.table,t),S=C&&this.getDetailConfigForRecord?this.getDetailConfigForRecord(C,t):null,[,b,,x]=sd((u=S?.style)===null||u===void 0?void 0:u.margin);let E=0,k=m;return _?(E=w,k=m-g-w):y?(E=w,k=m-w):(E=f+w,k=m-f-g-w),{clipX:h+x,clipY:E,clipWidth:v-h-p-x/2-b/2,clipHeight:k}}catch{return null}},o=r.window;if(!o||typeof o.getContext!="function")return;const l=o.getContext();if(!l)return;const c=(u,d,f)=>{const h=u[d];typeof h=="function"&&(a[f]=h,u[d]=function(...p){l.save();try{const g=i();if(g&&g.clipWidth>0&&g.clipHeight>0){const v=o.dpr||o.devicePixelRatio||1;l.beginPath(),l.rect(g.clipX*v,g.clipY*v,g.clipWidth*v,g.clipHeight*v),l.clip()}return h.apply(this,p)}finally{l.restore()}})};r.defaultLayer&&(c(r.defaultLayer,"render","__originalRenderMethod"),c(r.defaultLayer,"draw","__originalDrawMethod"))}setupAntiFlickerMechanism(e){var t;try{const n=(t=e.scenegraph)===null||t===void 0?void 0:t.updateNextFrame;if(!n)return;const r=this.table,a=()=>{e&&n&&n.call(e.scenegraph)};r.on("after_render",a),e.__antiFlickerHandler=a}catch{}}updateSubTablePositionsForRowResize(){const e=Et(this.table);e.subTableInstances&&(e.subTableInstances.forEach(((t,n)=>{try{const r=n+this.table.columnHeaderLevelCount,a=this.table.scenegraph;let i=null;a&&typeof a.highPerformanceGetCell=="function"?i=a.highPerformanceGetCell(0,r):a&&typeof a.getCell=="function"&&(i=a.getCell(0,r));const o=i&&i.attribute&&typeof i.attribute.height=="number"?i.attribute.height:-1;e.originalRowHeights&&typeof o=="number"&&o!==-1&&e.originalRowHeights.set(n,o)}catch{}})),this.recalculateAllSubTablePositions())}recalculateAllSubTablePositions(e,t,n){var r;this.columnRangeCache=null;const a=Et(this.table);(r=a.subTableInstances)===null||r===void 0||r.forEach(((i,o)=>{var l,c;if(e!==void 0&&o<e||t!==void 0&&o>t)return;const u=zi(this.table,o),d=n?n(u,o):this.getDetailConfigForRecord?this.getDetailConfigForRecord(u,o):null,f=o+this.table.columnHeaderLevelCount,h=((l=a.originalRowHeights)===null||l===void 0?void 0:l.get(o))||0,p=this.table.getRowHeight(f)-h,g=this.calculateSubTableViewBox(o,d,p);if(g){const v=g.x2-g.x1,m=g.y2-g.y1;i.options.viewBox=g;const _=i.options;_.canvasWidth===v&&_.canvasHeight===m||(_.canvasWidth=v,_.canvasHeight=m,i.resize()),!((c=i.scenegraph)===null||c===void 0)&&c.stage&&i.scenegraph.stage.setViewBox(g,!1)}}))}cleanup(){if(!this.table)return;this.cleanupAllTimers();const e=Et(this.table);e&&e.subTableInstances&&(e.subTableInstances.forEach(((t,n)=>{this.removeSubTable(n)})),e.subTableInstances.clear()),this.columnRangeCache=null,this.getDetailConfigForRecord=void 0,this.table=null}getAllSubTableInstances(){return Et(this.table).subTableInstances}getSubTableInstance(e){var t;return((t=Et(this.table).subTableInstances)===null||t===void 0?void 0:t.get(e))||null}setCallbacks(e){this.getDetailConfigForRecord=e.getDetailConfigForRecord}setupSubTableEventForwarding(e,t){const n=e+this.table.columnHeaderLevelCount;Object.values(We.TABLE_EVENT_TYPE).forEach((r=>{var a;if(r){const i=(...c)=>{this.forwardSubTableEvent(r,e,n,t,c)};t.on(r,i);const o=t;o.__eventHandlers||(o.__eventHandlers=new Map);const l=o.__eventHandlers;l.has(r)||l.set(r,[]),(a=l.get(r))===null||a===void 0||a.push(i)}}))}forwardSubTableEvent(e,t,n,r,a){const i={eventType:e,masterBodyRowIndex:t,masterRowIndex:n,subTable:r,originalEventArgs:a};this.table.fireListeners(We.TABLE_EVENT_TYPE.PLUGIN_EVENT,{plugin:{name:"Master Detail Plugin"},event:a[0],pluginEventInfo:i})}clearMainTableSelectionInternal(){typeof this.table.clearSelected=="function"&&this.table.clearSelected()}clearAllSelectionsExcept(e){var t;this.clearMainTableSelectionInternal(),(t=Et(this.table).subTableInstances)===null||t===void 0||t.forEach(((n,r)=>{r!==e&&n&&typeof n.clearSelected=="function"&&n.clearSelected()}))}cleanupSubTableEventForwarding(e){const t=e;if(t.__eventHandlers){for(const[n,r]of t.__eventHandlers)for(const a of r)e.off(n,a);delete t.__eventHandlers}}},vE=class{constructor(e,t,n,r){this.currentMouseX=0,this.currentMouseY=0,this.isDragging=!1,this.dragStartIsPluginUnderline=!1,this.table=e,this.configManager=t,this.eventManager=n,this.callbacks=r,this.initMouseTracking()}initMouseTracking(){this.mouseEventListener=e=>{try{const t=this.table;if(t&&t.internalProps&&t.internalProps.canvas){const n=t.internalProps.canvas.getBoundingClientRect();this.currentMouseX=e.clientX-n.left,this.currentMouseY=e.clientY-n.top}}catch{}e.type==="mouseup"&&(this.isDragging=!1,this.dragStartIsPluginUnderline=!1)};try{const e=this.table;if(e&&e.internalProps&&e.internalProps.canvas){const t=e.internalProps.canvas;t.addEventListener("mousemove",this.mouseEventListener),t.addEventListener("mousedown",this.mouseEventListener),t.addEventListener("mouseup",this.mouseEventListener)}}catch{}}extendTableAPI(){this.extendUpdateCellContent(),this.extendUpdateResizeRow(),this.extendDealHeightMode(),this.extendUpdatePagination(),this.extendToggleHierarchyState(),this.extendUpdateFilterRules(),this.extendUpdateChartSizeForResizeColWidth(),this.extendUpdateChartSizeForResizeRowHeight(),this.extendGetRowY(),this.extendUpdateRowHeight(),this.extendGetResizeColAt()}extendUpdateCellContent(){const e=this.table;this.originalUpdateCellContent=e.scenegraph.updateCellContent.bind(e.scenegraph),e.scenegraph.updateCellContent=(t,n,r=!1)=>{var a,i,o,l;if(this.eventManager.isRowExpanded(n)){const c=n-this.table.columnHeaderLevelCount,u=bn(this.table,c),d=this.table.getRowHeight(n);if(u>0&&d!==u){this.table._setRowHeight(n,u,!1);const f=this.table.scenegraph.getCell(t,n),h=(a=f?.attribute)===null||a===void 0?void 0:a.y,p=(i=this.originalUpdateCellContent)===null||i===void 0?void 0:i.call(this,t,n,r);if(this.table._setRowHeight(n,d,!1),h!==void 0){const v=this.table.scenegraph.getCell(t,n);v&&v.attribute.y!==h&&v.setAttribute("y",h)}const g=this.table.scenegraph.getCell(t,n);return g&&(n!==this.table.rowCount-1&&this.callbacks.addUnderlineToCell(g,u),this.eventManager.handleAfterUpdateCellContentWidth({col:t,row:n,cellHeight:((o=g.attribute)===null||o===void 0?void 0:o.height)||0,cellGroup:g,padding:[0,0,0,0],textBaseline:"middle"})),p}}return(l=this.originalUpdateCellContent)===null||l===void 0?void 0:l.call(this,t,n,r)}}extendUpdateResizeRow(){const e=this.table;this.originalUpdateResizeRow=e.stateManager.updateResizeRow.bind(e.stateManager),e.stateManager.updateResizeRow=(t,n)=>{const r=e.stateManager;t=Math.ceil(t),n=Math.ceil(n);let a=r.rowResize.isBottomFrozen?r.rowResize.y-n:n-r.rowResize.y;if(Math.abs(a)<1)return;const i=r.rowResize.row,o=this.eventManager.isRowExpanded(i),l=r.table.internalProps.limitMinHeight;let c=l;if(o){const d=i-this.table.columnHeaderLevelCount,f=bn(this.table,d),h=this.table.getRowHeight(i)-f;c=this.dragStartIsPluginUnderline?l+h:f+l}let u=r.table.getRowHeight(r.rowResize.row)+a;if(u<c&&(u=c,a=u-r.table.getRowHeight(r.rowResize.row)),r.table.heightMode==="adaptive"&&r.rowResize.row<r.table.rowCount-1){let d=r.table.getRowHeight(r.rowResize.row+1);d-=a;let f=l;const h=r.rowResize.row+1;if(this.eventManager.isRowExpanded(h)){const p=h-this.table.columnHeaderLevelCount,g=bn(this.table,p);f=l+(this.table.getRowHeight(h)-g)}d-a<f&&(a=d-f)}a=Math.ceil(a),r.rowResize.row<r.table.columnHeaderLevelCount||r.rowResize.row>=r.table.rowCount-r.table.bottomFrozenRowCount?this.updateResizeColForRow(a,r):r.table.internalProps.rowResizeType==="all"?this.updateResizeColForAll(a,r):this.updateResizeColForRow(a,r),r.rowResize.y=n,r.table.scenegraph.component.updateResizeRow(r.rowResize.row,t,r.rowResize.isBottomFrozen),r.table.scenegraph.updateNextFrame()}}updateResizeColForRow(e,t){t.table.heightMode==="adaptive"&&t.rowResize.row<t.table.rowCount-1?(t.table.scenegraph.updateRowHeight(t.rowResize.row,e),t.table.scenegraph.updateRowHeight(t.rowResize.row+1,-e),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row+1)):(t.table.scenegraph.updateRowHeight(t.rowResize.row,e),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row))}updateResizeColForAll(e,t){for(let n=t.table.frozenRowCount;n<t.table.rowCount-t.table.bottomFrozenRowCount;n++)t.table.scenegraph.updateRowHeight(n,e),t.table.internalProps._heightResizedRowMap.add(n)}extendDealHeightMode(){const e=this.table.scenegraph;this.originalDealHeightMode=e.dealHeightMode.bind(e),e.dealHeightMode=()=>{if(this.table.heightMode!=="adaptive")return this.originalDealHeightMode();const t=this.eventManager.getExpandedRows(),n=this.table,r=n;n._clearRowRangeHeightsMap();let a,i;if((r.heightAdaptiveMode||"only-body")==="all")a=0,i=n.tableNoFrameHeight;else{const h=n.getRowsHeight(0,n.columnHeaderLevelCount-1),p=n.isPivotChart()?n.getBottomFrozenRowsHeight():0;a=n.columnHeaderLevelCount,i=n.tableNoFrameHeight-h-p}const o=n.isPivotChart()?n.rowCount-n.bottomFrozenRowCount:n.rowCount;if(t.length===0){let h=0;for(let p=a;p<o;p++)h+=n.getRowHeight(p);if(h>0){const p=i/h;for(let g=a;g<o;g++){const v=n.getRowHeight(g),m=Math.max(Math.round(v*p),20);e.setRowHeight(g,m)}}return}const l=new Map;let c=0;for(const h of t)if(h>=n.columnHeaderLevelCount&&h<o){const p=bn(n,h-n.columnHeaderLevelCount),g=n.getRowHeight(h),v=g-p;l.set(h,{baseHeight:p>0?p:g,detailHeight:v}),c+=v}let u=0;for(let h=a;h<o;h++)if(l.has(h)){const p=l.get(h);p&&(u+=p.baseHeight)}else u+=n.getRowHeight(h);const d=(i-c)/u;for(let h=a;h<o;h++){let p;if(l.has(h)){const g=l.get(h);if(g){const v=Math.round(g.baseHeight*d);p=v+g.detailHeight,l.set(h,{baseHeight:v,detailHeight:g.detailHeight})}else p=Math.round(n.getRowHeight(h)*d)}else{const g=n.getRowHeight(h);p=Math.round(g*d)}e.setRowHeight(h,p)}const f=[];for(let h=a;h<o;h++)f.push(h);if(f.length>0){const h=f.reduce(((p,g)=>p+n.getRowHeight(g)),0);if(Math.abs(h-i)>1){const p=f[f.length-1],g=i-f.slice(0,-1).reduce(((v,m)=>v+n.getRowHeight(m)),0);if(l.has(p)){const v=l.get(p);if(v){const m=v.detailHeight,_=Math.max(g,m);e.setRowHeight(p,_),l.set(p,{baseHeight:_-v.detailHeight,detailHeight:v.detailHeight})}}else e.setRowHeight(p,g)}}this.callbacks.updateOriginalHeightsAfterAdaptive(l),this.callbacks.updateSubTablePositions()}}extendUpdatePagination(){const e=this.table;this.originalUpdatePagination=e.updatePagination.bind(e),e.updatePagination=t=>{[...this.eventManager.getExpandedRows()].forEach((r=>{this.callbacks.collapseRowToNoRealRecordIndex(r)}));const n=this.originalUpdatePagination(t);return this.waitForRenderComplete((()=>{this.callbacks.restoreExpandedStatesAfter()})),n}}extendToggleHierarchyState(){const e=this.table;this.originalToggleHierarchyState=e.toggleHierarchyState.bind(e),e.toggleHierarchyState=(t,n,r=!0)=>{if(this.table.isHeader(t,n)){[...this.eventManager.getExpandedRows()].forEach((i=>{this.callbacks.collapseRowToNoRealRecordIndex(i)}));const a=this.originalToggleHierarchyState(t,n,r);return this.waitForRenderComplete((()=>{this.callbacks.restoreExpandedStatesAfter()})),a}return this.originalToggleHierarchyState(t,n,r)}}extendUpdateFilterRules(){const e=this.table;this.originalUpdateFilterRules=e.updateFilterRules.bind(e),e.updateFilterRules=t=>([...this.eventManager.getExpandedRows()].forEach((n=>{this.callbacks.collapseRow(n)})),this.originalUpdateFilterRules(t))}extendUpdateChartSizeForResizeColWidth(){const e=this.table;this.originalUpdateChartSizeForResizeColWidth=e.scenegraph.updateChartSizeForResizeColWidth.bind(e.scenegraph),e.scenegraph.updateChartSizeForResizeColWidth=t=>{const n=e.getRowHeight.bind(e);e.getRowHeight=a=>{if(this.eventManager.isRowExpanded(a)){const i=a-this.table.columnHeaderLevelCount,o=bn(this.table,i);return o>0?o:n(a)}return n(a)};const r=this.originalUpdateChartSizeForResizeColWidth(t);return e.getRowHeight=n,r}}extendUpdateChartSizeForResizeRowHeight(){const e=this.table;this.originalUpdateChartSizeForResizeRowHeight=e.scenegraph.updateChartSizeForResizeRowHeight.bind(e.scenegraph),e.scenegraph.updateChartSizeForResizeRowHeight=t=>{const n=e.getRowHeight.bind(e);e.getRowHeight=a=>{if(this.eventManager.isRowExpanded(a)){const i=a-this.table.columnHeaderLevelCount,o=bn(this.table,i);return o>0?o:n(a)}return n(a)};const r=this.originalUpdateChartSizeForResizeRowHeight(t);return e.getRowHeight=n,r}}extendGetRowY(){var e;const t=this.table.scenegraph;if(t.component){const n=t.component.showResizeRow.bind(t.component);n&&(t.component.showResizeRow=(a,i,o)=>this.protectedShowResizeRow(n,a,i,o));const r=(e=t.component.updateResizeRow)===null||e===void 0?void 0:e.bind(t.component);r&&(t.component.updateResizeRow=(a,i,o)=>this.protectedUpdateResizeRow(r,a,i,o))}}extendUpdateRowHeight(){const e=this.table.scenegraph;this.originalUpdateRowHeight=e.updateRowHeight.bind(e),e.updateRowHeight=(t,n,r)=>{if(!this.eventManager.isRowExpanded(t)||!this.isDragging||this.dragStartIsPluginUnderline)return this.originalUpdateRowHeight(t,n,r);n=Math.round(n),this.callbacks.updateRowHeightForExpand(t,n),e.updateContainerHeight(t,n)}}extendGetResizeColAt(){const e=this.table.scenegraph;this.originalGetResizeColAt=e.getResizeColAt.bind(e),e.getResizeColAt=(t,n,r)=>{if(!r){const a=this.table.getCellAtRelativePosition(t,n);if(a&&a.row>=0&&this.eventManager.isRowExpanded(a.row))return{col:-1,row:-1}}return this.originalGetResizeColAt(t,n,r)}}isMouseInPluginUnderlineArea(e){var t,n,r,a;try{const i=((n=(t=this.table.stateManager)===null||t===void 0?void 0:t.scroll)===null||n===void 0?void 0:n.verticalBarPos)||0,o=this.table.getRowsHeight(0,e-1)+this.table.getRowHeight(e)-i+(((a=(r=this.table.theme)===null||r===void 0?void 0:r.frameStyle)===null||a===void 0?void 0:a.shadowBlur)||0),l=this.currentMouseY>=o-(this.table.internalProps.limitMinHeight-1)&&this.currentMouseY<=o+(this.table.internalProps.limitMinHeight-1),c=this.eventManager.isRowExpanded(e);return!(l&&c)}catch{return!1}}protectedShowResizeRow(e,t,n,r){if(this.isDragging||(this.isDragging=!0,this.dragStartIsPluginUnderline=this.isMouseInPluginUnderlineArea(t)),this.dragStartIsPluginUnderline){const a=this.table.getRowsHeight.bind(this.table);this.table.getRowsHeight=(o,l)=>this.getRowsHeightWithOriginalHeight(o,l);const i=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=o=>{if(o===t&&this.eventManager.isRowExpanded(o)){const l=o-this.table.columnHeaderLevelCount,c=bn(this.table,l);return c>0?c:i(o)}return i(o)};try{return e(t,n,r)}finally{this.table.getRowsHeight=a,this.table.getRowHeight=i}}else{const a=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=i=>{if(i===t&&this.eventManager.isRowExpanded(i)){const o=i-this.table.columnHeaderLevelCount,l=bn(this.table,o);return a(i)-l}return a(i)};try{return e(t,n,r)}finally{this.table.getRowHeight=a}}}protectedUpdateResizeRow(e,t,n,r){if(this.dragStartIsPluginUnderline){const a=this.table.getRowsHeight.bind(this.table);this.table.getRowsHeight=(o,l)=>this.getRowsHeightWithOriginalHeight(o,l);const i=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=o=>{if(o===t&&this.eventManager.isRowExpanded(o)){const l=o-this.table.columnHeaderLevelCount,c=bn(this.table,l);return c>0?c:i(o)}return i(o)};try{return e(t,n,r)}finally{this.table.getRowsHeight=a,this.table.getRowHeight=i}}else{const a=this.table.getRowHeight.bind(this.table);this.table.getRowHeight=i=>{if(i===t&&this.eventManager.isRowExpanded(i)){const o=i-this.table.columnHeaderLevelCount,l=bn(this.table,o);return a(i)-l}return a(i)};try{return e(t,n,r)}finally{this.table.getRowHeight=a}}}getRowsHeightWithOriginalHeight(e,t){let n=0;for(let r=e;r<=t;r++)if(this.eventManager.isRowExpanded(r)&&r===t){const a=r-this.table.columnHeaderLevelCount,i=bn(this.table,a);n+=i>0?i:this.table.getRowHeight(r)}else n+=this.table.getRowHeight(r);return n}waitForRenderComplete(e){const t=()=>{this.table.off(We.TABLE_EVENT_TYPE.AFTER_RENDER,t),e()};this.table.on(We.TABLE_EVENT_TYPE.AFTER_RENDER,t)}cleanup(){if(this.mouseEventListener){try{const e=this.table;if(e&&e.internalProps&&e.internalProps.canvas){const t=e.internalProps.canvas;t.removeEventListener("mousemove",this.mouseEventListener),t.removeEventListener("mousedown",this.mouseEventListener),t.removeEventListener("mouseup",this.mouseEventListener)}}catch{}this.mouseEventListener=void 0}if(this.originalUpdateCellContent&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateCellContent&&(e.scenegraph.updateCellContent=this.originalUpdateCellContent),this.originalUpdateCellContent=void 0}if(this.originalUpdateResizeRow&&this.table){const e=this.table;e.stateManager&&e.stateManager.updateResizeRow&&(e.stateManager.updateResizeRow=this.originalUpdateResizeRow),this.originalUpdateResizeRow=void 0}if(this.originalDealHeightMode&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.dealHeightMode&&(e.scenegraph.dealHeightMode=this.originalDealHeightMode),this.originalDealHeightMode=void 0}if(this.originalUpdatePagination&&this.table){const e=this.table;e.updatePagination&&(e.updatePagination=this.originalUpdatePagination),this.originalUpdatePagination=void 0}if(this.originalToggleHierarchyState&&this.table){const e=this.table;e.toggleHierarchyState&&(e.toggleHierarchyState=this.originalToggleHierarchyState),this.originalToggleHierarchyState=void 0}if(this.originalUpdateFilterRules&&this.table){const e=this.table;e.updateFilterRules&&(e.updateFilterRules=this.originalUpdateFilterRules),this.originalUpdateFilterRules=void 0}if(this.originalUpdateChartSizeForResizeColWidth&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateChartSizeForResizeColWidth&&(e.scenegraph.updateChartSizeForResizeColWidth=this.originalUpdateChartSizeForResizeColWidth),this.originalUpdateChartSizeForResizeColWidth=void 0}if(this.originalUpdateChartSizeForResizeRowHeight&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateChartSizeForResizeRowHeight&&(e.scenegraph.updateChartSizeForResizeRowHeight=this.originalUpdateChartSizeForResizeRowHeight),this.originalUpdateChartSizeForResizeRowHeight=void 0}if(this.originalUpdateRowHeight&&this.table){const e=this.table;e.scenegraph&&e.scenegraph.updateRowHeight&&(e.scenegraph.updateRowHeight=this.originalUpdateRowHeight),this.originalUpdateRowHeight=void 0}if(this.originalGetResizeColAt&&this.table){const e=this.table.scenegraph;e&&e.getResizeColAt&&(e.getResizeColAt=this.originalGetResizeColAt),this.originalGetResizeColAt=void 0}this.isDragging=!1,this.dragStartIsPluginUnderline=!1,this.currentMouseX=0,this.currentMouseY=0,this.callbacks=null,this.table=null,this.configManager=null,this.eventManager=null}};function mE(e,t){const n=i=>{var o;const{col:l,row:c,checked:u,field:d}=i;if(e.isHeader(l,c)){const g=Et(e);t.getExpandedRows().forEach((v=>{var m;const _=v-e.columnHeaderLevelCount,y=(m=g.subTableInstances)===null||m===void 0?void 0:m.get(_);y&&d&&pv(y,typeof d=="string"?d:String(d),u)}));return}const f=c;if(!t.isRowExpanded(f))return;const h=c-e.columnHeaderLevelCount,p=(o=Et(e).subTableInstances)===null||o===void 0?void 0:o.get(h);p&&d&&pv(p,typeof d=="string"?d:String(d),u)},r=e.stateManager.updateHeaderCheckedState;e.stateManager.updateHeaderCheckedState=function(i,o,l){const c=this;let u,d=!0,f=!0,h=!1,p=!1;return c.checkedState.forEach(((g,v)=>{var m;v=v.includes(",")?v.split(",").map((S=>Number(S))):Number(v);const _=c.table.getTableIndexByRecordIndex(v),y=c.table.transpose?c.table.getCustomMerge(_,l):c.table.getCustomMerge(o,_),w=(m=c.table.dataSource)===null||m===void 0?void 0:m.get(v);if(y||!c.table.internalProps.enableCheckboxCascade&&w?.vtableMerge)return;const C=g?.[i];C==="indeterminate"?(p=!0,h=!0,d=!1,f=!1):C!==!0?d=!1:(f=!1,h=!0)})),u=p?"indeterminate":!!d||!f&&!!h&&"indeterminate",c.headerCheckedState[i]=u,u},e.on("checkbox_state_change",n);const a=yE(e);return()=>{e.off("checkbox_state_change",n),e.stateManager.updateHeaderCheckedState=r,a()}}function yE(e){const t=Et(e),n=t.subTableInstances.set;return n&&t.subTableInstances?(t.subTableInstances.set=function(r,a){const i=n.call(this,r,a),o=l=>{const{field:c}=l;_E(e,a,r,c)};return a.on("checkbox_state_change",o),a.__checkboxHandler=o,i},()=>{t.subTableInstances&&n&&(t.subTableInstances.set=n)}):()=>{}}function _E(e,t,n,r){const a=n+e.columnHeaderLevelCount;let i=!1;const o=t.stateManager.headerCheckedState[r];o!==void 0&&(i=o);const l=Ko(e,r);if(l!==-1&&e.stateManager&&(e.stateManager.setCheckedState(l,a,r,i),e.getCellType(l,a)==="checkbox"&&Es(l,a,i,e),e.internalProps.enableCheckboxCascade)){const c=e.stateManager.headerCheckedState[r],u=e.stateManager.updateHeaderCheckedState(r,l,0);c!==u&&e.isHeader(l,0)&&e.scenegraph.updateHeaderCheckboxCellState(l,0,u)}}function pv(e,t,n){if(!e.stateManager)return;e.stateManager.headerCheckedState[t]=n,(e.records||[]).forEach(((a,i)=>{const o=i.toString();a[t]=n;let l=e.stateManager.checkedState.get(o);l||(l={},e.stateManager.checkedState.set(o,l)),l[t]=n}));const r=Ko(e,t);if(r>=0){e.scenegraph.updateHeaderCheckboxCellState(r,0,n);for(let a=e.columnHeaderLevelCount;a<e.rowCount;a++)Es(r,a,n,e)}}var wE=class{constructor(e={}){this.id="Master Detail Plugin",this.name="Master Detail Plugin",this.runTime=[We.TABLE_EVENT_TYPE.BEFORE_INIT,We.TABLE_EVENT_TYPE.INITIALIZED,We.TABLE_EVENT_TYPE.SORT_CLICK,We.TABLE_EVENT_TYPE.AFTER_SORT,We.TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH,We.TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT],this.pluginOptions=e}run(...e){const t=e[0],n=e[1],r=e[2];if(n===We.TABLE_EVENT_TYPE.BEFORE_INIT)this.table=r,this.initializeManagers(),this.configManager.injectMasterDetailOptions(t.options);else if(n===We.TABLE_EVENT_TYPE.INITIALIZED)this.setupMasterDetailFeatures();else{if(n===We.TABLE_EVENT_TYPE.SORT_CLICK)return this.eventManager.executeMasterDetailBeforeSort(),!0;n===We.TABLE_EVENT_TYPE.AFTER_SORT?this.eventManager.executeMasterDetailAfterSort():n===We.TABLE_EVENT_TYPE.AFTER_UPDATE_CELL_CONTENT_WIDTH?this.eventManager.handleAfterUpdateCellContentWidth(t):n===We.TABLE_EVENT_TYPE.AFTER_UPDATE_SELECT_BORDER_HEIGHT&&this.eventManager.handleAfterUpdateSelectBorderHeight(t)}}initializeManagers(){var e;this.configManager=new fE(this.pluginOptions,this.table),this.eventManager=new hE(this.table,this.configManager.getChildrenKey());const t=(e=this.pluginOptions.enableCheckboxCascade)===null||e===void 0||e;this.subTableManager=new gE(this.table,t),this.configManager.setRowExpandedChecker((n=>this.eventManager.isRowExpanded(n))),this.configManager.setExpandRowCallback((n=>this.expandRow(n))),this.eventManager.setCallbacks({onUpdateSubTablePositions:()=>this.subTableManager.recalculateAllSubTablePositions(),onUpdateSubTablePositionsForRow:()=>this.subTableManager.updateSubTablePositionsForRowResize(),onExpandRow:(n,r)=>this.expandRow(n,r),onCollapseRow:(n,r)=>this.collapseRow(n,r),onCollapseRowToNoRealRecordIndex:n=>this.collapseRowToNoRealRecordIndex(n),onToggleRowExpand:(n,r)=>this.toggleRowExpand(n,r),getOriginalRowHeight:n=>bn(this.table,n)}),this.subTableManager.setCallbacks({getDetailConfigForRecord:(n,r)=>this.configManager.getDetailConfigForRecord(n,r)}),this.subTableManager.setAutoHeightCallback(((n,r)=>{this.handleAutoHeightUpdate(n,r)}))}setupMasterDetailFeatures(){this.initInternalProps(),this.eventManager.bindEventHandlers(),this.setupUnifiedSelectionManagement(),this.extendTableAPI(),this.initCheckboxCascade()}setupUnifiedSelectionManagement(){this.mainTableClickHandler=()=>{this.clearAllSubTableVisibleSelections()},this.table.on("click_cell",this.mainTableClickHandler)}initCheckboxCascade(){var e;((e=this.pluginOptions.enableCheckboxCascade)===null||e===void 0||e)&&(this.checkboxCascadeCleanup=mE(this.table,this.eventManager))}initInternalProps(){const e=Et(this.table);e.expandedRecordIndices=[],e.subTableInstances=new Map,e.originalRowHeights=new Map,e.subTableCheckboxStates=new Map}extendTableAPI(){this.tableAPIExtensions=new vE(this.table,this.configManager,this.eventManager,{addUnderlineToCell:e=>this.addUnderlineToCell(e),updateOriginalHeightsAfterAdaptive:e=>this.updateOriginalHeightsAfterAdaptive(e),collapseRowToNoRealRecordIndex:e=>this.collapseRowToNoRealRecordIndex(e),expandRow:e=>this.expandRow(e),restoreExpandedStatesAfter:()=>this.restoreExpandedStatesAfter(),collapseRow:e=>this.collapseRow(e),updateSubTablePositions:()=>this.subTableManager.recalculateAllSubTablePositions(),updateRowHeightForExpand:(e,t)=>this.updateRowHeightForExpand(e,t)}),this.tableAPIExtensions.extendTableAPI()}updateOriginalHeightsAfterAdaptive(e){const t=Et(this.table);for(const[n,r]of e){const a=n-this.table.columnHeaderLevelCount;t.originalRowHeights&&t.originalRowHeights.set(a,r.baseHeight)}}restoreExpandedStatesAfter(){const e=Et(this.table);!e.expandedRecordIndices||e.expandedRecordIndices.length===0||this.table.dataSource._currentPagerIndexedData&&e.expandedRecordIndices.forEach((t=>{try{const n=this.table.getBodyRowIndexByRecordIndex(t);if(n>=0){const r=n+this.table.columnHeaderLevelCount;this.expandRow(r)}}catch{}}))}expandRow(e,t){var n;const r=e-this.table.columnHeaderLevelCount,a=Et(this.table);if(this.eventManager.isRowExpanded(e))return;const i=this.table.getRecordIndexByCell(0,e);if(i==null)return;a.expandedRecordIndices&&(uE(a.expandedRecordIndices,i)||a.expandedRecordIndices.push(i)),this.eventManager.addExpandedRow(e);const o=this.table.getRowHeight(e);a.originalRowHeights&&(this.table.scenegraph.getCell(t,e),a.originalRowHeights.set(r,o));const l=zi(this.table,r),c=this.configManager.getDetailConfigForRecord(l,r),u=((n=c?.style)===null||n===void 0?void 0:n.height)||300,d=this.configManager.getChildrenKey(),f=Array.isArray(l[d])?l[d]:[],h=u==="auto"?300:typeof u=="number"?u:300;this.updateRowHeightForExpand(e,h),this.table.scenegraph.updateContainerHeight(e,h),a._heightResizedRowMap.add(e),this.subTableManager.renderSubTable(r,f,((p,g)=>this.configManager.getDetailConfigForRecord(p,g))),e!==this.table.rowCount-1&&this.drawUnderlineForRow(e),this.refreshRowIcon(e,t),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}handleAutoHeightUpdate(e,t){var n;try{const r=e+this.table.columnHeaderLevelCount,a=t-(this.table.getRowHeight(r)-(((n=Et(this.table).originalRowHeights)===null||n===void 0?void 0:n.get(e))||0));this.updateRowHeightForExpand(r,a),this.table.scenegraph.updateContainerHeight(r,a)}catch{}}collapseRow(e,t){const n=e-this.table.columnHeaderLevelCount,r=Et(this.table);if(!this.eventManager.isRowExpanded(e))return;const a=this.table.getRecordIndexByCell(0,e);if(a==null)return;if(this.subTableManager.removeSubTable(n),r.expandedRecordIndices){const o=dE(r.expandedRecordIndices,a);o>-1&&r.expandedRecordIndices.splice(o,1)}this.eventManager.removeExpandedRow(e);const i=this.table.getRowHeight(e)-bn(this.table,n);this.updateRowHeightForExpand(e,-i),r._heightResizedRowMap.delete(e),this.table.scenegraph.updateContainerHeight(e,-i),r.originalRowHeights&&r.originalRowHeights.delete(n),e!==this.table.rowCount-1&&this.removeUnderlineFromRow(e),this.refreshRowIcon(e,t),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}collapseRowToNoRealRecordIndex(e){const t=e-this.table.columnHeaderLevelCount,n=Et(this.table);if(!this.eventManager.isRowExpanded(e))return;this.subTableManager.removeSubTable(t),this.eventManager.removeExpandedRow(e);const r=this.table.getRowHeight(e)-bn(this.table,t);this.updateRowHeightForExpand(e,-r),n._heightResizedRowMap.delete(e),this.table.scenegraph.updateContainerHeight(e,-r),n.originalRowHeights&&n.originalRowHeights.delete(t),e!==this.table.rowCount-1&&this.removeUnderlineFromRow(e),this.refreshRowIcon(e),this.table.heightMode==="adaptive"&&this.table.scenegraph.dealHeightMode(),this.updateFrozenColumnShadowHeight()}toggleRowExpand(e,t){this.eventManager.isRowExpanded(e)?this.collapseRow(e,t):this.expandRow(e,t)}updateRowHeightForExpand(e,t){this.table._setRowHeight(e,this.table.getRowHeight(e)+t,!0);const n=e+1;let r=0;r=e<this.table.frozenRowCount?this.table.frozenRowCount-1:e>=this.table.rowCount-this.table.bottomFrozenRowCount?this.table.rowCount-1:Math.min(this.table.scenegraph.proxy.rowEnd,this.table.rowCount-this.table.bottomFrozenRowCount-1);for(let a=0;a<this.table.colCount;a++)for(let i=n;i<=r;i++){const o=this.table.scenegraph.highPerformanceGetCell(a,i);o.role==="cell"&&o.setAttribute("y",o.attribute.y+t)}}drawUnderlineForRow(e){if(!this.table.scenegraph)return;const t=this.getRowCells(e);t.length!==0&&(t.forEach(((n,r)=>{n&&n.attribute&&this.addUnderlineToCell(n)})),this.table.scenegraph.updateNextFrame())}getRowCells(e){const t=[];for(let n=0;n<this.table.colCount;n++){const r=this.table.scenegraph.getCell(n,e);r&&r.role==="cell"&&t.push(r)}return t}addUnderlineToCell(e){var t;const n=e.attribute,r=n.strokeArrayWidth||(n.lineWidth?[n.lineWidth,n.lineWidth,n.lineWidth,n.lineWidth]:[1,1,1,1]),a=n.strokeArrayColor||(n.stroke?[n.stroke,n.stroke,n.stroke,n.stroke]:["transparent","transparent","transparent","transparent"]);e._hasUnderline||(e._originalStrokeArrayWidth=[...r],e._originalStrokeArrayColor=[...a],e._hasUnderline=!0);const i=e._originalStrokeArrayWidth||r,o=e._originalStrokeArrayColor||a,l=[...i],c=[...o];if(l[2]=2*(.75*(i[2]||1)+.75*(i[0]||1)),o[2]!=="transparent"&&o[2])c[2]=o[2];else{const u=this.table.theme;c[2]=((t=u?.bodyStyle)===null||t===void 0?void 0:t.borderColor)||"#e1e4e8"}e.setAttributes({strokeArrayWidth:l,strokeArrayColor:c,stroke:!0})}removeUnderlineFromRow(e){this.getRowCells(e).forEach(((t,n)=>{t&&t._hasUnderline&&this.removeUnderlineFromCell(t)})),this.table.scenegraph.updateNextFrame()}removeUnderlineFromCell(e){e._hasUnderline&&(e._originalStrokeArrayWidth&&e._originalStrokeArrayColor&&(e.setAttributes({strokeArrayWidth:e._originalStrokeArrayWidth,strokeArrayColor:e._originalStrokeArrayColor}),delete e._originalStrokeArrayWidth,delete e._originalStrokeArrayColor),e._hasUnderline=!1)}refreshRowIcon(e,t){let n;typeof t=="number"?n=t:n=this.table.options.rowSeriesNumber?1:0;const r=this.table.getCellOriginRecord(n,e);if(r&&typeof r=="object"){const a=r,i=We.TYPES.HierarchyState;a.hierarchyState=this.eventManager.isRowExpanded(e)?i.expand:i.collapse,this.table.scenegraph.updateHierarchyIcon(n,e)}}setRecordChildren(e,t,n){const r=this.table.getCellOriginRecord(t,n);r&&(r[this.configManager.getChildrenKey()]=e,this.expandRow(n,t),this.table.scenegraph.updateCellContent(t,n))}release(){var e,t,n,r,a;const i=Et(this.table);i&&(i._isReleasing=!0);try{if(this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.checkboxCascadeCleanup){try{this.checkboxCascadeCleanup()}catch{}this.checkboxCascadeCleanup=void 0}if(this.eventManager)try{this.eventManager.cleanup()}catch{}if(this.subTableManager)try{this.subTableManager.cleanup()}catch{}if(this.configManager)try{this.configManager.release()}catch{}if(this.cleanupMasterDetailFeatures(),this.table&&i)try{(e=i.expandedRecordIndices)===null||e===void 0||e.splice(0),(t=i.subTableInstances)===null||t===void 0||t.clear(),(n=i.originalRowHeights)===null||n===void 0||n.clear(),(r=i.subTableCheckboxStates)===null||r===void 0||r.clear(),(a=i._heightResizedRowMap)===null||a===void 0||a.clear()}catch{}}catch{}finally{try{this.configManager=null,this.eventManager=null,this.subTableManager=null,this.tableAPIExtensions=null,this.table=null,this.pluginOptions=null}catch{}}}clearAllSubTableVisibleSelections(){var e;(e=Et(this.table).subTableInstances)===null||e===void 0||e.forEach((t=>{t&&typeof t.clearSelected=="function"&&t.clearSelected()}))}getAllSubTableInstances(){return this.subTableManager.getAllSubTableInstances()}getSubTableByRowIndex(e){const t=e-this.table.columnHeaderLevelCount;return this.subTableManager.getSubTableInstance(t)}getSubTableByBodyRowIndex(e){return this.subTableManager.getSubTableInstance(e)}filterSubTables(e){const t=[],n=this.subTableManager.getAllSubTableInstances();if(!n)return t;for(const[r,a]of n)try{e(r,a,zi(this.table,r))&&t.push({bodyRowIndex:r,subTable:a})}catch{}return t}updateFrozenColumnShadowHeight(){try{const e=this.table.frozenColCount;e>0&&this.table.scenegraph.component.setFrozenColumnShadow(e-1)}catch{}}cleanupMasterDetailFeatures(){this.mainTableClickHandler&&(this.table.off("click_cell",this.mainTableClickHandler),this.mainTableClickHandler=void 0),this.tableAPIExtensions&&(this.tableAPIExtensions.cleanup(),this.tableAPIExtensions=void 0)}},ks={cellInnerBorder:!1,defaultStyle:{bgColor:"#fff",borderColor:"#e5e6eb",color:"#1d2129",fontSize:14,fontFamily:"Inter, -apple-system, BlinkMacSystemFont, PingFang SC, Hiragino Sans GB, noto sans, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif"},headerStyle:{bgColor:"#f2f3f5",fontWeight:500,padding:[0,8,0,8],lineHeight:14},bodyStyle:{padding:[0,8,0,8],lineHeight:14},frameStyle:{},scrollStyle:{barToSide:!0,width:10,visible:"always",hoverOn:!1}},bE=(0,s.defineComponent)({name:"JFormItem",__name:"form-item",props:{id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>({})},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},isNotCol:{type:Boolean,default:!1}},setup(e){const t=new Set(["j-input-cards","j-input-rows","j-table"]),n=e,{formData:r,errorFields:a,span:i,labelWidth:o}=ra(),{getTableData:l,row:c,pRowData:u}=xs(),{t:d}=vt(),f=(0,s.ref)(0);(0,s.watch)(r,()=>{f.value++},{deep:!0});const h=(0,s.computed)(()=>(f.value,(n.getCompType?n.getCompType({config:n.config,formData:r,row:c,getTableData:l,pRowData:u}):n.type)||"")),p=(0,s.computed)(()=>{f.value;const C=In({config:n.config||{},getCompConfig:n.getCompConfig,formData:r,row:c,getTableData:l,pRowData:u});return C.needFormItem===void 0&&t.has(h.value)?{...C,needFormItem:!1}:C}),g=(0,s.computed)(()=>p.value.display!==!1),v=(0,s.computed)(()=>({id:n.id,type:h.value,config:p.value,children:n.children})),m=(0,s.computed)(()=>ws(h.value)&&!p.value?.notInput||p.value?.isInput),_=(0,s.computed)(()=>p.value?.labelWidth||o.value),y=(0,s.computed)(()=>(p.value?.rule||[]).some(C=>C.required===!0)),w=(0,s.computed)(()=>a?.value?.[n.id]?.msg||"");return(C,S)=>{const b=(0,s.resolveComponent)("j-comp"),x=(0,s.resolveComponent)("el-form-item"),E=(0,s.resolveComponent)("el-col");return g.value&&!e.isNotCol?((0,s.openBlock)(),(0,s.createBlock)(E,{key:0,span:p.value.span||(0,s.unref)(i),style:(0,s.normalizeStyle)({...p.value.colStyle||{}}),class:(0,s.normalizeClass)(p.value.colClass||{})},{default:(0,s.withCtx)(()=>[m.value&&p.value.needFormItem!==!1?((0,s.openBlock)(),(0,s.createBlock)(x,{key:0,label:(0,s.unref)(d)(p.value.notShowLabel?"":p.value.label||""),"label-position":p.value.labelPosition,"label-width":_.value,required:y.value,error:(0,s.unref)(d)(w.value),class:(0,s.normalizeClass)(`${h.value}-form-item`)},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(b,(0,s.normalizeProps)((0,s.guardReactiveProps)(v.value)),null,16)]),_:1},8,["label","label-position","label-width","required","error","class"])):((0,s.openBlock)(),(0,s.createBlock)(b,(0,s.normalizeProps)((0,s.mergeProps)({key:1},v.value)),null,16))]),_:1},8,["span","style","class"])):g.value?((0,s.openBlock)(),(0,s.createBlock)(b,(0,s.normalizeProps)((0,s.mergeProps)({key:1},v.value)),null,16)):(0,s.createCommentVNode)("",!0)}}}),gv=bE,CE=(0,s.defineComponent)({name:"JComp",__name:"comp",props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},id:{type:String,default:""},type:{type:String,default:""},getCompType:{type:Function,default:void 0},config:{type:Object,default:()=>{}},getCompConfig:{type:Function,default:void 0},children:{type:Array,default:()=>[]},row:{type:Object,default:void 0},isTableCell:{type:Boolean,default:!1},colNum:{type:Number,default:void 0},rowNum:{type:Number,default:void 0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,{useData:a}=vt(),{loadDataByComp:i,getDataByComp:o,getLabel:l}=a(),{contextType:c}=jg(),{formData:u,formChange:d,gutter:f,runFlow:h,runFlowByNotRunActions:p}=ra(),g=(0,s.computed)(()=>f?.value||16),{registerMethod:v,runFlow:m,runFlowByNotRunActions:_}=Jg(),{getTableData:y,row:w,rowChange:C,pRowData:S}=xs(),b=n.row||w;Xo({getTableData:y,row:b,rowChange:C,pRowData:S});const x=(0,s.computed)(()=>ws(L.value)&&!R.value?.notInput||R.value?.isInput||L.value==="j-tabs"||L.value==="j-collapse"||L.value==="j-table"),E=(0,s.computed)(()=>{if(["j-select","j-tree-select","j-checkbox"].includes(n.type)){const B={...n.config||{}};return!(n.type==="j-select"&&!B.multiple||n.type==="j-tree-select"&&!B.multiple)}return!1}),k=(0,s.computed)({get(){let B;if(b?B=b[n.id]:u?B=u[n.id]:B=n.modelValue,B===void 0&&L.value==="j-tabs"){if(R.value?.defaultValue)return R.value.defaultValue;const W=n.children.findIndex(X=>X.config?.active);return W>-1?"_tab"+W:"_tab0"}if(B===void 0&&L.value==="j-collapse"){if(R.value?.defaultValue)return R.value.defaultValue;const W=n.children.map((X,K)=>({item:X,index:K})).filter(({item:X})=>X.config?.active);return R.value?.accordion?W.length>0?"_collapse"+W[0].index:"":W.map(({index:X})=>"_collapse"+X)}return E.value?B?B.split(","):[]:B},set(B){B&&E.value&&(B=String(B||[])),b?b[n.id]=B:u&&(u[n.id]=B),r("update:modelValue",B)}}),T=(0,s.ref)(0);(0,s.watch)([()=>u,()=>b],()=>T.value++,{deep:!0});const R=(0,s.computed)(()=>(T.value,In({config:n.config,getCompConfig:n.getCompConfig,formData:u||{},row:b,getTableData:y,pRowData:S}))),D=(0,s.computed)(()=>(T.value,bs({type:n.type,getCompType:n.getCompType,config:R.value,formData:u||{},row:b,getTableData:y,pRowData:S})||"")),A=(0,s.computed)(()=>{if(L.value!=="j-tree")return o?o({type:L.value,config:R.value,formData:u||{},row:b,getTableData:y})||[]:R.value.options||[]}),L=(0,s.computed)(()=>n.isTableCell&&(D.value==="j-radio"||D.value==="j-checkbox")?"j-select":D.value==="j-textarea"?"j-input":((D.value==null||D.value==="")&&console.warn("组件类型不能为空"),D.value)),N=B=>l({value:B,config:I.value||{},formData:u||{},row:b,getTableData:y}),M=async B=>i?await i({type:L.value,config:I.value,formData:u||{},row:b,getTableData:y,params:B}):[],I=(0,s.computed)(()=>{const B={...R.value};return L.value==="j-layer-form"&&(B.schema=n.children),L.value==="el-collapse-item"&&B.label&&(B.title=B.label,delete B.label),["j-input-cards","j-input-rows","j-table"].includes(D.value)&&(B.columns=n.children.map(W=>{const X=W.config?.parentTableId;return X&&W.id&&W.id.startsWith(X+".")?{...W,id:W.id.slice(X.length+1)}:W})),n.isTableCell&&(D.value==="j-checkbox"&&(B.multiple=!0),D.value==="j-select"&&B.multiple&&(B.collapseTags=!0,B.collapseTagsTooltip=!0),D.value==="j-switch"&&(B.size="small"),D.value==="j-textarea"&&(B.type="textarea")),["j-button-layer","j-input-layer"].includes(n.type)&&(B.loadLayerData=M,B.getText=N),B.dataType&&(B.options=A.value),B}),$=(0,s.computed)(()=>{if(L.value==="j-layer-form"||L.value==="j-input-rows"||L.value==="j-input-cards")return{};const B={};return n.children.forEach((W,X)=>{let K=W;L.value==="j-tabs"&&(K={...W,type:"el-tab-pane",config:{...W.config||{},name:"_tab"+X}},c=="form"&&(K.config.needRow=K.config.needRow!==!1,K.config.needFormItem=K.config.needFormItem!==!1)),L.value==="j-collapse"&&(K={...W,type:"el-collapse-item",config:{...W.config||{},name:"_collapse"+X}},c=="form"&&(K.config.needRow=K.config.needRow!==!1,K.config.needFormItem=K.config.needFormItem!==!1)),K.slot?(B[K.slot]=B[K.slot]||[],B[K.slot].push(K)):(B.default=B.default||[],B.default.push(K))}),B}),ee=B=>{const W={...B,id:n.id,formData:u,row:b,getTableData:y,config:R.value,type:"change",colNum:n.colNum,rowNum:n.rowNum};R.value?.change&&R.value?.change(W),C&&C(W),d&&d(W),r("change",W)},oe=(0,s.ref)(),j=(0,s.ref)([]),U=(B,...W)=>{if(oe.value&&typeof oe.value[B]=="function")return oe.value[B](...W);console.warn(`方法 ${B} 不存在或不是函数`)},H=()=>{if(j.value.forEach(W=>W()),j.value=[],!v)return;const B=v(n.id,U);j.value.push(B)};return(0,s.watch)(()=>oe.value,()=>{H()}),(0,s.onMounted)(()=>{H(),n.id&&p&&p(n.id),n.id&&_&&_(n.id)}),(0,s.onBeforeUnmount)(()=>{j.value.forEach(B=>B()),j.value=[]}),(B,W)=>{const X=(0,s.resolveComponent)("JComp"),K=(0,s.resolveComponent)("el-row");return I.value.display!=!1&&x.value?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(L.value),(0,s.mergeProps)({key:0,ref_key:"compRef",ref:oe},I.value,{modelValue:k.value,"onUpdate:modelValue":W[0]||(W[0]=ne=>k.value=ne),"run-flow":(0,s.unref)(h),onChange:ee}),(0,s.createSlots)({_:2},[(0,s.renderList)($.value,(ne,he)=>({name:he,fn:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(ne,O=>((0,s.openBlock)(),(0,s.createBlock)(X,(0,s.mergeProps)({key:O.id},{ref_for:!0},O),null,16))),128))])}))]),1040,["modelValue","run-flow"])):I.value.display!=!1?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(L.value),(0,s.mergeProps)({key:1,ref_key:"compRef",ref:oe},I.value,{"run-flow":(0,s.unref)(h)||(0,s.unref)(m),onChange:ee}),(0,s.createSlots)({_:2},[(0,s.renderList)($.value,(ne,he)=>({name:he,fn:(0,s.withCtx)(()=>[I.value.needRow===!0||I.value.needRow?.[he]===!0?((0,s.openBlock)(),(0,s.createBlock)(K,{key:0,gutter:g.value},{default:(0,s.withCtx)(()=>[I.value.needFormItem===!0||I.value.needFormItem?.[he]===!0?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)(ne,O=>((0,s.openBlock)(),(0,s.createBlock)(gv,(0,s.mergeProps)({key:O.id},{ref_for:!0},O),null,16))),128)):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(ne,O=>((0,s.openBlock)(),(0,s.createBlock)(X,(0,s.mergeProps)({key:O.id},{ref_for:!0},O),null,16))),128))]),_:2},1032,["gutter"])):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(ne,O=>((0,s.openBlock)(),(0,s.createBlock)(X,(0,s.mergeProps)({key:O.id},{ref_for:!0},O),null,16))),128))])}))]),1040,["run-flow"])):(0,s.createCommentVNode)("",!0)}}}),vv=CE,SE=class{wrapContainer=null;container=null;currentValue=null;async onStart(e){const{value:t}=e;await this.createElement(e)&&t!=null&&this.setValue(t)}findColumnByField(e,t){for(const n of e){if(n.field===t)return n;if(n.columns){const r=this.findColumnByField(n.columns,t);if(r)return r}}return null}async createElement(e){return await this.createEditor(e)}async createEditor(e){const{container:t,referencePosition:n,col:r,row:a,table:i}=e,o=i.getBodyField(r,a),l=i.options?.columns||[],c=this.findColumnByField(l,o),u=c?._compConfig||{},d=(0,s.ref)(i.getCellOriginRecord(r,a)||{});if(!t)return!1;let f=c?._compType;if(d.value._compTypeByRender&&d.value._compTypeByRender[o]&&(f=d.value._compTypeByRender[o],!yv(f)))return this.currentValue=d.value[o],!1;const h=document.createElement("div");h.style.position="absolute",h.style.width="100%",h.style.height="100%",h.style.boxSizing="border-box";const{bgColor:p}=i.getCellStyle(r,a)||{};if(h.style.backgroundColor=p||"#FFFFFF",f==="j-switch"){const v=c?.style?.textAlign;h.style.display="flex",h.style.alignItems="center",h.style.justifyContent=v==="center"?"center":v==="right"?"flex-end":"flex-start",h.style.paddingLeft=v==="center"?"0":"11px"}this.wrapContainer=h,this.container=t,this.container&&this.container.appendChild(h),u.autoFocus=!0,this.currentValue=void 0;const g=(0,s.h)(vv,{id:o,type:f,config:u,getCompConfig:c._getCompConfig,getCompType:c._getCompType,row:d.value||{},isTableCell:!0,class:"j-comp-editor","onUpdate:modelValue":v=>{this.currentValue=v},colNum:r,rowNum:a});return g.appContext=i._getAppContext(),g.appContext.provides=i._getProvides(),(0,s.render)(g,h),n?.rect&&this.adjustPosition(n.rect),!0}getValue(){return this.currentValue}setValue(e){this.currentValue=e}adjustPosition(e){this.wrapContainer&&(this.wrapContainer.style.top=`${e.top}px`,this.wrapContainer.style.left=`${e.left}px`,this.wrapContainer.style.width=`${e.width-1}px`,this.wrapContainer.style.height=`${e.height-1}px`)}onEnd(){const e=this.wrapContainer;if(e){try{(0,s.render)(null,e)}catch{}try{e.isConnected?e.remove():this.container&&e.parentNode===this.container&&this.container.removeChild(e)}catch{}this.wrapContainer=null,this.container=null}}isEditorElement(e){return this.wrapContainer?.contains(e)?!0:this.isClickPopUp(e)}isClickPopUp(e){let t=e;for(;t;){if(t.classList){for(const n of["el-select-dropdown","el-popper","el-picker-panel","el-cascader-panel","el-autocomplete-suggestion","el-date-picker","el-time-picker"])if(t.classList.contains(n))return!0}t=t.parentNode}return!1}},mv=new Map;function xE(){if(!mv.has("j-comp-editor")){const e=new SE;ta.register.editor("j-comp-editor",e),mv.set("j-comp-editor",e)}}function EE(e){if(Tg(e))return"j-comp-editor"}function yv(e){if(e)return EE(e)}function kE(){xE()}var TE={class:"j-table-footer"},RE={key:0,class:"j-table-pagination"},ME=["onClick"],Kn=40,BE=(0,s.defineComponent)({name:"JTable",__name:"table",props:{id:{type:String,default:""},modelValue:{type:Array,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},records:{type:Array,default:()=>[]},isTree:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!1},parentKey:{type:String,default:""},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},selectStateKey:{type:String,default:""},isPage:{type:Boolean,default:!1},pageLayoutSimple:{type:Boolean,default:!1},pageSizes:Array,pageTotal:{type:Number,default:0},tablePage:{type:Number,default:1},pageSize:{type:Number,default:100},rowKey:{type:String,default:"id"},actions:{type:Array,default:()=>[]},actionFilter:{type:Function,default:null},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},isAnimationAppear:{type:Boolean,default:!1},heightMode:{type:String,default:"full"},maxHeight:{type:[String,Number],default:void 0},highlightMode:{type:String,default:"row"},editConfig:{type:Object,default:()=>({})},emptyTipText:{type:String,default:"暂无数据"},subColumns:{type:Array,default:()=>[]},isSubShowNumber:{type:Boolean,default:!0},subActions:{type:Array,default:()=>[]},loadChildren:{type:Function,default:null}},emits:["ready","selectionChanged","selectRecordsChanged","update:tablePage","update:pageSize","loadPageData","rowChange","update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=(0,s.getCurrentInstance)(),a=e,i=n,{formData:o}=ra(),{useData:l}=vt(),{getLabel:c,getCode:u,loadDataState:d,getObjectList:f}=l(),{openLayer:h}=La(),p=(0,s.computed)(()=>a.heightMode==="auto"?{height:"auto"}:{}),g=(0,s.reactive)({}),v=()=>{Object.keys(g).forEach(F=>{delete g[F]})},m=(0,s.ref)(40),_=(0,s.computed)(()=>{const F={};return a.heightMode==="auto"&&(a.emptyTipText&&m.value<200?F.height="200px":F.height=m.value+"px",F.flex="none",a.maxHeight&&(F.maxHeight=typeof a.maxHeight=="number"?`${a.maxHeight}px`:a.maxHeight)),F}),y=(0,s.ref)(null);let w=null,C=null,S=0,b=0,x=!1;const E=(0,s.ref)(0);let k=a.records.length,T=45;const R=(0,s.ref)(!1),D=(0,s.ref)({}),A=(0,s.ref)([]),L=(0,s.ref)(null),N=(0,s.ref)(0);let M=null,I=!1,$=!1;const ee=(F,Y,Q,le,G)=>{A.value=F,L.value=Y,N.value=Q,D.value={left:`${le}px`,top:`${G}px`},R.value=!0,I=!1,document.addEventListener("wheel",W,{passive:!1})},oe=()=>{R.value=!1,I=!1,$=!1,U(),document.removeEventListener("wheel",W)},j=()=>{U(),M=setTimeout(()=>{!I&&!$&&oe()},100)},U=()=>{M&&(clearTimeout(M),M=null)},H=()=>{I=!0,U()},B=()=>{I=!1,j()},W=F=>{F.preventDefault()},X=F=>{F.config?.disabled||(L.value&&F.click&&F.click({data:L.value,openLayer:h}),oe())},K=F=>{let Y=F.action.config?.display!==!1,Q=F.action.config?.disabled===!0;const le=a.actionFilter;if(le)try{const G=le(F);typeof G=="boolean"?Y=G:G&&typeof G=="object"&&(typeof G.display=="boolean"&&(Y=G.display),typeof G.disabled=="boolean"&&(Q=G.disabled))}catch{Y=F.action.config?.display!==!1,Q=F.action.config?.disabled===!0}return{display:Y,disabled:Q}},ne=(F,Y)=>Y.disabled?{...F,config:{...F.config||{},disabled:!0}}:F,he=F=>{const{Group:Y,Text:Q}=ta.CustomLayout,le=a.actionsMaxCount,G=F.filter(ge=>ge.config?.display!==!1),ae=G.length>le,ce=ae?G.slice(0,le-1):G;let ve=0;if(ce.forEach((ge,Se)=>{const Me=Ln(ge.config?.label||ge.label||"")||0;ve+=Me+(Se===0?24:12)}),ae){const ge=(Ln("更多")||0)+12;ve+=ge}const pe=Math.max(80,ve)+"px";return{field:"__actions__",title:a.actionsLabel,width:pe,maxWidth:pe,minWidth:pe,disableColumnResize:!0,disableSelect:!0,customLayout:ge=>{const{table:Se,row:Me,col:Pe}=ge,Be=Se.getCellOriginRecord(Pe,Me),Xe=Se.getRecordIndexByCell(Pe,Me),Ve=G.map(ye=>{const pt=K({action:ye,record:Be,recordIndex:Xe,col:Pe,row:Me,table:Se});return{action:ne(ye,{disabled:pt.disabled}),display:pt.display}}).filter(ye=>ye.display).map(ye=>ye.action),De=a.actionsMaxCount,Ke=Ve.length>De,Ze=Ke?Ve.slice(0,De-1):Ve,ht=Ke?Ve.slice(De-1):[],Qe=new Y({height:40,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",flexWrap:"nowrap"});if(Ze.forEach((ye,pt)=>{const He=ye.config?.disabled===!0,Wt=He?"#c9cdd4":ye.config?.danger?"#f53f3f":"#165dff",Xn=new Q({text:ye.label,fontSize:14,fill:Wt,boundsPadding:[0,12,0,pt==0?12:0],cursor:He?"not-allowed":"pointer"});Xn.addEventListener("click",()=>{!He&&ye.click&&ye.click({data:Be,openLayer:h})}),Xn.addEventListener("mouseenter",ir=>{He||(ir.target.setAttribute("fill",re(Wt,-20)),Se.scenegraph.stage.renderNextFrame())}),Xn.addEventListener("mouseleave",ir=>{He||(ir.target.setAttribute("fill",Wt),Se.scenegraph.stage.renderNextFrame())}),Qe.add(Xn)}),Ke&&ht.length>0){const ye="#1677ff",pt=new Q({text:"更多",fontSize:14,fill:ye,boundsPadding:[0,0,0,0],cursor:"pointer"});pt.addEventListener("mouseenter",He=>{He.target.setAttribute("fill",re(ye,-20)),Se.scenegraph.stage.renderNextFrame();const Wt=y.value?.getBoundingClientRect();Wt&&ee(ht,Be,Xe,He.canvasX+Wt.left-64,He.canvasY+Wt.top+8),$=!0,U()}),pt.addEventListener("mouseleave",He=>{He.target.setAttribute("fill",ye),Se.scenegraph.stage.renderNextFrame(),$=!1,j()}),Qe.add(pt)}return{rootContainer:Qe,renderDefault:!1}}}},O=(F,Y)=>{const{dataValue:Q,table:le,col:G,row:ae,value:ce}=F,ve=F.rect??le?.getCellRect?.(G,ae)??{width:0,height:0},pe=le?.getBodyField?.(G,ae),ge=le?.options?.columns||[],Se=(pe?Ne(ge,pe):null)?.style?.textAlign||"left",Me=8,Pe=Math.max(0,ve.width-Me*2);let Be=ce??Q;Be==null&&(Be="");const Xe=Te(typeof Be=="object"?JSON.stringify(Be):String(Be),Pe);let Ve=Me,De="left";return Se==="center"?(Ve=ve.width/2,De="center"):Se==="right"&&(Ve=Math.max(Me,ve.width-Me),De="right"),{elements:[{type:"text",text:Xe,x:Ve,y:ve.height/2,fontSize:14,fill:"#1d2129",textAlign:De,textBaseline:"middle"}],expectedHeight:Kn}},Z=(F,Y)=>{const{dataValue:Q,rect:le,table:G,col:ae,row:ce}=F;let ve="mdi:toggle-switch",pe="#165dff";Q||(ve="mdi:toggle-switch-off",pe="#e5e6eb");const ge=(0,Ar.getIcon)(ve),Se=ge?.body?.replace(/currentColor/g,pe),Me=[],Pe=G?.getBodyField?.(ae,ce),Be=G?.options?.columns||[],Xe=Pe?Ne(Be,Pe):null,Ve=8,De=40;let Ke=Ve;return Xe?.style?.textAlign==="center"?Ke=Math.max(Ve,(le.width-De)/2):Xe?.style?.textAlign==="right"&&(Ke=Math.max(Ve,le.width-De-Ve)),Me.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${De}" height="${De}" viewBox="0 0 ${ge?.width} ${ge?.height}" >${Se}</svg>`,x:Ke,y:(le.height-De)/2,width:De,height:De}),{elements:Me,expectedHeight:Kn}},ue=(F,Y)=>{const{dataValue:Q,rect:le}=F,G=Number(Q)||0,ae=5,ce=20,ve=4,pe=8,ge=(le.height-ce)/2,Se=[],Me=(0,Ar.getIcon)("mdi:star"),Pe=(0,Ar.getIcon)("mdi:star-half-full"),Be=(0,Ar.getIcon)("mdi:star-outline"),Xe="#f7ba2a",Ve="#e5e6eb";for(let De=0;De<ae;De++){const Ke=pe+De*(ce+ve),Ze=ge;if(G>=De+1){const ht=Me?.body?.replace(/currentColor/g,Xe);Se.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ce}" height="${ce}" viewBox="0 0 ${Me?.width} ${Me?.height}">${ht}</svg>`,x:Ke,y:Ze,width:ce,height:ce})}else if(G>De&&G<De+1){const ht=Pe?.body?.replace(/currentColor/g,Xe);Se.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ce}" height="${ce}" viewBox="0 0 ${Pe?.width} ${Pe?.height}">${ht}</svg>`,x:Ke,y:Ze,width:ce,height:ce})}else{const ht=Be?.body?.replace(/currentColor/g,Ve);Se.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${ce}" height="${ce}" viewBox="0 0 ${Be?.width} ${Be?.height}">${ht}</svg>`,x:Ke,y:Ze,width:ce,height:ce})}}return{elements:Se,expectedHeight:Kn}},se=(F,Y)=>{const{dataValue:Q,rect:le,table:G,col:ae,row:ce}=F,ve=G.getBodyField(ae,ce),pe=Ne(G.options?.columns||[],ve),ge=G.getCellOriginRecord?.(ae,ce)||G.getRecordByCell?.(ae,ce)||{},Se=Y||In({config:pe?._compConfig,getCompConfig:pe?._getCompConfig,formData:o||{},getTableData:at,row:ge})||{},Me=Number(Se.min)||0,Pe=Number(Se.max)||100,Be=Number(Q)||0,Xe=Pe-Me,Ve=Xe===0?0:Math.max(0,Math.min(100,(Be-Me)/Xe*100)),De=4,Ke=8,Ze=8,ht=(le.height-De)/2,Qe=String(Be),ye=Ln(Qe)||0,pt=Ke,He=ht,Wt=le.width-Ke*2-ye-Ze,Xn=Wt*Ve/100,ir=[],or=(on,dt,Ot)=>{const gt=Math.min(Ot,dt/2,on/2);return`M ${gt} 0 L ${on-gt} 0 Q ${on} 0 ${on} ${gt} L ${on} ${dt-gt} Q ${on} ${dt} ${on-gt} ${dt} L ${gt} ${dt} Q 0 ${dt} 0 ${dt-gt} L 0 ${gt} Q 0 0 ${gt} 0 Z`},us=(on,dt,Ot)=>{const gt=Math.min(Ot,dt/2,on/2);return on<=gt*2?or(on,dt,Ot):`M ${gt} 0 L ${on} 0 L ${on} ${dt} L ${gt} ${dt} Q 0 ${dt} 0 ${dt-gt} L 0 ${gt} Q 0 0 ${gt} 0 Z`},$u=or(Wt,De,De/2);if(ir.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${Wt}" height="${De}" viewBox="0 0 ${Wt} ${De}"><path d="${$u}" fill="#e5e6eb"/></svg>`,x:pt,y:He,width:Wt,height:De}),Xn>0){const on=us(Xn,De,De/2);ir.push({type:"icon",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${Xn}" height="${De}" viewBox="0 0 ${Xn} ${De}"><path d="${on}" fill="#165dff"/></svg>`,x:pt,y:He,width:Xn,height:De})}const Wu=pt+Wt+Ze,fg=le.height/2;return ir.push({type:"text",text:Qe,x:Wu,y:fg,fontSize:14,fill:"#333333",textAlign:"left",textBaseline:"middle"}),{elements:ir,expectedHeight:Kn}},we=F=>String(F).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Te=(F,Y)=>{if(!F)return"";if((Ln(F)||0)<=Y)return F;const Q="...",le=Ln(Q)||0;if(le>=Y)return"";let G=0,ae=F.length;for(;G<ae;){const ce=Math.ceil((G+ae)/2);(Ln(F.slice(0,ce))||0)+le<=Y?G=ce:ae=ce-1}return F.slice(0,G)+Q},Ee=(F,Y)=>{const{value:Q,rect:le,table:G,col:ae,row:ce}=F;if(!Q)return{elements:[],expectedHeight:Kn};const ve=G.getBodyField(ae,ce),pe=Ne(G.options?.columns||[],ve),ge=G.getCellOriginRecord?.(ae,ce)||G.getRecordByCell?.(ae,ce)||{},Se=Y||In({config:pe?._compConfig,getCompConfig:pe?._getCompConfig,formData:o||{},getTableData:at,row:ge})||{},Me=Number(Se.size)||16,Pe=Se.color,Be=(le.width-Me)/2,Xe=(le.height-Me)/2;let Ve=String(Q).trim();if(!Ve)return{elements:[],expectedHeight:Kn};if(Ve.startsWith("<svg")){const De=Ve.match(/<svg\b([^>]*)>([\s\S]*?)<\/svg>/i);if(De){const Ke=De[1]||"",Ze=De[2]||"";let ht=Ke.match(/\bviewBox\s*=\s*["']([^"']+)["']/i)?.[1];if(!ht){const Qe=Ke.match(/\bwidth\s*=\s*["']?([0-9.]+)[^"']*["']?/i)?.[1],ye=Ke.match(/\bheight\s*=\s*["']?([0-9.]+)[^"']*["']?/i)?.[1];ht=Qe&&ye?`0 0 ${Qe} ${ye}`:"0 0 24 24"}Ve=`<svg xmlns="http://www.w3.org/2000/svg" width="${Me}" height="${Me}" viewBox="${ht}">${Ze}</svg>`}else Ve=`<svg xmlns="http://www.w3.org/2000/svg" width="${Me}" height="${Me}" viewBox="0 0 24 24"></svg>`}else{const De=(0,Ar.getIcon)(Ve);if(De){const{body:Ke,width:Ze,height:ht}=De;Ve=`<svg xmlns="http://www.w3.org/2000/svg" width="${Me}" height="${Me}" viewBox="0 0 ${Ze} ${ht}">${Ke}</svg>`}}return Pe&&(Ve=Ve.replace(/currentColor/g,Pe)),{elements:[{type:"icon",svg:Ve,x:Be,y:Xe,width:Me,height:Me}],expectedHeight:Math.max(Kn,Me)}},Ye=(F,Y)=>{const{dataValue:Q,rect:le,table:G,col:ae,row:ce,value:ve}=F,pe=G.getBodyField(ae,ce),ge=Ne(G.options?.columns||[],pe),Se=G.getCellOriginRecord?.(ae,ce)||G.getRecordByCell?.(ae,ce)||{},Me=Y||In({config:ge?._compConfig,getCompConfig:ge?._getCompConfig,formData:o||{},getTableData:at,row:Se})||{},Pe=ge?.style?.textAlign||"left",Be=f({config:Me,row:Se,value:ge._fieldFormat?ve:Q});if(Be.length===0)return{elements:[],expectedHeight:Kn};const Xe=14,Ve=28,De=2,Ke=12,Ze=8,ht=6;let Qe=8,ye=Math.max(0,le.width-Qe*2),pt=Math.max(0,ye-Ke*2);const He=[],Wt=dt=>{const Ot=Ln(Te(dt,pt))||0;return Math.min(ye,Ot+Ke*2)},Xn=(dt,Ot,gt,Br,Dr)=>{const Pi=Te(gt,pt),Ni=we(Pi),Uu=Ln(Pi)||0,Yo=Math.min(ye,Uu+Ke*2),jF=Br||"#f2f3f5",$F=Dr||"#1d2129",WF=Ve/2+Xe*.35,UF=`<svg xmlns="http://www.w3.org/2000/svg" width="${Yo}" height="${Ve}" viewBox="0 0 ${Yo} ${Ve}"><rect x="0" y="0" width="${Yo}" height="${Ve}" rx="${De}" ry="${De}" fill="${jF}"/><text x="${Yo/2}" y="${WF}" text-anchor="middle" font-size="${Xe}" fill="${$F}">${Ni}</text></svg>`;return He.push({type:"icon",svg:UF,x:dt,y:Ot,width:Yo,height:Ve}),{tagWidth:Yo}},ir=()=>{const dt=[];let Ot=[],gt=0;for(let Br=0;Br<Be.length;Br++){const Dr=Be[Br],Pi=Dr.label,Ni=Wt(Pi),Uu={label:Pi,bg:Dr.color||"#f2f3f5",text:Dr.textColor||_t(Dr.color||"#f2f3f5"),width:Ni};Ot.length>0&>+Ze+Ni>ye?(dt.push({items:Ot,lineWidth:gt}),Ot=[Uu],gt=Ni):(Ot.push(Uu),gt+=Ot.length>1?Ze+Ni:Ni)}return Ot.length>0&&dt.push({items:Ot,lineWidth:gt}),{lines:dt,needsWrap:dt.length>1}};let{lines:or,needsWrap:us}=ir();Qe!==0&&us&&(Qe=0,ye=Math.max(0,le.width-Qe*2),pt=Math.max(0,ye-Ke*2),{lines:or,needsWrap:us}=ir());const $u=or.length*Ve+(or.length>1?(or.length-1)*ht:0);let Wu=Math.max(0,(le.height-$u)/2);const fg=us;for(let dt=0;dt<or.length;dt++){const Ot=or[dt];let gt=fg?Qe:Pe==="center"?Qe+Math.max(0,(ye-Ot.lineWidth)/2):Pe==="right"?Qe+Math.max(0,ye-Ot.lineWidth):Qe;for(let Br=0;Br<Ot.items.length;Br++){const Dr=Ot.items[Br],{tagWidth:Pi}=Xn(gt,Wu,Dr.label,Dr.bg,Dr.text);gt+=Pi+(Br<Ot.items.length-1?Ze:0)}Wu+=Ve+(dt<or.length-1?ht:0)}const on=Math.min(le.width,Math.max(0,...or.map(dt=>dt.lineWidth))+Qe*2);return{elements:He,expectedHeight:Math.max(Kn,$u),expectedWidth:on}},_t=F=>{if(!F)return"#1d2129";F=F.replace("#",""),F.length===3&&(F=F.split("").map(G=>G+G).join(""));const Y=parseInt(F.substring(0,2),16),Q=parseInt(F.substring(2,4),16),le=parseInt(F.substring(4,6),16);if((Y*299+Q*587+le*114)/1e3>=128){const G=Y/255,ae=Q/255,ce=le/255,ve=Math.max(G,ae,ce),pe=Math.min(G,ae,ce);let ge=0,Se=0;const Me=(ve+pe)/2;if(ve!==pe){const Ze=ve-pe;switch(Se=Me>.5?Ze/(2-ve-pe):Ze/(ve+pe),ve){case G:ge=(ae-ce)/Ze+(ae<ce?6:0);break;case ae:ge=(ce-G)/Ze+2;break;case ce:ge=(G-ae)/Ze+4;break}ge/=6}const Pe=.3,Be=Se;let Xe,Ve,De;if(Be===0)Xe=Ve=De=Pe;else{const Ze=(ye,pt,He)=>(He<0&&(He+=1),He>1&&(He-=1),He<.16666666666666666?ye+(pt-ye)*6*He:He<.5?pt:He<.6666666666666666?ye+(pt-ye)*(.6666666666666666-He)*6:ye),ht=Pe<.5?Pe*(1+Be):Pe+Be-Pe*Be,Qe=2*Pe-ht;Xe=Ze(Qe,ht,ge+1/3),Ve=Ze(Qe,ht,ge),De=Ze(Qe,ht,ge-1/3)}const Ke=Ze=>Math.round(Ze*255).toString(16).padStart(2,"0");return`#${Ke(Xe)}${Ke(Ve)}${Ke(De)}`}return"#ffffff"},$e=F=>{const{table:Y,row:Q,col:le,rect:G,value:ae}=F,{Group:ce,Text:ve}=ta.CustomLayout,pe=Y.getBodyField(le,Q),ge=Ne(Y.options?.columns||[],pe),Se=ge?._compConfig||{},Me=new ce({height:G.height,width:G.width,display:"flex",alignItems:"center",justifyContent:ge.style?.textAlign==="center"?"center":ge.style?.textAlign==="right"?"flex-end":"flex-start"}),Pe="#165dff",Be=new ve({text:String(ae??""),fontSize:14,fill:Pe,cursor:"pointer",boundsPadding:[0,8,0,8]});return Be.addEventListener("click",()=>{if(Se.click){const Xe=Y.getCellOriginRecord(le,Q);Se.click({row:Xe,column:ge,openLayer:h})}}),Be.addEventListener("mouseenter",Xe=>{Xe.target.setAttribute("fill",re(Pe,-20)),Y.scenegraph.stage.renderNextFrame()}),Be.addEventListener("mouseleave",Xe=>{Xe.target.setAttribute("fill",Pe),Y.scenegraph.stage.renderNextFrame()}),Me.add(Be),{rootContainer:Me,renderDefault:!1}},Re=F=>{const{table:Y,row:Q,col:le,rect:G}=F,{height:ae,width:ce}=G??Y.getCellRect(le,Q),{Group:ve,CheckBox:pe}=ta.CustomLayout,ge=Y.getBodyField(le,Q),Se=Ne(Y.options?.columns||[],ge),Me=Y.getCellOriginRecord(le,Q)||{},Pe=Se?.style?.textAlign==="right"?"flex-end":Se?.style?.textAlign==="center"?"center":"flex-start",Be=Se?.style?.textAlign==="right"?"flex-end":Se?.style?.textAlign==="center"?"center":"flex-start",Xe=(Qe,ye)=>{const pt=Me?.[ge];Me[ge]=(Array.isArray(pt)?pt:[]).map((He,Wt)=>Wt!==Qe?He:He&&typeof He=="object"?{...He,...ye}:{...ye})},Ve=()=>{Y.renderWithRecreateCells()},De=new ve({width:ce,height:Math.max(ae||0,40),display:"flex",flexDirection:"column",alignItems:Pe,justifyContent:"center",flexWrap:"nowrap"}),Ke=Me?.[ge];if(!Array.isArray(Ke))return{rootContainer:De,renderDefault:!1};const Ze=Ke,ht=new ve({width:ce,display:"flex",flexDirection:"row",flexWrap:"wrap",boundsPadding:[0,4,0,4],justifyContent:Be,alignItems:"center"});De.add(ht);for(let Qe=0;Qe<Ze.length;Qe++){const ye=Ze[Qe],pt=ye&&typeof ye=="object"?ye.label??ye.value??"":ye??"",He=new pe({text:{text:String(pt),fontSize:12},checked:!!(ye&&typeof ye=="object"&&ye.checked),disabled:!!(ye&&typeof ye=="object"&&ye.disabled),spaceBetweenTextAndIcon:2,boundsPadding:[4,4,4,4]});He.render?.(),ht.add(He),He.addEventListener("checkbox_state_change",()=>{const Wt=!!He.attribute?.checked;Xe(Qe,{checked:Wt}),Ve()})}return{rootContainer:De,renderDefault:!1}},Oe=F=>{const{table:Y,row:Q,col:le}=F,G=Y.getBodyField(le,Q),ae=Ne(Y.options?.columns||[],G),ce=ae?._compConfig||{};if(ae?._customLayout)return ae._customLayout({...F,config:ce,customLayout:ta.CustomLayout})},Ne=(F,Y)=>{for(const Q of F){if(Q.field===Y)return Q;if(Q.columns){const le=Ne(Q.columns,Y);if(le)return le}}return null},nt=F=>{const{table:Y,col:Q,row:le}=F,G=Y.getBodyField(Q,le),ae=Ne(Y.options?.columns||[],G);if(!ae)return{elements:[],expectedHeight:Kn};const ce=Y.getCellOriginRecord?.(Q,le)||Y.getRecordByCell?.(Q,le)||{},ve=In({config:ae._compConfig,getCompConfig:ae._getCompConfig,formData:o||{},getTableData:at,row:ce}),pe=bs({type:ae._compType,getCompType:ae._getCompType,config:ve,formData:o||{},getTableData:at,row:ce});ce._compTypeByRender=ce._compTypeByRender||{},ce._compTypeByRender[G]=pe;const ge={text:O,"j-switch":Z,"j-rate":ue,"j-slider":se,"j-tag":Ye,"j-input-tag":Ye,"j-icon":Ee}[pe]||O;return ge?ge(F,ve):{elements:[],expectedHeight:Kn}},Qt=(F,Y,Q,le)=>{const G=le.getBodyField(Y,Q),ae=Ne(le.options?.columns||[],G);if(ae._fieldFormat)return ae._fieldFormat(F,Y,Q,le);if(ae._compType==="dateTime"){const pe=ae._compConfig?.format||"YYYY-MM-DD HH:mm:ss";return Cs(F[G],pe)}const ce=Rg(F[G],c,{type:ae._compType,getCompType:ae._getCompType,getCompConfig:ae._getCompConfig,config:ae._compConfig,formData:o,getTableData:at,row:F});if(F[G]&&F[G]==ce.label&&ce.config.dataType&&ce.config.dataType!="options"&&!ce.config.options&&ce.type!="j-autocomplete"&&c&&u){var ve=u(ce.config.dataType,ce.config.dataCode,{value:F[G]});g[ve]=!0}return ce.label},J=()=>{if(!d?.value)return!1;const F=Object.keys(g);return F.length===0?!1:F.every(Y=>d.value?.[Y]===9)};(0,s.watch)(()=>J(),F=>{F&&w&&w.renderWithRecreateCells()});const de=F=>{const Y=F.filter(Q=>Q.config?.display!==!1).map(Q=>{const{id:le,type:G,config:ae,getCompConfig:ce,getCompType:ve,children:pe,customLayout:ge}=Q,{label:Se,width:Me,minWidth:Pe,maxWidth:Be,align:Xe,headerAlign:Ve,fieldFormat:De,editor:Ke,frozen:Ze,...ht}=ae||{},Qe=Ve??Xe,ye={field:le,title:Se,width:Me,minWidth:Pe,maxWidth:Be,...Qe?{headerStyle:{textAlign:Qe}}:{},style:{textAlign:Xe},_customLayout:ge,_fieldFormat:De,_compType:G,_compConfig:{...ht},_getCompConfig:ce,_getCompType:ve,frozen:Ze},pt=typeof ve=="function",He=yv(G);return(He||pt)&&(ye.editor=He||"j-comp-editor",x=!0),pt?ye.customRender=nt:(G==="j-switch"&&(ye.customRender=Z),G==="j-rate"&&(ye.customRender=ue),G==="j-slider"&&(ye.customRender=se),(G==="j-tag"||G==="j-input-tag")&&(ye.customRender=Ye),G==="j-icon"&&(ye.customRender=Ee)),G==="link"&&(ye.customLayout=$e),G==="checkbox"&&(ye.customLayout=Re),G==="j-switch"&&(ye.minWidth=ye.minWidth||Me,ye.maxWidth=ye.maxWidth||Me),ge&&(ye.customLayout=Oe),ye.fieldFormat=Qt,pe&&pe.length>0&&(ye.columns=de(pe)),ye});return a.isTree&&Y.length>0&&(Y[0].tree=!0),Y},re=(F,Y)=>{const Q=F.replace("#",""),le=parseInt(Q,16),G=Math.min(255,Math.max(0,(le>>16)+Y)),ae=Math.min(255,Math.max(0,(le>>8&255)+Y)),ce=Math.min(255,Math.max(0,(le&255)+Y));return`#${(G<<16|ae<<8|ce).toString(16).padStart(6,"0")}`},ie=()=>{let F=k;a.isPage&&(F=fn.value+k);let Y=Ln(String(F))||0;return a.subColumns&&a.subColumns.length>0&&(Y=Y+32),Math.max(45,Y+18)},fe=F=>{let Y=(Q,le,G,ae)=>{const ce=ae.getRecordIndexByCell(le,G);return a.isPage&&!F?fn.value+ce+1:ce+1};return F&&(Y=(Q,le,G,ae)=>ae.getRecordIndexByCell(le,G)+1),{field:"__sequence__",title:"序号",width:T,minWidth:T,maxWidth:T,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:Y,_getCompConfig:void 0,_getCompType:void 0}},ke=()=>({field:"__placeholder__",title:"",width:"auto",minWidth:60,disableColumnResize:!0,headerStyle:{textAlign:"center"},style:{textAlign:"center"},fieldFormat:()=>"",_getCompConfig:void 0,_getCompType:void 0}),Le=F=>{if(F.frozen)return F.frozen;if(F.columns)for(const Y of F.columns){const Q=Le(Y);if(Q)return Q}},Ie=F=>{const Y=[];return F.forEach(Q=>{if(Q.frozen){Y.push(Q);return}if(!Q.columns||Q.columns.length===0){Y.push(Q);return}const le=Ie(Q.columns),G=[],ae=[],ce=[];if(le.forEach(ve=>{const pe=Le(ve);pe==="left"?G.push(ve):pe==="right"?ae.push(ve):ce.push(ve)}),(G.length>0?1:0)+(ae.length>0?1:0)+(ce.length>0?1:0)<=1){Q.columns=le,Y.push(Q);return}G.length&&Y.push({...Q,columns:G}),ce.length&&Y.push({...Q,columns:ce}),ae.length&&Y.push({...Q,columns:ae})}),Y},Tt=F=>{let Y=0,Q=0;return F.forEach(le=>{if(le.columns&&le.columns.length>0){const G=Tt(le.columns);Y+=G.left,Q+=G.right}else le.frozen==="left"?Y++:le.frozen==="right"&&Q++}),{left:Y,right:Q}},rt=(F,Y,Q,le)=>{S=0,b=0,x=!1;const G={};let ae=de(F);ae.length===0&&(ae=[ke()]),ae=Ie(ae);const ce=[],ve=[],pe=[];ae.forEach(Pe=>{const Be=Le(Pe);Be==="left"?ce.push(Pe):Be==="right"?ve.push(Pe):pe.push(Pe)});const ge=Tt(ce),Se=Tt(ve);b+=ge.left,S+=Se.right,ae=[...ce,...pe,...ve],Y&&(ae.unshift(fe(le)),b++),Q.length>0&&(ae.push(he(Q)),S++),x&&(G.editCellTrigger="click",G.keyboardOptions={copySelected:!0,cutSelected:!0,pasteValueToCell:!0,selectAllOnCtrlA:!0});const Me=Pe=>{for(const Be of Pe)if(Be?._compType==="checkbox"||Be?.customRender===nt||Be?.customRender===Ye||Array.isArray(Be?.columns)&&Me(Be.columns))return!0;return!1};return Me(ae)&&!(a.subColumns&&a.subColumns.length>0)&&(G.defaultRowHeight="auto",G.defaultHeaderRowHeight=40),{columns:ae,option:G}},Rr=()=>{const F=rt(a.columns,a.isShowNumber&&!a.isTree,a.actions);ar.value&&b++;const Y={records:[],columns:F.columns,autoFillWidth:!0,enableCheckboxCascade:ar.value,enableHeaderCheckboxCascade:ar.value,rightFrozenColCount:S,frozenColCount:b,tooltip:{isShowOverflowTextTooltip:!0},hover:{highlightMode:a.highlightMode},select:{highlightMode:a.highlightMode},...F.option};return a.isTree&&a.defaultExpandAll&&!a.loadChildren&&(Y.hierarchyExpandLevel=Number.POSITIVE_INFINITY),a.emptyTipText&&(Y.emptyTip={text:a.emptyTipText}),a.isAnimationAppear&&(Y.animationAppear={duration:100,delay:0,type:"one-by-one",direction:"row"}),ar.value&&(Y.rowSeriesNumber={width:40,minWidth:40,maxWidth:40,disableColumnResize:!0,format:()=>"",field:"_checkState",cellType:"checkbox",headerType:"checkbox",headerStyle:{textAlign:"center"},style:{textAlign:"center"}}),Y.theme=ks,a.heightMode==="auto"&&(Y.theme={...ks,scrollStyle:{...ks.scrollStyle,hoverOn:!0,width:8}}),a.subColumns&&a.subColumns.length>0&&(C=new wE({detailTableOptions:{columns:rt(a.subColumns,a.isSubShowNumber,a.subActions,!0).columns,style:{margin:[8,8,8,0],height:"auto"},theme:ks,...F.option}}),Y.plugins=[C]),Y},Mr=F=>!a.isTree||!a.parentKey||F.some(Y=>Array.isArray(Y?.children)&&Y.children.length>0)?F:bg(F,(a.rowKey||"").split(",")[0]?.trim()||"id",a.parentKey),Pa=F=>{if(!y.value)return;v(),T=ie(),kE();const Y=Rr(),Q=SS();F&&F.length>=0?Y.records=Mr(F):Q.length>0?Y.records=Mr(Q):(Y.records=Mr(a.records),i("update:modelValue",Y.records)),w=new ta.ListTable(y.value,Y),w._getAppContext=()=>r?.appContext;const le=r?.provides;w._getProvides=()=>le,a.loadChildren&&w.on(ta.ListTable.EVENT_TYPE.TREE_HIERARCHY_STATE_CHANGE,async G=>{if(G.hierarchyState===ta.TYPES.HierarchyState.expand&&G.originData?.children===!0){w.setLoadingHierarchyState(G.col,G.row);try{const ae=await a.loadChildren(G.originData);a.isTree&&w&&typeof w.setRecordChildren=="function"?w.setRecordChildren(ae,G.col,G.row):C&&typeof C.setRecordChildren=="function"?C.setRecordChildren(ae,G.col,G.row):w&&typeof w.setRecordChildren=="function"&&w.setRecordChildren(ae,G.col,G.row)}catch(ae){console.error("Failed to load detail data:",ae),w.setLoadingHierarchyState(G.col,G.row)}}}),w.on("click_cell",G=>{const{col:ae,row:ce,cellType:ve,originData:pe}=G,ge=pe||{children:w.records};if(ar.value){if(ve==="checkbox"&&ae==0){if(ge.__checkState=G.target.attribute.checked,ce===0&&ge.__checkState===!1){const Me=Pe=>{!Array.isArray(Pe)||Pe.length===0||Pe.forEach(Be=>{Be&&(Be.__checkState=!1,Array.isArray(Be.children)&&Be.children.length>0&&Me(Be.children))})};Me(ge.children)}const Se=qt();Se.length==0&&w.setCellCheckboxState(0,0,!1),E.value=Se.length,i("selectionChanged",{isMultiple:!0,selections:Se,record:ge,checked:ge.__checkState}),w.renderWithRecreateCells()}}else setTimeout(()=>{const Se=qt();E.value=Se.length,i("selectionChanged",{isMultiple:!1,selections:Se,record:ge,checked:!0})},0)}),m.value=w.getAllRowsHeight(),i("ready",w)},Uo=()=>{w&&(w.release(),w=null)},xe=()=>w,Ae=F=>{if(v(),E.value=0,w){w.setScrollTop(0),k=F.length;const Y=Mr(F);if(a.subColumns&&a.subColumns.length>0)setTimeout(()=>{Uo(),Pa(Y)});else{const Q=ie();Q!==T?(T=Q,a.subColumns&&a.subColumns.length>0?(Uo(),Pa(Y)):Rt(Y)):w.setRecords(Y)}if(a.selectStateKey&&a.isMultiple){const Q=F.filter(le=>le[a.selectStateKey]);Ue(Q),E.value=Q.length,i("selectRecordsChanged",Q),i("selectionChanged",{isMultiple:!0,selections:Q,record:{children:w.records},checked:Q.length>0})}}},at=()=>w?w.records:[];(0,s.onMounted)(()=>{Pa()}),(0,s.onBeforeUnmount)(()=>{Uo(),U(),document.removeEventListener("wheel",W)});const Ft=(0,s.computed)({get(){return a.tablePage},set(F){i("update:tablePage",F)}}),_e=(0,s.ref)(0),St=(0,s.computed)({get(){return _e.value!==0?_e.value:a.pageSize},set(F){_e.value=F,i("update:pageSize",F)}}),fn=(0,s.computed)(()=>(Ft.value-1)*St.value),Gt=(F,Y)=>{i("loadPageData",{rows:Y,page:F})},qt=()=>{if(!w)return[];if(!ar.value){const F=w.getSelectedCellInfos();if(F&&F.length>0){const Y=F[0][0];return Y?.originData?[Y.originData]:[]}return[]}if(w.stateManager&&w.stateManager.checkedState){const F=[],Y=new Set,Q=ve=>{if(!ve)return;const pe=Nn(ve);if(pe){if(Y.has(pe))return;Y.add(pe);const ge={};ve.__checkState=!0,Go(ge,ve,["children"]),F.push(ge)}else console.warn("key is empty")},le=ve=>{const pe=ve?.children;!Array.isArray(pe)||pe.length===0||pe.forEach(ge=>{Q(ge),le(ge)})},G=w.stateManager.checkedState,ae=w.records,ce=(ve,pe,ge)=>{const Se=ge[pe[ve]];return ve<pe.length-1&&Se?.children&&Se.children.length>0?ce(ve+1,pe,Se.children||[]):Se};return G.forEach((ve,pe)=>{const ge=ve?._checkState;if(ge==="indeterminate"||ge===!0){const Se=ce(0,(pe+"").split(",").map(Number),ae);Q(Se),ge===!0&&le(Se)}}),F}return[]},Nn=F=>a.editConfig.isRemoveBtn?F._i:a.rowKey?a.rowKey.split(",").map(Y=>F[Y.trim()]).join("::"):"",Ue=F=>{if(w)if(ar.value||w.clearSelected(),a.rowKey){const Y=new Set(F.map(Nn)),Q="__checkState";if(!ar.value){const ve=w.records;for(let pe=0;pe<ve.length;pe++){const ge=ve[pe];if(!Y.has(Nn(ge)))continue;const Se=w.getTableIndexByRecordIndex(pe);w.selectRow(Se);break}return}const le=ve=>{ve.forEach(pe=>{if(Array.isArray(pe?.children)&&pe.children.length>0){le(pe.children);const ge=pe.children,Se=ge.filter(Pe=>Pe?.[Q]===!0),Me=ge.filter(Pe=>Pe?.[Q]===!1);Se.length==ge.length?pe[Q]=!0:Me.length==ge.length?pe[Q]=!1:pe[Q]="indeterminate",pe[Q]==="indeterminate"&&(pe.hierarchyState="expand")}else pe[Q]=!!Y.has(Nn(pe))})},G=w.records;a.isTree?le(G):G.forEach(ve=>{ve[Q]=Y.has(Nn(ve))});const ae=Rr();ae.records=G,w.updateOption(ae,{clearColWidthCache:!1,clearRowHeightCache:!1}),a.heightMode==="auto"&&(m.value=w.getAllRowsHeight());const ce=w.getAllBodyCells(1);for(let ve=0;ve<ce.length;ve++)ce[ve][0].originData[Q]==!0&&w.setCellCheckboxState(0,ve+1,!0);w.renderWithRecreateCells()}else console.warn("Warning: rowKey is not defined. Please set rowKey to enable row selection.")},ea=F=>{i("rowChange",F),w.renderWithRecreateCells()},Rt=F=>{if(!w)return;const Y=qt();if(Y.length>0){Ue(Y);return}const Q=Rr();Q.records=F||w.records,w.updateOption(Q,{clearColWidthCache:!1,clearRowHeightCache:!1}),a.heightMode==="auto"&&(m.value=w.getAllRowsHeight()),E.value=0},xt=()=>{w.renderWithRecreateCells()},an=(0,s.computed)(()=>a.editConfig.isAddBtn),Jn=(0,s.computed)(()=>a.editConfig.addBtnText||"添加"),_n=(0,s.computed)(()=>a.editConfig.isRemoveBtn),cs=(0,s.computed)(()=>a.editConfig.readonly),ar=(0,s.computed)(()=>a.isMultiple||_n.value),SS=()=>{const F=a.modelValue||[];return F.forEach(Y=>{Y._i||(Y._i=Nr())}),F};(0,s.watch)(()=>a.modelValue,()=>{Ae(SS())});const VF=(0,s.computed)(()=>{const F=Y=>{const Q=[];return Y.forEach(le=>{le.children&&le.children.length>0?Q.push(...F(le.children)):Q.push(le)}),Q};return F(a.columns)}),zF=()=>{const F={};F._i=Nr(),VF.value.forEach(Y=>{const Q=Y.config?.valueRowKey||Y.id||"";Q&&(F[Q]=Mn(Y.config?.defaultValue))}),w&&(w.addRecord(F),a.heightMode==="auto"&&Rt(),w.scrollToCell({col:0,row:w.records.length})),i("change",{id:a.id,value:F,data:F,formData:o,tableData:w.records,type:"add"})},HF=(0,s.computed)(()=>E.value>0),FF=()=>{if(!w)return;const F=qt();F.length!==0&&xS.ElMessageBox.confirm(`确定要删除选中的 ${F.length} 条记录吗?`,"删除确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const Y=w.records,Q=new Set(F.map(G=>G._i)),le=Y.filter(G=>!Q.has(G._i));Rt(le),i("update:modelValue",le),F.forEach(G=>{i("change",{id:a.id,value:G,data:G,formData:o,tableData:le,type:"delete"})}),E.value=0}).catch(()=>{})};return(0,s.watch)(()=>a.columns,(F,Y)=>{JSON.stringify(F)!==JSON.stringify(Y)&&Rt()}),(0,s.watch)(()=>[a.isTree,a.defaultExpandAll,a.isMultiple,a.isShowNumber,a.isPage,a.isAnimationAppear,a.actionsMaxCount,a.actionsLabel,a.actionFilter,a.heightMode,a.highlightMode,a.pageTotal,a.subColumns,a.isSubShowNumber,a.subActions,_n.value],()=>{Rt()}),(0,s.watch)(()=>a.actions,()=>{Rt()},{deep:!0}),Xo({getTableData:at,rowChange:ea}),t({getInstance:xe,setRecords:Ae,getRecords:at,getSelection:qt,setSelection:Ue,renderTable:xt}),(F,Y)=>{const Q=(0,s.resolveComponent)("j-button"),le=(0,s.resolveComponent)("el-space"),G=(0,s.resolveComponent)("el-pagination");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-table",{"j-table-auto":e.heightMode==="auto"}]),style:(0,s.normalizeStyle)(p.value)},[(0,s.createElementVNode)("div",{class:"j-table-wrapper",style:(0,s.normalizeStyle)(_.value)},[(0,s.createElementVNode)("div",{ref_key:"tableContainer",ref:y,class:(0,s.normalizeClass)("j-block")},null,512)],4),(0,s.createElementVNode)("div",TE,[e.isPage||!cs.value&&(an.value||_n.value)?((0,s.openBlock)(),(0,s.createElementBlock)("div",RE,[(0,s.createVNode)(le,null,{default:(0,s.withCtx)(()=>[an.value?((0,s.openBlock)(),(0,s.createBlock)(Q,{key:0,type:"link",label:Jn.value,icon:"mdi:add",onClick:zF},null,8,["label"])):(0,s.createCommentVNode)("",!0),_n.value?((0,s.openBlock)(),(0,s.createBlock)(Q,{key:1,type:"link",label:"删除",icon:"mdi:delete-outline",danger:"",disabled:!HF.value,onClick:FF},null,8,["disabled"])):(0,s.createCommentVNode)("",!0)]),_:1}),Y[2]||(Y[2]=(0,s.createElementVNode)("div",null,null,-1)),e.isPage?((0,s.openBlock)(),(0,s.createBlock)(G,{key:0,"current-page":Ft.value,"onUpdate:currentPage":Y[0]||(Y[0]=ae=>Ft.value=ae),"page-size":St.value,"onUpdate:pageSize":Y[1]||(Y[1]=ae=>St.value=ae),"page-sizes":e.pageSizes||[100,200,500,1e3],total:e.pageTotal,layout:"total, prev, pager, next,sizes",onChange:Gt},null,8,["current-page","page-size","page-sizes","total"])):(0,s.createCommentVNode)("",!0)])):(0,s.createCommentVNode)("",!0)]),R.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-table-dropdown",style:(0,s.normalizeStyle)(D.value),onMouseenter:H,onMouseleave:B},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(A.value,ae=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:ae.id,class:"j-table-dropdown-item",style:(0,s.normalizeStyle)({color:ae.config?.disabled?"var(--j-color-text-disabled)":ae.config?.danger?"var(--j-color-danger)":"var(--j-color-primary)",cursor:ae.config?.disabled?"not-allowed":"pointer",opacity:ae.config?.disabled?.7:1}),onClick:ce=>X(ae)},(0,s.toDisplayString)(ae.label),13,ME))),128))],36)):(0,s.createCommentVNode)("",!0)],6)}}}),DE=BE,_v=be(DE),AE=["title"],PE={key:0,style:{"margin-left":"8px"}},NE={key:0,class:"j-dialog-steps"},LE={class:"j-block j-overflow-y"},IE={key:1,class:"j-dialog-btns"},OE=(0,s.defineComponent)({name:"JDialog",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},subtitle:{type:Function,default:void 0},width:{type:Number,default:600},height:{type:Number,default:400},minWidth:{type:Number,default:300},minHeight:{type:Number,default:200},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},autoHeight:{type:Boolean,default:!1},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},zoomControls:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]}},emits:["update:visible","update:stepActive","cancel","ok","closed"],setup(e,{expose:t,emit:n}){const r=e,a=n,{t:i}=vt(),o=(0,s.ref)(!1),l=(0,s.ref)(!1),c=(0,s.ref)(""),u=(0,s.ref)(!1),d=(0,s.ref)(!0),f=(0,s.ref)(!1),h=(0,s.ref)(!0),p=(0,s.ref)(-1),g=(0,s.reactive)({isMove:!1,pageX:0,pageY:0,left:0,top:0,_left:0,_top:0}),v=(0,s.ref)(0),m=(0,s.ref)(),_=(0,s.ref)(48),y=(0,s.ref)(0),w=(0,s.ref)(0);(0,s.watch)(()=>r.visible,B=>{v.value=1,v.value=0,o.value=B,B===!0&&r.zoomControls&&(0,s.nextTick)(()=>{typeof document<"u"&&(m.value=document.querySelector(".j-dialog"),m.value&&(m.value.onmousemove=U))})},{immediate:!0});const C=(0,s.computed)(()=>{let B=r.height+v.value;return typeof window<"u"&&B+40>window.innerHeight&&(B=window.innerHeight-32-40),B}),S=(0,s.computed)(()=>{let B=0+v.value;return typeof document<"u"&&document.body&&(B=(document.body.clientWidth-x.value)/2),B}),b=(0,s.computed)(()=>{let B=0+v.value;return typeof window<"u"&&(B=(window.innerHeight-C.value-40)/2),B}),x=(0,s.computed)(()=>{let B=0+v.value;return B=r.width,typeof document<"u"&&document.body&&B>document.body.clientWidth&&(B=document.body.clientWidth-32),B}),E=B=>{c.value=B||"保存数据中...",l.value=!0},k=()=>{l.value=!1},T=()=>{r.beforeClose&&r.beforeClose()===!1||(o.value=!1,a("update:visible",!1),a("cancel"))},R=()=>{a("ok",E,k)},D=()=>{g.left=0,g.top=0,w.value=0,y.value=0,r.isStep&&(A.value=0,(0,s.nextTick)(()=>{I()})),a("closed")},A=(0,s.computed)({get(){return p.value!==-1?p.value:r.stepActive},set(B){p.value=B,a("update:stepActive",B)}}),L=()=>{A.value>0&&A.value--,(0,s.nextTick)(()=>{I()})},N=async()=>{await M()&&(A.value<r.steps.length-1&&(A.value+=1),(0,s.nextTick)(()=>{I()}))},M=async()=>{if(u.value=!0,r.validateSteps){const B=await r.validateSteps(r.stepActive,E,k);return u.value=!1,B}return u.value=!1,!0},I=()=>{switch(h.value=!0,f.value=!0,d.value=!0,A.value){case 0:f.value=!1;break;case r.steps.length-1:d.value=!1,h.value=!1;break;default:d.value=!1,f.value=!1;break}},$=(0,s.computed)(()=>r.steps.map(B=>({title:B,disabled:!0}))),ee=function(B){r.autoHeight||(g.pageX=B.pageX,g.pageY=B.pageY,g._left=g.left,g._top=g.top,g.isMove=!0,typeof document<"u"&&(document.onmouseup=oe,document.onmousemove=j))},oe=()=>{g.isMove=!1,typeof document<"u"&&(document.onmouseup=null,document.onmousemove=null)},j=B=>{if(g.isMove){const W=B.pageX-g.pageX,X=B.pageY-g.pageY;let K=g._left+W,ne=g._top+X;K+S.value<0&&(K=-S.value),typeof document<"u"&&document.body&&(y.value?K+y.value+S.value>document.body.clientWidth&&(K=document.body.clientWidth-y.value-S.value):K+x.value+S.value>document.body.clientWidth&&(K=document.body.clientWidth-x.value-S.value)),ne+b.value<0&&(ne=-b.value),typeof window<"u"&&(w.value?ne+w.value+b.value+40>window.innerHeight&&(ne=window.innerHeight-w.value-b.value-40):ne+C.value+b.value+40>window.innerHeight&&(ne=window.innerHeight-C.value-b.value-40)),g.left=K,g.top=ne}},U=B=>{const W=m.value.offsetLeft,X=m.value.offsetTop,K=m.value.clientWidth,ne=m.value.clientHeight,he=ne-_.value,O=m.value.scrollTop;if(B.clientX>W+K-10&&O+B.clientY>X+ne-10||O+B.clientY<X+5&&W+10>B.clientX)m.value.style.cursor="se-resize";else if(W+10>B.clientX&&O+B.clientY>X+ne-10||B.clientX>W+K-10&&O+B.clientY<X+5)m.value.style.cursor="sw-resize";else if(B.clientX>W+K-10||W+10>B.clientX)m.value.style.cursor="w-resize";else if(O+B.clientY>X+ne-10||O+B.clientY<X+5)m.value.style.cursor="s-resize";else{m.value.style.cursor="default",m.value.onmousedown=null;return}m.value.onmousedown=Z=>{const{clientX:ue}=Z,{clientY:se}=Z,we=g.left+S.value,Te=g.top+b.value;g._left=g.left,g._top=g.top,w.value||(w.value=he),y.value||(y.value=K),ue>we+10&&ue<we+K-10&&se>Te+5&&se<Te+47||(typeof document<"u"&&(document.onmousemove=function(Ee){Ee.preventDefault(),ue>we&&ue<we+10&&(ue>Ee.clientX&&(y.value=K+(ue-Ee.clientX),g.left=g._left-(ue-Ee.clientX)),ue<Ee.clientX&&y.value>r.minWidth&&(y.value=K-(Ee.clientX-ue),g.left=g._left+Ee.clientX-ue)),ue>we+K-10&&ue<we+K&&(ue>Ee.clientX&&y.value>r.minWidth&&(y.value=K-(ue-Ee.clientX)),ue<Ee.clientX&&typeof document<"u"&&document.body&&S.value+g.left+y.value<document.body.clientWidth&&(y.value=K+(Ee.clientX-ue))),se>Te&&se<Te+5&&(se>Ee.clientY&&(w.value=he+se-Ee.clientY,g.top=g._top-(se-Ee.clientY)),se<Ee.clientY&&w.value>r.minHeight&&(w.value=he-(Ee.clientY-se),g.top=g._top+Ee.clientY-se)),O+se>Te+he+38&&O+se<Te+he+48&&(se>Ee.clientY&&w.value>r.minHeight&&(w.value=he-(se-Ee.clientY)),se<Ee.clientY&&typeof window<"u"&&b.value+g.top+w.value+48<window.innerHeight&&(w.value=he+Ee.clientY-se))}),typeof document<"u"&&(document.onmouseup=function(){typeof document<"u"&&(document.onmousemove=null,document.onmouseup=null)}))}},H=async B=>{B.click&&await B.click()};return t({showLoading:E,hideLoading:k}),(B,W)=>{const X=(0,s.resolveComponent)("j-button"),K=(0,s.resolveComponent)("el-space"),ne=(0,s.resolveComponent)("el-step"),he=(0,s.resolveComponent)("el-steps"),O=(0,s.resolveComponent)("el-dialog");return(0,s.openBlock)(),(0,s.createBlock)(O,{modelValue:o.value,"onUpdate:modelValue":W[0]||(W[0]=Z=>o.value=Z),class:"j-dialog","align-center":"","append-to-body":!0,"destroy-on-close":e.destroyOnClose,"show-close":!1,modal:e.mask,"modal-penetrable":!e.mask,"close-on-click-modal":!1,width:`${y.value||x.value}px`,style:(0,s.normalizeStyle)({position:"fixed",left:`${S.value+g.left}px`,top:`${b.value+g.top}px`,"pointer-events":e.mask?"":"none"}),onClosed:D},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:"j-dialog-header",onMousedown:ee},[(0,s.createElementVNode)("div",{class:"j-dialog-header-left",title:(0,s.unref)(i)(e.title||""),style:(0,s.normalizeStyle)({cursor:e.autoHeight?"":"move"})},[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)((0,s.unref)(i)(e.title||"")),1),e.subtitle?((0,s.openBlock)(),(0,s.createElementBlock)("span",PE,[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(e.subtitle())))])):(0,s.createCommentVNode)("",!0)],12,AE),e.showCloseBtn?((0,s.openBlock)(),(0,s.createBlock)(K,{key:0,size:0},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(X,{type:"text",icon:"mdi:close",onClick:T})]),_:1})):(0,s.createCommentVNode)("",!0)],32),(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-dialog-window",{"j-dialog-window-hasBtns":e.hasBtns},{"j-dialog-window-hasSteps":e.isStep}]),style:(0,s.normalizeStyle)({height:e.autoHeight?"auto":(w.value>0?w.value:C.value)+"px"})},[e.isStep?((0,s.openBlock)(),(0,s.createElementBlock)("div",NE,[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({maxWidth:`${200*$.value.length}px`,width:"100%"})},[(0,s.createVNode)(he,{simple:"",active:A.value,space:160,"finish-status":"success"},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)($.value,(Z,ue)=>((0,s.openBlock)(),(0,s.createBlock)(ne,{key:ue,title:(0,s.unref)(i)(Z.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",LE,[(0,s.renderSlot)(B.$slots,"default")]),e.hasBtns?((0,s.openBlock)(),(0,s.createElementBlock)("div",IE,[(0,s.createVNode)(K,{size:8},{default:(0,s.withCtx)(()=>[e.isStep?((0,s.openBlock)(),(0,s.createBlock)(X,{key:0,size:"mini",disabled:d.value,label:(0,s.unref)(i)("上一步"),onClick:L},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0),e.isStep?((0,s.openBlock)(),(0,s.createBlock)(X,{key:1,size:"mini",disabled:f.value,loading:u.value,label:(0,s.unref)(i)("下一步"),onClick:N},null,8,["disabled","loading","label"])):(0,s.createCommentVNode)("",!0),!e.isStep&&e.showCloseBtn?((0,s.openBlock)(),(0,s.createBlock)(X,{key:2,size:"mini",label:(0,s.unref)(i)("取消"),onClick:T},null,8,["label"])):(0,s.createCommentVNode)("",!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.buttons,Z=>((0,s.openBlock)(),(0,s.createBlock)(X,(0,s.mergeProps)({ref_for:!0},Z.config,{key:Z.id,label:Z.label,onClick:ue=>H(Z)}),null,16,["label","onClick"]))),128)),e.hasSaveBtn?((0,s.openBlock)(),(0,s.createBlock)(X,{key:3,size:"mini",type:"primary",disabled:h.value&&e.isStep,label:(0,s.unref)(i)(e.btnText),onClick:R},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0)]),_:1})])):(0,s.createCommentVNode)("",!0)],6)]),_:3},8,["modelValue","destroy-on-close","modal","modal-penetrable","width","style"])}}}),VE=OE,wv=be(VE),zE=["element-loading-text"],HE={key:0,class:"j-dialog-full-header"},FE={class:"j-dialog-full-header-left"},jE=["src"],$E={class:"j-dialog-full-title-text"},WE={style:{height:"28px","line-height":"32px","margin-left":"8px"}},UE={class:"j-dialog-full-header-right"},YE={class:"j-dialog-full-body"},GE=(0,s.defineComponent)({name:"JDialogFull",__name:"index",props:{visible:{type:Boolean},title:{type:String,default:""},destroyOnClose:{type:Boolean,default:!1},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},showCloseBtn:{type:Boolean,default:!0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:stepActive","update:visible","cancel","ok","closed"],setup(e,{expose:t,emit:n}){const r=e,a=n,{logoImg:i,t:o}=vt(),l=(0,s.ref)(!1),c=(0,s.ref)(!1),u=(0,s.ref)(""),d=(0,s.ref)(!1),f=(0,s.ref)(!0),h=(0,s.ref)(!1),p=(0,s.ref)(!0),g=(0,s.ref)(-1);(0,s.watch)(()=>r.visible,R=>{l.value=R},{immediate:!0});const v=(0,s.computed)({get(){return g.value!==-1?g.value:r.stepActive},set(R){g.value=R,a("update:stepActive",R)}}),m=()=>{r.beforeClose&&r.beforeClose()===!1||(l.value=!1,a("update:visible",!1),a("cancel"))},_=()=>{a("ok",w,C)},y=()=>{r.isStep&&(v.value=0,(0,s.nextTick)(()=>{E()})),a("closed")},w=R=>{u.value=R||"保存数据中...",c.value=!0},C=()=>{c.value=!1},S=()=>{v.value>0&&v.value--,(0,s.nextTick)(()=>{E()})},b=async()=>{await x()&&(v.value<r.steps.length-1&&(v.value+=1),(0,s.nextTick)(()=>{E()}))},x=async()=>{if(d.value=!0,r.validateSteps){const R=await r.validateSteps(r.stepActive,w,C);return d.value=!1,R}return d.value=!1,!0},E=()=>{switch(p.value=!0,h.value=!0,f.value=!0,v.value){case 0:h.value=!1;break;case r.steps.length-1:f.value=!1,p.value=!1;break;default:f.value=!1,h.value=!1;break}},k=(0,s.computed)(()=>r.steps.map(R=>({title:R,disabled:!0}))),T=async R=>{R.click&&await R.click()};return t({showLoading:w,hideLoading:C}),(R,D)=>{const A=(0,s.resolveComponent)("el-step"),L=(0,s.resolveComponent)("el-steps"),N=(0,s.resolveComponent)("j-button"),M=(0,s.resolveComponent)("el-space"),I=(0,s.resolveComponent)("el-divider"),$=(0,s.resolveComponent)("el-dialog"),ee=(0,s.resolveDirective)("loading");return(0,s.openBlock)(),(0,s.createBlock)($,{modelValue:l.value,"onUpdate:modelValue":D[0]||(D[0]=oe=>l.value=oe),class:"j-dialog-full",width:"100%","append-to-body":!0,fullscreen:!0,"show-close":!1,modal:!0,"destroy-on-close":e.destroyOnClose,onClosed:y},{default:(0,s.withCtx)(()=>[(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"j-block j-dialog-full-window","element-loading-text":(0,s.unref)(o)(u.value)},[e.hasHeader?((0,s.openBlock)(),(0,s.createElementBlock)("div",HE,[(0,s.createElementVNode)("div",FE,[(0,s.unref)(i)?((0,s.openBlock)(),(0,s.createElementBlock)("img",{key:0,class:"j-dialog-full-header-logo",src:(0,s.unref)(i)},null,8,jE)):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("span",$E,(0,s.toDisplayString)((0,s.unref)(o)(e.title)),1),(0,s.createElementVNode)("span",WE,[e.subtitle?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(e.subtitle()),{key:0})):(0,s.createCommentVNode)("",!0)])]),(0,s.createElementVNode)("div",{class:"j-dialog-full-header-mid",style:(0,s.normalizeStyle)({maxWidth:`${200*k.value.length}px`})},[e.isStep?((0,s.openBlock)(),(0,s.createBlock)(L,{key:0,simple:"",active:v.value,space:160,"finish-status":"success"},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(k.value,(oe,j)=>((0,s.openBlock)(),(0,s.createBlock)(A,{key:j,title:(0,s.unref)(o)(oe.title)},null,8,["title"]))),128))]),_:1},8,["active"])):(0,s.createCommentVNode)("",!0)],4),(0,s.createElementVNode)("div",UE,[(0,s.createVNode)(M,{size:0},{default:(0,s.withCtx)(()=>[e.hasBtns?((0,s.openBlock)(),(0,s.createBlock)(M,{key:0},{default:(0,s.withCtx)(()=>[e.isStep?((0,s.openBlock)(),(0,s.createBlock)(N,{key:0,size:"mini",disabled:f.value,label:(0,s.unref)(o)("上一步"),onClick:S},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0),e.isStep?((0,s.openBlock)(),(0,s.createBlock)(N,{key:1,size:"mini",disabled:h.value,loading:d.value,label:(0,s.unref)(o)("下一步"),onClick:b},null,8,["disabled","loading","label"])):(0,s.createCommentVNode)("",!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.buttons,oe=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:oe.id},[oe.config?.display!==!1?((0,s.openBlock)(),(0,s.createBlock)(N,(0,s.mergeProps)({key:0,ref_for:!0},oe.config,{label:oe.label,onClick:j=>T(oe)}),null,16,["label","onClick"])):(0,s.createCommentVNode)("",!0)],64))),128)),e.hasSaveBtn?((0,s.openBlock)(),(0,s.createBlock)(N,{key:2,size:"mini",type:"primary",disabled:p.value&&e.isStep,label:(0,s.unref)(o)(e.btnText),onClick:_},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0)]),_:1})):(0,s.createCommentVNode)("",!0),e.showCloseBtn&&e.hasBtns?((0,s.openBlock)(),(0,s.createBlock)(I,{key:1,type:"vertical",style:{margin:"0 8px"}})):(0,s.createCommentVNode)("",!0),e.showCloseBtn?((0,s.openBlock)(),(0,s.createBlock)(N,{key:2,type:"text",icon:"mdi:close",onClick:m})):(0,s.createCommentVNode)("",!0)]),_:1})])])):e.showCloseBtn?((0,s.openBlock)(),(0,s.createBlock)(N,{key:1,type:"primary",icon:"mdi:close",shape:"circle",onClick:m,class:"j-fixed-close"})):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",YE,[(0,s.renderSlot)(R.$slots,"default")])],8,zE)),[[ee,c.value]])]),_:3},8,["modelValue","destroy-on-close"])}}}),qE=GE,bv=be(qE),JE=["element-loading-text"],XE={class:"j-block"},KE={key:0,class:"j-drawer-bottom-btns"},ZE={class:"j-drawer--header"},QE={class:"j-drawer--title"},ek={style:{height:"28px","line-height":"32px","margin-left":"8px"}},tk={key:0,class:"j-drawer--btns"},nk={key:0,class:"j-drawer-steps"},rk=(0,s.defineComponent)({name:"JDrawer",__name:"drawer",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},direction:{type:String,default:"rtl"},height:{type:Number,default:400},width:{type:Number,default:600},mask:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},beforeClose:{type:Function,default:void 0},isStep:{type:Boolean,default:!1},stepActive:{type:Number,default:0},steps:{type:Array,default:()=>[]},validateSteps:{type:Function,default:void 0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},showCloseBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},subtitle:{type:Function,default:void 0}},emits:["update:visible","update:stepActive","closed","ok","cancel"],setup(e,{expose:t,emit:n}){const r=e,{t:a}=vt(),i=n,o=(0,s.ref)(!1),l=(0,s.ref)(""),c=(0,s.computed)(()=>["ltr","rtl"].indexOf(r.direction)!==-1?`${r.width}px`:`${r.height}px`),u=(0,s.computed)({get(){return r.visible},set(R){i("update:visible",!!R)}}),d=R=>{l.value=R||"保存数据中...",o.value=!0},f=()=>{o.value=!1},h=()=>{r.isStep&&(S.value=0,(0,s.nextTick)(()=>{k()})),i("closed")},p=()=>{i("ok",d,f)},g=()=>{r.beforeClose&&r.beforeClose()===!1||(u.value=!1,i("update:visible",!1),i("cancel"))},v=async R=>{R.click&&await R.click()},m=(0,s.ref)(!1),_=(0,s.ref)(!0),y=(0,s.ref)(!1),w=(0,s.ref)(!0),C=(0,s.ref)(-1),S=(0,s.computed)({get(){return C.value!==-1?C.value:r.stepActive},set(R){C.value=R,i("update:stepActive",R)}}),b=()=>{S.value>0&&S.value--,(0,s.nextTick)(()=>{k()})},x=async()=>{await E()&&(S.value<r.steps.length-1&&(S.value+=1),(0,s.nextTick)(()=>{k()}))},E=async()=>{if(m.value=!0,r.validateSteps){const R=await r.validateSteps(r.stepActive,d,f);return m.value=!1,R}return m.value=!1,!0},k=()=>{switch(w.value=!0,y.value=!0,_.value=!0,S.value){case 0:y.value=!1;break;case r.steps.length-1:_.value=!1,w.value=!1;break;default:_.value=!1,y.value=!1;break}},T=(0,s.computed)(()=>r.steps.map(R=>({title:R,disabled:!0})));return t({showLoading:d,hideLoading:f}),(R,D)=>{const A=(0,s.resolveComponent)("el-input"),L=(0,s.resolveComponent)("j-button"),N=(0,s.resolveComponent)("el-space"),M=(0,s.resolveComponent)("el-step"),I=(0,s.resolveComponent)("el-steps"),$=(0,s.resolveComponent)("el-drawer"),ee=(0,s.resolveDirective)("loading");return(0,s.openBlock)(),(0,s.createBlock)($,{modelValue:u.value,"onUpdate:modelValue":D[0]||(D[0]=oe=>u.value=oe),class:"j-drawer","append-to-body":!0,direction:e.direction,size:c.value,"with-header":!1,"wrapper-closable":!0,"destroy-on-close":e.destroyOnClose,modal:e.mask,"before-close":e.beforeClose,"close-on-click-modal":!0,onClosed:h},{default:(0,s.withCtx)(()=>[(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-drawer--warpper",{"j-drawer--warpper-hasSteps":e.isStep}]),"element-loading-text":l.value},[(0,s.createElementVNode)("div",{class:"j-drawer--body",style:(0,s.normalizeStyle)({"padding-bottom":e.showCloseBtn||e.hasSaveBtn||e.buttons.length>0?"48px":"0"})},[(0,s.createVNode)(A,{style:{position:"absolute",top:"-200px"}}),(0,s.createElementVNode)("div",XE,[(0,s.renderSlot)(R.$slots,"default")]),e.hasBtns?((0,s.openBlock)(),(0,s.createElementBlock)("div",KE,[(0,s.createVNode)(N,{size:8},{default:(0,s.withCtx)(()=>[e.isStep?((0,s.openBlock)(),(0,s.createBlock)(L,{key:0,size:"mini",disabled:_.value,label:(0,s.unref)(a)("上一步"),onClick:b},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0),e.isStep?((0,s.openBlock)(),(0,s.createBlock)(L,{key:1,size:"mini",disabled:y.value,loading:m.value,label:(0,s.unref)(a)("下一步"),onClick:x},null,8,["disabled","loading","label"])):(0,s.createCommentVNode)("",!0),!e.isStep&&e.showCloseBtn?((0,s.openBlock)(),(0,s.createBlock)(L,{key:2,size:"mini",label:(0,s.unref)(a)("取消"),onClick:g},null,8,["label"])):(0,s.createCommentVNode)("",!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.buttons,oe=>((0,s.openBlock)(),(0,s.createBlock)(L,(0,s.mergeProps)({key:oe.id},{ref_for:!0},oe.config,{label:oe.label,onClick:j=>v(oe)}),null,16,["label","onClick"]))),128)),e.hasSaveBtn?((0,s.openBlock)(),(0,s.createBlock)(L,{key:3,size:"mini",type:"primary",disabled:w.value&&e.isStep,label:(0,s.unref)(a)(e.btnText),onClick:p},null,8,["disabled","label"])):(0,s.createCommentVNode)("",!0)]),_:1})])):(0,s.createCommentVNode)("",!0)],4),(0,s.createElementVNode)("div",ZE,[(0,s.createElementVNode)("div",QE,[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)((0,s.unref)(a)(e.title)),1),(0,s.createElementVNode)("span",ek,[e.subtitle?((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(e.subtitle()),{key:0})):(0,s.createCommentVNode)("",!0)])]),e.showCloseBtn?((0,s.openBlock)(),(0,s.createElementBlock)("div",tk,[(0,s.createVNode)(L,{type:"text",icon:"mdi:close",onClick:g})])):(0,s.createCommentVNode)("",!0)]),e.isStep?((0,s.openBlock)(),(0,s.createElementBlock)("div",nk,[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({maxWidth:`${200*T.value.length}px`,width:"100%"})},[(0,s.createVNode)(I,{simple:"",active:S.value,space:160,"finish-status":"success"},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(T.value,(oe,j)=>((0,s.openBlock)(),(0,s.createBlock)(M,{key:j,title:(0,s.unref)(a)(oe.title)},null,8,["title"]))),128))]),_:1},8,["active"])],4)])):(0,s.createCommentVNode)("",!0)],10,JE)),[[ee,o.value]])]),_:3},8,["modelValue","direction","size","destroy-on-close","modal","before-close"])}}}),ak=rk,Cv=be(ak),ik=(0,s.defineComponent)({name:"JLayer",__name:"layer",props:{width:{type:Number,default:600},height:{type:Number,default:400},isStep:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},hasHeader:{type:Boolean,default:!0},hasBtns:{type:Boolean,default:!0},hasSaveBtn:{type:Boolean,default:!0},btnText:{type:String,default:"保存"},buttons:{type:Array,default:()=>[]},destroyOnClose:{type:Boolean,default:!0},validateSteps:{type:Function,default:void 0},beforeClose:{type:Function,default:void 0}},emits:["ok","closed","cancel"],setup(e,{expose:t,emit:n}){const r=n,a=(0,s.ref)(!1),i=(0,s.ref)(""),o=(0,s.ref)(),l=(0,s.ref)(0),c=(0,s.ref)(""),u=(0,s.ref)(),d=(_,y,w)=>{i.value=_,u.value=w,c.value=y||"modal",a.value=!0},f=()=>{a.value=!1},h=(_,y)=>{r("ok",_,y)},p=()=>{l.value=0,r("closed")},g=()=>{r("cancel")},v=_=>{o.value&&o.value.showLoading(_)},m=()=>{o.value&&o.value.hideLoading()};return qg({stepActive:l}),t({open:d,close:f,showLoading:v,hideLoading:m}),(_,y)=>{const w=(0,s.resolveComponent)("j-dialog-full"),C=(0,s.resolveComponent)("j-drawer"),S=(0,s.resolveComponent)("j-dialog");return c.value==="full"?((0,s.openBlock)(),(0,s.createBlock)(w,{key:0,ref_key:"modalRef",ref:o,visible:a.value,"onUpdate:visible":y[0]||(y[0]=b=>a.value=b),"step-active":l.value,"onUpdate:stepActive":y[1]||(y[1]=b=>l.value=b),title:i.value,"before-close":e.beforeClose,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:u.value,onOk:h,onClosed:p,onCancel:g},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(_.$slots,"default")]),_:3},8,["visible","step-active","title","before-close","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):c.value==="drawer"?((0,s.openBlock)(),(0,s.createBlock)(C,{key:1,ref_key:"modalRef",ref:o,visible:a.value,"onUpdate:visible":y[2]||(y[2]=b=>a.value=b),"step-active":l.value,"onUpdate:stepActive":y[3]||(y[3]=b=>l.value=b),"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"has-header":e.hasHeader,subtitle:u.value,onOk:h,onClosed:p,onCancel:g},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(_.$slots,"default")]),_:3},8,["visible","step-active","is-step","steps","validate-steps","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","has-header","subtitle"])):((0,s.openBlock)(),(0,s.createBlock)(S,{key:2,ref_key:"modalRef",ref:o,visible:a.value,"onUpdate:visible":y[4]||(y[4]=b=>a.value=b),"step-active":l.value,"onUpdate:stepActive":y[5]||(y[5]=b=>l.value=b),width:e.width,height:e.height,title:i.value,"before-close":e.beforeClose,"has-btns":e.hasBtns,"btn-text":e.btnText,"destroy-on-close":e.destroyOnClose,buttons:e.buttons,"has-save-btn":e.hasSaveBtn,"is-step":e.isStep,steps:e.steps,"validate-steps":e.validateSteps,subtitle:u.value,onOk:h,onClosed:p,onCancel:g},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(_.$slots,"default")]),_:3},8,["visible","step-active","width","height","title","before-close","has-btns","btn-text","destroy-on-close","buttons","has-save-btn","is-step","steps","validate-steps","subtitle"]))}}}),ok=ik,cd=be(ok),lk=(0,s.defineComponent)({name:"JInputTag",__name:"input-tag",props:{modelValue:{default:void 0},options:{default:()=>[]},placeholder:{default:"请输入标签,回车完成标签填写"},readonly:{type:Boolean,default:!1},colors:{default:()=>[]},isStyleLoop:{type:Boolean,default:!0},size:{default:"default"}},emits:["update:modelValue","change","select","search"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(),i=(0,s.computed)(()=>ln(n.modelValue)?[]:n.modelValue?.split(",")||[]),o=(0,s.computed)(()=>n.isStyleLoop?i.value?.map((f,h)=>{let p=n.colors[h%n.colors.length]||{};return p={...p,borderWidth:(p.borderWidth||0)+"px"},p})||[]:n.colors),l=f=>{u(),r("select",f)},c=f=>{f.preventDefault(),f.stopPropagation()},u=()=>{if(a.value){const f=[...i.value,a.value];a.value="",r("update:modelValue",f.join(",")),r("change",{value:f.join(",")})}},d=f=>{const h=[...i.value];h.splice(f,1),r("update:modelValue",h.join(",")),r("change",{value:h.join(",")})};return(f,h)=>{const p=(0,s.resolveComponent)("el-tag"),g=(0,s.resolveComponent)("el-space"),v=(0,s.resolveComponent)("j-autocomplete");return(0,s.openBlock)(),(0,s.createBlock)(v,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=m=>a.value=m),class:"j-input-tag",options:e.options,style:{width:"100%"},readonly:e.readonly,placeholder:e.placeholder,size:e.size,onSelect:l,onKeyup:(0,s.withKeys)((0,s.withModifiers)(u,["stop"]),["enter"]),onKeydown:(0,s.withKeys)((0,s.withModifiers)(c,["stop"]),["enter"])},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(g,null,{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(i.value,(m,_)=>((0,s.openBlock)(),(0,s.createBlock)(p,{key:_,type:"info",closable:!e.readonly,style:(0,s.normalizeStyle)(o.value[_]||{}),size:e.size,onClose:(0,s.withModifiers)(y=>d(_),["prevent"])},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(m),1)]),_:2},1032,["closable","style","size","onClose"]))),128))]),_:1})]),_:1},8,["modelValue","options","readonly","placeholder","size","onKeyup","onKeydown"])}}}),sk=lk,Sv=be(sk),ck=(0,s.defineComponent)({name:"JRate",__name:"rate",props:{modelValue:{default:0},max:{default:5},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},showText:{type:Boolean,default:!1},showScore:{type:Boolean,default:!1},texts:{default:()=>[]},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get(){return Number(n.modelValue)},set(c){r("update:modelValue",c),r("change",{value:c})}}),i=(0,s.computed)(()=>n.texts?.map(c=>c.value)||[]),o=(0,s.ref)(0),l=c=>{o.value=c};return(c,u)=>{const d=(0,s.resolveComponent)("el-rate");return(0,s.openBlock)(),(0,s.createBlock)(d,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=f=>a.value=f),size:e.size,max:e.max,"allow-half":e.allowHalf,clearable:e.allowClear,disabled:e.readonly,"show-text":e.showText,texts:i.value,"show-score":e.showScore,onHoverChange:l},null,8,["modelValue","size","max","allow-half","clearable","disabled","show-text","texts","show-score"])}}}),uk=ck,xv=be(uk),dk=(0,s.defineComponent)({name:"JSlider",__name:"slider",props:{modelValue:{default:0},min:{default:0},max:{default:100},readonly:{type:Boolean,default:!1},step:{default:1},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},size:{default:"default"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:{},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{},ariaLabel:{},rangeStartLabel:{},rangeEndLabel:{},formatValueText:{},tooltipClass:{},placement:{default:"top"},marks:{},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get(){return Number(n.modelValue)},set(i){r("update:modelValue",i),r("change",{value:i})}});return(i,o)=>{const l=(0,s.resolveComponent)("el-slider");return(0,s.openBlock)(),(0,s.createBlock)(l,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),min:e.min,max:e.max,disabled:e.readonly,step:e.step,"show-input":e.showInput,"show-input-controls":e.showInputControls,size:e.size,"input-size":e.size,"show-stops":e.showStops,"show-tooltip":e.showTooltip,"format-tooltip":e.formatTooltip,range:e.range,vertical:e.vertical,height:e.height,"aria-label":e.ariaLabel,"range-start-label":e.rangeStartLabel,"range-end-label":e.rangeEndLabel,"format-value-text":e.formatValueText,"tooltip-class":e.tooltipClass,placement:e.placement,marks:e.marks,"validate-event":e.validateEvent,persistent:e.persistent},null,8,["modelValue","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","aria-label","range-start-label","range-end-label","format-value-text","tooltip-class","placement","marks","validate-event","persistent"])}}}),fk=dk,Ev=be(fk),Ts=e=>e<1024?qo(e)+" B":e>=1024&&e<1048576?qo(e/1024)+" KB":e>=1048576&&e<1073741824?qo(e/1024/1024)+" MB":e>=1073741824?qo(e/1024/1024/1024)+" GB":"",hk=e=>{const t=window.open("_blank");t&&(t.location=e)},pk={key:1,style:{position:"relative",width:"72px",height:"72px",overflow:"hidden"}},gk=["src"],vk={class:"j-upload-dragItem-content"},mk={class:"j-upload-dragItem-mask"},yk=["src"],_k={class:"j-upload-imgItem-mask"},wk={class:"j-upload-item-content"},bk=(0,s.defineComponent)({__name:"list",props:{isUploadImg:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},showFileList:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},previewFile:{type:Function,required:!0},deleteFile:{type:Function,required:!0},readonly:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},setup(e){const{t}=vt();return(n,r)=>{const a=(0,s.resolveComponent)("j-icon"),i=(0,s.resolveComponent)("el-text"),o=(0,s.resolveComponent)("j-button"),l=(0,s.resolveComponent)("el-progress"),c=(0,s.resolveComponent)("el-link");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-upload-list",{"j-upload-image-list":e.isUploadImg,"j-upload-drag-list":e.drag}])},[e.drag?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[e.showFileList?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:0},(0,s.renderList)(e.list,u=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:u.id,class:"j-upload-dragItem"},[e.isUploadImg?((0,s.openBlock)(),(0,s.createElementBlock)("div",pk,[(0,s.createElementVNode)("img",{src:u.url,style:{width:"100%"},alt:""},null,8,gk)])):((0,s.openBlock)(),(0,s.createBlock)(a,{key:0,icon:"file-text",style:(0,s.normalizeStyle)({color:u.color?`var(${u.color})`:void 0}),size:72},null,8,["style"])),(0,s.createElementVNode)("div",vk,[(0,s.createVNode)(i,{ellipsis:""},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(`${(0,s.unref)(t)(u.name)}${u.status==="unUpload"?"("+(0,s.unref)(t)("未传")+")":""}`),1)]),_:2},1024),(0,s.createElementVNode)("div",null,[u.status==="uploading"?((0,s.openBlock)(),(0,s.createBlock)(i,{key:0},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(Ts)(u.uploadSize))+"/",1)]),_:2},1024)):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(i,null,{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(Ts)(u.size)),1)]),_:2},1024)])]),(0,s.withDirectives)((0,s.createElementVNode)("div",mk,[u.status==="done"||u.status==="unUpload"?((0,s.openBlock)(),(0,s.createBlock)(o,{key:0,icon:"mdi:eye",type:"link",onClick:(0,s.withModifiers)(d=>e.previewFile(u),["stop"])},null,8,["onClick"])):(0,s.createCommentVNode)("",!0),!e.readonly&&(u.status==="done"||u.status==="unUpload")?((0,s.openBlock)(),(0,s.createBlock)(o,{key:1,icon:"mdi:delete",type:"link",danger:"",onClick:(0,s.withModifiers)(d=>e.deleteFile(u),["stop","prevent"])},null,8,["onClick"])):(0,s.createCommentVNode)("",!0)],512),[[s.vShow,u.status==="error"]]),u.status==="uploading"?((0,s.openBlock)(),(0,s.createBlock)(l,{key:2,"stroke-width":4,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},percent:u.percent,"show-text":!1},null,8,["percent"])):(0,s.createCommentVNode)("",!0)]))),128)):(0,s.createCommentVNode)("",!0),(0,s.renderSlot)(n.$slots,"default")],64)):e.isUploadImg?((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:1},(0,s.renderList)(e.list,u=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:u.id,class:"j-upload-imgItem"},[u.status==="done"||u.status==="unUpload"?((0,s.openBlock)(),(0,s.createElementBlock)("img",{key:0,src:u.url,style:{width:"100%"},alt:""},null,8,yk)):(0,s.createCommentVNode)("",!0),(0,s.withDirectives)((0,s.createElementVNode)("div",_k,[u.status==="done"||u.status==="unUpload"?((0,s.openBlock)(),(0,s.createBlock)(o,{key:0,type:"link",icon:"mdi:eye",onClick:(0,s.withModifiers)(d=>e.previewFile(u),["stop"])},null,8,["onClick"])):(0,s.createCommentVNode)("",!0),!e.readonly&&(u.status==="done"||u.status==="unUpload")?((0,s.openBlock)(),(0,s.createBlock)(o,{key:1,type:"link",danger:"",icon:"mdi:delete",onClick:(0,s.withModifiers)(d=>e.deleteFile(u),["stop","prevent"])},null,8,["onClick"])):(0,s.createCommentVNode)("",!0)],512),[[s.vShow,u.status==="error"]]),u.status==="uploading"?((0,s.openBlock)(),(0,s.createBlock)(l,{key:1,"stroke-width":4,percent:u.percent,"show-text":!1},null,8,["percent"])):(0,s.createCommentVNode)("",!0)]))),128)):((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,{key:2},(0,s.renderList)(e.list,u=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:u.id,class:"j-upload-item"},[(0,s.createVNode)(a,{icon:"file-text",style:(0,s.normalizeStyle)({color:u.color?`var(${u.color})`:void 0}),size:16},null,8,["style"]),(0,s.createElementVNode)("div",wk,[(0,s.createVNode)(c,{type:"primary",underline:"never",onClick:(0,s.withModifiers)(d=>e.previewFile(u),["stop"])},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(`${(0,s.unref)(t)(u.name)}${u.status==="unUpload"?"("+(0,s.unref)(t)("未传")+")":""}`),1)]),_:2},1032,["onClick"])]),u.status==="uploading"?((0,s.openBlock)(),(0,s.createBlock)(i,{key:0},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(Ts)(u.uploadSize))+"/",1)]),_:2},1024)):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(i,null,{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)((0,s.unref)(Ts)(u.size)),1)]),_:2},1024),u.status==="done"&&e.isShowSuccessIcon?((0,s.openBlock)(),(0,s.createBlock)(a,{key:1,class:"j-upload-item-success",icon:"check-circle",size:24})):(0,s.createCommentVNode)("",!0),e.readonly?(0,s.createCommentVNode)("",!0):(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createBlock)(a,{key:2,class:"j-upload-item-error",icon:"delete",size:24,onClick:(0,s.withModifiers)(d=>e.deleteFile(u),["stop","prevent"])},null,8,["onClick"])),[[s.vShow,u.status==="error"]]),u.status==="uploading"?((0,s.openBlock)(),(0,s.createBlock)(l,{key:3,style:{position:"absolute",bottom:"-4px",left:"0",margin:"0 !important"},"stroke-width":4,percent:u.percent,"show-text":!1},null,8,["percent"])):(0,s.createCommentVNode)("",!0)]))),128))],2)}}}),kv=bk,Ck={class:"j-upload"},Sk={key:0},xk={style:{"margin-top":"8px"}},Ek={key:0,style:{"margin-top":"4px"}},kk={key:0,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center",overflow:"auto","overflow-x":"hidden"}},Tk=["src"],Rk={key:1,class:"j-block"},Mk=["src"],Bk=(0,s.defineComponent)({name:"JUpload",__name:"upload",props:{modelValue:{type:String,default:void 0},readonly:{type:Boolean,default:!1},limit:{type:Number,default:1},multiple:{type:Boolean,default:!1},maxSize:{type:Number,default:void 0},sizeType:{type:String,default:void 0},accept:{type:String,default:void 0},showFileList:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},onlyName:{type:Boolean,default:!1},isTip:Boolean,placeholder:{type:String,default:"点击上传"},btnType:{type:String,default:"primary"},btnSize:{type:String,default:"default"},btnText:{type:String,default:"查看"},isNotApi:{type:Boolean,default:!1},autoUpload:{type:Boolean,default:!0},isUploadImg:{type:Boolean,default:!1},isLayer:{type:Boolean,default:!1},upload:{type:Function,default:void 0},uploadCallback:{type:Function,default:void 0},isSaveLast:{type:Boolean,default:!1},isShowSuccessIcon:{type:Boolean,default:!0}},emits:["update:modelValue","change","start","success","error","delete","load","notUploadChange"],setup(e,{emit:t}){const n=e,r=t,{warning:a,error:i,createConfirm:o,t:l,apiUrl:c,token:u,useFile:d}=vt(),{fileChunkedUpload:f,deleteFile:h}=d(),p=(0,s.computed)(()=>n.isUploadImg?n.accept||"image/*":n.accept),g=(0,s.computed)(()=>{if(n.limit!==-1)return n.limit}),v=(0,s.computed)(()=>n.limit===-1?"":`,${l("上传数量")}${n.limit}`),m=(0,s.ref)(""),_=(0,s.computed)(()=>({folderId:n.modelValue||m.value,maxSize:n.maxSize,sizeType:n.sizeType})),y=(0,s.ref)([]),w=()=>{y.value=[...y.value]},C=O=>{if(n.maxSize&&n.sizeType){let Z=O;switch(n.sizeType){case"GB":Z=1024*1024*1024*n.maxSize;break;case"MB":Z=1024*1024*n.maxSize;break;case"KB":Z=1024*n.maxSize;break;default:Z=n.maxSize;break}if(Z<O)return!1}return!0},S={doc:"file-word",docx:"file-word",xls:"file-excel",xlsx:"file-excel",pdf:"file-pdf",image:"file-image",txt:"file-txt",json:"file-json"},b=O=>{if(O){const Z=O.split(".");return Z[Z.length-1]}return""},x=(O,Z)=>{if(Z&&Z.indexOf("image")>-1)return"file-image";const ue=b(O);return["webp","bmp","jpg","jpge","png","tif","gif","svg"].includes(ue)?"file-image":S[ue]||"file-ufo"},E=O=>{O.status=n.autoUpload?"uploading":"unUpload",O.uploadSize=0,O.icon=x(O.name,O.type),f||(O.icon="file-text"),O.id=O.uid,O.url=window.URL.createObjectURL(O),O.date=Jo(),O.param=_.value},k=O=>{r("start",{file:O,list:y.value})},T=(O,Z,ue)=>{O.percent=ue,O.uploadSize=Z,w()},R=O=>{O.status="done",O.id+="1",O.uid+="1",w(),r("success",{file:O,list:y.value}),n.modelValue||(r("update:modelValue",m.value),r("change",{value:m.value}))},D=(O,Z)=>{console.error(Z,"简搭提醒您:文件上传错误!"),O.status="error",w(),r("error",{file:O,list:y.value})},A=O=>{if(y.value.push(O),O.status==="unUpload"){r("notUploadChange",{value:O.url});return}!n.isNotApi&&n.upload?n.upload(O):!n.isNotApi&&f?f(O,{onStart:k,onProgress:T,onSuccess:R,onError:D,uploadCallback:n.uploadCallback}):R(O)},L=O=>{if(!C(O.size))return i&&i("上传文件超出大小了"),!1},N=O=>{E(O.file),A(O.file)},M=O=>new Promise(Z=>{o?o({title:"提示",iconType:"warning",content:`您确定删除【${O.name}】?`,onOk:()=>{Z(!0)},onCancel:()=>{Z(!1)}}):(I(O),Z(!0))}),I=O=>{if(!n.isNotApi){const Z=O.response?.fileId||O.id;h&&h(Z)}y.value=y.value.filter(Z=>Z.id!==O.id),y.value.length===0&&(r("update:modelValue",""),r("change",{value:""})),r("delete",{file:O,list:y.value})},$=async O=>{await M(O)&&I(O)},ee=(0,s.ref)(!1),oe=(0,s.ref)(""),j=(0,s.ref)(""),U=(0,s.ref)(!1),H=(0,s.ref)(!1);let B=null;const W=(0,s.ref)(Jo(new Date,"YYYY-MM-DD")),X=O=>{if(O.isPreview===!1&&!n.isUploadImg){a&&a("无权限预览!");return}const Z=O.name.split(".")[O.name.split(".").length-1];switch(B=O,ee.value=!1,oe.value=O.name,Z.toLowerCase()){case"jpg":case"gif":case"png":case"bmp":case"jpeg":case"svg":ee.value=!0,j.value=O.url,H.value=!1,U.value=!0;break;default:if(n.isNotApi){a&&a("预览表单中,不支持预览!");return}if(O.status!=="done"){a&&a("当前文件还没上传成功,不支持预览!");return}if(j.value=K(O),j.value===""){a&&a("当前文件不支持预览!");return}H.value=!0,U.value=!0;break}W.value=Jo(new Date,"YYYY-MM-DD HH:mm:ss")},K=O=>{const Z=O.response?.fileId||O.id;if(!c)return"";const ue=Jo(new Date,"YYYY-MM-DD HH:mm:ss")+"|"+Z;return`${c}/system/annexesfile/preview/${zg.createAesEncryption({key:"jianda"}).encrypt(ue).replace(/\//g,"|")}?token=${u?.value}`},ne=()=>{B.isDown===!1&&a&&a("无权限下载!"),hk(`${c}/system/annexesfile/${B.response?.fileId||B.id}?token=${u?.value}`)},he=()=>{if(n.limit!==-1&&n.limit<=y.value.length)return a&&a(`当前限制选择${n.limit}个文件`),!1};return(O,Z)=>{const ue=(0,s.resolveComponent)("j-icon"),se=(0,s.resolveComponent)("j-button"),we=(0,s.resolveComponent)("el-popover"),Te=(0,s.resolveComponent)("el-button"),Ee=(0,s.resolveComponent)("el-upload"),Ye=(0,s.resolveComponent)("el-text"),_t=(0,s.resolveComponent)("j-dialog-full"),$e=(0,s.resolveDirective)("loading");return(0,s.openBlock)(),(0,s.createElementBlock)("div",Ck,[(0,s.createVNode)(Ee,{action:"",drag:e.drag,disabled:e.readonly,"show-file-list":e.isUploadImg&&!e.isLayer&&e.showFileList,"list-type":e.isUploadImg&&!e.isLayer?"picture-card":void 0,accept:p.value,limit:g.value,multiple:e.multiple,"before-upload":L,"http-request":N,"file-list":y.value,"before-remove":M,"on-remove":I,"on-preview":X,"on-exceed":he},{default:(0,s.withCtx)(()=>[e.isUploadImg&&!e.isLayer&&!e.readonly?((0,s.openBlock)(),(0,s.createElementBlock)("div",Sk,[(0,s.createVNode)(ue,{icon:"mdi:add"}),(0,s.createElementVNode)("div",xk,(0,s.toDisplayString)((0,s.unref)(l)(e.placeholder)),1)])):e.isLayer&&e.showFileList&&y.value.length>0&&!U.value?((0,s.openBlock)(),(0,s.createBlock)(we,{key:1,placement:"bottom",title:e.isUploadImg?(0,s.unref)(l)("图片列表"):(0,s.unref)(l)("文件列表")},{content:(0,s.withCtx)(()=>[(0,s.createVNode)(kv,{style:(0,s.normalizeStyle)({width:e.isUploadImg?void 0:"400px"}),list:y.value,"preview-file":X,"delete-file":$,"is-upload-img":e.isUploadImg,readonly:e.readonly},null,8,["style","list","is-upload-img","readonly"])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(se,{type:e.btnType,size:e.btnSize,icon:"mdi:tray-upload",label:e.readonly?(0,s.unref)(l)(e.btnText):e.placeholder},null,8,["type","size","label"])]),_:1},8,["title"])):e.readonly?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createBlock)(Te,{key:2,type:e.btnType,size:e.btnSize},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(ue,{icon:"mdi:tray-upload"}),(0,s.createTextVNode)(" "+(0,s.toDisplayString)(e.placeholder),1)]),_:1},8,["type","size"]))]),_:1},8,["drag","disabled","show-file-list","list-type","accept","limit","multiple","file-list"]),e.isTip?((0,s.openBlock)(),(0,s.createElementBlock)("div",Ek,[(0,s.createVNode)(Ye,null,{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(`${(0,s.unref)(l)("只能上传不超过{0}的{1}文件",`${e.maxSize}${e.sizeType}`,`${p.value||""}`)},${v.value}`),1)]),_:1})])):(0,s.createCommentVNode)("",!0),!e.isLayer&&!e.isUploadImg&&e.showFileList&&y.value.length>0?((0,s.openBlock)(),(0,s.createBlock)(kv,{key:1,style:{"margin-top":"4px"},list:y.value,"preview-file":X,"delete-file":$,readonly:e.readonly,"is-show-success-icon":e.isShowSuccessIcon},null,8,["list","readonly","is-show-success-icon"])):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(_t,{visible:U.value,"onUpdate:visible":Z[1]||(Z[1]=Re=>U.value=Re),"btn-text":"下载",title:`${(0,s.unref)(l)("文件预览")}【${oe.value}】`,"destroy-on-close":!0,"has-btns":!!(0,s.unref)(c),onOk:ne},{default:(0,s.withCtx)(()=>[ee.value&&j.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",kk,[(0,s.createElementVNode)("img",{width:"100%",style:{"max-width":"1024px"},src:j.value,alt:""},null,8,Tk)])):j.value!=""?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",Rk,[(0,s.createElementVNode)("iframe",{ref:"iframe",src:j.value,style:{width:"100%",height:"100%"},frameborder:"0",onLoad:Z[0]||(Z[0]=Re=>H.value=!1)},null,40,Mk)])),[[$e,H.value]]):(0,s.createCommentVNode)("",!0)]),_:1},8,["visible","title","has-btns"])])}}}),Dk=Bk,Tv=be(Dk),ud=function(e,t){return ud=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},ud(e,t)};function et(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ud(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ak=(function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e})(),it=new((function(){function e(){this.browser=new Ak,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return e})());typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(it.wxa=!0,it.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?it.worker=!0:!it.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(it.node=!0,it.svgSupported=!0):Pk(navigator.userAgent,it);function Pk(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),i=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),a&&(n.ie=!0,n.version=a[1]),i&&(n.edge=!0,n.version=i[1],n.newEdge=+i[1].split(".")[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,t.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<"u"){var l=document.documentElement.style;t.transform3dSupported=(n.ie&&"transition"in l||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var YF=12,Nk="sans-serif",Lk="12px "+Nk,Ik=20,Ok=100,Vk="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function zk(e){var t={};if(typeof JSON>"u")return t;for(var n=0;n<e.length;n++){var r=String.fromCharCode(n+32);t[r]=(e.charCodeAt(n)-Ik)/Ok}return t}var Hk=zk(Vk),ur={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var e,t;return function(n,r){if(!e){var a=ur.createCanvas();e=a&&a.getContext("2d")}if(e)return t!==r&&(t=e.font=r||"12px sans-serif"),e.measureText(n);n=n||"",r=r||"12px sans-serif";var i=/((?:\d+)?\.?\d*)px/.exec(r),o=i&&+i[1]||12,l=0;if(r.indexOf("mono")>=0)l=o*n.length;else for(var c=0;c<n.length;c++){var u=Hk[n[c]];l+=u==null?o:u*o}return{width:l}}})(),loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r}},Rv=Fi(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),Mv=Fi(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),Hi=Object.prototype.toString,Rs=Array.prototype,Fk=Rs.forEach,jk=Rs.filter,dd=Rs.slice,$k=Rs.map,Bv=function(){}.constructor,Ms=Bv?Bv.prototype:null,fd="__proto__",Wk=2311;function Dv(){return Wk++}function Ia(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];typeof console<"u"&&console.error.apply(console,e)}function ft(e){if(e==null||typeof e!="object")return e;var t=e,n=Hi.call(e);if(n==="[object Array]"){if(!Qo(e)){t=[];for(var r=0,a=e.length;r<a;r++)t[r]=ft(e[r])}}else if(Mv[n]){if(!Qo(e)){var i=e.constructor;if(i.from)t=i.from(e);else{t=new i(e.length);for(var r=0,a=e.length;r<a;r++)t[r]=e[r]}}}else if(!Rv[n]&&!Qo(e)&&!pd(e)){t={};for(var o in e)e.hasOwnProperty(o)&&o!==fd&&(t[o]=ft(e[o]))}return t}function jt(e,t,n){if(!ze(t)||!ze(e))return n?ft(t):e;for(var r in t)if(t.hasOwnProperty(r)&&r!==fd){var a=e[r],i=t[r];ze(i)&&ze(a)&&!Fe(i)&&!Fe(a)&&!pd(i)&&!pd(a)&&!Pv(i)&&!Pv(a)&&!Qo(i)&&!Qo(a)?jt(a,i,n):(n||!(r in e))&&(e[r]=ft(t[r]))}return e}function Ce(e,t){if(Object.assign)Object.assign(e,t);else for(var n in t)t.hasOwnProperty(n)&&n!==fd&&(e[n]=t[n]);return e}function sn(e,t,n){for(var r=Vt(t),a=0,i=r.length;a<i;a++){var o=r[a];(n?t[o]!=null:e[o]==null)&&(e[o]=t[o])}return e}var GF=ur.createCanvas;function kt(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n}return-1}function Uk(e,t){var n=e.prototype;function r(){}r.prototype=t.prototype,e.prototype=new r;for(var a in n)n.hasOwnProperty(a)&&(e.prototype[a]=n[a]);e.prototype.constructor=e,e.superClass=t}function Lr(e,t,n){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(t),a=0;a<r.length;a++){var i=r[a];i!=="constructor"&&(n?t[i]!=null:e[i]==null)&&(e[i]=t[i])}else sn(e,t,n)}function Bn(e){return!e||typeof e=="string"?!1:typeof e.length=="number"}function q(e,t,n){if(e&&t)if(e.forEach&&e.forEach===Fk)e.forEach(t,n);else if(e.length===+e.length)for(var r=0,a=e.length;r<a;r++)t.call(n,e[r],r,e);else for(var i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function bt(e,t,n){if(!e)return[];if(!t)return gd(e);if(e.map&&e.map===$k)return e.map(t,n);for(var r=[],a=0,i=e.length;a<i;a++)r.push(t.call(n,e[a],a,e));return r}function Fi(e,t,n,r){if(e&&t){for(var a=0,i=e.length;a<i;a++)n=t.call(r,n,e[a],a,e);return n}}function Cn(e,t,n){if(!e)return[];if(!t)return gd(e);if(e.filter&&e.filter===jk)return e.filter(t,n);for(var r=[],a=0,i=e.length;a<i;a++)t.call(n,e[a],a,e)&&r.push(e[a]);return r}function Vt(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function Yk(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return e.apply(t,n.concat(dd.call(arguments)))}}var Sn=Ms&&ot(Ms.bind)?Ms.call.bind(Ms.bind):Yk;function hd(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(this,t.concat(dd.call(arguments)))}}function Fe(e){return Array.isArray?Array.isArray(e):Hi.call(e)==="[object Array]"}function ot(e){return typeof e=="function"}function Ge(e){return typeof e=="string"}function Av(e){return Hi.call(e)==="[object String]"}function Dt(e){return typeof e=="number"}function ze(e){var t=typeof e;return t==="function"||!!e&&t==="object"}function Pv(e){return!!Rv[Hi.call(e)]}function hn(e){return!!Mv[Hi.call(e)]}function pd(e){return typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.ownerDocument=="object"}function Bs(e){return e.colorStops!=null}function Gk(e){return e.image!=null}function qk(e){return Hi.call(e)==="[object RegExp]"}function Nv(e){return e!==e}function qe(e,t){return e??t}function Zo(e,t,n){return e??t??n}function gd(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return dd.apply(e,t)}function vd(e){if(typeof e=="number")return[e,e,e,e];var t=e.length;return t===2?[e[0],e[1],e[0],e[1]]:t===3?[e[0],e[1],e[2],e[1]]:e}function je(e,t){if(!e)throw new Error(t)}function aa(e){return e==null?null:typeof e.trim=="function"?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Lv="__ec_primitive__";function Ds(e){e[Lv]=!0}function Qo(e){return e[Lv]}var Jk=(function(){function e(){this.data={}}return e.prototype.delete=function(t){var n=this.has(t);return n&&delete this.data[t],n},e.prototype.has=function(t){return this.data.hasOwnProperty(t)},e.prototype.get=function(t){return this.data[t]},e.prototype.set=function(t,n){return this.data[t]=n,this},e.prototype.keys=function(){return Vt(this.data)},e.prototype.forEach=function(t){var n=this.data;for(var r in n)n.hasOwnProperty(r)&&t(n[r],r)},e})(),Iv=typeof Map=="function";function Xk(){return Iv?new Map:new Jk}var Kk=(function(){function e(t){var n=Fe(t);this.data=Xk();var r=this;t instanceof e?t.each(a):t&&q(t,a);function a(i,o){n?r.set(i,o):r.set(o,i)}}return e.prototype.hasKey=function(t){return this.data.has(t)},e.prototype.get=function(t){return this.data.get(t)},e.prototype.set=function(t,n){return this.data.set(t,n),n},e.prototype.each=function(t,n){this.data.forEach(function(r,a){t.call(n,r,a)})},e.prototype.keys=function(){var t=this.data.keys();return Iv?Array.from(t):t},e.prototype.removeKey=function(t){this.data.delete(t)},e})();function Je(e){return new Kk(e)}function Zk(e,t){for(var n=new e.constructor(e.length+t.length),r=0;r<e.length;r++)n[r]=e[r];for(var a=e.length,r=0;r<t.length;r++)n[r+a]=t[r];return n}function As(e,t){var n;if(Object.create)n=Object.create(e);else{var r=function(){};r.prototype=e,n=new r}return t&&Ce(n,t),n}function Ov(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function ia(e,t){return e.hasOwnProperty(t)}function Vn(){}var Qk=180/Math.PI,qF=Number.EPSILON||Math.pow(2,-52);function ji(e,t){return e==null&&(e=0),t==null&&(t=0),[e,t]}function eT(e){return[e[0],e[1]]}function Vv(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function tT(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function nT(e){return Math.sqrt(rT(e))}function rT(e){return e[0]*e[0]+e[1]*e[1]}function md(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function aT(e,t){var n=nT(t);return n===0?(e[0]=0,e[1]=0):(e[0]=t[0]/n,e[1]=t[1]/n),e}function yd(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var _d=yd;function iT(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var $i=iT;function wd(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e}function el(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a+n[4],e[1]=n[1]*r+n[3]*a+n[5],e}function Wi(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e}function Ui(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}var Yi=(function(){function e(t,n){this.target=t,this.topTarget=n&&n.topTarget}return e})(),oT=(function(){function e(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return e.prototype._dragStart=function(t){for(var n=t.target;n&&!n.draggable;)n=n.parent||n.__hostTarget;n&&(this._draggingTarget=n,n.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new Yi(n,t),"dragstart",t.event))},e.prototype._drag=function(t){var n=this._draggingTarget;if(n){var r=t.offsetX,a=t.offsetY,i=r-this._x,o=a-this._y;this._x=r,this._y=a,n.drift(i,o,t),this.handler.dispatchToElement(new Yi(n,t),"drag",t.event);var l=this.handler.findHover(r,a,n).target,c=this._dropTarget;this._dropTarget=l,n!==l&&(c&&l!==c&&this.handler.dispatchToElement(new Yi(c,t),"dragleave",t.event),l&&l!==c&&this.handler.dispatchToElement(new Yi(l,t),"dragenter",t.event))}},e.prototype._dragEnd=function(t){var n=this._draggingTarget;n&&(n.dragging=!1),this.handler.dispatchToElement(new Yi(n,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new Yi(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},e})(),dr=(function(){function e(t){t&&(this._$eventProcessor=t)}return e.prototype.on=function(t,n,r,a){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof n=="function"&&(a=r,r=n,n=null),!r||!t)return this;var o=this._$eventProcessor;n!=null&&o&&o.normalizeQuery&&(n=o.normalizeQuery(n)),i[t]||(i[t]=[]);for(var l=0;l<i[t].length;l++)if(i[t][l].h===r)return this;var c={h:r,query:n,ctx:a||this,callAtLast:r.zrEventfulCallAtLast},u=i[t].length-1,d=i[t][u];return d&&d.callAtLast?i[t].splice(u,0,c):i[t].push(c),this},e.prototype.isSilent=function(t){var n=this._$handlers;return!n||!n[t]||!n[t].length},e.prototype.off=function(t,n){var r=this._$handlers;if(!r)return this;if(!t)return this._$handlers={},this;if(n){if(r[t]){for(var a=[],i=0,o=r[t].length;i<o;i++)r[t][i].h!==n&&a.push(r[t][i]);r[t]=a}r[t]&&r[t].length===0&&delete r[t]}else delete r[t];return this},e.prototype.trigger=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this._$handlers)return this;var a=this._$handlers[t],i=this._$eventProcessor;if(a)for(var o=n.length,l=a.length,c=0;c<l;c++){var u=a[c];if(!(i&&i.filter&&u.query!=null&&!i.filter(t,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,n[0]);break;case 2:u.h.call(u.ctx,n[0],n[1]);break;default:u.h.apply(u.ctx,n);break}}return i&&i.afterTrigger&&i.afterTrigger(t),this},e.prototype.triggerWithContext=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this._$handlers)return this;var a=this._$handlers[t],i=this._$eventProcessor;if(a)for(var o=n.length,l=n[o-1],c=a.length,u=0;u<c;u++){var d=a[u];if(!(i&&i.filter&&d.query!=null&&!i.filter(t,d.query)))switch(o){case 0:d.h.call(l);break;case 1:d.h.call(l,n[0]);break;case 2:d.h.call(l,n[0],n[1]);break;default:d.h.apply(l,n.slice(1,o-1));break}}return i&&i.afterTrigger&&i.afterTrigger(t),this},e})(),lT=Math.log(2);function bd(e,t,n,r,a,i){var o=r+"-"+a,l=e.length;if(i.hasOwnProperty(o))return i[o];if(t===1){var c=Math.round(Math.log((1<<l)-1&~a)/lT);return e[n][c]}for(var u=r|1<<n,d=n+1;r&1<<d;)d++;for(var f=0,h=0,p=0;h<l;h++){var g=1<<h;g&a||(f+=(p%2?-1:1)*e[n][h]*bd(e,t-1,d,u,a|g,i),p++)}return i[o]=f,f}function zv(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},a=bd(n,8,0,0,0,r);if(a!==0){for(var i=[],o=0;o<8;o++)for(var l=0;l<8;l++)i[l]??(i[l]=0),i[l]+=((o+l)%2?-1:1)*bd(n,7,o===0?1:0,1<<o,1<<l,r)/a*t[o];return function(c,u,d){var f=u*i[6]+d*i[7]+1;c[0]=(u*i[0]+d*i[1]+i[2])/f,c[1]=(u*i[3]+d*i[4]+i[5])/f}}}var Hv="___zrEVENTSAVED";function sT(e,t,n,r,a){if(t.getBoundingClientRect&&it.domSupported&&!Fv(t)){var i=t[Hv]||(t[Hv]={}),o=uT(cT(t,i),i,a);if(o)return o(e,n,r),!0}return!1}function cT(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=["left","right"],a=["top","bottom"],i=0;i<4;i++){var o=document.createElement("div"),l=o.style,c=i%2,u=(i>>1)%2;l.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[c]+":0",a[u]+":0",r[1-c]+":auto",a[1-u]+":auto",""].join("!important;"),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){q(n,function(d){d.parentNode&&d.parentNode.removeChild(d)})},n}function uT(e,t,n){for(var r=n?"invTrans":"trans",a=t[r],i=t.srcCoords,o=[],l=[],c=!0,u=0;u<4;u++){var d=e[u].getBoundingClientRect(),f=2*u,h=d.left,p=d.top;o.push(h,p),c=c&&i&&h===i[f]&&p===i[f+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return c&&a?a:(t.srcCoords=o,t[r]=n?zv(l,o):zv(o,l))}function Fv(e){return e.nodeName.toUpperCase()==="CANVAS"}var dT=/([&<>"'])/g,fT={"&":"&","<":"<",">":">",'"':""","'":"'"};function Cd(e){return e==null?"":(e+"").replace(dT,function(t,n){return fT[n]})}var hT=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Sd=[],pT=it.browser.firefox&&+it.browser.version.split(".")[0]<39;function xd(e,t,n,r){return n=n||{},r?jv(e,t,n):pT&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX!=null?(n.zrX=t.offsetX,n.zrY=t.offsetY):jv(e,t,n),n}function jv(e,t,n){if(it.domSupported&&e.getBoundingClientRect){var r=t.clientX,a=t.clientY;if(Fv(e)){var i=e.getBoundingClientRect();n.zrX=r-i.left,n.zrY=a-i.top;return}else if(sT(Sd,e,r,a)){n.zrX=Sd[0],n.zrY=Sd[1];return}}n.zrX=n.zrY=0}function Ed(e){return e||window.event}function Zn(e,t,n){if(t=Ed(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf("touch")>=0){var i=r!=="touchend"?t.targetTouches[0]:t.changedTouches[0];i&&xd(e,i,t,n)}else{xd(e,t,t,n);var a=gT(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&hT.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function gT(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var a=Math.abs(r!==0?r:n),i=r>0?-1:r<0?1:n>0?-1:1;return 3*a*i}function vT(e,t,n,r){e.addEventListener(t,n,r)}function mT(e,t,n,r){e.removeEventListener(t,n,r)}var yT=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0},_T=(function(){function e(){this._track=[]}return e.prototype.recognize=function(t,n,r){return this._doTrack(t,n,r),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,n,r){var a=t.touches;if(a){for(var i={points:[],touches:[],target:n,event:t},o=0,l=a.length;o<l;o++){var c=a[o],u=xd(r,c,{});i.points.push([u.zrX,u.zrY]),i.touches.push(c)}this._track.push(i)}},e.prototype._recognize=function(t){for(var n in kd)if(kd.hasOwnProperty(n)){var r=kd[n](this._track,t);if(r)return r}},e})();function $v(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}function wT(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}var kd={pinch:function(e,t){var n=e.length;if(n){var r=(e[n-1]||{}).points,a=(e[n-2]||{}).points||r;if(a&&a.length>1&&r&&r.length>1){var i=$v(r)/$v(a);!isFinite(i)&&(i=1),t.pinchScale=i;var o=wT(r);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Gi(){return[1,0,0,1,0,0]}function bT(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Wv(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Td(e,t,n){var r=t[0]*n[0]+t[2]*n[1],a=t[1]*n[0]+t[3]*n[1],i=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],l=t[0]*n[4]+t[2]*n[5]+t[4],c=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=a,e[2]=i,e[3]=o,e[4]=l,e[5]=c,e}function Uv(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function CT(e,t,n,r){r===void 0&&(r=[0,0]);var a=t[0],i=t[2],o=t[4],l=t[1],c=t[3],u=t[5],d=Math.sin(n),f=Math.cos(n);return e[0]=a*f+l*d,e[1]=-a*d+l*f,e[2]=i*f+c*d,e[3]=-i*d+f*c,e[4]=f*(o-r[0])+d*(u-r[1])+r[0],e[5]=f*(u-r[1])-d*(o-r[0])+r[1],e}function ST(e,t,n){var r=n[0],a=n[1];return e[0]=t[0]*r,e[1]=t[1]*a,e[2]=t[2]*r,e[3]=t[3]*a,e[4]=t[4]*r,e[5]=t[5]*a,e}function Rd(e,t){var n=t[0],r=t[2],a=t[4],i=t[1],o=t[3],l=t[5],c=n*o-i*r;return c?(c=1/c,e[0]=o*c,e[1]=-i*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*l-o*a)*c,e[5]=(i*a-n*l)*c,e):null}var tt=(function(){function e(t,n){this.x=t||0,this.y=n||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,n){return this.x=t,this.y=n,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,n){this.x+=t.x*n,this.y+=t.y*n},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var n=this.x-t.x,r=this.y-t.y;return Math.sqrt(n*n+r*r)},e.prototype.distanceSquare=function(t){var n=this.x-t.x,r=this.y-t.y;return n*n+r*r},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var n=this.x,r=this.y;return this.x=t[0]*n+t[2]*r+t[4],this.y=t[1]*n+t[3]*r+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,n,r){t.x=n,t.y=r},e.copy=function(t,n){t.x=n.x,t.y=n.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,n){return t.x*n.x+t.y*n.y},e.add=function(t,n,r){t.x=n.x+r.x,t.y=n.y+r.y},e.sub=function(t,n,r){t.x=n.x-r.x,t.y=n.y-r.y},e.scale=function(t,n,r){t.x=n.x*r,t.y=n.y*r},e.scaleAndAdd=function(t,n,r,a){t.x=n.x+r.x*a,t.y=n.y+r.y*a},e.lerp=function(t,n,r,a){var i=1-a;t.x=i*n.x+a*r.x,t.y=i*n.y+a*r.y},e})(),Oa=Math.min,qi=Math.max,Md=Math.abs,Yv=["x","y"],xT=["width","height"],Va=new tt,za=new tt,Ha=new tt,Fa=new tt,Dn=qv(),tl=Dn.minTv,Bd=Dn.maxTv,nl=[0,0],lt=(function(){function e(t,n,r,a){e.set(this,t,n,r,a)}return e.set=function(t,n,r,a,i){return a<0&&(n=n+a,a=-a),i<0&&(r=r+i,i=-i),t.x=n,t.y=r,t.width=a,t.height=i,t},e.prototype.union=function(t){var n=Oa(t.x,this.x),r=Oa(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=qi(t.x+t.width,this.x+this.width)-n:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=qi(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=n,this.y=r},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var n=this,r=t.width/n.width,a=t.height/n.height,i=Gi();return Uv(i,i,[-n.x,-n.y]),ST(i,i,[r,a]),Uv(i,i,[t.x,t.y]),i},e.prototype.intersect=function(t,n,r){return e.intersect(this,t,n,r)},e.intersect=function(t,n,r,a){r&&tt.set(r,0,0);var i=a&&a.outIntersectRect||null,o=a&&a.clamp;if(i&&(i.x=i.y=i.width=i.height=NaN),!t||!n)return!1;t instanceof e||(t=e.set(ET,t.x,t.y,t.width,t.height)),n instanceof e||(n=e.set(kT,n.x,n.y,n.width,n.height));var l=!!r;Dn.reset(a,l);var c=Dn.touchThreshold,u=t.x+c,d=t.x+t.width-c,f=t.y+c,h=t.y+t.height-c,p=n.x+c,g=n.x+n.width-c,v=n.y+c,m=n.y+n.height-c;if(u>d||f>h||p>g||v>m)return!1;var _=!(d<p||g<u||h<v||m<f);return(l||i)&&(nl[0]=1/0,nl[1]=0,Gv(u,d,p,g,0,l,i,o),Gv(f,h,v,m,1,l,i,o),l&&tt.copy(r,_?Dn.useDir?Dn.dirMinTv:tl:Bd)),_},e.contain=function(t,n,r){return n>=t.x&&n<=t.x+t.width&&r>=t.y&&r<=t.y+t.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,n){return t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height,t},e.applyTransform=function(t,n,r){if(!r){t!==n&&e.copy(t,n);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var a=r[0],i=r[3],o=r[4],l=r[5];t.x=n.x*a+o,t.y=n.y*i+l,t.width=n.width*a,t.height=n.height*i,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Va.x=Ha.x=n.x,Va.y=Fa.y=n.y,za.x=Fa.x=n.x+n.width,za.y=Ha.y=n.y+n.height,Va.transform(r),Fa.transform(r),za.transform(r),Ha.transform(r),t.x=Oa(Va.x,za.x,Ha.x,Fa.x),t.y=Oa(Va.y,za.y,Ha.y,Fa.y);var c=qi(Va.x,za.x,Ha.x,Fa.x),u=qi(Va.y,za.y,Ha.y,Fa.y);t.width=c-t.x,t.height=u-t.y},e})(),ET=new lt(0,0,0,0),kT=new lt(0,0,0,0);function Gv(e,t,n,r,a,i,o,l){var c=Md(t-n),u=Md(r-e),d=Oa(c,u),f=Yv[a],h=Yv[1-a],p=xT[a];t<n||r<e?c<u?(i&&(Bd[f]=-c),l&&(o[f]=t,o[p]=0)):(i&&(Bd[f]=u),l&&(o[f]=e,o[p]=0)):(o&&(o[f]=qi(e,n),o[p]=Oa(t,r)-o[f]),i&&(d<nl[0]||Dn.useDir)&&(nl[0]=Oa(d,nl[0]),(c<u||!Dn.bidirectional)&&(tl[f]=c,tl[h]=0,Dn.useDir&&Dn.calcDirMTV()),(c>=u||!Dn.bidirectional)&&(tl[f]=-u,tl[h]=0,Dn.useDir&&Dn.calcDirMTV())))}function qv(){var e=0,t=new tt,n=new tt,r={minTv:new tt,maxTv:new tt,useDir:!1,dirMinTv:new tt,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,o){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=qi(0,i.touchThreshold)),r.negativeSize=!1,o&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var i=r.minTv,o=r.dirMinTv,l=i.y*i.y+i.x*i.x,c=Math.sin(e),u=Math.cos(e),d=c*i.y+u*i.x;if(a(d)){a(i.x)&&a(i.y)&&o.set(0,0);return}if(n.x=l*u/d,n.y=l*c/d,a(n.x)&&a(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()<o.len()&&o.copy(n)}};function a(i){return Md(i)<1e-10}return r}var Jv="silent";function TT(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:RT}}function RT(){yT(this.event)}var MT=(function(e){et(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.handler=null,n}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t})(dr),rl=(function(){function e(t,n){this.x=t,this.y=n}return e})(),BT=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Dd=new lt(0,0,0,0),Xv=(function(e){et(t,e);function t(n,r,a,i,o){var l=e.call(this)||this;return l._hovered=new rl(0,0),l.storage=n,l.painter=r,l.painterRoot=i,l._pointerSize=o,a=a||new MT,l.proxy=null,l.setHandlerProxy(a),l._draggingMgr=new oT(l),l}return t.prototype.setHandlerProxy=function(n){this.proxy&&this.proxy.dispose(),n&&(q(BT,function(r){n.on&&n.on(r,this[r],this)},this),n.handler=this),this.proxy=n},t.prototype.mousemove=function(n){var r=n.zrX,a=n.zrY,i=Zv(this,r,a),o=this._hovered,l=o.target;l&&!l.__zr&&(o=this.findHover(o.x,o.y),l=o.target);var c=this._hovered=i?new rl(r,a):this.findHover(r,a),u=c.target,d=this.proxy;d.setCursor&&d.setCursor(u?u.cursor:"default"),l&&u!==l&&this.dispatchToElement(o,"mouseout",n),this.dispatchToElement(c,"mousemove",n),u&&u!==l&&this.dispatchToElement(c,"mouseover",n)},t.prototype.mouseout=function(n){var r=n.zrEventControl;r!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",n),r!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:n})},t.prototype.resize=function(){this._hovered=new rl(0,0)},t.prototype.dispatch=function(n,r){var a=this[n];a&&a.call(this,r)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(n){var r=this.proxy;r.setCursor&&r.setCursor(n)},t.prototype.dispatchToElement=function(n,r,a){n=n||{};var i=n.target;if(!(i&&i.silent)){for(var o="on"+r,l=TT(r,n,a);i&&(i[o]&&(l.cancelBubble=!!i[o].call(i,l)),i.trigger(r,l),i=i.__hostTarget?i.__hostTarget:i.parent,!l.cancelBubble););l.cancelBubble||(this.trigger(r,l),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(c){typeof c[o]=="function"&&c[o].call(c,l),c.trigger&&c.trigger(r,l)}))}},t.prototype.findHover=function(n,r,a){var i=this.storage.getDisplayList(),o=new rl(n,r);if(Kv(i,o,n,r,a),this._pointerSize&&!o.target){for(var l=[],c=this._pointerSize,u=c/2,d=new lt(n-u,r-u,c,c),f=i.length-1;f>=0;f--){var h=i[f];h!==a&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(Dd.copy(h.getBoundingRect()),h.transform&&Dd.applyTransform(h.transform),Dd.intersect(d)&&l.push(h))}if(l.length){for(var p=4,g=Math.PI/12,v=Math.PI*2,m=0;m<u;m+=p)for(var _=0;_<v;_+=g)if(Kv(l,o,n+m*Math.cos(_),r+m*Math.sin(_),a),o.target)return o}}return o},t.prototype.processGesture=function(n,r){this._gestureMgr||(this._gestureMgr=new _T);var a=this._gestureMgr;r==="start"&&a.clear();var i=a.recognize(n,this.findHover(n.zrX,n.zrY,null).target,this.proxy.dom);if(r==="end"&&a.clear(),i){var o=i.type;n.gestureEvent=o;var l=new rl;l.target=i.target,this.dispatchToElement(l,o,i.event)}},t})(dr);q(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){Xv.prototype[e]=function(t){var n=t.zrX,r=t.zrY,a=Zv(this,n,r),i,o;if((e!=="mouseup"||!a)&&(i=this.findHover(n,r),o=i.target),e==="mousedown")this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(e==="mouseup")this._upEl=o;else if(e==="click"){if(this._downEl!==this._upEl||!this._downPoint||_d(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}});function DT(e,t,n){if(e[e.rectHover?"rectContain":"contain"](t,n)){for(var r=e,a=void 0,i=!1;r;){if(r.ignoreClip&&(i=!0),!i){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(a=!0);var l=r.__hostTarget;r=l?r.ignoreHostSilent?null:l:r.parent}return a?Jv:!0}return!1}function Kv(e,t,n,r,a){for(var i=e.length-1;i>=0;i--){var o=e[i],l=void 0;if(o!==a&&!o.ignore&&(l=DT(o,n,r))&&(!t.topTarget&&(t.topTarget=o),l!==Jv)){t.target=o;break}}}function Zv(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var Qv=32,al=7;function AT(e){for(var t=0;e>=Qv;)t|=e&1,e>>=1;return e+t}function e0(e,t,n,r){var a=t+1;if(a===n)return 1;if(r(e[a++],e[t])<0){for(;a<n&&r(e[a],e[a-1])<0;)a++;PT(e,t,a)}else for(;a<n&&r(e[a],e[a-1])>=0;)a++;return a-t}function PT(e,t,n){for(n--;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}function t0(e,t,n,r,a){for(r===t&&r++;r<n;r++){for(var i=e[r],o=t,l=r,c;o<l;)c=o+l>>>1,a(i,e[c])<0?l=c:o=c+1;var u=r-o;switch(u){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;u>0;)e[o+u]=e[o+u-1],u--}e[o]=i}}function Ad(e,t,n,r,a,i){var o=0,l=0,c=1;if(i(e,t[n+a])>0){for(l=r-a;c<l&&i(e,t[n+a+c])>0;)o=c,c=(c<<1)+1,c<=0&&(c=l);c>l&&(c=l),o+=a,c+=a}else{for(l=a+1;c<l&&i(e,t[n+a-c])<=0;)o=c,c=(c<<1)+1,c<=0&&(c=l);c>l&&(c=l);var u=o;o=a-c,c=a-u}for(o++;o<c;){var d=o+(c-o>>>1);i(e,t[n+d])>0?o=d+1:c=d}return c}function Pd(e,t,n,r,a,i){var o=0,l=0,c=1;if(i(e,t[n+a])<0){for(l=a+1;c<l&&i(e,t[n+a-c])<0;)o=c,c=(c<<1)+1,c<=0&&(c=l);c>l&&(c=l);var u=o;o=a-c,c=a-u}else{for(l=r-a;c<l&&i(e,t[n+a+c])>=0;)o=c,c=(c<<1)+1,c<=0&&(c=l);c>l&&(c=l),o+=a,c+=a}for(o++;o<c;){var d=o+(c-o>>>1);i(e,t[n+d])<0?c=d:o=d+1}return c}function NT(e,t){var n=al,r,a,i=0,o=[];r=[],a=[];function l(p,g){r[i]=p,a[i]=g,i+=1}function c(){for(;i>1;){var p=i-2;if(p>=1&&a[p-1]<=a[p]+a[p+1]||p>=2&&a[p-2]<=a[p]+a[p-1])a[p-1]<a[p+1]&&p--;else if(a[p]>a[p+1])break;d(p)}}function u(){for(;i>1;){var p=i-2;p>0&&a[p-1]<a[p+1]&&p--,d(p)}}function d(p){var g=r[p],v=a[p],m=r[p+1],_=a[p+1];a[p]=v+_,p===i-3&&(r[p+1]=r[p+2],a[p+1]=a[p+2]),i--;var y=Pd(e[m],e,g,v,0,t);g+=y,v-=y,v!==0&&(_=Ad(e[g+v-1],e,m,_,_-1,t),_!==0&&(v<=_?f(g,v,m,_):h(g,v,m,_)))}function f(p,g,v,m){var _=0;for(_=0;_<g;_++)o[_]=e[p+_];var y=0,w=v,C=p;if(e[C++]=e[w++],--m===0){for(_=0;_<g;_++)e[C+_]=o[y+_];return}if(g===1){for(_=0;_<m;_++)e[C+_]=e[w+_];e[C+m]=o[y];return}for(var S=n,b,x,E;;){b=0,x=0,E=!1;do if(t(e[w],o[y])<0){if(e[C++]=e[w++],x++,b=0,--m===0){E=!0;break}}else if(e[C++]=o[y++],b++,x=0,--g===1){E=!0;break}while((b|x)<S);if(E)break;do{if(b=Pd(e[w],o,y,g,0,t),b!==0){for(_=0;_<b;_++)e[C+_]=o[y+_];if(C+=b,y+=b,g-=b,g<=1){E=!0;break}}if(e[C++]=e[w++],--m===0){E=!0;break}if(x=Ad(o[y],e,w,m,0,t),x!==0){for(_=0;_<x;_++)e[C+_]=e[w+_];if(C+=x,w+=x,m-=x,m===0){E=!0;break}}if(e[C++]=o[y++],--g===1){E=!0;break}S--}while(b>=al||x>=al);if(E)break;S<0&&(S=0),S+=2}if(n=S,n<1&&(n=1),g===1){for(_=0;_<m;_++)e[C+_]=e[w+_];e[C+m]=o[y]}else{if(g===0)throw new Error;for(_=0;_<g;_++)e[C+_]=o[y+_]}}function h(p,g,v,m){var _=0;for(_=0;_<m;_++)o[_]=e[v+_];var y=p+g-1,w=m-1,C=v+m-1,S=0,b=0;if(e[C--]=e[y--],--g===0){for(S=C-(m-1),_=0;_<m;_++)e[S+_]=o[_];return}if(m===1){for(C-=g,y-=g,b=C+1,S=y+1,_=g-1;_>=0;_--)e[b+_]=e[S+_];e[C]=o[w];return}for(var x=n;;){var E=0,k=0,T=!1;do if(t(o[w],e[y])<0){if(e[C--]=e[y--],E++,k=0,--g===0){T=!0;break}}else if(e[C--]=o[w--],k++,E=0,--m===1){T=!0;break}while((E|k)<x);if(T)break;do{if(E=g-Pd(o[w],e,p,g,g-1,t),E!==0){for(C-=E,y-=E,g-=E,b=C+1,S=y+1,_=E-1;_>=0;_--)e[b+_]=e[S+_];if(g===0){T=!0;break}}if(e[C--]=o[w--],--m===1){T=!0;break}if(k=m-Ad(e[y],o,0,m,m-1,t),k!==0){for(C-=k,w-=k,m-=k,b=C+1,S=w+1,_=0;_<k;_++)e[b+_]=o[S+_];if(m<=1){T=!0;break}}if(e[C--]=e[y--],--g===0){T=!0;break}x--}while(E>=al||k>=al);if(T)break;x<0&&(x=0),x+=2}if(n=x,n<1&&(n=1),m===1){for(C-=g,y-=g,b=C+1,S=y+1,_=g-1;_>=0;_--)e[b+_]=e[S+_];e[C]=o[w]}else{if(m===0)throw new Error;for(S=C-(m-1),_=0;_<m;_++)e[S+_]=o[_]}}return{mergeRuns:c,forceMergeRuns:u,pushRun:l}}function Ps(e,t,n,r){n||(n=0),r||(r=e.length);var a=r-n;if(!(a<2)){var i=0;if(a<Qv){i=e0(e,n,r,t),t0(e,n,r,n+i,t);return}var o=NT(e,t),l=AT(a);do{if(i=e0(e,n,r,t),i<l){var c=a;c>l&&(c=l),t0(e,n,n+c,n+i,t),i=c}o.pushRun(n,i),o.mergeRuns(),a-=i,n+=i}while(a!==0);o.forceMergeRuns()}}var n0=!1;function Nd(){n0||(n0=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function r0(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var LT=(function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=r0}return e.prototype.traverse=function(t,n){for(var r=0;r<this._roots.length;r++)this._roots[r].traverse(t,n)},e.prototype.getDisplayList=function(t,n){n=n||!1;var r=this._displayList;return(t||!r.length)&&this.updateDisplayList(n),r},e.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var n=this._roots,r=this._displayList,a=0,i=n.length;a<i;a++)this._updateAndAddDisplayable(n[a],null,t);r.length=this._displayListLen,Ps(r,r0)},e.prototype._updateAndAddDisplayable=function(t,n,r){if(!(t.ignore&&!r)){t.beforeUpdate(),t.update(),t.afterUpdate();var a=t.getClipPath(),i=n&&n.length,o=0,l=t.__clipPaths;if(!t.ignoreClip&&(i||a)){if(l||(l=t.__clipPaths=[]),i)for(var c=0;c<n.length;c++)l[o++]=n[c];for(var u=a,d=t;u;)u.parent=d,u.updateTransform(),l[o++]=u,d=u,u=u.getClipPath()}if(l&&(l.length=o),t.childrenRef){for(var f=t.childrenRef(),h=0;h<f.length;h++){var p=f[h];t.__dirty&&(p.__dirty|=1),this._updateAndAddDisplayable(p,l,r)}t.__dirty=0}else{var g=t;isNaN(g.z)&&(Nd(),g.z=0),isNaN(g.z2)&&(Nd(),g.z2=0),isNaN(g.zlevel)&&(Nd(),g.zlevel=0),this._displayList[this._displayListLen++]=g}var v=t.getDecalElement&&t.getDecalElement();v&&this._updateAndAddDisplayable(v,l,r);var m=t.getTextGuideLine();m&&this._updateAndAddDisplayable(m,l,r);var _=t.getTextContent();_&&this._updateAndAddDisplayable(_,l,r)}},e.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},e.prototype.delRoot=function(t){if(t instanceof Array){for(var n=0,r=t.length;n<r;n++)this.delRoot(t[n]);return}var a=kt(this._roots,t);a>=0&&this._roots.splice(a,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e})(),Ld=it.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},il={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-il.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?il.bounceIn(e*2)*.5:il.bounceOut(e*2-1)*.5+.5}},Ns=Math.pow,oa=Math.sqrt,Ls=1e-8,a0=1e-4,i0=oa(3),Is=1/3,fr=ji(),zn=ji(),Ji=ji();function la(e){return e>-Ls&&e<Ls}function o0(e){return e>Ls||e<-Ls}function tn(e,t,n,r,a){var i=1-a;return i*i*(i*e+3*a*t)+a*a*(a*r+3*i*n)}function l0(e,t,n,r,a){var i=1-a;return 3*(((t-e)*i+2*(n-t)*a)*i+(r-n)*a*a)}function s0(e,t,n,r,a,i){var o=r+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),u=e-a,d=l*l-3*o*c,f=l*c-9*o*u,h=c*c-3*l*u,p=0;if(la(d)&&la(f))if(la(l))i[0]=0;else{var g=-c/l;g>=0&&g<=1&&(i[p++]=g)}else{var v=f*f-4*d*h;if(la(v)){var m=f/d,g=-l/o+m,_=-m/2;g>=0&&g<=1&&(i[p++]=g),_>=0&&_<=1&&(i[p++]=_)}else if(v>0){var y=oa(v),w=d*l+1.5*o*(-f+y),C=d*l+1.5*o*(-f-y);w<0?w=-Ns(-w,Is):w=Ns(w,Is),C<0?C=-Ns(-C,Is):C=Ns(C,Is);var g=(-l-(w+C))/(3*o);g>=0&&g<=1&&(i[p++]=g)}else{var S=(2*d*l-3*o*f)/(2*oa(d*d*d)),b=Math.acos(S)/3,x=oa(d),E=Math.cos(b),g=(-l-2*x*E)/(3*o),_=(-l+x*(E+i0*Math.sin(b)))/(3*o),k=(-l+x*(E-i0*Math.sin(b)))/(3*o);g>=0&&g<=1&&(i[p++]=g),_>=0&&_<=1&&(i[p++]=_),k>=0&&k<=1&&(i[p++]=k)}}return p}function c0(e,t,n,r,a){var i=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,l=3*t-3*e,c=0;if(la(o)){if(o0(i)){var u=-l/i;u>=0&&u<=1&&(a[c++]=u)}}else{var d=i*i-4*o*l;if(la(d))a[0]=-i/(2*o);else if(d>0){var f=oa(d),u=(-i+f)/(2*o),h=(-i-f)/(2*o);u>=0&&u<=1&&(a[c++]=u),h>=0&&h<=1&&(a[c++]=h)}}return c}function Os(e,t,n,r,a,i){var o=(t-e)*a+e,l=(n-t)*a+t,c=(r-n)*a+n,u=(l-o)*a+o,d=(c-l)*a+l,f=(d-u)*a+u;i[0]=e,i[1]=o,i[2]=u,i[3]=f,i[4]=f,i[5]=d,i[6]=c,i[7]=r}function u0(e,t,n,r,a,i,o,l,c,u,d){var f,h=.005,p=1/0,g,v,m,_;fr[0]=c,fr[1]=u;for(var y=0;y<1;y+=.05)zn[0]=tn(e,n,a,o,y),zn[1]=tn(t,r,i,l,y),m=$i(fr,zn),m<p&&(f=y,p=m);p=1/0;for(var w=0;w<32&&!(h<a0);w++)g=f-h,v=f+h,zn[0]=tn(e,n,a,o,g),zn[1]=tn(t,r,i,l,g),m=$i(zn,fr),g>=0&&m<p?(f=g,p=m):(Ji[0]=tn(e,n,a,o,v),Ji[1]=tn(t,r,i,l,v),_=$i(Ji,fr),v<=1&&_<p?(f=v,p=_):h*=.5);return d&&(d[0]=tn(e,n,a,o,f),d[1]=tn(t,r,i,l,f)),oa(p)}function IT(e,t,n,r,a,i,o,l,c){for(var u=e,d=t,f=0,h=1/c,p=1;p<=c;p++){var g=p*h,v=tn(e,n,a,o,g),m=tn(t,r,i,l,g),_=v-u,y=m-d;f+=Math.sqrt(_*_+y*y),u=v,d=m}return f}function cn(e,t,n,r){var a=1-r;return a*(a*e+2*r*t)+r*r*n}function d0(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function OT(e,t,n,r,a){var i=e-2*t+n,o=2*(t-e),l=e-r,c=0;if(la(i)){if(o0(o)){var u=-l/o;u>=0&&u<=1&&(a[c++]=u)}}else{var d=o*o-4*i*l;if(la(d)){var u=-o/(2*i);u>=0&&u<=1&&(a[c++]=u)}else if(d>0){var f=oa(d),u=(-o+f)/(2*i),h=(-o-f)/(2*i);u>=0&&u<=1&&(a[c++]=u),h>=0&&h<=1&&(a[c++]=h)}}return c}function f0(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Vs(e,t,n,r,a){var i=(t-e)*r+e,o=(n-t)*r+t,l=(o-i)*r+i;a[0]=e,a[1]=i,a[2]=l,a[3]=l,a[4]=o,a[5]=n}function h0(e,t,n,r,a,i,o,l,c){var u,d=.005,f=1/0;fr[0]=o,fr[1]=l;for(var h=0;h<1;h+=.05){zn[0]=cn(e,n,a,h),zn[1]=cn(t,r,i,h);var p=$i(fr,zn);p<f&&(u=h,f=p)}f=1/0;for(var g=0;g<32&&!(d<a0);g++){var v=u-d,m=u+d;zn[0]=cn(e,n,a,v),zn[1]=cn(t,r,i,v);var p=$i(zn,fr);if(v>=0&&p<f)u=v,f=p;else{Ji[0]=cn(e,n,a,m),Ji[1]=cn(t,r,i,m);var _=$i(Ji,fr);m<=1&&_<f?(u=m,f=_):d*=.5}}return c&&(c[0]=cn(e,n,a,u),c[1]=cn(t,r,i,u)),oa(f)}function VT(e,t,n,r,a,i,o){for(var l=e,c=t,u=0,d=1/o,f=1;f<=o;f++){var h=f*d,p=cn(e,n,a,h),g=cn(t,r,i,h),v=p-l,m=g-c;u+=Math.sqrt(v*v+m*m),l=p,c=g}return u}var zT=/cubic-bezier\(([0-9,\.e ]+)\)/;function p0(e){var t=e&&zT.exec(e);if(t){var n=t[1].split(","),r=+aa(n[0]),a=+aa(n[1]),i=+aa(n[2]),o=+aa(n[3]);if(isNaN(r+a+i+o))return;var l=[];return function(c){return c<=0?0:c>=1?1:s0(0,r,i,1,c,l)&&tn(0,a,o,1,l[0])}}}var HT=(function(){function e(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Vn,this.ondestroy=t.ondestroy||Vn,this.onrestart=t.onrestart||Vn,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,n){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=n;return}var r=this._life,a=t-this._startTime-this._pausedTime,i=a/r;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,l=o?o(i):i;if(this.onframe(l),i===1)if(this.loop){var c=a%r;this._startTime=t-c,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=ot(t)?t:il[t]||p0(t)},e})(),g0=(function(){function e(t){this.value=t}return e})(),FT=(function(){function e(){this._len=0}return e.prototype.insert=function(t){var n=new g0(t);return this.insertEntry(n),n},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var n=t.prev,r=t.next;n?n.next=r:this.head=r,r?r.prev=n:this.tail=n,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e})(),Xi=(function(){function e(t){this._list=new FT,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,n){var r=this._list,a=this._map,i=null;if(a[t]==null){var o=r.len(),l=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var c=r.head;r.remove(c),delete a[c.key],i=c.value,this._lastRemovedEntry=c}l?l.value=n:l=new g0(n),l.key=t,r.insertEntry(l),a[t]=l}return i},e.prototype.get=function(t){var n=this._map[t],r=this._list;if(n!=null)return n!==r.tail&&(r.remove(n),r.insertEntry(n)),n.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e})(),v0={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ol(e){return e=Math.round(e),e<0?0:e>255?255:e}function jT(e){return e=Math.round(e),e<0?0:e>360?360:e}function m0(e){return e<0?0:e>1?1:e}function Id(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?ol(parseFloat(t)/100*255):ol(parseInt(t,10))}function ja(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?m0(parseFloat(t)/100):m0(parseFloat(t))}function Od(e,t,n){return n<0?n+=1:n>1&&(n-=1),n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function Hn(e,t,n,r,a){return e[0]=t,e[1]=n,e[2]=r,e[3]=a,e}function Vd(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var y0=new Xi(20),zs=null;function Ki(e,t){zs&&Vd(zs,t),zs=y0.put(e,zs||t.slice())}function $a(e,t){if(e){t=t||[];var n=y0.get(e);if(n)return Vd(t,n);e=e+"";var r=e.replace(/ /g,"").toLowerCase();if(r in v0)return Vd(t,v0[r]),Ki(e,t),t;var a=r.length;if(r.charAt(0)==="#"){if(a===4||a===5){var i=parseInt(r.slice(1,4),16);if(!(i>=0&&i<=4095)){Hn(t,0,0,0,1);return}return Hn(t,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,a===5?parseInt(r.slice(4),16)/15:1),Ki(e,t),t}else if(a===7||a===9){var i=parseInt(r.slice(1,7),16);if(!(i>=0&&i<=16777215)){Hn(t,0,0,0,1);return}return Hn(t,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(r.slice(7),16)/255:1),Ki(e,t),t}return}var o=r.indexOf("("),l=r.indexOf(")");if(o!==-1&&l+1===a){var c=r.substr(0,o),u=r.substr(o+1,l-(o+1)).split(","),d=1;switch(c){case"rgba":if(u.length!==4)return u.length===3?Hn(t,+u[0],+u[1],+u[2],1):Hn(t,0,0,0,1);d=ja(u.pop());case"rgb":if(u.length>=3)return Hn(t,Id(u[0]),Id(u[1]),Id(u[2]),u.length===3?d:ja(u[3])),Ki(e,t),t;Hn(t,0,0,0,1);return;case"hsla":if(u.length!==4){Hn(t,0,0,0,1);return}return u[3]=ja(u[3]),zd(u,t),Ki(e,t),t;case"hsl":if(u.length!==3){Hn(t,0,0,0,1);return}return zd(u,t),Ki(e,t),t;default:return}}Hn(t,0,0,0,1)}}function zd(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=ja(e[1]),a=ja(e[2]),i=a<=.5?a*(r+1):a+r-a*r,o=a*2-i;return t=t||[],Hn(t,ol(Od(o,i,n+1/3)*255),ol(Od(o,i,n)*255),ol(Od(o,i,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function $T(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=i-a,l=(i+a)/2,c,u;if(o===0)c=0,u=0;else{l<.5?u=o/(i+a):u=o/(2-i-a);var d=((i-t)/6+o/2)/o,f=((i-n)/6+o/2)/o,h=((i-r)/6+o/2)/o;t===i?c=h-f:n===i?c=1/3+d-h:r===i&&(c=2/3+f-d),c<0&&(c+=1),c>1&&(c-=1)}var p=[c*360,u,l];return e[3]!=null&&p.push(e[3]),p}}function _0(e,t){var n=$a(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return Fd(n,n.length===4?"rgba":"rgb")}}function Hd(e,t,n,r){var a=$a(e);if(e)return a=$T(a),t!=null&&(a[0]=jT(ot(t)?t(a[0]):t)),n!=null&&(a[1]=ja(ot(n)?n(a[1]):n)),r!=null&&(a[2]=ja(ot(r)?r(a[2]):r)),Fd(zd(a),"rgba")}function Fd(e,t){if(!(!e||!e.length)){var n=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(n+=","+e[3]),t+"("+n+")"}}function Hs(e,t){var n=$a(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var w0=new Xi(100);function b0(e){if(Ge(e)){var t=w0.get(e);return t||(t=_0(e,-.1),w0.put(e,t)),t}else if(Bs(e)){var n=Ce({},e);return n.colorStops=bt(e.colorStops,function(r){return{offset:r.offset,color:_0(r.color,-.1)}}),n}return e}function WT(e){return e.type==="linear"}function UT(e){return e.type==="radial"}var JF=(function(){return it.hasGlobalWindow&&ot(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return process.env.NODE_ENV!=="production"&&Ia("Base64 isn't natively supported in the current environment."),null}})(),jd=Array.prototype.slice;function Ir(e,t,n){return(t-e)*n+e}function $d(e,t,n,r){for(var a=t.length,i=0;i<a;i++)e[i]=Ir(t[i],n[i],r);return e}function YT(e,t,n,r){for(var a=t.length,i=a&&t[0].length,o=0;o<a;o++){e[o]||(e[o]=[]);for(var l=0;l<i;l++)e[o][l]=Ir(t[o][l],n[o][l],r)}return e}function Fs(e,t,n,r){for(var a=t.length,i=0;i<a;i++)e[i]=t[i]+n[i]*r;return e}function C0(e,t,n,r){for(var a=t.length,i=a&&t[0].length,o=0;o<a;o++){e[o]||(e[o]=[]);for(var l=0;l<i;l++)e[o][l]=t[o][l]+n[o][l]*r}return e}function GT(e,t){for(var n=e.length,r=t.length,a=n>r?t:e,i=Math.min(n,r),o=a[i-1]||{color:[0,0,0,0],offset:0},l=i;l<Math.max(n,r);l++)a.push({offset:o.offset,color:o.color.slice()})}function qT(e,t,n){var r=e,a=t;if(!(!r.push||!a.push)){var i=r.length,o=a.length;if(i!==o)if(i>o)r.length=o;else for(var l=i;l<o;l++)r.push(n===1?a[l]:jd.call(a[l]));for(var c=r[0]&&r[0].length,l=0;l<r.length;l++)if(n===1)isNaN(r[l])&&(r[l]=a[l]);else for(var u=0;u<c;u++)isNaN(r[l][u])&&(r[l][u]=a[l][u])}}function js(e){if(Bn(e)){var t=e.length;if(Bn(e[0])){for(var n=[],r=0;r<t;r++)n.push(jd.call(e[r]));return n}return jd.call(e)}return e}function $s(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=e[3]==null?1:e[3],"rgba("+e.join(",")+")"}function JT(e){return Bn(e&&e[0])?2:1}var Ws=0,Us=1,S0=2,ll=3,Wd=4,Ud=5,x0=6;function E0(e){return e===Wd||e===Ud}function Ys(e){return e===Us||e===S0}var sl=[0,0,0,0],XT=(function(){function e(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,n,r){this._needsSort=!0;var a=this.keyframes,i=a.length,o=!1,l=x0,c=n;if(Bn(n)){var u=JT(n);l=u,(u===1&&!Dt(n[0])||u===2&&!Dt(n[0][0]))&&(o=!0)}else if(Dt(n)&&!Nv(n))l=Ws;else if(Ge(n))if(!isNaN(+n))l=Ws;else{var d=$a(n);d&&(c=d,l=ll)}else if(Bs(n)){var f=Ce({},c);f.colorStops=bt(n.colorStops,function(p){return{offset:p.offset,color:$a(p.color)}}),WT(n)?l=Wd:UT(n)&&(l=Ud),c=f}i===0?this.valType=l:(l!==this.valType||l===x0)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:c,rawValue:n,percent:0};return r&&(h.easing=r,h.easingFunc=ot(r)?r:il[r]||p0(r)),a.push(h),h},e.prototype.prepare=function(t,n){var r=this.keyframes;this._needsSort&&r.sort(function(v,m){return v.time-m.time});for(var a=this.valType,i=r.length,o=r[i-1],l=this.discrete,c=Ys(a),u=E0(a),d=0;d<i;d++){var f=r[d],h=f.value,p=o.value;f.percent=f.time/t,l||(c&&d!==i-1?qT(h,p,a):u&>(h.colorStops,p.colorStops))}if(!l&&a!==Ud&&n&&this.needsAnimate()&&n.needsAnimate()&&a===n.valType&&!n._finished){this._additiveTrack=n;for(var g=r[0].value,d=0;d<i;d++)a===Ws?r[d].additiveValue=r[d].value-g:a===ll?r[d].additiveValue=Fs([],r[d].value,g,-1):Ys(a)&&(r[d].additiveValue=a===Us?Fs([],r[d].value,g,-1):C0([],r[d].value,g,-1))}},e.prototype.step=function(t,n){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var r=this._additiveTrack!=null,a=r?"additiveValue":"value",i=this.valType,o=this.keyframes,l=o.length,c=this.propName,u=i===ll,d,f=this._lastFr,h=Math.min,p,g;if(l===1)p=g=o[0];else{if(n<0)d=0;else if(n<this._lastFrP){for(d=h(f+1,l-1);d>=0&&!(o[d].percent<=n);d--);d=h(d,l-2)}else{for(d=f;d<l&&!(o[d].percent>n);d++);d=h(d-1,l-2)}g=o[d+1],p=o[d]}if(p&&g){this._lastFr=d,this._lastFrP=n;var v=g.percent-p.percent,m=v===0?1:h((n-p.percent)/v,1);g.easingFunc&&(m=g.easingFunc(m));var _=r?this._additiveValue:u?sl:t[c];if((Ys(i)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[c]=m<1?p.rawValue:g.rawValue;else if(Ys(i))i===Us?$d(_,p[a],g[a],m):YT(_,p[a],g[a],m);else if(E0(i)){var y=p[a],w=g[a],C=i===Wd;t[c]={type:C?"linear":"radial",x:Ir(y.x,w.x,m),y:Ir(y.y,w.y,m),colorStops:bt(y.colorStops,function(b,x){var E=w.colorStops[x];return{offset:Ir(b.offset,E.offset,m),color:$s($d([],b.color,E.color,m))}}),global:w.global},C?(t[c].x2=Ir(y.x2,w.x2,m),t[c].y2=Ir(y.y2,w.y2,m)):t[c].r=Ir(y.r,w.r,m)}else if(u)$d(_,p[a],g[a],m),r||(t[c]=$s(_));else{var S=Ir(p[a],g[a],m);r?this._additiveValue=S:t[c]=S}r&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var n=this.valType,r=this.propName,a=this._additiveValue;n===Ws?t[r]=t[r]+a:n===ll?($a(t[r],sl),Fs(sl,sl,a,1),t[r]=$s(sl)):n===Us?Fs(t[r],t[r],a,1):n===S0&&C0(t[r],t[r],a,1)},e})(),Yd=(function(){function e(t,n,r,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=n,n&&a){Ia("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=r}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,n,r){return this.whenWithKeys(t,n,Vt(n),r)},e.prototype.whenWithKeys=function(t,n,r,a){for(var i=this._tracks,o=0;o<r.length;o++){var l=r[o],c=i[l];if(!c){c=i[l]=new XT(l);var u=void 0,d=this._getAdditiveTrack(l);if(d){var f=d.keyframes,h=f[f.length-1];u=h&&h.value,d.valType===ll&&u&&(u=$s(u))}else u=this._target[l];if(u==null)continue;t>0&&c.addKeyframe(0,js(u),a),this._trackKeys.push(l)}c.addKeyframe(t,js(n[l]),a)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var n=t.length,r=0;r<n;r++)t[r].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,n=this._abortedCbs;if(t&&t.removeClip(this._clip),this._clip=null,n)for(var r=0;r<n.length;r++)n[r].call(this)},e.prototype._setTracksFinished=function(){for(var t=this._tracks,n=this._trackKeys,r=0;r<n.length;r++)t[n[r]].setFinished()},e.prototype._getAdditiveTrack=function(t){var n,r=this._additiveAnimators;if(r)for(var a=0;a<r.length;a++){var i=r[a].getTrack(t);i&&(n=i)}return n},e.prototype.start=function(t){if(!(this._started>0)){this._started=1;for(var n=this,r=[],a=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],l=this._tracks[o],c=this._getAdditiveTrack(o),u=l.keyframes,d=u.length;if(l.prepare(a,c),l.needsAnimate())if(!this._allowDiscrete&&l.discrete){var f=u[d-1];f&&(n._target[l.propName]=f.rawValue),l.setFinished()}else r.push(l)}if(r.length||this._force){var h=new HT({life:a,loop:this._loop,delay:this._delay||0,onframe:function(p){n._started=2;var g=n._additiveAnimators;if(g){for(var v=!1,m=0;m<g.length;m++)if(g[m]._clip){v=!0;break}v||(n._additiveAnimators=null)}for(var m=0;m<r.length;m++)r[m].step(n._target,p);var _=n._onframeCbs;if(_)for(var m=0;m<_.length;m++)_[m](n._target,p)},ondestroy:function(){n._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),t&&h.setEasing(t)}else this._doneCallback();return this}},e.prototype.stop=function(t){if(this._clip){var n=this._clip;t&&n.onframe(1),this._abortedCallback()}},e.prototype.delay=function(t){return this._delay=t,this},e.prototype.during=function(t){return t&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(t)),this},e.prototype.done=function(t){return t&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(t)),this},e.prototype.aborted=function(t){return t&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(t)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(t){return this._tracks[t]},e.prototype.getTracks=function(){var t=this;return bt(this._trackKeys,function(n){return t._tracks[n]})},e.prototype.stopTracks=function(t,n){if(!t.length||!this._clip)return!0;for(var r=this._tracks,a=this._trackKeys,i=0;i<t.length;i++){var o=r[t[i]];o&&!o.isFinished()&&(n?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var l=!0,i=0;i<a.length;i++)if(!r[a[i]].isFinished()){l=!1;break}return l&&this._abortedCallback(),l},e.prototype.saveTo=function(t,n,r){if(t){n=n||this._trackKeys;for(var a=0;a<n.length;a++){var i=n[a],o=this._tracks[i];if(!(!o||o.isFinished())){var l=o.keyframes,c=l[r?0:l.length-1];c&&(t[i]=js(c.rawValue))}}}},e.prototype.__changeFinalValue=function(t,n){n=n||Vt(t);for(var r=0;r<n.length;r++){var a=n[r],i=this._tracks[a];if(i){var o=i.keyframes;if(o.length>1){var l=o.pop();i.addKeyframe(l.time,t[a]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e})();function Zi(){return new Date().getTime()}var KT=(function(e){et(t,e);function t(n){var r=e.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,n=n||{},r.stage=n.stage||{},r}return t.prototype.addClip=function(n){n.animation&&this.removeClip(n),this._head?(this._tail.next=n,n.prev=this._tail,n.next=null,this._tail=n):this._head=this._tail=n,n.animation=this},t.prototype.addAnimator=function(n){n.animation=this;var r=n.getClip();r&&this.addClip(r)},t.prototype.removeClip=function(n){if(n.animation){var r=n.prev,a=n.next;r?r.next=a:this._head=a,a?a.prev=r:this._tail=r,n.next=n.prev=n.animation=null}},t.prototype.removeAnimator=function(n){var r=n.getClip();r&&this.removeClip(r),n.animation=null},t.prototype.update=function(n){for(var r=Zi()-this._pausedTime,a=r-this._time,i=this._head;i;){var o=i.next;i.step(r,a)&&(i.ondestroy(),this.removeClip(i)),i=o}this._time=r,n||(this.trigger("frame",a),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var n=this;this._running=!0;function r(){n._running&&(Ld(r),!n._paused&&n.update())}Ld(r)},t.prototype.start=function(){this._running||(this._time=Zi(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Zi(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Zi()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var n=this._head;n;){var r=n.next;n.prev=n.next=n.animation=null,n=r}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(n,r){r=r||{},this.start();var a=new Yd(n,r.loop);return this.addAnimator(a),a},t})(dr),ZT=300,Gd=it.domSupported,qd=(function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:bt(e,function(r){var a=r.replace("mouse","pointer");return n.hasOwnProperty(a)?a:r})}})(),k0={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},T0=!1;function Jd(e){var t=e.pointerType;return t==="pen"||t==="touch"}function QT(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function Xd(e){e&&(e.zrByTouch=!0)}function eR(e,t){return Zn(e.dom,new tR(e,t),!0)}function R0(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var tR=(function(){function e(t,n){this.stopPropagation=Vn,this.stopImmediatePropagation=Vn,this.preventDefault=Vn,this.type=n.type,this.target=this.currentTarget=t.dom,this.pointerType=n.pointerType,this.clientX=n.clientX,this.clientY=n.clientY}return e})(),Qn={mousedown:function(e){e=Zn(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Zn(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=Zn(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=Zn(this.dom,e);var t=e.toElement||e.relatedTarget;R0(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){T0=!0,e=Zn(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){T0||(e=Zn(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=Zn(this.dom,e),Xd(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Qn.mousemove.call(this,e),Qn.mousedown.call(this,e)},touchmove:function(e){e=Zn(this.dom,e),Xd(e),this.handler.processGesture(e,"change"),Qn.mousemove.call(this,e)},touchend:function(e){e=Zn(this.dom,e),Xd(e),this.handler.processGesture(e,"end"),Qn.mouseup.call(this,e),+new Date-+this.__lastTouchMoment<ZT&&Qn.click.call(this,e)},pointerdown:function(e){Qn.mousedown.call(this,e)},pointermove:function(e){Jd(e)||Qn.mousemove.call(this,e)},pointerup:function(e){Qn.mouseup.call(this,e)},pointerout:function(e){Jd(e)||Qn.mouseout.call(this,e)}};q(["click","dblclick","contextmenu"],function(e){Qn[e]=function(t){t=Zn(this.dom,t),this.trigger(e,t)}});var Kd={pointermove:function(e){Jd(e)||Kd.mousemove.call(this,e)},pointerup:function(e){Kd.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function nR(e,t){var n=t.domHandlers;it.pointerEventsSupported?q(qd.pointer,function(r){Gs(t,r,function(a){n[r].call(e,a)})}):(it.touchEventsSupported&&q(qd.touch,function(r){Gs(t,r,function(a){n[r].call(e,a),QT(t)})}),q(qd.mouse,function(r){Gs(t,r,function(a){a=Ed(a),t.touching||n[r].call(e,a)})}))}function rR(e,t){it.pointerEventsSupported?q(k0.pointer,n):it.touchEventsSupported||q(k0.mouse,n);function n(r){function a(i){i=Ed(i),R0(e,i.target)||(i=eR(e,i),t.domHandlers[r].call(e,i))}Gs(t,r,a,{capture:!0})}}function Gs(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,vT(e.domTarget,t,n,r)}function Zd(e){var t=e.mounted;for(var n in t)t.hasOwnProperty(n)&&mT(e.domTarget,n,t[n],e.listenerOpts[n]);e.mounted={}}var M0=(function(){function e(t,n){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=n}return e})(),aR=(function(e){et(t,e);function t(n,r){var a=e.call(this)||this;return a.__pointerCapturing=!1,a.dom=n,a.painterRoot=r,a._localHandlerScope=new M0(n,Qn),Gd&&(a._globalHandlerScope=new M0(document,Kd)),nR(a,a._localHandlerScope),a}return t.prototype.dispose=function(){Zd(this._localHandlerScope),Gd&&Zd(this._globalHandlerScope)},t.prototype.setCursor=function(n){this.dom.style&&(this.dom.style.cursor=n||"default")},t.prototype.__togglePointerCapture=function(n){if(this.__mayPointerCapture=null,Gd&&+this.__pointerCapturing^+n){this.__pointerCapturing=n;var r=this._globalHandlerScope;n?rR(this,r):Zd(r)}},t})(dr),B0=1;it.hasGlobalWindow&&(B0=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var qs=B0,D0=.4,Qd="#333",ef="#ccc",iR="#eee",A0=bT,P0=5e-5;function Wa(e){return e>P0||e<-P0}var Ua=[],Qi=[],tf=Gi(),nf=Math.abs,rf=(function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return Wa(this.rotation)||Wa(this.x)||Wa(this.y)||Wa(this.scaleX-1)||Wa(this.scaleY-1)||Wa(this.skewX)||Wa(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,n=this.needLocalTransform(),r=this.transform;if(!(n||t)){r&&(A0(r),this.invTransform=null);return}r=r||Gi(),n?this.getLocalTransform(r):A0(r),t&&(n?Td(r,t,r):Wv(r,t)),this.transform=r,this._resolveGlobalScaleRatio(r)},e.prototype._resolveGlobalScaleRatio=function(t){var n=this.globalScaleRatio;if(n!=null&&n!==1){this.getGlobalScale(Ua);var r=Ua[0]<0?-1:1,a=Ua[1]<0?-1:1,i=((Ua[0]-r)*n+r)/Ua[0]||0,o=((Ua[1]-a)*n+a)/Ua[1]||0;t[0]*=i,t[1]*=i,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Gi(),Rd(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,n=[];t;)n.push(t),t=t.parent;for(;t=n.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var n=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],a=Math.atan2(t[1],t[0]),i=Math.PI/2+a-Math.atan2(t[3],t[2]);r=Math.sqrt(r)*Math.cos(i),n=Math.sqrt(n),this.skewX=i,this.skewY=0,this.rotation=-a,this.x=+t[4],this.y=+t[5],this.scaleX=n,this.scaleY=r,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,n=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Gi(),Td(Qi,t.invTransform,n),n=Qi);var r=this.originX,a=this.originY;(r||a)&&(tf[4]=r,tf[5]=a,Td(Qi,n,tf),Qi[4]-=r,Qi[5]-=a,n=Qi),this.setLocalTransform(n)}},e.prototype.getGlobalScale=function(t){var n=this.transform;return t=t||[],n?(t[0]=Math.sqrt(n[0]*n[0]+n[1]*n[1]),t[1]=Math.sqrt(n[2]*n[2]+n[3]*n[3]),n[0]<0&&(t[0]=-t[0]),n[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,n){var r=[t,n],a=this.invTransform;return a&&el(r,r,a),r},e.prototype.transformCoordToGlobal=function(t,n){var r=[t,n],a=this.transform;return a&&el(r,r,a),r},e.prototype.getLineScale=function(){var t=this.transform;return t&&nf(t[0]-1)>1e-10&&nf(t[3]-1)>1e-10?Math.sqrt(nf(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){oR(this,t)},e.getLocalTransform=function(t,n){n=n||[];var r=t.originX||0,a=t.originY||0,i=t.scaleX,o=t.scaleY,l=t.anchorX,c=t.anchorY,u=t.rotation||0,d=t.x,f=t.y,h=t.skewX?Math.tan(t.skewX):0,p=t.skewY?Math.tan(-t.skewY):0;if(r||a||l||c){var g=r+l,v=a+c;n[4]=-g*i-h*v*o,n[5]=-v*o-p*g*i}else n[4]=n[5]=0;return n[0]=i,n[3]=o,n[1]=p*i,n[2]=h*o,u&&CT(n,n,u),n[4]+=r+d,n[5]+=a+f,n},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e})(),cl=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function oR(e,t){for(var n=0;n<cl.length;n++){var r=cl[n];e[r]=t[r]}}function Or(e){Js||(Js=new Xi(100)),e=e||"12px sans-serif";var t=Js.get(e);return t||(t={font:e,strWidthCache:new Xi(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:ur.measureText("国",e).width,asciiCharWidth:ur.measureText("a",e).width},Js.put(e,t)),t}var Js;function lR(e){if(!(af>=N0)){e=e||"12px sans-serif";for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=ur.measureText(String.fromCharCode(r),e).width;var a=+new Date-n;return a>16?af=N0:a>2&&af++,t}}var af=0,N0=5;function L0(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=lR(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Vr(e,t){var n=e.strWidthCache,r=n.get(t);return r==null&&(r=ur.measureText(t,e.font).width,n.put(t,r)),r}function ul(e,t,n,r){return n==="right"?r?e+=t:e-=t:n==="center"&&(r?e+=t/2:e-=t/2),e}function eo(e,t,n,r){return n==="middle"?r?e+=t/2:e-=t/2:n==="bottom"&&(r?e+=t:e-=t),e}function of(e){return Or(e).stWideCharWidth}function dl(e,t){return typeof e=="string"?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function I0(e,t,n){var r=t.position||"inside",a=t.distance!=null?t.distance:5,i=n.height,o=n.width,l=i/2,c=n.x,u=n.y,d="left",f="top";if(r instanceof Array)c+=dl(r[0],n.width),u+=dl(r[1],n.height),d=null,f=null;else switch(r){case"left":c-=a,u+=l,d="right",f="middle";break;case"right":c+=a+o,u+=l,f="middle";break;case"top":c+=o/2,u-=a,d="center",f="bottom";break;case"bottom":c+=o/2,u+=i+a,d="center";break;case"inside":c+=o/2,u+=l,d="center",f="middle";break;case"insideLeft":c+=a,u+=l,f="middle";break;case"insideRight":c+=o-a,u+=l,d="right",f="middle";break;case"insideTop":c+=o/2,u+=a,d="center";break;case"insideBottom":c+=o/2,u+=i-a,d="center",f="bottom";break;case"insideTopLeft":c+=a,u+=a;break;case"insideTopRight":c+=o-a,u+=a,d="right";break;case"insideBottomLeft":c+=a,u+=i-a,f="bottom";break;case"insideBottomRight":c+=o-a,u+=i-a,d="right",f="bottom";break}return e=e||{},e.x=c,e.y=u,e.align=d,e.verticalAlign=f,e}var O0="__zr_normal__",lf=cl.concat(["ignore"]),sR=Fi(cl,function(e,t){return e[t]=!0,e},{ignore:!1}),to={},cR=new lt(0,0,0,0),Xs=[],Ks=(function(){function e(t){this.id=Dv(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,n,r){switch(this.draggable){case"horizontal":n=0;break;case"vertical":t=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=t,a[5]+=n,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var n=this._textContent;if(n&&(!n.ignore||t)){this.textConfig||(this.textConfig={});var r=this.textConfig,a=r.local,i=n.innerTransformable,o=void 0,l=void 0,c=!1;i.parent=a?this:null;var u=!1;i.copyTransform(n);var d=r.position!=null,f=r.autoOverflowArea,h=void 0;if((f||d)&&(h=cR,r.layoutRect?h.copy(r.layoutRect):h.copy(this.getBoundingRect()),a||h.applyTransform(this.transform)),d){this.calculateTextPosition?this.calculateTextPosition(to,r,h):I0(to,r,h),i.x=to.x,i.y=to.y,o=to.align,l=to.verticalAlign;var p=r.origin;if(p&&r.rotation!=null){var g=void 0,v=void 0;p==="center"?(g=h.width*.5,v=h.height*.5):(g=dl(p[0],h.width),v=dl(p[1],h.height)),u=!0,i.originX=-i.x+g+(a?0:h.x),i.originY=-i.y+v+(a?0:h.y)}}r.rotation!=null&&(i.rotation=r.rotation);var m=r.offset;m&&(i.x+=m[0],i.y+=m[1],u||(i.originX=-m[0],i.originY=-m[1]));var _=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(f){var y=_.overflowRect=_.overflowRect||new lt(0,0,0,0);i.getLocalTransform(Xs),Rd(Xs,Xs),lt.copy(y,h),y.applyTransform(Xs)}else _.overflowRect=null;var w=r.inside==null?typeof r.position=="string"&&r.position.indexOf("inside")>=0:r.inside,C=void 0,S=void 0,b=void 0;w&&this.canBeInsideText()?(C=r.insideFill,S=r.insideStroke,(C==null||C==="auto")&&(C=this.getInsideTextFill()),(S==null||S==="auto")&&(S=this.getInsideTextStroke(C),b=!0)):(C=r.outsideFill,S=r.outsideStroke,(C==null||C==="auto")&&(C=this.getOutsideFill()),(S==null||S==="auto")&&(S=this.getOutsideStroke(C),b=!0)),C=C||"#000",(C!==_.fill||S!==_.stroke||b!==_.autoStroke||o!==_.align||l!==_.verticalAlign)&&(c=!0,_.fill=C,_.stroke=S,_.autoStroke=b,_.align=o,_.verticalAlign=l,n.setDefaultTextStyle(_)),n.__dirty|=1,c&&n.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ef:Qd},e.prototype.getOutsideStroke=function(t){var n=this.__zr&&this.__zr.getBackgroundColor(),r=typeof n=="string"&&$a(n);r||(r=[255,255,255,1]);for(var a=r[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*a+(i?0:255)*(1-a);return r[3]=1,Fd(r,"rgba")},e.prototype.traverse=function(t,n){},e.prototype.attrKV=function(t,n){t==="textConfig"?this.setTextConfig(n):t==="textContent"?this.setTextContent(n):t==="clipPath"?this.setClipPath(n):t==="extra"?(this.extra=this.extra||{},Ce(this.extra,n)):this[t]=n},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,n){if(typeof t=="string")this.attrKV(t,n);else if(ze(t))for(var r=Vt(t),a=0;a<r.length;a++){var i=r[a];this.attrKV(i,t[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var n=this._normalState,r=0;r<this.animators.length;r++){var a=this.animators[r],i=a.__fromStateTransition;if(!(a.getLoop()||i&&i!=="__zr_normal__")){var o=a.targetName,l=o?n[o]:n;a.saveTo(l)}}},e.prototype._innerSaveToNormal=function(t){var n=this._normalState;n||(n=this._normalState={}),t.textConfig&&!n.textConfig&&(n.textConfig=this.textConfig),this._savePrimaryToNormal(t,n,lf)},e.prototype._savePrimaryToNormal=function(t,n,r){for(var a=0;a<r.length;a++){var i=r[a];t[i]!=null&&!(i in n)&&(n[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var n=this.states;return n[t]||(n[t]={}),n[t]},e.prototype.clearStates=function(t){this.useState(O0,!1,t)},e.prototype.useState=function(t,n,r,a){var i=t===O0;if(!(!this.hasState()&&i)){var o=this.currentStates,l=this.stateTransition;if(!(kt(o,t)>=0&&(n||o.length===1))){var c;if(this.stateProxy&&!i&&(c=this.stateProxy(t)),c||(c=this.states&&this.states[t]),!c&&!i){Ia("State "+t+" not exists.");return}i||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,c,this._normalState,n,!r&&!this.__inHover&&l&&l.duration>0,l);var d=this._textContent,f=this._textGuide;return d&&d.useState(t,n,r,u),f&&f.useState(t,n,r,u),i?(this.currentStates=[],this._normalState={}):n?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),c}}},e.prototype.useStates=function(t,n,r){if(!t.length)this.clearStates();else{var a=[],i=this.currentStates,o=t.length,l=o===i.length;if(l){for(var c=0;c<o;c++)if(t[c]!==i[c]){l=!1;break}}if(l)return;for(var c=0;c<o;c++){var u=t[c],d=void 0;this.stateProxy&&(d=this.stateProxy(u,t)),d||(d=this.states[u]),d&&a.push(d)}var f=a[o-1],h=!!(f&&f.hoverLayer||r);h&&this._toggleHoverLayerFlag(!0);var p=this._mergeStates(a),g=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(t.join(","),p,this._normalState,!1,!n&&!this.__inHover&&g&&g.duration>0,g);var v=this._textContent,m=this._textGuide;v&&v.useStates(t,n,h),m&&m.useStates(t,n,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var n=t.__hostTarget;t=n?t.ignoreHostSilent?null:n:t.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var n=this.animators[t];n.targetName&&n.changeTarget(this[n.targetName])}},e.prototype.removeState=function(t){var n=kt(this.currentStates,t);if(n>=0){var r=this.currentStates.slice();r.splice(n,1),this.useStates(r)}},e.prototype.replaceState=function(t,n,r){var a=this.currentStates.slice(),i=kt(a,t),o=kt(a,n)>=0;i>=0?o?a.splice(i,1):a[i]=n:r&&!o&&a.push(n),this.useStates(a)},e.prototype.toggleState=function(t,n){n?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var n={},r,a=0;a<t.length;a++){var i=t[a];Ce(n,i),i.textConfig&&(r=r||{},Ce(r,i.textConfig))}return r&&(n.textConfig=r),n},e.prototype._applyStateObj=function(t,n,r,a,i,o){var l=!(n&&a);n&&n.textConfig?(this.textConfig=Ce({},a?this.textConfig:r.textConfig),Ce(this.textConfig,n.textConfig)):l&&r.textConfig&&(this.textConfig=r.textConfig);for(var c={},u=!1,d=0;d<lf.length;d++){var f=lf[d],h=i&&sR[f];n&&n[f]!=null?h?(u=!0,c[f]=n[f]):this[f]=n[f]:l&&r[f]!=null&&(h?(u=!0,c[f]=r[f]):this[f]=r[f])}if(!i)for(var d=0;d<this.animators.length;d++){var p=this.animators[d],g=p.targetName;p.getLoop()||p.__changeFinalValue(g?(n||r)[g]:n||r)}u&&this._transitionState(t,c,o)},e.prototype._attachComponent=function(t){if(t.__zr&&!t.__hostTarget){if(process.env.NODE_ENV!=="production")throw new Error("Text element has been added to zrender.");return}if(t===this){if(process.env.NODE_ENV!=="production")throw new Error("Recursive component attachment.");return}var n=this.__zr;n&&t.addSelfToZr(n),t.__zr=n,t.__hostTarget=this},e.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},e.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(t){var n=this._textContent;if(n!==t){if(n&&n!==t&&this.removeTextContent(),process.env.NODE_ENV!=="production"&&t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");t.innerTransformable=new rf,this._attachComponent(t),this._textContent=t,this.markRedraw()}},e.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),Ce(this.textConfig,t),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.innerTransformable=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var n=this._textContent,r=this._textGuide;n&&(n.__inHover=t),r&&(r.__inHover=t)},e.prototype.addSelfToZr=function(t){if(this.__zr!==t){this.__zr=t;var n=this.animators;if(n)for(var r=0;r<n.length;r++)t.animation.addAnimator(n[r]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){if(this.__zr){this.__zr=null;var n=this.animators;if(n)for(var r=0;r<n.length;r++)t.animation.removeAnimator(n[r]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)}},e.prototype.animate=function(t,n,r){var a=t?this[t]:this;if(process.env.NODE_ENV!=="production"&&!a){Ia('Property "'+t+'" is not existed in element '+this.id);return}var i=new Yd(a,n,r);return t&&(i.targetName=t),this.addAnimator(i,t),i},e.prototype.addAnimator=function(t,n){var r=this.__zr,a=this;t.during(function(){a.updateDuringAnimation(n)}).done(function(){var i=a.animators,o=kt(i,t);o>=0&&i.splice(o,1)}),this.animators.push(t),r&&r.animation.addAnimator(t),r&&r.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,n){for(var r=this.animators,a=r.length,i=[],o=0;o<a;o++){var l=r[o];!t||t===l.scope?l.stop(n):i.push(l)}return this.animators=i,this},e.prototype.animateTo=function(t,n,r){sf(this,t,n,r)},e.prototype.animateFrom=function(t,n,r){sf(this,t,n,r,!0)},e.prototype._transitionState=function(t,n,r,a){for(var i=sf(this,n,r,a),o=0;o<i.length;o++)i[o].__fromStateTransition=t},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=(function(){var t=e.prototype;t.type="element",t.name="",t.ignore=t.silent=t.ignoreHostSilent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=t.__inHover=!1,t.__dirty=1;var n={};function r(i,o,l){n[i+o+l]||(console.warn("DEPRECATED: '"+i+"' has been deprecated. use '"+o+"', '"+l+"' instead"),n[i+o+l]=!0)}function a(i,o,l,c){Object.defineProperty(t,i,{get:function(){if(process.env.NODE_ENV!=="production"&&r(i,l,c),!this[o]){var d=this[o]=[];u(this,d)}return this[o]},set:function(d){process.env.NODE_ENV!=="production"&&r(i,l,c),this[l]=d[0],this[c]=d[1],this[o]=d,u(this,d)}});function u(d,f){Object.defineProperty(f,0,{get:function(){return d[l]},set:function(h){d[l]=h}}),Object.defineProperty(f,1,{get:function(){return d[c]},set:function(h){d[c]=h}})}}Object.defineProperty&&(a("position","_legacyPos","x","y"),a("scale","_legacyScale","scaleX","scaleY"),a("origin","_legacyOrigin","originX","originY"))})(),e})();Lr(Ks,dr),Lr(Ks,rf);function sf(e,t,n,r,a){n=n||{};var i=[];V0(e,"",e,t,n,r,i,a);var o=i.length,l=!1,c=n.done,u=n.aborted,d=function(){l=!0,o--,o<=0&&(l?c&&c():u&&u())},f=function(){o--,o<=0&&(l?c&&c():u&&u())};o||c&&c(),i.length>0&&n.during&&i[0].during(function(g,v){n.during(v)});for(var h=0;h<i.length;h++){var p=i[h];d&&p.done(d),f&&p.aborted(f),n.force&&p.duration(n.duration),p.start(n.easing)}return i}function cf(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function uR(e){return Bn(e[0])}function dR(e,t,n){if(Bn(t[n]))if(Bn(e[n])||(e[n]=[]),hn(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),cf(e[n],t[n],r))}else{var a=t[n],i=e[n],o=a.length;if(uR(a))for(var l=a[0].length,c=0;c<o;c++)i[c]?cf(i[c],a[c],l):i[c]=Array.prototype.slice.call(a[c]);else cf(i,a,o);i.length=a.length}else e[n]=t[n]}function fR(e,t){return e===t||Bn(e)&&Bn(t)&&hR(e,t)}function hR(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function V0(e,t,n,r,a,i,o,l){for(var c=Vt(r),u=a.duration,d=a.delay,f=a.additive,h=a.setToFinal,p=!ze(i),g=e.animators,v=[],m=0;m<c.length;m++){var _=c[m],y=r[_];if(y!=null&&n[_]!=null&&(p||i[_]))if(ze(y)&&!Bn(y)&&!Bs(y)){if(t){l||(n[_]=y,e.updateDuringAnimation(t));continue}V0(e,_,n[_],y,a,i&&i[_],o,l)}else v.push(_);else l||(n[_]=y,e.updateDuringAnimation(t),v.push(_))}var w=v.length;if(!f&&w)for(var C=0;C<g.length;C++){var S=g[C];if(S.targetName===t&&S.stopTracks(v)){var b=kt(g,S);g.splice(b,1)}}if(a.force||(v=Cn(v,function(T){return!fR(r[T],n[T])}),w=v.length),w>0||a.force&&!o.length){var x=void 0,E=void 0,k=void 0;if(l){E={},h&&(x={});for(var C=0;C<w;C++){var _=v[C];E[_]=n[_],h?x[_]=r[_]:n[_]=r[_]}}else if(h){k={};for(var C=0;C<w;C++){var _=v[C];k[_]=js(n[_]),dR(n,r,_)}}var S=new Yd(n,!1,!1,f?Cn(g,function(R){return R.targetName===t}):null);S.targetName=t,a.scope&&(S.scope=a.scope),h&&x&&S.whenWithKeys(0,x,v),k&&S.whenWithKeys(0,k,v),S.whenWithKeys(u??500,l?E:r,v).delay(d||0),e.addAnimator(S,t),o.push(S)}}var fl=(function(e){et(t,e);function t(n){var r=e.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(n),r}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(n){return this._children[n]},t.prototype.childOfName=function(n){for(var r=this._children,a=0;a<r.length;a++)if(r[a].name===n)return r[a]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(n){if(n&&(n!==this&&n.parent!==this&&(this._children.push(n),this._doAdd(n)),process.env.NODE_ENV!=="production"&&n.__hostTarget))throw"This elemenet has been used as an attachment";return this},t.prototype.addBefore=function(n,r){if(n&&n!==this&&n.parent!==this&&r&&r.parent===this){var a=this._children,i=a.indexOf(r);i>=0&&(a.splice(i,0,n),this._doAdd(n))}return this},t.prototype.replace=function(n,r){var a=kt(this._children,n);return a>=0&&this.replaceAt(r,a),this},t.prototype.replaceAt=function(n,r){var a=this._children,i=a[r];if(n&&n!==this&&n.parent!==this&&n!==i){a[r]=n,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(n)}return this},t.prototype._doAdd=function(n){n.parent&&n.parent.remove(n),n.parent=this;var r=this.__zr;r&&r!==n.__zr&&n.addSelfToZr(r),r&&r.refresh()},t.prototype.remove=function(n){var r=this.__zr,a=this._children,i=kt(a,n);return i<0?this:(a.splice(i,1),n.parent=null,r&&n.removeSelfFromZr(r),r&&r.refresh(),this)},t.prototype.removeAll=function(){for(var n=this._children,r=this.__zr,a=0;a<n.length;a++){var i=n[a];r&&i.removeSelfFromZr(r),i.parent=null}return n.length=0,this},t.prototype.eachChild=function(n,r){for(var a=this._children,i=0;i<a.length;i++){var o=a[i];n.call(r,o,i)}return this},t.prototype.traverse=function(n,r){for(var a=0;a<this._children.length;a++){var i=this._children[a],o=n.call(r,i);i.isGroup&&!o&&i.traverse(n,r)}return this},t.prototype.addSelfToZr=function(n){e.prototype.addSelfToZr.call(this,n);for(var r=0;r<this._children.length;r++)this._children[r].addSelfToZr(n)},t.prototype.removeSelfFromZr=function(n){e.prototype.removeSelfFromZr.call(this,n);for(var r=0;r<this._children.length;r++)this._children[r].removeSelfFromZr(n)},t.prototype.getBoundingRect=function(n){for(var r=new lt(0,0,0,0),a=n||this._children,i=[],o=null,l=0;l<a.length;l++){var c=a[l];if(!(c.ignore||c.invisible)){var u=c.getBoundingRect(),d=c.getLocalTransform(i);d?(lt.applyTransform(r,u,d),o=o||r.clone(),o.union(r)):(o=o||u.clone(),o.union(u))}}return o||r},t})(Ks);fl.prototype.type="group";var hl={},z0={};function pR(e){delete z0[e]}function gR(e){if(!e)return!1;if(typeof e=="string")return Hs(e,1)<D0;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,a=0;a<r;a++)n+=Hs(t[a].color,1);return n/=r,n<D0}return!1}var vR=(function(){function e(t,n,r){var a=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,r=r||{},this.dom=n,this.id=t;var i=new LT,o=r.renderer||"canvas";if(hl[o]||(o=Vt(hl)[0]),process.env.NODE_ENV!=="production"&&!hl[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");r.useDirtyRect=r.useDirtyRect==null?!1:r.useDirtyRect;var l=new hl[o](n,i,r,t),c=r.ssr||l.ssrOnly;this.storage=i,this.painter=l;var u=!it.node&&!it.worker&&!c?new aR(l.getViewportRoot(),l.root):null,d=r.useCoarsePointer,f=d==null||d==="auto"?it.touchEventsSupported:!!d,h=44,p;f&&(p=qe(r.pointerSize,h)),this.handler=new Xv(i,l,u,l.root,p),this.animation=new KT({stage:{update:c?null:function(){return a._flush(!0)}}}),c||this.animation.start()}return e.prototype.add=function(t){this._disposed||!t||(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},e.prototype.remove=function(t){this._disposed||!t||(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(t,n){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,n),this.refresh())},e.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=gR(t))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(t){this._darkMode=t},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(t){this._disposed||(t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!1)},e.prototype._flush=function(t){var n,r=Zi();this._needsRefresh&&(n=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(n=!0,this.refreshHoverImmediately());var a=Zi();n?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:a-r})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,n){if(!this._disposed)return this.handler.findHover(t,n)},e.prototype.on=function(t,n,r){return this._disposed||this.handler.on(t,n,r),this},e.prototype.off=function(t,n){this._disposed||this.handler.off(t,n)},e.prototype.trigger=function(t,n){this._disposed||this.handler.trigger(t,n)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),n=0;n<t.length;n++)t[n]instanceof fl&&t[n].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,pR(this.id))},e})();function H0(e,t){var n=new vR(Dv(),e,t);return z0[n.id]=n,n}function mR(e,t){hl[e]=t}var yR;function _R(e){yR=e}var F0=20;function wR(e){return e.replace(/^\s+|\s+$/g,"")}var bR=Math.min,Ya=Math.max,pl=Math.abs;function CR(e,t,n,r){var a=t[0],i=t[1],o=n[0],l=n[1],c=i-a,u=l-o;if(c===0)return u===0?o:(o+l)/2;if(r)if(c>0){if(e<=a)return o;if(e>=i)return l}else{if(e>=a)return o;if(e<=i)return l}else{if(e===a)return o;if(e===i)return l}return(e-a)/c*u+o}var sa=SR;function SR(e,t,n){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%";break}return xR(e,t,n)}function xR(e,t,n){return Ge(e)?wR(e).match(/%$/)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function uf(e,t,n){return t==null&&(t=10),t=Math.min(Math.max(0,t),F0),e=(+e).toFixed(t),n?e:+e}function no(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n}return ER(e)}function ER(e){var t=e.toString().toLowerCase(),n=t.indexOf("e"),r=n>0?+t.slice(n+1):0,a=n>0?n:t.length,i=t.indexOf("."),o=i<0?0:a-1-i;return Math.max(0,o-r)}function kR(e,t){var n=Math.max(no(e),no(t)),r=e+t;return n>F0?r:uf(r,n)}var TR=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function j0(e){if(e instanceof Date)return e;if(Ge(e)){var t=TR.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return t[8].toUpperCase()!=="Z"&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}else return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}else if(e==null)return new Date(NaN);return new Date(Math.round(e))}function Ga(e){var t=parseFloat(e);return t==e&&(t!==0||!Ge(e)||e.indexOf("x")<=0)?t:NaN}function RR(e){return!isNaN(Ga(e))}function $0(){return Math.round(Math.random()*9)}function W0(e,t){return t===0?e:W0(t,e%t)}function U0(e,t){return e==null?t:t==null?e:e*t/W0(e,t)}var MR="[ECharts] ",Y0={},BR=typeof console<"u"&&console.warn&&console.log;function Zs(e,t,n){if(BR){if(n){if(Y0[t])return;Y0[t]=!0}console[e](MR+t)}}function DR(e,t){Zs("log",e,t)}function zr(e,t){Zs("warn",e,t)}function At(e,t){Zs("error",e,t)}function Hr(e){process.env.NODE_ENV!=="production"&&Zs("warn","DEPRECATED: "+e,!0)}function Jt(e,t,n){process.env.NODE_ENV!=="production"&&Hr((n?"["+n+"]":"")+(e+" is deprecated; use "+t+" instead."))}function df(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";if(process.env.NODE_ENV!=="production"){var r=function(a){return a===void 0?"undefined":a===1/0?"Infinity":a===-1/0?"-Infinity":Nv(a)?"NaN":a instanceof Date?"Date("+a.toISOString()+")":ot(a)?"function () { ... }":qk(a)?a+"":null};n=bt(e,function(a){if(Ge(a))return a;var i=r(a);if(i!=null)return i;if(typeof JSON<"u"&&JSON.stringify)try{return JSON.stringify(a,function(o,l){var c=r(l);return c??l})}catch{return"?"}else return"?"}).join(" ")}return n}function xn(e){throw new Error(e)}function G0(e,t,n){return(t-e)*n+e}var q0="series\0",AR="\0_ec_\0";function pn(e){return e instanceof Array?e:e==null?[]:[e]}function J0(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,a=n.length;r<a;r++){var i=n[r];!e.emphasis[t].hasOwnProperty(i)&&e[t].hasOwnProperty(i)&&(e.emphasis[t][i]=e[t][i])}}}var X0=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Qs(e){return ze(e)&&!Fe(e)&&!(e instanceof Date)?e.value:e}function PR(e){return ze(e)&&!(e instanceof Array)}function NR(e,t,n){var r=n==="normalMerge",a=n==="replaceMerge",i=n==="replaceAll";e=e||[],t=(t||[]).slice();var o=Je();q(t,function(c,u){if(!ze(c)){t[u]=null;return}process.env.NODE_ENV!=="production"&&(c.id!=null&&!Q0(c.id)&&Z0(c.id),c.name!=null&&!Q0(c.name)&&Z0(c.name))});var l=LR(e,o,n);return(r||a)&&IR(l,e,o,t),r&&OR(l,t),r||a?VR(l,t,a):i&&zR(l,t),HR(l),l}function LR(e,t,n){var r=[];if(n==="replaceAll")return r;for(var a=0;a<e.length;a++){var i=e[a];i&&i.id!=null&&t.set(i.id,a),r.push({existing:n==="replaceMerge"||ro(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return r}function IR(e,t,n,r){q(r,function(a,i){if(!(!a||a.id==null)){var o=gl(a.id),l=n.get(o);if(l!=null){var c=e[l];je(!c.newOption,'Duplicated option on id "'+o+'".'),c.newOption=a,c.existing=t[l],r[i]=null}}})}function OR(e,t){q(t,function(n,r){if(!(!n||n.name==null))for(var a=0;a<e.length;a++){var i=e[a].existing;if(!e[a].newOption&&i&&(i.id==null||n.id==null)&&!ro(n)&&!ro(i)&&K0("name",i,n)){e[a].newOption=n,t[r]=null;return}}})}function VR(e,t,n){q(t,function(r){if(r){for(var a,i=0;(a=e[i])&&(a.newOption||ro(a.existing)||a.existing&&r.id!=null&&!K0("id",r,a.existing));)i++;a?(a.newOption=r,a.brandNew=n):e.push({newOption:r,brandNew:n,existing:null,keyInfo:null}),i++}})}function zR(e,t){q(t,function(n){e.push({newOption:n,brandNew:!0,existing:null,keyInfo:null})})}function HR(e){var t=Je();q(e,function(n){var r=n.existing;r&&t.set(r.id,n)}),q(e,function(n){var r=n.newOption;je(!r||r.id==null||!t.get(r.id)||t.get(r.id)===n,"id duplicates: "+(r&&r.id)),r&&r.id!=null&&t.set(r.id,n),!n.keyInfo&&(n.keyInfo={})}),q(e,function(n,r){var a=n.existing,i=n.newOption,o=n.keyInfo;if(ze(i)){if(o.name=i.name!=null?gl(i.name):a?a.name:q0+r,a)o.id=gl(a.id);else if(i.id!=null)o.id=gl(i.id);else{var l=0;do o.id="\0"+o.name+"\0"+l++;while(t.get(o.id))}t.set(o.id,n)}})}function K0(e,t,n){var r=hr(t[e],null),a=hr(n[e],null);return r!=null&&a!=null&&r===a}function gl(e){if(process.env.NODE_ENV!=="production"&&e==null)throw new Error;return hr(e,"")}function hr(e,t){return e==null?t:Ge(e)?e:Dt(e)||Av(e)?e+"":t}function Z0(e){process.env.NODE_ENV!=="production"&&zr("`"+e+"` is invalid id or name. Must be a string or number.")}function Q0(e){return Av(e)||RR(e)}function em(e){var t=e.name;return!!(t&&t.indexOf(q0))}function ro(e){return e&&e.id!=null&&gl(e.id).indexOf(AR)===0}function FR(e,t,n){q(e,function(r){var a=r.newOption;ze(a)&&(r.keyInfo.mainType=t,r.keyInfo.subType=jR(t,a,r.existing,n))})}function jR(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}function ec(e,t){if(t.dataIndexInside!=null)return t.dataIndexInside;if(t.dataIndex!=null)return Fe(t.dataIndex)?bt(t.dataIndex,function(n){return e.indexOfRawIndex(n)}):e.indexOfRawIndex(t.dataIndex);if(t.name!=null)return Fe(t.name)?bt(t.name,function(n){return e.indexOfName(n)}):e.indexOfName(t.name)}function nn(){var e="__ec_inner_"+$R++;return function(t){return t[e]||(t[e]={})}}var $R=$0();function ff(e,t,n){var r=tm(t,n),a=r.mainTypeSpecified,i=r.queryOptionMap,o=r.others,l=n?n.defaultMainType:null;return!a&&l&&i.set(l,{}),i.each(function(c,u){var d=tc(e,u,c,{useDefault:l===u,enableAll:n&&n.enableAll!=null?n.enableAll:!0,enableNone:n&&n.enableNone!=null?n.enableNone:!0});o[u+"Models"]=d.models,o[u+"Model"]=d.models[0]}),o}function tm(e,t){var n;if(Ge(e)){var r={};r[e+"Index"]=0,n=r}else n=e;var a=Je(),i={},o=!1;return q(n,function(l,c){if(c==="dataIndex"||c==="dataIndexInside"){i[c]=l;return}var u=c.match(/^(\w+)(Index|Id|Name)$/)||[],d=u[1],f=(u[2]||"").toLowerCase();if(!(!d||!f||t&&t.includeMainTypes&&kt(t.includeMainTypes,d)<0)){o=o||!!d;var h=a.get(d)||a.set(d,{});h[f]=l}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var hf={useDefault:!0,enableAll:!1,enableNone:!1};function tc(e,t,n,r){r=r||hf;var a=n.index,i=n.id,o=n.name,l={models:null,specified:a!=null||i!=null||o!=null};if(!l.specified){var c=void 0;return l.models=r.useDefault&&(c=e.getComponent(t))?[c]:[],l}if(a==="none"||a===!1){if(r.enableNone)return l.models=[],l;process.env.NODE_ENV!=="production"&&At('`"none"` or `false` is not a valid value on index option.'),a=-1}return a==="all"&&(r.enableAll?a=i=o=null:(process.env.NODE_ENV!=="production"&&At('`"all"` is not a valid value on index option.'),a=-1)),l.models=e.queryComponents({mainType:t,index:a,id:i,name:o}),l}function WR(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function UR(e,t,n,r,a){var i=t==null||t==="auto";if(r==null)return r;if(Dt(r)){var o=G0(n||0,r,a);return uf(o,i?Math.max(no(n||0),no(r)):t)}else{if(Ge(r))return a<1?n:r;for(var l=[],c=n,u=r,d=Math.max(c?c.length:0,u.length),f=0;f<d;++f){var h=e.getDimensionInfo(f);if(h&&h.type==="ordinal")l[f]=(a<1&&c?c:u)[f];else{var p=c&&c[f]?c[f]:0,g=u[f],o=G0(p,g,a);l[f]=uf(o,i?Math.max(no(p),no(g)):t)}}return l}}var XF=(function(){function e(){}return e.prototype.reset=function(t,n,r,a){return this._list=t,this._step=a=a||1,this._idx=n,this._end=r??(a>0?t.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)?(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0):!1},e})(),YR=".",qa="___EC__COMPONENT__CONTAINER___",nm="___EC__EXTENDED_CLASS___";function pr(e){var t={main:"",sub:""};if(e){var n=e.split(YR);t.main=n[0]||"",t.sub=n[1]||""}return t}function GR(e){je(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function qR(e){return!!(e&&e[nm])}function pf(e,t){e.$constructor=e,e.extend=function(n){process.env.NODE_ENV!=="production"&&q(t,function(i){n[i]||console.warn("Method `"+i+"` should be implemented"+(n.type?" in "+n.type:"")+".")});var r=this,a;return JR(r)?a=(function(i){et(o,i);function o(){return i.apply(this,arguments)||this}return o})(r):(a=function(){(n.$constructor||r).apply(this,arguments)},Uk(a,this)),Ce(a.prototype,n),a[nm]=!0,a.extend=this.extend,a.superCall=ZR,a.superApply=QR,a.superClass=r,a}}function JR(e){return ot(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function rm(e,t){e.extend=t.extend}var XR=Math.round(Math.random()*10);function KR(e){var t=["__\0is_clz",XR++].join("_");e.prototype[t]=!0,process.env.NODE_ENV!=="production"&&je(!e.isInstance,'The method "is" can not be defined.'),e.isInstance=function(n){return!!(n&&n[t])}}function ZR(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[t].apply(e,n)}function QR(e,t,n){return this.superClass.prototype[t].apply(e,n)}function gf(e){var t={};e.registerClass=function(r){var a=r.type||r.prototype.type;if(a){GR(a),r.prototype.type=a;var i=pr(a);if(!i.sub)process.env.NODE_ENV!=="production"&&t[i.main]&&console.warn(i.main+" exists."),t[i.main]=r;else if(i.sub!==qa){var o=n(i);o[i.sub]=r}}return r},e.getClass=function(r,a,i){var o=t[r];if(o&&o[qa]&&(o=a?o[a]:null),i&&!o)throw new Error(a?"Component "+r+"."+(a||"")+" is used but not imported.":r+".type should be specified.");return o},e.getClassesByMainType=function(r){var a=pr(r),i=[],o=t[a.main];return o&&o[qa]?q(o,function(l,c){c!==qa&&i.push(l)}):i.push(o),i},e.hasClass=function(r){return!!t[pr(r).main]},e.getAllClassMainTypes=function(){var r=[];return q(t,function(a,i){r.push(i)}),r},e.hasSubTypes=function(r){var a=t[pr(r).main];return a&&a[qa]};function n(r){var a=t[r.main];return(!a||!a[qa])&&(a=t[r.main]={},a[qa]=!0),a}}function vl(e,t){for(var n=0;n<e.length;n++)e[n][1]||(e[n][1]=e[n][0]);return t=t||!1,function(r,a,i){for(var o={},l=0;l<e.length;l++){var c=e[l][1];if(!(a&&kt(a,c)>=0||i&&kt(i,c)<0)){var u=r.getShallow(c,t);u!=null&&(o[e[l][0]]=u)}}return o}}var e2=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],t2=vl(e2),n2=(function(){function e(){}return e.prototype.getAreaStyle=function(t,n){return t2(this,t,n)},e})(),vf=new Xi(50);function r2(e){if(typeof e=="string"){var t=vf.get(e);return t&&t.image}else return e}function am(e,t,n,r,a){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!n)return t;var i=vf.get(e),o={hostEl:n,cb:r,cbPayload:a};return i?(t=i.image,!nc(t)&&i.pending.push(o)):(t=ur.loadImage(e,im,im),t.__zrImageSrc=e,vf.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function im(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var n=e.pending[t],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}e.pending.length=0}function nc(e){return e&&e.width&&e.height}var mf=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function a2(e,t,n,r,a,i){if(!n){e.text="",e.isTruncated=!1;return}var o=(t+"").split(`
|
|
2
|
+
`);i=om(n,r,a,i);for(var l=!1,c={},u=0,d=o.length;u<d;u++)lm(c,o[u],i),o[u]=c.textLine,l=l||c.isTruncated;e.text=o.join(`
|
|
3
|
+
`),e.isTruncated=l}function om(e,t,n,r){r=r||{};var a=Ce({},r);n=qe(n,"..."),a.maxIterations=qe(r.maxIterations,2);var i=a.minChar=qe(r.minChar,0),o=a.fontMeasureInfo=Or(t),l=o.asciiCharWidth;a.placeholder=qe(r.placeholder,"");for(var c=e=Math.max(0,e-1),u=0;u<i&&c>=l;u++)c-=l;var d=Vr(o,n);return d>c&&(n="",d=0),c=e-d,a.ellipsis=n,a.ellipsisWidth=d,a.contentWidth=c,a.containerWidth=e,a}function lm(e,t,n){var r=n.containerWidth,a=n.contentWidth,i=n.fontMeasureInfo;if(!r){e.textLine="",e.isTruncated=!1;return}var o=Vr(i,t);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var l=0;;l++){if(o<=a||l>=n.maxIterations){t+=n.ellipsis;break}var c=l===0?i2(t,a,i):o>0?Math.floor(t.length*a/o):0;t=t.substr(0,c),o=Vr(i,t)}t===""&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function i2(e,t,n){for(var r=0,a=0,i=e.length;a<i&&r<t;a++)r+=L0(n,e.charCodeAt(a));return a}function o2(e,t,n,r){var a=_f(e),i=t.overflow,o=t.padding,l=o?o[1]+o[3]:0,c=o?o[0]+o[2]:0,u=t.font,d=i==="truncate",f=of(u),h=qe(t.lineHeight,f),p=t.lineOverflow==="truncate",g=!1,v=t.width;v==null&&n!=null&&(v=n-l);var m=t.height;m==null&&r!=null&&(m=r-c);var _;v!=null&&(i==="break"||i==="breakAll")?_=a?cm(a,t.font,v,i==="breakAll",0).lines:[]:_=a?a.split(`
|
|
4
|
+
`):[];var y=_.length*h;if(m==null&&(m=y),y>m&&p){var w=Math.floor(m/h);g=g||_.length>w,_=_.slice(0,w),y=_.length*h}if(a&&d&&v!=null)for(var C=om(v,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),S={},b=0;b<_.length;b++)lm(S,_[b],C),_[b]=S.textLine,g=g||S.isTruncated;for(var x=m,E=0,k=Or(u),b=0;b<_.length;b++)E=Math.max(Vr(k,_[b]),E);v==null&&(v=E);var T=v;return x+=c,T+=l,{lines:_,height:m,outerWidth:T,outerHeight:x,lineHeight:h,calculatedLineHeight:f,contentWidth:E,contentHeight:y,width:v,isTruncated:g}}var l2=(function(){function e(){}return e})(),sm=(function(){function e(t){this.tokens=[],t&&(this.tokens=t)}return e})(),s2=(function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e})();function c2(e,t,n,r,a){var i=new s2,o=_f(e);if(!o)return i;var l=t.padding,c=l?l[1]+l[3]:0,u=l?l[0]+l[2]:0,d=t.width;d==null&&n!=null&&(d=n-c);var f=t.height;f==null&&r!=null&&(f=r-u);for(var h=t.overflow,p=(h==="break"||h==="breakAll")&&d!=null?{width:d,accumWidth:0,breakAll:h==="breakAll"}:null,g=mf.lastIndex=0,v;(v=mf.exec(o))!=null;){var m=v.index;m>g&&yf(i,o.substring(g,m),t,p),yf(i,v[2],t,p,v[1]),g=mf.lastIndex}g<o.length&&yf(i,o.substring(g,o.length),t,p);var _=[],y=0,w=0,C=h==="truncate",S=t.lineOverflow==="truncate",b={};function x(X,K,ne){X.width=K,X.lineHeight=ne,y+=ne,w=Math.max(w,K)}e:for(var E=0;E<i.lines.length;E++){for(var k=i.lines[E],T=0,R=0,D=0;D<k.tokens.length;D++){var A=k.tokens[D],L=A.styleName&&t.rich[A.styleName]||{},N=A.textPadding=L.padding,M=N?N[1]+N[3]:0,I=A.font=L.font||t.font;A.contentHeight=of(I);var $=qe(L.height,A.contentHeight);if(A.innerHeight=$,N&&($+=N[0]+N[2]),A.height=$,A.lineHeight=Zo(L.lineHeight,t.lineHeight,$),A.align=L&&L.align||a,A.verticalAlign=L&&L.verticalAlign||"middle",S&&f!=null&&y+A.lineHeight>f){var ee=i.lines.length;D>0?(k.tokens=k.tokens.slice(0,D),x(k,R,T),i.lines=i.lines.slice(0,E+1)):i.lines=i.lines.slice(0,E),i.isTruncated=i.isTruncated||i.lines.length<ee;break e}var oe=L.width,j=oe==null||oe==="auto";if(typeof oe=="string"&&oe.charAt(oe.length-1)==="%")A.percentWidth=oe,_.push(A),A.contentWidth=Vr(Or(I),A.text);else{if(j){var U=L.backgroundColor,H=U&&U.image;H&&(H=r2(H),nc(H)&&(A.width=Math.max(A.width,H.width*$/H.height)))}var B=C&&d!=null?d-R:null;B!=null&&B<A.width?!j||B<M?(A.text="",A.width=A.contentWidth=0):(a2(b,A.text,B-M,I,t.ellipsis,{minChar:t.truncateMinChar}),A.text=b.text,i.isTruncated=i.isTruncated||b.isTruncated,A.width=A.contentWidth=Vr(Or(I),A.text)):A.contentWidth=Vr(Or(I),A.text)}A.width+=M,R+=A.width,L&&(T=Math.max(T,A.lineHeight))}x(k,R,T)}i.outerWidth=i.width=qe(d,w),i.outerHeight=i.height=qe(f,y),i.contentHeight=y,i.contentWidth=w,i.outerWidth+=c,i.outerHeight+=u;for(var E=0;E<_.length;E++){var A=_[E],W=A.percentWidth;A.width=parseInt(W,10)/100*i.width}return i}function yf(e,t,n,r,a){var i=t==="",o=a&&n.rich[a]||{},l=e.lines,c=o.font||n.font,u=!1,d,f;if(r){var h=o.padding,p=h?h[1]+h[3]:0;if(o.width!=null&&o.width!=="auto"){var g=dl(o.width,r.width)+p;l.length>0&&g+r.accumWidth>r.width&&(d=t.split(`
|
|
5
|
+
`),u=!0),r.accumWidth=g}else{var v=cm(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=v.accumWidth+p,f=v.linesWidths,d=v.lines}}d||(d=t.split(`
|
|
6
|
+
`));for(var m=Or(c),_=0;_<d.length;_++){var y=d[_],w=new l2;if(w.styleName=a,w.text=y,w.isLineHolder=!y&&!i,typeof o.width=="number"?w.width=o.width:w.width=f?f[_]:Vr(m,y),!_&&!u){var C=(l[l.length-1]||(l[0]=new sm)).tokens,S=C.length;S===1&&C[0].isLineHolder?C[0]=w:(y||!S||i)&&C.push(w)}else l.push(new sm([w]))}}function u2(e){var t=e.charCodeAt(0);return t>=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var d2=Fi(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function f2(e){return u2(e)?!!d2[e]:!0}function cm(e,t,n,r,a){for(var i=[],o=[],l="",c="",u=0,d=0,f=Or(t),h=0;h<e.length;h++){var p=e.charAt(h);if(p===`
|
|
7
|
+
`){c&&(l+=c,d+=u),i.push(l),o.push(d),l="",c="",u=0,d=0;continue}var g=L0(f,p.charCodeAt(0)),v=r?!1:!f2(p);if(i.length?d+g>n:a+d+g>n){d?(l||c)&&(v?(l||(l=c,c="",u=0,d=u),i.push(l),o.push(d-u),c+=p,u+=g,l="",d=u):(c&&(l+=c,c="",u=0),i.push(l),o.push(d),l=p,d=g)):v?(i.push(c),o.push(u),c=p,u=g):(i.push(p),o.push(g));continue}d+=g,v?(c+=p,u+=g):(c&&(l+=c,c="",u=0),l+=p)}return c&&(l+=c),l&&(i.push(l),o.push(d)),i.length===1&&(d+=a),{accumWidth:d,lines:i,linesWidths:o}}function um(e,t,n,r,a,i){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,!!t){var o=t.width*2,l=t.height*2;lt.set(dm,ul(n,o,a),eo(r,l,i),o,l),lt.intersect(t,dm,null,fm);var c=fm.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=ul(c.x,c.width,a,!0),e.baseY=eo(c.y,c.height,i,!0)}}var dm=new lt(0,0,0,0),fm={outIntersectRect:{},clamp:!0};function _f(e){return e!=null?e+="":e=""}function h2(e){var t=_f(e.text),n=e.font;return wf(e,Vr(Or(n),t),of(n),null)}function wf(e,t,n,r){var a=new lt(ul(e.x||0,t,e.textAlign),eo(e.y||0,n,e.textBaseline),t,n),i=r??(hm(e)?e.lineWidth:0);return i>0&&(a.x-=i/2,a.y-=i/2,a.width+=i,a.height+=i),a}function hm(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var bf="__zr_style_"+Math.round(Math.random()*10),Ja={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},rc={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Ja[bf]=!0;var pm=["z","z2","invisible"],p2=["invisible"],ac=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype._init=function(n){for(var r=Vt(n),a=0;a<r.length;a++){var i=r[a];i==="style"?this.useStyle(n[i]):e.prototype.attrKV.call(this,i,n[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(n,r,a,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&g2(this,n,r)||o&&!o[0]&&!o[3])return!1;if(a&&this.__clipPaths&&this.__clipPaths.length){for(var l=0;l<this.__clipPaths.length;++l)if(this.__clipPaths[l].isZeroArea())return!1}if(i&&this.parent)for(var c=this.parent;c;){if(c.ignore)return!1;c=c.parent}return!0},t.prototype.contain=function(n,r){return this.rectContain(n,r)},t.prototype.traverse=function(n,r){n.call(r,this)},t.prototype.rectContain=function(n,r){var a=this.transformCoordToLocal(n,r);return this.getBoundingRect().contain(a[0],a[1])},t.prototype.getPaintRect=function(){var n=this._paintRect;if(!this._paintRect||this.__dirty){var r=this.transform,a=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,l=i.shadowOffsetX||0,c=i.shadowOffsetY||0;n=this._paintRect||(this._paintRect=new lt(0,0,0,0)),r?lt.applyTransform(n,a,r):n.copy(a),(o||l||c)&&(n.width+=o*2+Math.abs(l),n.height+=o*2+Math.abs(c),n.x=Math.min(n.x,n.x+l-o),n.y=Math.min(n.y,n.y+c-o));var u=this.dirtyRectTolerance;n.isZero()||(n.x=Math.floor(n.x-u),n.y=Math.floor(n.y-u),n.width=Math.ceil(n.width+1+u*2),n.height=Math.ceil(n.height+1+u*2))}return n},t.prototype.setPrevPaintRect=function(n){n?(this._prevPaintRect=this._prevPaintRect||new lt(0,0,0,0),this._prevPaintRect.copy(n)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(n){return this.animate("style",n)},t.prototype.updateDuringAnimation=function(n){n==="style"?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(n,r){n!=="style"?e.prototype.attrKV.call(this,n,r):this.style?this.setStyle(r):this.useStyle(r)},t.prototype.setStyle=function(n,r){return typeof n=="string"?this.style[n]=r:Ce(this.style,n),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(n){n||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&2)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(n){return As(Ja,n)},t.prototype.useStyle=function(n){n[bf]||(n=this.createStyle(n)),this.__inHover?this.__hoverStyle=n:this.style=n,this.dirtyStyle()},t.prototype.isStyleObject=function(n){return n[bf]},t.prototype._innerSaveToNormal=function(n){e.prototype._innerSaveToNormal.call(this,n);var r=this._normalState;n.style&&!r.style&&(r.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(n,r,pm)},t.prototype._applyStateObj=function(n,r,a,i,o,l){e.prototype._applyStateObj.call(this,n,r,a,i,o,l);var c=!(r&&i),u;if(r&&r.style?o?i?u=r.style:(u=this._mergeStyle(this.createStyle(),a.style),this._mergeStyle(u,r.style)):(u=this._mergeStyle(this.createStyle(),i?this.style:a.style),this._mergeStyle(u,r.style)):c&&(u=a.style),u)if(o){var d=this.style;if(this.style=this.createStyle(c?{}:d),c)for(var f=Vt(d),h=0;h<f.length;h++){var p=f[h];p in u&&(u[p]=u[p],this.style[p]=d[p])}for(var g=Vt(u),h=0;h<g.length;h++){var p=g[h];this.style[p]=this.style[p]}this._transitionState(n,{style:u},l,this.getAnimationStyleProps())}else this.useStyle(u);for(var v=this.__inHover?p2:pm,h=0;h<v.length;h++){var p=v[h];r&&r[p]!=null?this[p]=r[p]:c&&a[p]!=null&&(this[p]=a[p])}},t.prototype._mergeStates=function(n){for(var r=e.prototype._mergeStates.call(this,n),a,i=0;i<n.length;i++){var o=n[i];o.style&&(a=a||{},this._mergeStyle(a,o.style))}return a&&(r.style=a),r},t.prototype._mergeStyle=function(n,r){return Ce(n,r),n},t.prototype.getAnimationStyleProps=function(){return rc},t.initDefaultProps=(function(){var n=t.prototype;n.type="displayable",n.invisible=!1,n.z=0,n.z2=0,n.zlevel=0,n.culling=!1,n.cursor="pointer",n.rectHover=!1,n.incremental=!1,n._rect=null,n.dirtyRectTolerance=0,n.__dirty=3})(),t})(Ks),Cf=new lt(0,0,0,0),Sf=new lt(0,0,0,0);function g2(e,t,n){return Cf.copy(e.getBoundingRect()),e.transform&&Cf.applyTransform(e.transform),Sf.width=t,Sf.height=n,!Cf.intersect(Sf)}var Fn=Math.min,jn=Math.max,xf=Math.sin,Ef=Math.cos,Xa=Math.PI*2,ic=ji(),oc=ji(),lc=ji();function gm(e,t,n,r,a,i){a[0]=Fn(e,n),a[1]=Fn(t,r),i[0]=jn(e,n),i[1]=jn(t,r)}var vm=[],mm=[];function v2(e,t,n,r,a,i,o,l,c,u){var d=c0,f=tn,h=d(e,n,a,o,vm);c[0]=1/0,c[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<h;p++){var g=f(e,n,a,o,vm[p]);c[0]=Fn(g,c[0]),u[0]=jn(g,u[0])}h=d(t,r,i,l,mm);for(var p=0;p<h;p++){var v=f(t,r,i,l,mm[p]);c[1]=Fn(v,c[1]),u[1]=jn(v,u[1])}c[0]=Fn(e,c[0]),u[0]=jn(e,u[0]),c[0]=Fn(o,c[0]),u[0]=jn(o,u[0]),c[1]=Fn(t,c[1]),u[1]=jn(t,u[1]),c[1]=Fn(l,c[1]),u[1]=jn(l,u[1])}function m2(e,t,n,r,a,i,o,l){var c=f0,u=cn,d=jn(Fn(c(e,n,a),1),0),f=jn(Fn(c(t,r,i),1),0),h=u(e,n,a,d),p=u(t,r,i,f);o[0]=Fn(e,a,h),o[1]=Fn(t,i,p),l[0]=jn(e,a,h),l[1]=jn(t,i,p)}function y2(e,t,n,r,a,i,o,l,c){var u=Wi,d=Ui,f=Math.abs(a-i);if(f%Xa<1e-4&&f>1e-4){l[0]=e-n,l[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(ic[0]=Ef(a)*n+e,ic[1]=xf(a)*r+t,oc[0]=Ef(i)*n+e,oc[1]=xf(i)*r+t,u(l,ic,oc),d(c,ic,oc),a=a%Xa,a<0&&(a=a+Xa),i=i%Xa,i<0&&(i=i+Xa),a>i&&!o?i+=Xa:a<i&&o&&(a+=Xa),o){var h=i;i=a,a=h}for(var p=0;p<i;p+=Math.PI/2)p>a&&(lc[0]=Ef(p)*n+e,lc[1]=xf(p)*r+t,u(l,lc,l),d(c,lc,c))}var ct={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Ka=[],Za=[],gr=[],ca=[],vr=[],mr=[],kf=Math.min,Tf=Math.max,Qa=Math.cos,ei=Math.sin,Fr=Math.abs,Rf=Math.PI,ua=Rf*2,Mf=typeof Float32Array<"u",ml=[];function Bf(e){return Math.round(e/Rf*1e8)/1e8%2*Rf}function _2(e,t){var n=Bf(e[0]);n<0&&(n+=ua);var r=n-e[0],a=e[1];a+=r,!t&&a-n>=ua?a=n+ua:t&&n-a>=ua?a=n-ua:!t&&n>a?a=n+(ua-Bf(n-a)):t&&n<a&&(a=n-(ua-Bf(a-n))),e[0]=n,e[1]=a}var ti=(function(){function e(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(t,n,r){r=r||0,r>0&&(this._ux=Fr(r/qs/t)||0,this._uy=Fr(r/qs/n)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,n){return this._drawPendingPt(),this.addData(ct.M,t,n),this._ctx&&this._ctx.moveTo(t,n),this._x0=t,this._y0=n,this._xi=t,this._yi=n,this},e.prototype.lineTo=function(t,n){var r=Fr(t-this._xi),a=Fr(n-this._yi),i=r>this._ux||a>this._uy;if(this.addData(ct.L,t,n),this._ctx&&i&&this._ctx.lineTo(t,n),i)this._xi=t,this._yi=n,this._pendingPtDist=0;else{var o=r*r+a*a;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=n,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,n,r,a,i,o){return this._drawPendingPt(),this.addData(ct.C,t,n,r,a,i,o),this._ctx&&this._ctx.bezierCurveTo(t,n,r,a,i,o),this._xi=i,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,n,r,a){return this._drawPendingPt(),this.addData(ct.Q,t,n,r,a),this._ctx&&this._ctx.quadraticCurveTo(t,n,r,a),this._xi=r,this._yi=a,this},e.prototype.arc=function(t,n,r,a,i,o){this._drawPendingPt(),ml[0]=a,ml[1]=i,_2(ml,o),a=ml[0],i=ml[1];var l=i-a;return this.addData(ct.A,t,n,r,r,a,l,0,o?0:1),this._ctx&&this._ctx.arc(t,n,r,a,i,o),this._xi=Qa(i)*r+t,this._yi=ei(i)*r+n,this},e.prototype.arcTo=function(t,n,r,a,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,n,r,a,i),this},e.prototype.rect=function(t,n,r,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,n,r,a),this.addData(ct.R,t,n,r,a),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(ct.Z);var t=this._ctx,n=this._x0,r=this._y0;return t&&t.closePath(),this._xi=n,this._yi=r,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){if(this._saveData){var n=t.length;!(this.data&&this.data.length===n)&&Mf&&(this.data=new Float32Array(n));for(var r=0;r<n;r++)this.data[r]=t[r];this._len=n}},e.prototype.appendPath=function(t){if(this._saveData){t instanceof Array||(t=[t]);for(var n=t.length,r=0,a=this._len,i=0;i<n;i++)r+=t[i].len();var o=this.data;if(Mf&&(o instanceof Float32Array||!o)&&(this.data=new Float32Array(a+r),a>0&&o))for(var l=0;l<a;l++)this.data[l]=o[l];for(var i=0;i<n;i++)for(var c=t[i].data,l=0;l<c.length;l++)this.data[a++]=c[l];this._len=a}},e.prototype.addData=function(t,n,r,a,i,o,l,c,u){if(this._saveData){var d=this.data;this._len+arguments.length>d.length&&(this._expandData(),d=this.data);for(var f=0;f<arguments.length;f++)d[this._len++]=arguments[f]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],n=0;n<this._len;n++)t[n]=this.data[n];this.data=t}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,Mf&&this._len>11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){gr[0]=gr[1]=vr[0]=vr[1]=Number.MAX_VALUE,ca[0]=ca[1]=mr[0]=mr[1]=-Number.MAX_VALUE;var t=this.data,n=0,r=0,a=0,i=0,o;for(o=0;o<this._len;){var l=t[o++],c=o===1;switch(c&&(n=t[o],r=t[o+1],a=n,i=r),l){case ct.M:n=a=t[o++],r=i=t[o++],vr[0]=a,vr[1]=i,mr[0]=a,mr[1]=i;break;case ct.L:gm(n,r,t[o],t[o+1],vr,mr),n=t[o++],r=t[o++];break;case ct.C:v2(n,r,t[o++],t[o++],t[o++],t[o++],t[o],t[o+1],vr,mr),n=t[o++],r=t[o++];break;case ct.Q:m2(n,r,t[o++],t[o++],t[o],t[o+1],vr,mr),n=t[o++],r=t[o++];break;case ct.A:var u=t[o++],d=t[o++],f=t[o++],h=t[o++],p=t[o++],g=t[o++]+p;o+=1;var v=!t[o++];c&&(a=Qa(p)*f+u,i=ei(p)*h+d),y2(u,d,f,h,p,g,v,vr,mr),n=Qa(g)*f+u,r=ei(g)*h+d;break;case ct.R:a=n=t[o++],i=r=t[o++];var m=t[o++],_=t[o++];gm(a,i,a+m,i+_,vr,mr);break;case ct.Z:n=a,r=i;break}Wi(gr,gr,vr),Ui(ca,ca,mr)}return o===0&&(gr[0]=gr[1]=ca[0]=ca[1]=0),new lt(gr[0],gr[1],ca[0]-gr[0],ca[1]-gr[1])},e.prototype._calculateLength=function(){var t=this.data,n=this._len,r=this._ux,a=this._uy,i=0,o=0,l=0,c=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,d=0,f=0,h=0;h<n;){var p=t[h++],g=h===1;g&&(i=t[h],o=t[h+1],l=i,c=o);var v=-1;switch(p){case ct.M:i=l=t[h++],o=c=t[h++];break;case ct.L:var C=t[h++],S=t[h++],N=C-i,M=S-o;(Fr(N)>r||Fr(M)>a||h===n-1)&&(v=Math.sqrt(N*N+M*M),i=C,o=S);break;case ct.C:var y=t[h++],w=t[h++],C=t[h++],S=t[h++],m=t[h++],_=t[h++];v=IT(i,o,y,w,C,S,m,_,10),i=m,o=_;break;case ct.Q:var y=t[h++],w=t[h++],C=t[h++],S=t[h++];v=VT(i,o,y,w,C,S,10),i=C,o=S;break;case ct.A:var b=t[h++],x=t[h++],E=t[h++],k=t[h++],T=t[h++],R=t[h++],D=R+T;h+=1,g&&(l=Qa(T)*E+b,c=ei(T)*k+x),v=Tf(E,k)*kf(ua,Math.abs(R)),i=Qa(D)*E+b,o=ei(D)*k+x;break;case ct.R:l=i=t[h++],c=o=t[h++];var A=t[h++],L=t[h++];v=A*2+L*2;break;case ct.Z:var N=l-i,M=c-o;v=Math.sqrt(N*N+M*M),i=l,o=c;break}v>=0&&(u[f++]=v,d+=v)}return this._pathLen=d,d},e.prototype.rebuildPath=function(t,n){var r=this.data,a=this._ux,i=this._uy,o=this._len,l,c,u,d,f,h,p=n<1,g,v,m=0,_=0,y,w=0,C,S;if(!(p&&(this._pathSegLen||this._calculateLength(),g=this._pathSegLen,v=this._pathLen,y=n*v,!y)))e:for(var b=0;b<o;){var x=r[b++],E=b===1;switch(E&&(u=r[b],d=r[b+1],l=u,c=d),x!==ct.L&&w>0&&(t.lineTo(C,S),w=0),x){case ct.M:l=u=r[b++],c=d=r[b++],t.moveTo(u,d);break;case ct.L:f=r[b++],h=r[b++];var k=Fr(f-u),T=Fr(h-d);if(k>a||T>i){if(p){var R=g[_++];if(m+R>y){var D=(y-m)/R;t.lineTo(u*(1-D)+f*D,d*(1-D)+h*D);break e}m+=R}t.lineTo(f,h),u=f,d=h,w=0}else{var A=k*k+T*T;A>w&&(C=f,S=h,w=A)}break;case ct.C:var M=r[b++],I=r[b++],$=r[b++],ee=r[b++],L=r[b++],N=r[b++];if(p){var R=g[_++];if(m+R>y){var D=(y-m)/R;Os(u,M,$,L,D,Ka),Os(d,I,ee,N,D,Za),t.bezierCurveTo(Ka[1],Za[1],Ka[2],Za[2],Ka[3],Za[3]);break e}m+=R}t.bezierCurveTo(M,I,$,ee,L,N),u=L,d=N;break;case ct.Q:var M=r[b++],I=r[b++],$=r[b++],ee=r[b++];if(p){var R=g[_++];if(m+R>y){var D=(y-m)/R;Vs(u,M,$,D,Ka),Vs(d,I,ee,D,Za),t.quadraticCurveTo(Ka[1],Za[1],Ka[2],Za[2]);break e}m+=R}t.quadraticCurveTo(M,I,$,ee),u=$,d=ee;break;case ct.A:var oe=r[b++],j=r[b++],U=r[b++],H=r[b++],B=r[b++],W=r[b++],X=r[b++],K=!r[b++],ne=U>H?U:H,he=Fr(U-H)>.001,O=B+W,Z=!1;if(p){var R=g[_++];m+R>y&&(O=B+W*(y-m)/R,Z=!0),m+=R}if(he&&t.ellipse?t.ellipse(oe,j,U,H,X,B,O,K):t.arc(oe,j,ne,B,O,K),Z)break e;E&&(l=Qa(B)*U+oe,c=ei(B)*H+j),u=Qa(O)*U+oe,d=ei(O)*H+j;break;case ct.R:l=u=r[b],c=d=r[b+1],f=r[b++],h=r[b++];var ue=r[b++],se=r[b++];if(p){var R=g[_++];if(m+R>y){var we=y-m;t.moveTo(f,h),t.lineTo(f+kf(we,ue),h),we-=ue,we>0&&t.lineTo(f+ue,h+kf(we,se)),we-=se,we>0&&t.lineTo(f+Tf(ue-we,0),h+se),we-=ue,we>0&&t.lineTo(f,h+Tf(se-we,0));break e}m+=R}t.rect(f,h,ue,se);break;case ct.Z:if(p){var R=g[_++];if(m+R>y){var D=(y-m)/R;t.lineTo(u*(1-D)+l*D,d*(1-D)+c*D);break e}m+=R}t.closePath(),u=l,d=c}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=ct,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e})();function ao(e,t,n,r,a,i,o){if(a===0)return!1;var l=a,c=0,u=e;if(o>t+l&&o>r+l||o<t-l&&o<r-l||i>e+l&&i>n+l||i<e-l&&i<n-l)return!1;if(e!==n)c=(t-r)/(e-n),u=(e*r-n*t)/(e-n);else return Math.abs(i-e)<=l/2;var d=c*i-o+u;return d*d/(c*c+1)<=l/2*l/2}function w2(e,t,n,r,a,i,o,l,c,u,d){if(c===0)return!1;var f=c;return d>t+f&&d>r+f&&d>i+f&&d>l+f||d<t-f&&d<r-f&&d<i-f&&d<l-f||u>e+f&&u>n+f&&u>a+f&&u>o+f||u<e-f&&u<n-f&&u<a-f&&u<o-f?!1:u0(e,t,n,r,a,i,o,l,u,d,null)<=f/2}function b2(e,t,n,r,a,i,o,l,c){if(o===0)return!1;var u=o;return c>t+u&&c>r+u&&c>i+u||c<t-u&&c<r-u&&c<i-u||l>e+u&&l>n+u&&l>a+u||l<e-u&&l<n-u&&l<a-u?!1:h0(e,t,n,r,a,i,l,c,null)<=u/2}var ym=Math.PI*2;function jr(e){return e%=ym,e<0&&(e+=ym),e}var yl=Math.PI*2;function C2(e,t,n,r,a,i,o,l,c){if(o===0)return!1;var u=o;l-=e,c-=t;var d=Math.sqrt(l*l+c*c);if(d-u>n||d+u<n)return!1;if(Math.abs(r-a)%yl<1e-4)return!0;if(i){var f=r;r=jr(a),a=jr(f)}else r=jr(r),a=jr(a);r>a&&(a+=yl);var h=Math.atan2(c,l);return h<0&&(h+=yl),h>=r&&h<=a||h+yl>=r&&h+yl<=a}function ni(e,t,n,r,a,i){if(i>t&&i>r||i<t&&i<r||r===t)return 0;var o=(i-t)/(r-t),l=r<t?1:-1;(o===1||o===0)&&(l=r<t?.5:-.5);var c=o*(n-e)+e;return c===a?1/0:c>a?l:0}var da=ti.CMD,ri=Math.PI*2,S2=1e-4;function x2(e,t){return Math.abs(e-t)<S2}var gn=[-1,-1,-1],$n=[-1,-1];function E2(){var e=$n[0];$n[0]=$n[1],$n[1]=e}function k2(e,t,n,r,a,i,o,l,c,u){if(u>t&&u>r&&u>i&&u>l||u<t&&u<r&&u<i&&u<l)return 0;var d=s0(t,r,i,l,u,gn);if(d===0)return 0;for(var f=0,h=-1,p=void 0,g=void 0,v=0;v<d;v++){var m=gn[v],_=m===0||m===1?.5:1;tn(e,n,a,o,m)<c||(h<0&&(h=c0(t,r,i,l,$n),$n[1]<$n[0]&&h>1&&E2(),p=tn(t,r,i,l,$n[0]),h>1&&(g=tn(t,r,i,l,$n[1]))),h===2?m<$n[0]?f+=p<t?_:-_:m<$n[1]?f+=g<p?_:-_:f+=l<g?_:-_:m<$n[0]?f+=p<t?_:-_:f+=l<p?_:-_)}return f}function T2(e,t,n,r,a,i,o,l){if(l>t&&l>r&&l>i||l<t&&l<r&&l<i)return 0;var c=OT(t,r,i,l,gn);if(c===0)return 0;var u=f0(t,r,i);if(u>=0&&u<=1){for(var d=0,f=cn(t,r,i,u),h=0;h<c;h++){var p=gn[h]===0||gn[h]===1?.5:1,g=cn(e,n,a,gn[h]);g<o||(gn[h]<u?d+=f<t?p:-p:d+=i<f?p:-p)}return d}else{var p=gn[0]===0||gn[0]===1?.5:1,g=cn(e,n,a,gn[0]);return g<o?0:i<t?p:-p}}function R2(e,t,n,r,a,i,o,l){if(l-=t,l>n||l<-n)return 0;var c=Math.sqrt(n*n-l*l);gn[0]=-c,gn[1]=c;var u=Math.abs(r-a);if(u<1e-4)return 0;if(u>=ri-1e-4){r=0,a=ri;var d=i?1:-1;return o>=gn[0]+e&&o<=gn[1]+e?d:0}if(r>a){var f=r;r=a,a=f}r<0&&(r+=ri,a+=ri);for(var h=0,p=0;p<2;p++){var g=gn[p];if(g+e>o){var v=Math.atan2(l,g),d=i?1:-1;v<0&&(v=ri+v),(v>=r&&v<=a||v+ri>=r&&v+ri<=a)&&(v>Math.PI/2&&v<Math.PI*1.5&&(d=-d),h+=d)}}return h}function _m(e,t,n,r,a){for(var i=e.data,o=e.len(),l=0,c=0,u=0,d=0,f=0,h,p,g=0;g<o;){var v=i[g++],m=g===1;switch(v===da.M&&g>1&&(n||(l+=ni(c,u,d,f,r,a))),m&&(c=i[g],u=i[g+1],d=c,f=u),v){case da.M:d=i[g++],f=i[g++],c=d,u=f;break;case da.L:if(n){if(ao(c,u,i[g],i[g+1],t,r,a))return!0}else l+=ni(c,u,i[g],i[g+1],r,a)||0;c=i[g++],u=i[g++];break;case da.C:if(n){if(w2(c,u,i[g++],i[g++],i[g++],i[g++],i[g],i[g+1],t,r,a))return!0}else l+=k2(c,u,i[g++],i[g++],i[g++],i[g++],i[g],i[g+1],r,a)||0;c=i[g++],u=i[g++];break;case da.Q:if(n){if(b2(c,u,i[g++],i[g++],i[g],i[g+1],t,r,a))return!0}else l+=T2(c,u,i[g++],i[g++],i[g],i[g+1],r,a)||0;c=i[g++],u=i[g++];break;case da.A:var _=i[g++],y=i[g++],w=i[g++],C=i[g++],S=i[g++],b=i[g++];g+=1;var x=!!(1-i[g++]);h=Math.cos(S)*w+_,p=Math.sin(S)*C+y,m?(d=h,f=p):l+=ni(c,u,h,p,r,a);var E=(r-_)*C/w+_;if(n){if(C2(_,y,C,S,S+b,x,t,E,a))return!0}else l+=R2(_,y,C,S,S+b,x,E,a);c=Math.cos(S+b)*w+_,u=Math.sin(S+b)*C+y;break;case da.R:d=c=i[g++],f=u=i[g++];var k=i[g++],T=i[g++];if(h=d+k,p=f+T,n){if(ao(d,f,h,f,t,r,a)||ao(h,f,h,p,t,r,a)||ao(h,p,d,p,t,r,a)||ao(d,p,d,f,t,r,a))return!0}else l+=ni(h,f,h,p,r,a),l+=ni(d,p,d,f,r,a);break;case da.Z:if(n){if(ao(c,u,d,f,t,r,a))return!0}else l+=ni(c,u,d,f,r,a);c=d,u=f;break}}return!n&&!x2(u,f)&&(l+=ni(c,u,d,f,r,a)||0),l!==0}function M2(e,t,n){return _m(e,0,!1,t,n)}function B2(e,t,n,r){return _m(e,t,!0,n,r)}var wm=sn({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Ja),D2={style:sn({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},rc.style)},Df=cl.concat(["invisible","culling","z","z2","zlevel","parent"]),zt=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var a=this._decalEl=this._decalEl||new t;a.buildPath===t.prototype.buildPath&&(a.buildPath=function(c){n.buildPath(c,n.shape)}),a.silent=!0;var i=a.style;for(var o in r)i[o]!==r[o]&&(i[o]=r[o]);i.fill=r.fill?r.decal:null,i.decal=null,i.shadowColor=null,r.strokeFirst&&(i.stroke=null);for(var l=0;l<Df.length;++l)a[Df[l]]=this[Df[l]];a.__dirty|=1}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(n){var r=Vt(n);this.shape=this.getDefaultShape();var a=this.getDefaultStyle();a&&this.useStyle(a);for(var i=0;i<r.length;i++){var o=r[i],l=n[o];o==="style"?this.style?Ce(this.style,l):this.useStyle(l):o==="shape"?Ce(this.shape,l):e.prototype.attrKV.call(this,o,l)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var n=this.style.fill;if(n!=="none"){if(Ge(n)){var r=Hs(n,0);return r>.5?Qd:r>.2?iR:ef}else if(n)return ef}return Qd},t.prototype.getInsideTextStroke=function(n){var r=this.style.fill;if(Ge(r)){var a=this.__zr;if(!!(a&&a.isDarkMode())==Hs(n,0)<.4)return r}},t.prototype.buildPath=function(n,r,a){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(n){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,n),this.path},t.prototype.createPathProxy=function(){this.path=new ti(!1)},t.prototype.hasStroke=function(){var n=this.style,r=n.stroke;return!(r==null||r==="none"||!(n.lineWidth>0))},t.prototype.hasFill=function(){var n=this.style.fill;return n!=null&&n!=="none"},t.prototype.getBoundingRect=function(){var n=this._rect,r=this.style,a=!n;if(a){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||this.__dirty&4)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),n=o.getBoundingRect()}if(this._rect=n,this.hasStroke()&&this.path&&this.path.len()>0){var l=this._rectStroke||(this._rectStroke=n.clone());if(this.__dirty||a){l.copy(n);var c=r.strokeNoScale?this.getLineScale():1,u=r.lineWidth;if(!this.hasFill()){var d=this.strokeContainThreshold;u=Math.max(u,d??4)}c>1e-10&&(l.width+=u/c,l.height+=u/c,l.x-=u/c/2,l.y-=u/c/2)}return l}return n},t.prototype.contain=function(n,r){var a=this.transformCoordToLocal(n,r),i=this.getBoundingRect(),o=this.style;if(n=a[0],r=a[1],i.contain(n,r)){var l=this.path;if(this.hasStroke()){var c=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(c=Math.max(c,this.strokeContainThreshold)),B2(l,c/u,n,r)))return!0}if(this.hasFill())return M2(l,n,r)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(n){return this.animate("shape",n)},t.prototype.updateDuringAnimation=function(n){n==="style"?this.dirtyStyle():n==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(n,r){n==="shape"?this.setShape(r):e.prototype.attrKV.call(this,n,r)},t.prototype.setShape=function(n,r){var a=this.shape;return a||(a=this.shape={}),typeof n=="string"?a[n]=r:Ce(a,n),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(n){return As(wm,n)},t.prototype._innerSaveToNormal=function(n){e.prototype._innerSaveToNormal.call(this,n);var r=this._normalState;n.shape&&!r.shape&&(r.shape=Ce({},this.shape))},t.prototype._applyStateObj=function(n,r,a,i,o,l){e.prototype._applyStateObj.call(this,n,r,a,i,o,l);var c=!(r&&i),u;if(r&&r.shape?o?i?u=r.shape:(u=Ce({},a.shape),Ce(u,r.shape)):(u=Ce({},i?this.shape:a.shape),Ce(u,r.shape)):c&&(u=a.shape),u)if(o){this.shape=Ce({},this.shape);for(var d={},f=Vt(u),h=0;h<f.length;h++){var p=f[h];typeof u[p]=="object"?this.shape[p]=u[p]:d[p]=u[p]}this._transitionState(n,{shape:d},l)}else this.shape=u,this.dirtyShape()},t.prototype._mergeStates=function(n){for(var r=e.prototype._mergeStates.call(this,n),a,i=0;i<n.length;i++){var o=n[i];o.shape&&(a=a||{},this._mergeStyle(a,o.shape))}return a&&(r.shape=a),r},t.prototype.getAnimationStyleProps=function(){return D2},t.prototype.isZeroArea=function(){return!1},t.extend=function(n){var r=(function(i){et(o,i);function o(l){var c=i.call(this,l)||this;return n.init&&n.init.call(c,l),c}return o.prototype.getDefaultStyle=function(){return ft(n.style)},o.prototype.getDefaultShape=function(){return ft(n.shape)},o})(t);for(var a in n)typeof n[a]=="function"&&(r.prototype[a]=n[a]);return r},t.initDefaultProps=(function(){var n=t.prototype;n.type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,n.__dirty=7})(),t})(ac),A2=sn({strokeFirst:!0,font:Lk,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},wm),sc=(function(e){et(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.hasStroke=function(){return hm(this.style)},t.prototype.hasFill=function(){var n=this.style.fill;return n!=null&&n!=="none"},t.prototype.createStyle=function(n){return As(A2,n)},t.prototype.setBoundingRect=function(n){this._rect=n},t.prototype.getBoundingRect=function(){return this._rect||(this._rect=h2(this.style)),this._rect},t.initDefaultProps=(function(){var n=t.prototype;n.dirtyRectTolerance=10})(),t})(ac);sc.prototype.type="tspan";var P2=sn({x:0,y:0},Ja),N2={style:sn({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},rc.style)};function L2(e){return!!(e&&typeof e!="string"&&e.width&&e.height)}var _l=(function(e){et(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(n){return As(P2,n)},t.prototype._getSize=function(n){var r=this.style,a=r[n];if(a!=null)return a;var i=L2(r.image)?r.image:this.__image;if(!i)return 0;var o=n==="width"?"height":"width",l=r[o];return l==null?i[n]:i[n]/i[o]*l},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return N2},t.prototype.getBoundingRect=function(){var n=this.style;return this._rect||(this._rect=new lt(n.x||0,n.y||0,this.getWidth(),this.getHeight())),this._rect},t})(ac);_l.prototype.type="image";function I2(e,t){var n=t.x,r=t.y,a=t.width,i=t.height,o=t.r,l,c,u,d;a<0&&(n=n+a,a=-a),i<0&&(r=r+i,i=-i),typeof o=="number"?l=c=u=d=o:o instanceof Array?o.length===1?l=c=u=d=o[0]:o.length===2?(l=u=o[0],c=d=o[1]):o.length===3?(l=o[0],c=d=o[1],u=o[2]):(l=o[0],c=o[1],u=o[2],d=o[3]):l=c=u=d=0;var f;l+c>a&&(f=l+c,l*=a/f,c*=a/f),u+d>a&&(f=u+d,u*=a/f,d*=a/f),c+u>i&&(f=c+u,c*=i/f,u*=i/f),l+d>i&&(f=l+d,l*=i/f,d*=i/f),e.moveTo(n+l,r),e.lineTo(n+a-c,r),c!==0&&e.arc(n+a-c,r+c,c,-Math.PI/2,0),e.lineTo(n+a,r+i-u),u!==0&&e.arc(n+a-u,r+i-u,u,0,Math.PI/2),e.lineTo(n+d,r+i),d!==0&&e.arc(n+d,r+i-d,d,Math.PI/2,Math.PI),e.lineTo(n,r+l),l!==0&&e.arc(n+l,r+l,l,Math.PI,Math.PI*1.5)}var io=Math.round;function O2(e,t,n){if(t){var r=t.x1,a=t.x2,i=t.y1,o=t.y2;e.x1=r,e.x2=a,e.y1=i,e.y2=o;var l=n&&n.lineWidth;return l&&(io(r*2)===io(a*2)&&(e.x1=e.x2=oo(r,l,!0)),io(i*2)===io(o*2)&&(e.y1=e.y2=oo(i,l,!0))),e}}function V2(e,t,n){if(t){var r=t.x,a=t.y,i=t.width,o=t.height;e.x=r,e.y=a,e.width=i,e.height=o;var l=n&&n.lineWidth;return l&&(e.x=oo(r,l,!0),e.y=oo(a,l,!0),e.width=Math.max(oo(r+i,l,!1)-e.x,i===0?0:1),e.height=Math.max(oo(a+o,l,!1)-e.y,o===0?0:1)),e}}function oo(e,t,n){if(!t)return e;var r=io(e*2);return(r+io(t))%2===0?r/2:(r+(n?1:-1))/2}var z2=(function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e})(),H2={},$r=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new z2},t.prototype.buildPath=function(n,r){var a,i,o,l;if(this.subPixelOptimize){var c=V2(H2,r,this.style);a=c.x,i=c.y,o=c.width,l=c.height,c.r=r.r,r=c}else a=r.x,i=r.y,o=r.width,l=r.height;r.r?I2(n,r):n.rect(a,i,o,l)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t})(zt);$r.prototype.type="rect";var bm={fill:"#000"},Cm=2,yr={},F2={style:sn({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},rc.style)},cc=(function(e){et(t,e);function t(n){var r=e.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=bm,r.attr(n),r}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var n=0;n<this._children.length;n++){var r=this._children[n];r.zlevel=this.zlevel,r.z=this.z,r.z2=this.z2,r.culling=this.culling,r.cursor=this.cursor,r.invisible=this.invisible}},t.prototype.updateTransform=function(){var n=this.innerTransformable;n?(n.updateTransform(),n.transform&&(this.transform=n.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(n){var r=this.innerTransformable;return r?r.getLocalTransform(n):e.prototype.getLocalTransform.call(this,n)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,Y2(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(n){e.prototype.addSelfToZr.call(this,n);for(var r=0;r<this._children.length;r++)this._children[r].__zr=n},t.prototype.removeSelfFromZr=function(n){e.prototype.removeSelfFromZr.call(this,n);for(var r=0;r<this._children.length;r++)this._children[r].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var n=new lt(0,0,0,0),r=this._children,a=[],i=null,o=0;o<r.length;o++){var l=r[o],c=l.getBoundingRect(),u=l.getLocalTransform(a);u?(n.copy(c),n.applyTransform(u),i=i||n.clone(),i.union(n)):(i=i||c.clone(),i.union(c))}this._rect=i||n}return this._rect},t.prototype.setDefaultTextStyle=function(n){this._defaultStyle=n||bm},t.prototype.setTextContent=function(n){if(process.env.NODE_ENV!=="production")throw new Error("Can't attach text on another text")},t.prototype._mergeStyle=function(n,r){if(!r)return n;var a=r.rich,i=n.rich||a&&{};return Ce(n,r),a&&i?(this._mergeRich(i,a),n.rich=i):i&&(n.rich=i),n},t.prototype._mergeRich=function(n,r){for(var a=Vt(r),i=0;i<a.length;i++){var o=a[i];n[o]=n[o]||{},Ce(n[o],r[o])}},t.prototype.getAnimationStyleProps=function(){return F2},t.prototype._getOrCreateChild=function(n){var r=this._children[this._childCursor];return(!r||!(r instanceof n))&&(r=new n),this._children[this._childCursor++]=r,r.__zr=this.__zr,r.parent=this,r},t.prototype._updatePlainTexts=function(){var n=this.style,r=n.font||"12px sans-serif",a=n.padding,i=this._defaultStyle,o=n.x||0,l=n.y||0,c=n.align||i.align||"left",u=n.verticalAlign||i.verticalAlign||"top";um(yr,i.overflowRect,o,l,c,u),o=yr.baseX,l=yr.baseY;var d=o2(Mm(n),n,yr.outerWidth,yr.outerHeight),f=Af(n),h=!!n.backgroundColor,p=d.outerHeight,g=d.outerWidth,v=d.lines,m=d.lineHeight;this.isTruncated=!!d.isTruncated;var _=o,y=eo(l,d.contentHeight,u);if(f||a){var w=ul(o,g,c),C=eo(l,p,u);f&&this._renderBackground(n,n,w,C,g,p)}y+=m/2,a&&(_=Rm(o,c,a),u==="top"?y+=a[0]:u==="bottom"&&(y-=a[2]));for(var S=0,b=!1,x=!1,E=Tm("fill"in n?n.fill:(x=!0,i.fill)),k=km("stroke"in n?n.stroke:!h&&(!i.autoStroke||x)?(S=Cm,b=!0,i.stroke):null),T=n.textShadowBlur>0,R=0;R<v.length;R++){var D=this._getOrCreateChild(sc),A=D.createStyle();D.useStyle(A),A.text=v[R],A.x=_,A.y=y,c&&(A.textAlign=c),A.textBaseline="middle",A.opacity=n.opacity,A.strokeFirst=!0,T&&(A.shadowBlur=n.textShadowBlur||0,A.shadowColor=n.textShadowColor||"transparent",A.shadowOffsetX=n.textShadowOffsetX||0,A.shadowOffsetY=n.textShadowOffsetY||0),A.stroke=k,A.fill=E,k&&(A.lineWidth=n.lineWidth||S,A.lineDash=n.lineDash,A.lineDashOffset=n.lineDashOffset||0),A.font=r,xm(A,n),y+=m,D.setBoundingRect(wf(A,d.contentWidth,d.calculatedLineHeight,b?0:null))}},t.prototype._updateRichTexts=function(){var n=this.style,r=this._defaultStyle,a=n.align||r.align,i=n.verticalAlign||r.verticalAlign,o=n.x||0,l=n.y||0;um(yr,r.overflowRect,o,l,a,i),o=yr.baseX,l=yr.baseY;var c=c2(Mm(n),n,yr.outerWidth,yr.outerHeight,a),u=c.width,d=c.outerWidth,f=c.outerHeight,h=n.padding;this.isTruncated=!!c.isTruncated;var p=ul(o,d,a),g=eo(l,f,i),v=p,m=g;h&&(v+=h[3],m+=h[0]);var _=v+u;Af(n)&&this._renderBackground(n,n,p,g,d,f);for(var y=!!n.backgroundColor,w=0;w<c.lines.length;w++){for(var C=c.lines[w],S=C.tokens,b=S.length,x=C.lineHeight,E=C.width,k=0,T=v,R=_,D=b-1,A=void 0;k<b&&(A=S[k],!A.align||A.align==="left");)this._placeToken(A,n,x,m,T,"left",y),E-=A.width,T+=A.width,k++;for(;D>=0&&(A=S[D],A.align==="right");)this._placeToken(A,n,x,m,R,"right",y),E-=A.width,R-=A.width,D--;for(T+=(u-(T-v)-(_-R)-E)/2;k<=D;)A=S[k],this._placeToken(A,n,x,m,T+A.width/2,"center",y),T+=A.width,k++;m+=x}},t.prototype._placeToken=function(n,r,a,i,o,l,c){var u=r.rich[n.styleName]||{};u.text=n.text;var d=n.verticalAlign,f=i+a/2;d==="top"?f=i+n.height/2:d==="bottom"&&(f=i+a-n.height/2),!n.isLineHolder&&Af(u)&&this._renderBackground(u,r,l==="right"?o-n.width:l==="center"?o-n.width/2:o,f-n.height/2,n.width,n.height);var h=!!u.backgroundColor,p=n.textPadding;p&&(o=Rm(o,l,p),f-=n.height/2-p[0]-n.innerHeight/2);var g=this._getOrCreateChild(sc),v=g.createStyle();g.useStyle(v);var m=this._defaultStyle,_=!1,y=0,w=!1,C=Tm("fill"in u?u.fill:"fill"in r?r.fill:(_=!0,m.fill)),S=km("stroke"in u?u.stroke:"stroke"in r?r.stroke:!h&&!c&&(!m.autoStroke||_)?(y=Cm,w=!0,m.stroke):null),b=u.textShadowBlur>0||r.textShadowBlur>0;v.text=n.text,v.x=o,v.y=f,b&&(v.shadowBlur=u.textShadowBlur||r.textShadowBlur||0,v.shadowColor=u.textShadowColor||r.textShadowColor||"transparent",v.shadowOffsetX=u.textShadowOffsetX||r.textShadowOffsetX||0,v.shadowOffsetY=u.textShadowOffsetY||r.textShadowOffsetY||0),v.textAlign=l,v.textBaseline="middle",v.font=n.font||"12px sans-serif",v.opacity=Zo(u.opacity,r.opacity,1),xm(v,u),S&&(v.lineWidth=Zo(u.lineWidth,r.lineWidth,y),v.lineDash=qe(u.lineDash,r.lineDash),v.lineDashOffset=r.lineDashOffset||0,v.stroke=S),C&&(v.fill=C),g.setBoundingRect(wf(v,n.contentWidth,n.contentHeight,w?0:null))},t.prototype._renderBackground=function(n,r,a,i,o,l){var c=n.backgroundColor,u=n.borderWidth,d=n.borderColor,f=c&&c.image,h=c&&!f,p=n.borderRadius,g=this,v,m;if(h||n.lineHeight||u&&d){v=this._getOrCreateChild($r),v.useStyle(v.createStyle()),v.style.fill=null;var _=v.shape;_.x=a,_.y=i,_.width=o,_.height=l,_.r=p,v.dirtyShape()}if(h){var y=v.style;y.fill=c||null,y.fillOpacity=qe(n.fillOpacity,1)}else if(f){m=this._getOrCreateChild(_l),m.onload=function(){g.dirtyStyle()};var w=m.style;w.image=c.image,w.x=a,w.y=i,w.width=o,w.height=l}if(u&&d){var y=v.style;y.lineWidth=u,y.stroke=d,y.strokeOpacity=qe(n.strokeOpacity,1),y.lineDash=n.borderDash,y.lineDashOffset=n.borderDashOffset||0,v.strokeContainThreshold=0,v.hasFill()&&v.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var C=(v||m).style;C.shadowBlur=n.shadowBlur||0,C.shadowColor=n.shadowColor||"transparent",C.shadowOffsetX=n.shadowOffsetX||0,C.shadowOffsetY=n.shadowOffsetY||0,C.opacity=Zo(n.opacity,r.opacity,1)},t.makeFont=function(n){var r="";return U2(n)&&(r=[n.fontStyle,n.fontWeight,W2(n.fontSize),n.fontFamily||"sans-serif"].join(" ")),r&&aa(r)||n.textFont||n.font},t})(ac),j2={left:!0,right:1,center:1},$2={top:1,bottom:1,middle:1},Sm=["fontStyle","fontWeight","fontSize","fontFamily"];function W2(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?"12px":e+"px"}function xm(e,t){for(var n=0;n<Sm.length;n++){var r=Sm[n],a=t[r];a!=null&&(e[r]=a)}}function U2(e){return e.fontSize!=null||e.fontFamily||e.fontWeight}function Y2(e){return Em(e),q(e.rich,Em),e}function Em(e){if(e){e.font=cc.makeFont(e);var t=e.align;t==="middle"&&(t="center"),e.align=t==null||j2[t]?t:"left";var n=e.verticalAlign;n==="center"&&(n="middle"),e.verticalAlign=n==null||$2[n]?n:"top",e.padding&&(e.padding=vd(e.padding))}}function km(e,t){return e==null||t<=0||e==="transparent"||e==="none"?null:e.image||e.colorStops?"#000":e}function Tm(e){return e==null||e==="none"?null:e.image||e.colorStops?"#000":e}function Rm(e,t,n){return t==="right"?e-n[1]:t==="center"?e+n[3]/2-n[1]/2:e+n[3]}function Mm(e){var t=e.text;return t!=null&&(t+=""),t}function Af(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}var En=nn(),G2=function(e,t,n,r){if(r){var a=En(r);a.dataIndex=n,a.dataType=t,a.seriesIndex=e,a.ssrType="chart",r.type==="group"&&r.traverse(function(i){var o=En(i);o.seriesIndex=e,o.dataIndex=n,o.dataType=t,o.ssrType="chart"})}},Bm=1,Dm={},Am=nn(),Pf=nn(),KF=0,ZF=1,QF=2,lo=["emphasis","blur","select"],Pm=["normal","emphasis","blur","select"],e4=10,t4=9,Nf="highlight",Lf="downplay",Nm="select",Lm="unselect",Im="toggleSelect",If="selectchanged";function so(e){return e!=null&&e!=="none"}function uc(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function Om(e){uc(e,"emphasis",2)}function Vm(e){e.hoverState===2&&uc(e,"normal",0)}function Of(e){uc(e,"blur",1)}function zm(e){e.hoverState===1&&uc(e,"normal",0)}function q2(e){e.selected=!0}function J2(e){e.selected=!1}function Hm(e,t,n){t(e,n)}function Wr(e,t,n){Hm(e,t,n),e.isGroup&&e.traverse(function(r){Hm(r,t,n)})}function X2(e,t,n,r){for(var a=e.style,i={},o=0;o<t.length;o++){var l=t[o],c=a[l];i[l]=c??(r&&r[l])}for(var o=0;o<e.animators.length;o++){var u=e.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&u.targetName==="style"&&u.saveTo(i,t)}return i}function K2(e,t,n,r){var a=n&&kt(n,"select")>=0,i=!1;if(e instanceof zt){var o=Am(e),l=a&&o.selectFill||o.normalFill,c=a&&o.selectStroke||o.normalStroke;if(so(l)||so(c)){r=r||{};var u=r.style||{};u.fill==="inherit"?(i=!0,r=Ce({},r),u=Ce({},u),u.fill=l):!so(u.fill)&&so(l)?(i=!0,r=Ce({},r),u=Ce({},u),u.fill=b0(l)):!so(u.stroke)&&so(c)&&(i||(r=Ce({},r),u=Ce({},u)),u.stroke=b0(c)),r.style=u}}if(r&&r.z2==null){i||(r=Ce({},r));var d=e.z2EmphasisLift;r.z2=e.z2+(d??10)}return r}function Z2(e,t,n){if(n&&n.z2==null){n=Ce({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Q2(e,t,n){var r=kt(e.currentStates,t)>=0,a=e.style.opacity,i=r?null:X2(e,["opacity"],t,{opacity:1});n=n||{};var o=n.style||{};return o.opacity==null&&(n=Ce({},n),o=Ce({opacity:r?a:i.opacity*.1},o),n.style=o),n}function Vf(e,t){var n=this.states[e];if(this.style){if(e==="emphasis")return K2(this,e,t,n);if(e==="blur")return Q2(this,e,n);if(e==="select")return Z2(this,e,n)}return n}function eM(e){e.stateProxy=Vf;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Vf),n&&(n.stateProxy=Vf)}function Fm(e,t){!Ym(e,t)&&!e.__highByOuter&&Wr(e,Om)}function jm(e,t){!Ym(e,t)&&!e.__highByOuter&&Wr(e,Vm)}function zf(e,t){e.__highByOuter|=1<<(t||0),Wr(e,Om)}function Hf(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Wr(e,Vm)}function tM(e){Wr(e,Of)}function $m(e){Wr(e,zm)}function Wm(e){Wr(e,q2)}function Um(e){Wr(e,J2)}function Ym(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Gm(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(a,i){var o=Pf(i),l=a==="series",c=l?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!l&&r.push(c),o.isBlured&&(c.group.traverse(function(u){zm(u)}),l&&n.push(i)),o.isBlured=!1}),q(r,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(n,!1,t)})}function Ff(e,t,n,r){var a=r.getModel();n=n||"coordinateSystem";function i(u,d){for(var f=0;f<d.length;f++){var h=u.getItemGraphicEl(d[f]);h&&$m(h)}}if(e!=null&&!(!t||t==="none")){var o=a.getSeriesByIndex(e),l=o.coordinateSystem;l&&l.master&&(l=l.master);var c=[];a.eachSeries(function(u){var d=o===u,f=u.coordinateSystem;if(f&&f.master&&(f=f.master),!(n==="series"&&!d||n==="coordinateSystem"&&!(f&&l?f===l:d)||t==="series"&&d)){if(r.getViewOfSeriesModel(u).group.traverse(function(g){g.__highByOuter&&d&&t==="self"||Of(g)}),Bn(t))i(u.getData(),t);else if(ze(t))for(var h=Vt(t),p=0;p<h.length;p++)i(u.getData(h[p]),t[h[p]]);c.push(u),Pf(u).isBlured=!0}}),a.eachComponent(function(u,d){if(u!=="series"){var f=r.getViewOfComponentModel(d);f&&f.toggleBlurSeries&&f.toggleBlurSeries(c,!0,a)}})}}function jf(e,t,n){if(!(e==null||t==null)){var r=n.getModel().getComponent(e,t);if(r){Pf(r).isBlured=!0;var a=n.getViewOfComponentModel(r);!a||!a.focusBlurEnabled||a.group.traverse(function(i){Of(i)})}}}function nM(e,t,n){var r=e.seriesIndex,a=e.getData(t.dataType);if(!a){process.env.NODE_ENV!=="production"&&At("Unknown dataType "+t.dataType);return}var i=ec(a,t);i=(Fe(i)?i[0]:i)||0;var o=a.getItemGraphicEl(i);if(!o)for(var l=a.count(),c=0;!o&&c<l;)o=a.getItemGraphicEl(c++);if(o){var u=En(o);Ff(r,u.focus,u.blurScope,n)}else{var d=e.get(["emphasis","focus"]),f=e.get(["emphasis","blurScope"]);d!=null&&Ff(r,d,f,n)}}function $f(e,t,n,r){var a={focusSelf:!1,dispatchers:null};if(e==null||e==="series"||t==null||n==null)return a;var i=r.getModel().getComponent(e,t);if(!i)return a;var o=r.getViewOfComponentModel(i);if(!o||!o.findHighDownDispatchers)return a;for(var l=o.findHighDownDispatchers(n),c,u=0;u<l.length;u++)if(process.env.NODE_ENV!=="production"&&!co(l[u])&&At("param should be highDownDispatcher"),En(l[u]).focus==="self"){c=!0;break}return{focusSelf:c,dispatchers:l}}function rM(e,t,n){process.env.NODE_ENV!=="production"&&!co(e)&&At("param should be highDownDispatcher");var r=En(e),a=$f(r.componentMainType,r.componentIndex,r.componentHighDownName,n),i=a.dispatchers,o=a.focusSelf;i?(o&&jf(r.componentMainType,r.componentIndex,n),q(i,function(l){return Fm(l,t)})):(Ff(r.seriesIndex,r.focus,r.blurScope,n),r.focus==="self"&&jf(r.componentMainType,r.componentIndex,n),Fm(e,t))}function aM(e,t,n){process.env.NODE_ENV!=="production"&&!co(e)&&At("param should be highDownDispatcher"),Gm(n);var r=En(e),a=$f(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;a?q(a,function(i){return jm(i,t)}):jm(e,t)}function iM(e,t,n){if(Wf(t)){var r=t.dataType,a=ec(e.getData(r),t);Fe(a)||(a=[a]),e[t.type==="toggleSelect"?"toggleSelect":t.type==="select"?"select":"unselect"](a,r)}}function qm(e){q(e.getAllData(),function(t){var n=t.data,r=t.type;n.eachItemGraphicEl(function(a,i){e.isSelected(i,r)?Wm(a):Um(a)})})}function oM(e){var t=[];return e.eachSeries(function(n){q(n.getAllData(),function(r){r.data;var a=r.type,i=n.getSelectedDataIndices();if(i.length>0){var o={dataIndex:i,seriesIndex:n.seriesIndex};a!=null&&(o.dataType=a),t.push(o)}})}),t}function lM(e,t,n){cM(e,!0),Wr(e,eM),sM(e,t,n)}function sM(e,t,n){var r=En(e);t!=null?(r.focus=t,r.blurScope=n):r.focus&&(r.focus=null)}function cM(e,t){var n=t===!1,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||r.__highDownDispatcher)&&(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function co(e){return!!(e&&e.__highDownDispatcher)}function uM(e){var t=Dm[e];return t==null&&Bm<=32&&(t=Dm[e]=Bm++),t}function Wf(e){var t=e.type;return t==="select"||t==="unselect"||t==="toggleSelect"}function Jm(e){var t=e.type;return t==="highlight"||t==="downplay"}function dM(e){var t=Am(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}var uo=ti.CMD,fM=[[],[],[]],Xm=Math.sqrt,hM=Math.atan2;function pM(e,t){if(t){var n=e.data,r=e.len(),a,i,o,l,c,u,d=uo.M,f=uo.C,h=uo.L,p=uo.R,g=uo.A,v=uo.Q;for(o=0,l=0;o<r;){switch(a=n[o++],l=o,i=0,a){case d:i=1;break;case h:i=1;break;case f:i=3;break;case v:i=2;break;case g:var m=t[4],_=t[5],y=Xm(t[0]*t[0]+t[1]*t[1]),w=Xm(t[2]*t[2]+t[3]*t[3]),C=hM(-t[1]/w,t[0]/y);n[o]*=y,n[o++]+=m,n[o]*=w,n[o++]+=_,n[o++]*=y,n[o++]*=w,n[o++]+=C,n[o++]+=C,o+=2,l=o;break;case p:u[0]=n[o++],u[1]=n[o++],el(u,u,t),n[l++]=u[0],n[l++]=u[1],u[0]+=n[o++],u[1]+=n[o++],el(u,u,t),n[l++]=u[0],n[l++]=u[1]}for(c=0;c<i;c++){var S=fM[c];S[0]=n[o++],S[1]=n[o++],el(S,S,t),n[l++]=S[0],n[l++]=S[1]}}e.increaseVersion()}}var Uf=Math.sqrt,dc=Math.sin,fc=Math.cos,wl=Math.PI;function Km(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Yf(e,t){return(e[0]*t[0]+e[1]*t[1])/(Km(e)*Km(t))}function Zm(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Yf(e,t))}function Qm(e,t,n,r,a,i,o,l,c,u,d){var f=c*(wl/180),h=fc(f)*(e-n)/2+dc(f)*(t-r)/2,p=-1*dc(f)*(e-n)/2+fc(f)*(t-r)/2,g=h*h/(o*o)+p*p/(l*l);g>1&&(o*=Uf(g),l*=Uf(g));var v=(a===i?-1:1)*Uf((o*o*(l*l)-o*o*(p*p)-l*l*(h*h))/(o*o*(p*p)+l*l*(h*h)))||0,m=v*o*p/l,_=v*-l*h/o,y=(e+n)/2+fc(f)*m-dc(f)*_,w=(t+r)/2+dc(f)*m+fc(f)*_,C=Zm([1,0],[(h-m)/o,(p-_)/l]),S=[(h-m)/o,(p-_)/l],b=[(-1*h-m)/o,(-1*p-_)/l],x=Zm(S,b);if(Yf(S,b)<=-1&&(x=wl),Yf(S,b)>=1&&(x=0),x<0){var E=Math.round(x/wl*1e6)/1e6;x=wl*2+E%2*wl}d.addData(u,y,w,o,l,C,x,f,i)}var gM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,vM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function mM(e){var t=new ti;if(!e)return t;var n=0,r=0,a=n,i=r,o,l=ti.CMD,c=e.match(gM);if(!c)return t;for(var u=0;u<c.length;u++){for(var d=c[u],f=d.charAt(0),h=void 0,p=d.match(vM)||[],g=p.length,v=0;v<g;v++)p[v]=parseFloat(p[v]);for(var m=0;m<g;){var _=void 0,y=void 0,w=void 0,C=void 0,S=void 0,b=void 0,x=void 0,E=n,k=r,T=void 0,R=void 0;switch(f){case"l":n+=p[m++],r+=p[m++],h=l.L,t.addData(h,n,r);break;case"L":n=p[m++],r=p[m++],h=l.L,t.addData(h,n,r);break;case"m":n+=p[m++],r+=p[m++],h=l.M,t.addData(h,n,r),a=n,i=r,f="l";break;case"M":n=p[m++],r=p[m++],h=l.M,t.addData(h,n,r),a=n,i=r,f="L";break;case"h":n+=p[m++],h=l.L,t.addData(h,n,r);break;case"H":n=p[m++],h=l.L,t.addData(h,n,r);break;case"v":r+=p[m++],h=l.L,t.addData(h,n,r);break;case"V":r=p[m++],h=l.L,t.addData(h,n,r);break;case"C":h=l.C,t.addData(h,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),n=p[m-2],r=p[m-1];break;case"c":h=l.C,t.addData(h,p[m++]+n,p[m++]+r,p[m++]+n,p[m++]+r,p[m++]+n,p[m++]+r),n+=p[m-2],r+=p[m-1];break;case"S":_=n,y=r,T=t.len(),R=t.data,o===l.C&&(_+=n-R[T-4],y+=r-R[T-3]),h=l.C,E=p[m++],k=p[m++],n=p[m++],r=p[m++],t.addData(h,_,y,E,k,n,r);break;case"s":_=n,y=r,T=t.len(),R=t.data,o===l.C&&(_+=n-R[T-4],y+=r-R[T-3]),h=l.C,E=n+p[m++],k=r+p[m++],n+=p[m++],r+=p[m++],t.addData(h,_,y,E,k,n,r);break;case"Q":E=p[m++],k=p[m++],n=p[m++],r=p[m++],h=l.Q,t.addData(h,E,k,n,r);break;case"q":E=p[m++]+n,k=p[m++]+r,n+=p[m++],r+=p[m++],h=l.Q,t.addData(h,E,k,n,r);break;case"T":_=n,y=r,T=t.len(),R=t.data,o===l.Q&&(_+=n-R[T-4],y+=r-R[T-3]),n=p[m++],r=p[m++],h=l.Q,t.addData(h,_,y,n,r);break;case"t":_=n,y=r,T=t.len(),R=t.data,o===l.Q&&(_+=n-R[T-4],y+=r-R[T-3]),n+=p[m++],r+=p[m++],h=l.Q,t.addData(h,_,y,n,r);break;case"A":w=p[m++],C=p[m++],S=p[m++],b=p[m++],x=p[m++],E=n,k=r,n=p[m++],r=p[m++],h=l.A,Qm(E,k,n,r,b,x,w,C,S,h,t);break;case"a":w=p[m++],C=p[m++],S=p[m++],b=p[m++],x=p[m++],E=n,k=r,n+=p[m++],r+=p[m++],h=l.A,Qm(E,k,n,r,b,x,w,C,S,h,t);break}}(f==="z"||f==="Z")&&(h=l.Z,t.addData(h),n=a,r=i),o=h}return t.toStatic(),t}var yM=(function(e){et(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.applyTransform=function(n){},t})(zt);function _M(e){return e.setData!=null}function wM(e,t){var n=mM(e),r=Ce({},t);return r.buildPath=function(a){var i=_M(a);if(i&&a.canSave()){a.appendPath(n);var o=a.getContext();o&&a.rebuildPath(o,1)}else{var o=i?a.getContext():a;o&&n.rebuildPath(o,1)}},r.applyTransform=function(a){pM(n,a),this.dirtyShape()},r}function bM(e,t){return new yM(wM(e,t))}var CM=(function(){function e(){this.cx=0,this.cy=0,this.r=0}return e})(),Gf=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new CM},t.prototype.buildPath=function(n,r){n.moveTo(r.cx+r.r,r.cy),n.arc(r.cx,r.cy,r.r,0,Math.PI*2)},t})(zt);Gf.prototype.type="circle";var SM=(function(){function e(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return e})(),ey=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new SM},t.prototype.buildPath=function(n,r){var a=.5522848,i=r.cx,o=r.cy,l=r.rx,c=r.ry,u=l*a,d=c*a;n.moveTo(i-l,o),n.bezierCurveTo(i-l,o-d,i-u,o-c,i,o-c),n.bezierCurveTo(i+u,o-c,i+l,o-d,i+l,o),n.bezierCurveTo(i+l,o+d,i+u,o+c,i,o+c),n.bezierCurveTo(i-u,o+c,i-l,o+d,i-l,o),n.closePath()},t})(zt);ey.prototype.type="ellipse";var ty=Math.PI,qf=ty*2,ai=Math.sin,fo=Math.cos,xM=Math.acos,un=Math.atan2,ny=Math.abs,bl=Math.sqrt,Cl=Math.max,_r=Math.min,er=1e-4;function EM(e,t,n,r,a,i,o,l){var c=n-e,u=r-t,d=o-a,f=l-i,h=f*c-d*u;if(!(h*h<er))return h=(d*(t-i)-f*(e-a))/h,[e+h*c,t+h*u]}function hc(e,t,n,r,a,i,o){var l=e-n,c=t-r,u=(o?i:-i)/bl(l*l+c*c),d=u*c,f=-u*l,h=e+d,p=t+f,g=n+d,v=r+f,m=(h+g)/2,_=(p+v)/2,y=g-h,w=v-p,C=y*y+w*w,S=a-i,b=h*v-g*p,x=(w<0?-1:1)*bl(Cl(0,S*S*C-b*b)),E=(b*w-y*x)/C,k=(-b*y-w*x)/C,T=(b*w+y*x)/C,R=(-b*y+w*x)/C,D=E-m,A=k-_,L=T-m,N=R-_;return D*D+A*A>L*L+N*N&&(E=T,k=R),{cx:E,cy:k,x0:-d,y0:-f,x1:E*(a/S-1),y1:k*(a/S-1)}}function kM(e){var t;if(Fe(e)){var n=e.length;if(!n)return e;n===1?t=[e[0],e[0],0,0]:n===2?t=[e[0],e[0],e[1],e[1]]:n===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function TM(e,t){var n,r=Cl(t.r,0),a=Cl(t.r0||0,0),i=r>0;if(!(!i&&!(a>0))){if(i||(r=a,a=0),a>r){var o=r;r=a,a=o}var l=t.startAngle,c=t.endAngle;if(!(isNaN(l)||isNaN(c))){var u=t.cx,d=t.cy,f=!!t.clockwise,h=ny(c-l),p=h>qf&&h%qf;if(p>er&&(h=p),!(r>er))e.moveTo(u,d);else if(h>qf-er)e.moveTo(u+r*fo(l),d+r*ai(l)),e.arc(u,d,r,l,c,!f),a>er&&(e.moveTo(u+a*fo(c),d+a*ai(c)),e.arc(u,d,a,c,l,f));else{var g=void 0,v=void 0,m=void 0,_=void 0,y=void 0,w=void 0,C=void 0,S=void 0,b=void 0,x=void 0,E=void 0,k=void 0,T=void 0,R=void 0,D=void 0,A=void 0,L=r*fo(l),N=r*ai(l),M=a*fo(c),I=a*ai(c),$=h>er;if($){var ee=t.cornerRadius;ee&&(n=kM(ee),g=n[0],v=n[1],m=n[2],_=n[3]);var oe=ny(r-a)/2;if(y=_r(oe,m),w=_r(oe,_),C=_r(oe,g),S=_r(oe,v),E=b=Cl(y,w),k=x=Cl(C,S),(b>er||x>er)&&(T=r*fo(c),R=r*ai(c),D=a*fo(l),A=a*ai(l),h<ty)){var j=EM(L,N,D,A,T,R,M,I);if(j){var U=L-j[0],H=N-j[1],B=T-j[0],W=R-j[1],X=1/ai(xM((U*B+H*W)/(bl(U*U+H*H)*bl(B*B+W*W)))/2),K=bl(j[0]*j[0]+j[1]*j[1]);E=_r(b,(r-K)/(X+1)),k=_r(x,(a-K)/(X-1))}}}if(!$)e.moveTo(u+L,d+N);else if(E>er){var ne=_r(m,E),he=_r(_,E),O=hc(D,A,L,N,r,ne,f),Z=hc(T,R,M,I,r,he,f);e.moveTo(u+O.cx+O.x0,d+O.cy+O.y0),E<b&&ne===he?e.arc(u+O.cx,d+O.cy,E,un(O.y0,O.x0),un(Z.y0,Z.x0),!f):(ne>0&&e.arc(u+O.cx,d+O.cy,ne,un(O.y0,O.x0),un(O.y1,O.x1),!f),e.arc(u,d,r,un(O.cy+O.y1,O.cx+O.x1),un(Z.cy+Z.y1,Z.cx+Z.x1),!f),he>0&&e.arc(u+Z.cx,d+Z.cy,he,un(Z.y1,Z.x1),un(Z.y0,Z.x0),!f))}else e.moveTo(u+L,d+N),e.arc(u,d,r,l,c,!f);if(!(a>er)||!$)e.lineTo(u+M,d+I);else if(k>er){var ne=_r(g,k),he=_r(v,k),O=hc(M,I,T,R,a,-he,f),Z=hc(L,N,D,A,a,-ne,f);e.lineTo(u+O.cx+O.x0,d+O.cy+O.y0),k<x&&ne===he?e.arc(u+O.cx,d+O.cy,k,un(O.y0,O.x0),un(Z.y0,Z.x0),!f):(he>0&&e.arc(u+O.cx,d+O.cy,he,un(O.y0,O.x0),un(O.y1,O.x1),!f),e.arc(u,d,a,un(O.cy+O.y1,O.cx+O.x1),un(Z.cy+Z.y1,Z.cx+Z.x1),f),ne>0&&e.arc(u+Z.cx,d+Z.cy,ne,un(Z.y1,Z.x1),un(Z.y0,Z.x0),!f))}else e.lineTo(u+M,d+I),e.arc(u,d,a,c,l,f)}e.closePath()}}}var RM=(function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e})(),ry=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new RM},t.prototype.buildPath=function(n,r){TM(n,r)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t})(zt);ry.prototype.type="sector";var MM=(function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e})(),ay=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new MM},t.prototype.buildPath=function(n,r){var a=r.cx,i=r.cy,o=Math.PI*2;n.moveTo(a+r.r,i),n.arc(a,i,r.r,0,o,!1),n.moveTo(a+r.r0,i),n.arc(a,i,r.r0,0,o,!0)},t})(zt);ay.prototype.type="ring";function BM(e,t,n,r){var a=[],i=[],o=[],l=[],c,u,d,f;if(r){d=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,p=e.length;h<p;h++)Wi(d,d,e[h]),Ui(f,f,e[h]);Wi(d,d,r[0]),Ui(f,f,r[1])}for(var h=0,p=e.length;h<p;h++){var g=e[h];if(n)c=e[h?h-1:p-1],u=e[(h+1)%p];else if(h===0||h===p-1){a.push(eT(e[h]));continue}else c=e[h-1],u=e[h+1];tT(i,u,c),md(i,i,t);var v=yd(g,c),m=yd(g,u),_=v+m;_!==0&&(v/=_,m/=_),md(o,i,-v),md(l,i,m);var y=Vv([],g,o),w=Vv([],g,l);r&&(Ui(y,y,d),Wi(y,y,f),Ui(w,w,d),Wi(w,w,f)),a.push(y),a.push(w)}return n&&a.push(a.shift()),a}function iy(e,t,n){var r=t.smooth,a=t.points;if(a&&a.length>=2){if(r){var i=BM(a,r,n,t.smoothConstraint);e.moveTo(a[0][0],a[0][1]);for(var o=a.length,l=0;l<(n?o:o-1);l++){var c=i[l*2],u=i[l*2+1],d=a[(l+1)%o];e.bezierCurveTo(c[0],c[1],u[0],u[1],d[0],d[1])}}else{e.moveTo(a[0][0],a[0][1]);for(var l=1,f=a.length;l<f;l++)e.lineTo(a[l][0],a[l][1])}n&&e.closePath()}}var DM=(function(){function e(){this.points=null,this.smooth=0,this.smoothConstraint=null}return e})(),oy=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultShape=function(){return new DM},t.prototype.buildPath=function(n,r){iy(n,r,!0)},t})(zt);oy.prototype.type="polygon";var AM=(function(){function e(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return e})(),Jf=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new AM},t.prototype.buildPath=function(n,r){iy(n,r,!1)},t})(zt);Jf.prototype.type="polyline";var PM={},NM=(function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e})(),Xf=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new NM},t.prototype.buildPath=function(n,r){var a,i,o,l;if(this.subPixelOptimize){var c=O2(PM,r,this.style);a=c.x1,i=c.y1,o=c.x2,l=c.y2}else a=r.x1,i=r.y1,o=r.x2,l=r.y2;var u=r.percent;u!==0&&(n.moveTo(a,i),u<1&&(o=a*(1-u)+o*u,l=i*(1-u)+l*u),n.lineTo(o,l))},t.prototype.pointAt=function(n){var r=this.shape;return[r.x1*(1-n)+r.x2*n,r.y1*(1-n)+r.y2*n]},t})(zt);Xf.prototype.type="line";var kn=[],LM=(function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return e})();function ly(e,t,n){var r=e.cpx2,a=e.cpy2;return r!=null||a!=null?[(n?l0:tn)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?l0:tn)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?d0:cn)(e.x1,e.cpx1,e.x2,t),(n?d0:cn)(e.y1,e.cpy1,e.y2,t)]}var sy=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new LM},t.prototype.buildPath=function(n,r){var a=r.x1,i=r.y1,o=r.x2,l=r.y2,c=r.cpx1,u=r.cpy1,d=r.cpx2,f=r.cpy2,h=r.percent;h!==0&&(n.moveTo(a,i),d==null||f==null?(h<1&&(Vs(a,c,o,h,kn),c=kn[1],o=kn[2],Vs(i,u,l,h,kn),u=kn[1],l=kn[2]),n.quadraticCurveTo(c,u,o,l)):(h<1&&(Os(a,c,d,o,h,kn),c=kn[1],d=kn[2],o=kn[3],Os(i,u,f,l,h,kn),u=kn[1],f=kn[2],l=kn[3]),n.bezierCurveTo(c,u,d,f,o,l)))},t.prototype.pointAt=function(n){return ly(this.shape,n,!1)},t.prototype.tangentAt=function(n){var r=ly(this.shape,n,!0);return aT(r,r)},t})(zt);sy.prototype.type="bezier-curve";var IM=(function(){function e(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e})(),Kf=(function(e){et(t,e);function t(n){return e.call(this,n)||this}return t.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},t.prototype.getDefaultShape=function(){return new IM},t.prototype.buildPath=function(n,r){var a=r.cx,i=r.cy,o=Math.max(r.r,0),l=r.startAngle,c=r.endAngle,u=r.clockwise,d=Math.cos(l),f=Math.sin(l);n.moveTo(d*o+a,f*o+i),n.arc(a,i,o,l,c,!u)},t})(zt);Kf.prototype.type="arc";var Zf=Math.min,OM=Math.max,pc=Math.abs,ii=[0,0],oi=[0,0],Xt=qv(),gc=Xt.minTv,vc=Xt.maxTv,VM=(function(){function e(t,n){this._corners=[],this._axes=[],this._origin=[0,0];for(var r=0;r<4;r++)this._corners[r]=new tt;for(var r=0;r<2;r++)this._axes[r]=new tt;t&&this.fromBoundingRect(t,n)}return e.prototype.fromBoundingRect=function(t,n){var r=this._corners,a=this._axes,i=t.x,o=t.y,l=i+t.width,c=o+t.height;if(r[0].set(i,o),r[1].set(l,o),r[2].set(l,c),r[3].set(i,c),n)for(var u=0;u<4;u++)r[u].transform(n);tt.sub(a[0],r[1],r[0]),tt.sub(a[1],r[3],r[0]),a[0].normalize(),a[1].normalize();for(var u=0;u<2;u++)this._origin[u]=a[u].dot(r[0])},e.prototype.intersect=function(t,n,r){var a=!0,i=!n;return n&&tt.set(n,0,0),Xt.reset(r,!i),!this._intersectCheckOneSide(this,t,i,1)&&(a=!1,i)||!this._intersectCheckOneSide(t,this,i,-1)&&(a=!1,i)||!i&&!Xt.negativeSize&&tt.copy(n,a?Xt.useDir?Xt.dirMinTv:gc:vc),a},e.prototype._intersectCheckOneSide=function(t,n,r,a){for(var i=!0,o=0;o<2;o++){var l=t._axes[o];if(t._getProjMinMaxOnAxis(o,t._corners,ii),t._getProjMinMaxOnAxis(o,n._corners,oi),Xt.negativeSize||ii[1]<oi[0]||ii[0]>oi[1]){if(i=!1,Xt.negativeSize||r)return i;var c=pc(oi[0]-ii[1]),u=pc(ii[0]-oi[1]);Zf(c,u)>vc.len()&&(c<u?tt.scale(vc,l,-c*a):tt.scale(vc,l,u*a))}else if(!r){var c=pc(oi[0]-ii[1]),u=pc(ii[0]-oi[1]);(Xt.useDir||Zf(c,u)<gc.len())&&((c<u||!Xt.bidirectional)&&(tt.scale(gc,l,c*a),Xt.useDir&&Xt.calcDirMTV()),(c>=u||!Xt.bidirectional)&&(tt.scale(gc,l,-u*a),Xt.useDir&&Xt.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(t,n,r){for(var a=this._axes[t],i=this._origin,o=n[0].dot(a)+i[t],l=o,c=o,u=1;u<n.length;u++){var d=n[u].dot(a)+i[t];l=Zf(d,l),c=OM(d,c)}r[0]=l+Xt.touchThreshold,r[1]=c-Xt.touchThreshold,Xt.negativeSize=r[1]<r[0]},e})(),n4=nn();function zM(e,t,n,r,a){var i;if(t&&t.ecModel){var o=t.ecModel.getUpdatePayload();i=o&&o.animation}var l=t&&t.isAnimationEnabled(),c=e==="update";if(l){var u=void 0,d=void 0,f=void 0;return r?(u=qe(r.duration,200),d=qe(r.easing,"cubicOut"),f=0):(u=t.getShallow(c?"animationDurationUpdate":"animationDuration"),d=t.getShallow(c?"animationEasingUpdate":"animationEasing"),f=t.getShallow(c?"animationDelayUpdate":"animationDelay")),i&&(i.duration!=null&&(u=i.duration),i.easing!=null&&(d=i.easing),i.delay!=null&&(f=i.delay)),ot(f)&&(f=f(n,a)),ot(u)&&(u=u(n)),{duration:u||0,delay:f,easing:d}}else return null}function cy(e,t,n,r,a,i,o){var l=!1,c;ot(a)?(o=i,i=a,a=null):ze(a)&&(i=a.cb,o=a.during,l=a.isFrom,c=a.removeOpt,a=a.dataIndex);var u=e==="leave";u||t.stopAnimation("leave");var d=zM(e,r,a,u?c||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,a):null);if(d&&d.duration>0){var f=d.duration,h=d.delay,p=d.easing,g={duration:f,delay:h||0,easing:p,done:i,force:!!i||!!o,setToFinal:!u,scope:e,during:o};l?t.animateFrom(n,g):t.animateTo(n,g)}else t.stopAnimation(),!l&&t.attr(n),o&&o(1),i&&i()}function Qf(e,t,n,r,a,i){cy("update",e,t,n,r,a,i)}function eh(e,t,n,r,a,i){cy("enter",e,t,n,r,a,i)}function mc(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++)if(e.animators[t].scope==="leave")return!0;return!1}var HM={},FM=["x","y"],jM=["width","height"];function wr(e,t){HM[e]=t}function $M(e,t,n,r){var a=bM(e,t);return n&&(r==="center"&&(n=uy(n,a.getBoundingRect())),UM(a,n)),a}function WM(e,t,n){var r=new _l({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(a){if(n==="center"){var i={width:a.width,height:a.height};r.setStyle(uy(t,i))}}});return r}function uy(e,t){var n=t.width/t.height,r=e.height*n,a;r<=e.width?a=e.height:(r=e.width,a=r/n);var i=e.x+e.width/2,o=e.y+e.height/2;return{x:i-r/2,y:o-a/2,width:r,height:a}}function UM(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function dy(e,t,n,r,a){return t==null||(Dt(t)?mt[0]=mt[1]=mt[2]=mt[3]=t:(process.env.NODE_ENV!=="production"&&je(t.length===4),mt[0]=t[0],mt[1]=t[1],mt[2]=t[2],mt[3]=t[3]),r&&(mt[0]=Ya(0,mt[0]),mt[1]=Ya(0,mt[1]),mt[2]=Ya(0,mt[2]),mt[3]=Ya(0,mt[3])),n&&(mt[0]=-mt[0],mt[1]=-mt[1],mt[2]=-mt[2],mt[3]=-mt[3]),fy(e,mt,"x","width",3,1,a&&a[0]||0),fy(e,mt,"y","height",0,2,a&&a[1]||0)),e}var mt=[0,0,0,0];function fy(e,t,n,r,a,i,o){var l=t[i]+t[a],c=e[r];e[r]+=l,o=Ya(0,bR(o,c)),e[r]<o?(e[r]=o,e[n]+=t[a]>=0?-t[a]:t[i]>=0?c+t[i]:pl(l)>1e-8?(c-o)*t[a]/l:0):e[n]-=t[a]}function hy(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function YM(e,t){if(e)if(Fe(e))for(var n=0;n<e.length;n++)hy(e[n],t);else hy(e,t)}function GM(e){return!e||pl(e[1])<yc&&pl(e[2])<yc||pl(e[0])<yc&&pl(e[3])<yc}var yc=1e-5;function py(e,t){return e?lt.copy(e,t):t.clone()}function qM(e,t){return t?Wv(e||Gi(),t):void 0}function JM(e){return{z:e.get("z")||0,zlevel:e.get("zlevel")||0}}function XM(e,t,n){gy(e,t,n,-1/0)}function gy(e,t,n,r){if(e.ignoreModelZ)return r;var a=e.getTextContent(),i=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),l=0;l<o.length;l++)r=Ya(gy(o[l],t,n,r),r);else e.z=t,e.zlevel=n,r=Ya(e.z2||0,r);if(a&&(a.z=t,a.zlevel=n,isFinite(r)&&(a.z2=r+2)),i){var c=e.textGuideLineConfig;i.z=t,i.zlevel=n,isFinite(r)&&(i.z2=r+(c&&c.showAbove?1:-1))}return r}wr("circle",Gf),wr("ellipse",ey),wr("sector",ry),wr("ring",ay),wr("polygon",oy),wr("polyline",Jf),wr("rect",$r),wr("line",Xf),wr("bezierCurve",sy),wr("arc",Kf);var th={};function KM(e,t){for(var n=0;n<lo.length;n++){var r=lo[n],a=t[r],i=e.ensureState(r);i.style=i.style||{},i.style.text=a}var o=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(o,!0)}function ZM(e,t,n){var r=e.labelFetcher,a=e.labelDataIndex,i=e.labelDimIndex,o=t.normal,l;r&&(l=r.getFormattedLabel(a,"normal",null,i,o&&o.get("formatter"),n!=null?{interpolatedValue:n}:null)),l==null&&(l=ot(e.defaultText)?e.defaultText(a,e,n):e.defaultText);for(var c={normal:l},u=0;u<lo.length;u++){var d=lo[u],f=t[d];c[d]=qe(r?r.getFormattedLabel(a,d,null,i,f&&f.get("formatter")):null,l)}return c}function QM(e,t,n,r,a){var i={};return eB(i,e,n,r,a),t&&Ce(i,t),i}function eB(e,t,n,r,a){n=n||th;var i=t.ecModel,o=i&&i.option.textStyle,l=tB(t),c;if(l){c={};var u="richInheritPlainLabel",d=qe(t.get(u),i?i.get(u):void 0);for(var f in l)if(l.hasOwnProperty(f)){var h=t.getModel(["rich",f]);_y(c[f]={},h,o,t,d,n,r,a,!1,!0)}}c&&(e.rich=c);var p=t.get("overflow");p&&(e.overflow=p);var g=t.get("lineOverflow");g&&(e.lineOverflow=g);var v=e,m=t.get("minMargin");if(m!=null)m=Dt(m)?m/2:0,v.margin=[m,m,m,m],v.__marginType=ho.minMargin;else{var _=t.get("textMargin");_!=null&&(v.margin=vd(_),v.__marginType=ho.textMargin)}_y(e,t,o,null,null,n,r,a,!0,!1)}function tB(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||th).rich;if(n){t=t||{};for(var r=Vt(n),a=0;a<r.length;a++){var i=r[a];t[i]=1}}e=e.parentModel}return t}var vy=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],my=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],yy=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function _y(e,t,n,r,a,i,o,l,c,u){n=!o&&n||th;var d=i&&i.inheritColor,f=t.getShallow("color"),h=t.getShallow("textBorderColor"),p=qe(t.getShallow("opacity"),n.opacity);(f==="inherit"||f==="auto")&&(process.env.NODE_ENV!=="production"&&f==="auto"&&Jt("color: 'auto'","color: 'inherit'"),d?f=d:f=null),(h==="inherit"||h==="auto")&&(process.env.NODE_ENV!=="production"&&h==="auto"&&Jt("color: 'auto'","color: 'inherit'"),d?h=d:h=null),l||(f=f||n.color,h=h||n.textBorderColor),f!=null&&(e.fill=f),h!=null&&(e.stroke=h);var g=qe(t.getShallow("textBorderWidth"),n.textBorderWidth);g!=null&&(e.lineWidth=g);var v=qe(t.getShallow("textBorderType"),n.textBorderType);v!=null&&(e.lineDash=v);var m=qe(t.getShallow("textBorderDashOffset"),n.textBorderDashOffset);m!=null&&(e.lineDashOffset=m),!o&&p==null&&!u&&(p=i&&i.defaultOpacity),p!=null&&(e.opacity=p),!o&&!l&&e.fill==null&&i.inheritColor&&(e.fill=i.inheritColor);for(var _=0;_<vy.length;_++){var y=vy[_],w=a!==!1&&r?Zo(t.getShallow(y),r.getShallow(y),n[y]):qe(t.getShallow(y),n[y]);w!=null&&(e[y]=w)}for(var _=0;_<my.length;_++){var y=my[_],w=t.getShallow(y);w!=null&&(e[y]=w)}if(e.verticalAlign==null){var C=t.getShallow("baseline");C!=null&&(e.verticalAlign=C)}if(!c||!i.disableBox){for(var _=0;_<yy.length;_++){var y=yy[_],w=t.getShallow(y);w!=null&&(e[y]=w)}var S=t.getShallow("borderType");S!=null&&(e.borderDash=S),(e.backgroundColor==="auto"||e.backgroundColor==="inherit")&&d&&(process.env.NODE_ENV!=="production"&&e.backgroundColor==="auto"&&Jt("backgroundColor: 'auto'","backgroundColor: 'inherit'"),e.backgroundColor=d),(e.borderColor==="auto"||e.borderColor==="inherit")&&d&&(process.env.NODE_ENV!=="production"&&e.borderColor==="auto"&&Jt("borderColor: 'auto'","borderColor: 'inherit'"),e.borderColor=d)}}function nB(e,t){var n=t&&t.getModel("textStyle");return aa([e.fontStyle||n&&n.getShallow("fontStyle")||"",e.fontWeight||n&&n.getShallow("fontWeight")||"",(e.fontSize||n&&n.getShallow("fontSize")||12)+"px",e.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var wy=nn();function rB(e,t,n,r,a){var i=wy(e);if(!i.valueAnimation||i.prevValue===i.value)return;var o=i.defaultInterpolatedText,l=qe(i.interpolatedValue,i.prevValue),c=i.value;function u(d){var f=UR(n,i.precision,l,c,d);i.interpolatedValue=d===1?null:f,KM(e,ZM({labelDataIndex:t,labelFetcher:a,defaultText:o?o(f):f+""},i.statesModels,f))}e.percent=0,(i.prevValue==null?eh:Qf)(e,{percent:1},r,t,null,u)}var ho={minMargin:1,textMargin:2},aB=["textStyle","color"],nh=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],rh=new cc,iB=(function(){function e(){}return e.prototype.getTextColor=function(t){var n=this.ecModel;return this.getShallow("color")||(!t&&n?n.get(aB):null)},e.prototype.getFont=function(){return nB({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},e.prototype.getTextRect=function(t){for(var n={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},r=0;r<nh.length;r++)n[nh[r]]=this.getShallow(nh[r]);return rh.useStyle(n),rh.update(),rh.getBoundingRect()},e})(),by=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],oB=vl(by),lB=(function(){function e(){}return e.prototype.getLineStyle=function(t){return oB(this,t)},e})(),Cy=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],sB=vl(Cy),cB=(function(){function e(){}return e.prototype.getItemStyle=function(t,n){return sB(this,t,n)},e})(),vn=(function(){function e(t,n,r){this.parentModel=n,this.ecModel=r,this.option=t}return e.prototype.init=function(t,n,r){for(var a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i]},e.prototype.mergeOption=function(t,n){jt(this.option,t,!0)},e.prototype.get=function(t,n){return t==null?this.option:this._doGet(this.parsePath(t),!n&&this.parentModel)},e.prototype.getShallow=function(t,n){var r=this.option,a=r==null?r:r[t];if(a==null&&!n){var i=this.parentModel;i&&(a=i.getShallow(t))}return a},e.prototype.getModel=function(t,n){var r=t!=null,a=r?this.parsePath(t):null,i=r?this._doGet(a):this.option;return n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(a)),new e(i,n,this.ecModel)},e.prototype.isEmpty=function(){return this.option==null},e.prototype.restoreData=function(){},e.prototype.clone=function(){var t=this.constructor;return new t(ft(this.option))},e.prototype.parsePath=function(t){return typeof t=="string"?t.split("."):t},e.prototype.resolveParentPath=function(t){return t},e.prototype.isAnimationEnabled=function(){if(!it.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(t,n){var r=this.option;if(!t)return r;for(var a=0;a<t.length&&!(t[a]&&(r=r&&typeof r=="object"?r[t[a]]:null,r==null));a++);return r==null&&n&&(r=n._doGet(this.resolveParentPath(t),n.parentModel)),r},e})();pf(vn),KR(vn),Lr(vn,lB),Lr(vn,cB),Lr(vn,n2),Lr(vn,iB);var uB=Math.round(Math.random()*10);function _c(e){return[e||"",uB++].join("_")}function dB(e){var t={};e.registerSubTypeDefaulter=function(n,r){var a=pr(n);t[a.main]=r},e.determineSubType=function(n,r){var a=r.type;if(!a){var i=pr(n).main;e.hasSubTypes(n)&&t[i]&&(a=t[i](r))}return a}}function fB(e,t){e.topologicalTravel=function(i,o,l,c){if(!i.length)return;var u=n(o),d=u.graph,f=u.noEntryList,h={};for(q(i,function(y){h[y]=!0});f.length;){var p=f.pop(),g=d[p],v=!!h[p];v&&(l.call(c,p,g.originalDeps.slice()),delete h[p]),q(g.successor,v?_:m)}q(h,function(){var y="";throw process.env.NODE_ENV!=="production"&&(y=df("Circular dependency may exists: ",h,i,o)),new Error(y)});function m(y){d[y].entryCount--,d[y].entryCount===0&&f.push(y)}function _(y){h[y]=!0,m(y)}};function n(i){var o={},l=[];return q(i,function(c){var u=r(o,c),d=a(u.originalDeps=t(c),i);u.entryCount=d.length,u.entryCount===0&&l.push(c),q(d,function(f){kt(u.predecessor,f)<0&&u.predecessor.push(f);var h=r(o,f);kt(h.successor,f)<0&&h.successor.push(c)})}),{graph:o,noEntryList:l}}function r(i,o){return i[o]||(i[o]={predecessor:[],successor:[]}),i[o]}function a(i,o){var l=[];return q(i,function(c){kt(o,c)>=0&&l.push(c)}),l}}var hB={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},pB={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},wc="ZH",ah="EN",Sl=ah,bc={},gB={},vB=it.domSupported?(function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||Sl).toUpperCase().indexOf(wc)>-1?wc:Sl})():Sl;function Sy(e,t){e=e.toUpperCase(),gB[e]=new vn(t),bc[e]=t}function mB(e){if(Ge(e)){var t=bc[e.toUpperCase()]||{};return e===wc||e===ah?ft(t):jt(ft(t),ft(bc[Sl]),!1)}else return jt(ft(e),ft(bc[Sl]),!1)}Sy(ah,hB),Sy(wc,pB);var yB=vd,xy=["a","b","c","d","e","f","g"],ih=function(e,t){return"{"+e+(t??"")+"}"};function _B(e,t,n){Fe(t)||(t=[t]);var r=t.length;if(!r)return"";for(var a=t[0].$vars||[],i=0;i<a.length;i++){var o=xy[i];e=e.replace(ih(o),ih(o,0))}for(var l=0;l<r;l++)for(var c=0;c<a.length;c++){var u=t[l][a[c]];e=e.replace(ih(xy[c],l),n?Cd(u):u)}return e}function wB(e,t){var n=Ge(e)?{color:e,extraCssText:t}:e||{},r=n.color,a=n.type;t=n.extraCssText;var i=n.renderMode||"html";return r?i==="html"?a==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Cd(r)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Cd(r)+";"+(t||"")+'"></span>':{renderMode:i,content:"{"+(n.markerId||"markerX")+"|} ",style:a==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:""}function bB(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function CB(e,t){return t=t||"transparent",Ge(e)?e:ze(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var oh={},lh={},Ey=(function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,n){this._nonSeriesBoxMasterList=r(oh,!0),this._normalMasterList=r(lh,!1);function r(a,i){var o=[];return q(a,function(l,c){var u=l.create(t,n);o=o.concat(u||[]),process.env.NODE_ENV!=="production"&&i&&q(u,function(d){return je(!d.update)})}),o}},e.prototype.update=function(t,n){q(this._normalMasterList,function(r){r.update&&r.update(t,n)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(t,n){if(t==="matrix"||t==="calendar"){oh[t]=n;return}lh[t]=n},e.get=function(t){return lh[t]||oh[t]},e})(),r4=Je(),Cc=q,SB=["left","right","top","bottom","width","height"],Sc=[["width","left","right"],["height","top","bottom"]];function ky(e,t,n,r,a){var i=0,o=0;r==null&&(r=1/0),a==null&&(a=1/0);var l=0;t.eachChild(function(c,u){var d=c.getBoundingRect(),f=t.childAt(u+1),h=f&&f.getBoundingRect(),p,g;if(e==="horizontal"){var v=d.width+(h?-h.x+d.x:0);p=i+v,p>r||c.newline?(i=0,p=v,o+=l+n,l=d.height):l=Math.max(l,d.height)}else{var m=d.height+(h?-h.y+d.y:0);g=o+m,g>a||c.newline?(i+=l+n,o=0,g=m,l=d.width):l=Math.max(l,d.width)}c.newline||(c.x=i,c.y=o,c.markRedraw(),e==="horizontal"?i=p+n:o=g+n)})}var a4=hd(ky,"vertical"),i4=hd(ky,"horizontal");function xB(e,t){return{left:e.getShallow("left",t),top:e.getShallow("top",t),right:e.getShallow("right",t),bottom:e.getShallow("bottom",t),width:e.getShallow("width",t),height:e.getShallow("height",t)}}function EB(e,t,n){n=yB(n||0);var r=t.width,a=t.height,i=sa(e.left,r),o=sa(e.top,a),l=sa(e.right,r),c=sa(e.bottom,a),u=sa(e.width,r),d=sa(e.height,a),f=n[2]+n[0],h=n[1]+n[3],p=e.aspect;switch(isNaN(u)&&(u=r-l-h-i),isNaN(d)&&(d=a-c-f-o),p!=null&&(isNaN(u)&&isNaN(d)&&(p>r/a?u=r*.8:d=a*.8),isNaN(u)&&(u=p*d),isNaN(d)&&(d=u/p)),isNaN(i)&&(i=r-l-u-h),isNaN(o)&&(o=a-c-d-f),e.left||e.right){case"center":i=r/2-u/2-n[3];break;case"right":i=r-u-h;break}switch(e.top||e.bottom){case"middle":case"center":o=a/2-d/2-n[0];break;case"bottom":o=a-d-f;break}i=i||0,o=o||0,isNaN(u)&&(u=r-h-i-(l||0)),isNaN(d)&&(d=a-f-o-(c||0));var g=new lt((t.x||0)+i+n[3],(t.y||0)+o+n[0],u,d);return g.margin=n,g}function xc(e){var t=e.layoutMode||e.constructor.layoutMode;return ze(t)?t:t?{type:t}:null}function Ec(e,t,n){var r=n&&n.ignoreSize;!Fe(r)&&(r=[r,r]);var a=o(Sc[0],0),i=o(Sc[1],1);c(Sc[0],e,a),c(Sc[1],e,i);function o(u,d){var f={},h=0,p={},g=0,v=2;if(Cc(u,function(y){p[y]=e[y]}),Cc(u,function(y){ia(t,y)&&(f[y]=p[y]=t[y]),l(f,y)&&h++,l(p,y)&&g++}),r[d])return l(t,u[1])?p[u[2]]=null:l(t,u[2])&&(p[u[1]]=null),p;if(g===v||!h)return p;if(h>=v)return f;for(var m=0;m<u.length;m++){var _=u[m];if(!ia(f,_)&&ia(e,_)){f[_]=e[_];break}}return f}function l(u,d){return u[d]!=null&&u[d]!=="auto"}function c(u,d,f){Cc(u,function(h){d[h]=f[h]})}}function Ty(e){return kB({},e)}function kB(e,t){return t&&e&&Cc(SB,function(n){ia(t,n)&&(e[n]=t[n])}),e}var TB=nn(),yt=(function(e){et(t,e);function t(n,r,a){var i=e.call(this,n,r,a)||this;return i.uid=_c("ec_cpt_model"),i}return t.prototype.init=function(n,r,a){this.mergeDefaultAndTheme(n,a)},t.prototype.mergeDefaultAndTheme=function(n,r){var a=xc(this),i=a?Ty(n):{},o=r.getTheme();jt(n,o.get(this.mainType)),jt(n,this.getDefaultOption()),a&&Ec(n,i,a)},t.prototype.mergeOption=function(n,r){jt(this.option,n,!0);var a=xc(this);a&&Ec(this.option,n,a)},t.prototype.optionUpdated=function(n,r){},t.prototype.getDefaultOption=function(){var n=this.constructor;if(!qR(n))return n.defaultOption;var r=TB(this);if(!r.defaultOption){for(var a=[],i=n;i;){var o=i.prototype.defaultOption;o&&a.push(o),i=i.superClass}for(var l={},c=a.length-1;c>=0;c--)l=jt(l,a[c],!0);r.defaultOption=l}return r.defaultOption},t.prototype.getReferringComponents=function(n,r){var a=n+"Index",i=n+"Id";return tc(this.ecModel,n,{index:this.get(a,!0),id:this.get(i,!0)},r)},t.prototype.getBoxLayoutParams=function(){return xB(this,!1)},t.prototype.getZLevelKey=function(){return""},t.prototype.setZLevel=function(n){this.option.zlevel=n},t.protoInitialize=(function(){var n=t.prototype;n.type="component",n.id="",n.name="",n.mainType="",n.subType="",n.componentIndex=0})(),t})(vn);rm(yt,vn),gf(yt),dB(yt),fB(yt,RB);function RB(e){var t=[];return q(yt.getClassesByMainType(e),function(n){t=t.concat(n.dependencies||n.prototype.dependencies||[])}),t=bt(t,function(n){return pr(n).main}),e!=="dataset"&&kt(t,"dataset")<=0&&t.unshift("dataset"),t}var Wn={color:{},darkColor:{},size:{}},Pt=Wn.color={theme:["#5070dd","#b6d634","#505372","#ff994d","#0ca8df","#ffd10a","#fb628b","#785db0","#3fbe95"],neutral00:"#fff",neutral05:"#f4f7fd",neutral10:"#e8ebf0",neutral15:"#dbdee4",neutral20:"#cfd2d7",neutral25:"#c3c5cb",neutral30:"#b7b9be",neutral35:"#aaacb2",neutral40:"#9ea0a5",neutral45:"#929399",neutral50:"#86878c",neutral55:"#797b7f",neutral60:"#6d6e73",neutral65:"#616266",neutral70:"#54555a",neutral75:"#48494d",neutral80:"#3c3c41",neutral85:"#303034",neutral90:"#232328",neutral95:"#17171b",neutral99:"#000",accent05:"#eff1f9",accent10:"#e0e4f2",accent15:"#d0d6ec",accent20:"#c0c9e6",accent25:"#b1bbdf",accent30:"#a1aed9",accent35:"#91a0d3",accent40:"#8292cc",accent45:"#7285c6",accent50:"#6578ba",accent55:"#5c6da9",accent60:"#536298",accent65:"#4a5787",accent70:"#404c76",accent75:"#374165",accent80:"#2e3654",accent85:"#252b43",accent90:"#1b2032",accent95:"#121521",transparent:"rgba(0,0,0,0)",highlight:"rgba(255,231,130,0.8)"};Ce(Pt,{primary:Pt.neutral80,secondary:Pt.neutral70,tertiary:Pt.neutral60,quaternary:Pt.neutral50,disabled:Pt.neutral20,border:Pt.neutral30,borderTint:Pt.neutral20,borderShade:Pt.neutral40,background:Pt.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Pt.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Pt.neutral70,axisLineTint:Pt.neutral40,axisTick:Pt.neutral70,axisTickMinor:Pt.neutral60,axisLabel:Pt.neutral70,axisSplitLine:Pt.neutral15,axisMinorSplitLine:Pt.neutral05});for(var li in Pt)if(Pt.hasOwnProperty(li)){var Ry=Pt[li];li==="theme"?Wn.darkColor.theme=Pt.theme.slice():li==="highlight"?Wn.darkColor.highlight="rgba(255,231,130,0.4)":li.indexOf("accent")===0?Wn.darkColor[li]=Hd(Ry,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):Wn.darkColor[li]=Hd(Ry,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}Wn.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var My="";typeof navigator<"u"&&(My=navigator.platform||"");var po="rgba(0, 0, 0, 0.2)",By=Wn.color.theme[0],MB=Hd(By,null,null,.9),BB={darkMode:"auto",colorBy:"series",color:Wn.color.theme,gradientColor:[MB,By],aria:{decal:{decals:[{color:po,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:po,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:po,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:po,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:po,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:po,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:My.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},sh=Je(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),si="original",tr="arrayRows",go="objectRows",vo="keyedColumns",xl="typedArray",DB="unknown",Ur="column",An={Must:1,Might:2,Not:3},AB=nn();function PB(e){AB(e).datasetMap=Je()}function NB(e){if(!e.get("data",!0))return tc(e.ecModel,"dataset",{index:e.get("datasetIndex",!0),id:e.get("datasetId",!0)},hf).models[0]}function LB(e){return!e.get("transform",!0)&&!e.get("fromTransformResult",!0)?[]:tc(e.ecModel,"dataset",{index:e.get("fromDatasetIndex",!0),id:e.get("fromDatasetId",!0)},hf).models}function Dy(e,t){return IB(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function IB(e,t,n,r,a,i){var o,l=5;if(hn(e))return An.Not;var c,u;if(r){var d=r[i];ze(d)?(c=d.name,u=d.type):Ge(d)&&(c=d)}if(u!=null)return u==="ordinal"?An.Must:An.Not;if(t==="arrayRows"){var f=e;if(n==="row"){for(var h=f[i],p=0;p<(h||[]).length&&p<l;p++)if((o=C(h[a+p]))!=null)return o}else for(var p=0;p<f.length&&p<l;p++){var g=f[a+p];if(g&&(o=C(g[i]))!=null)return o}}else if(t==="objectRows"){var v=e;if(!c)return An.Not;for(var p=0;p<v.length&&p<l;p++){var m=v[p];if(m&&(o=C(m[c]))!=null)return o}}else if(t==="keyedColumns"){var _=e;if(!c)return An.Not;var h=_[c];if(!h||hn(h))return An.Not;for(var p=0;p<h.length&&p<l;p++)if((o=C(h[p]))!=null)return o}else if(t==="original")for(var y=e,p=0;p<y.length&&p<l;p++){var m=y[p],w=Qs(m);if(!Fe(w))return An.Not;if((o=C(w[i]))!=null)return o}function C(S){var b=Ge(S);if(S!=null&&Number.isFinite(Number(S))&&S!=="")return b?An.Might:An.Not;if(b&&S!=="-")return An.Must}return An.Not}var OB=Je();function VB(e,t,n){var r=OB.get(t);if(!r)return n;var a=r(e);if(!a)return n;if(process.env.NODE_ENV!=="production")for(var i=0;i<a.length;i++)je(ro(a[i]));return n.concat(a)}var Ay=nn(),o4=nn(),ch=(function(){function e(){}return e.prototype.getColorFromPalette=function(t,n,r){var a=pn(this.get("color",!0)),i=this.get("colorLayer",!0);return HB(this,Ay,a,i,t,n,r)},e.prototype.clearColorPalette=function(){FB(this,Ay)},e})();function zB(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}function HB(e,t,n,r,a,i,o){i=i||e;var l=t(i),c=l.paletteIdx||0,u=l.paletteNameMap=l.paletteNameMap||{};if(u.hasOwnProperty(a))return u[a];var d=o==null||!r?n:zB(r,o);if(d=d||n,!(!d||!d.length)){var f=d[c];return a&&(u[a]=f),l.paletteIdx=(c+1)%d.length,f}}function FB(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var kc,El,Py,uh="\0_ec_inner",Ny=1,jB={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",matrix:"MatrixComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},$B={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",chord:"ChordChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Tc={};function WB(e){q(e,function(t,n){if(!yt.hasClass(n)){var r=jB[n];r&&!Tc[r]&&(At("Component "+n+` is used but not imported.
|
|
8
|
+
import { `+r+` } from 'echarts/components';
|
|
9
|
+
echarts.use([`+r+"]);"),Tc[r]=!0)}})}var dh=(function(e){et(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(n,r,a,i,o,l){i=i||{},this.option=null,this._theme=new vn(i),this._locale=new vn(o),this._optionManager=l},t.prototype.setOption=function(n,r,a){process.env.NODE_ENV!=="production"&&(je(n!=null,"option is null/undefined"),je(n[uh]!==Ny,"please use chart.getOption()"));var i=Oy(r);this._optionManager.setOption(n,a,i),this._resetOption(null,i)},t.prototype.resetOption=function(n,r){return this._resetOption(n,Oy(r))},t.prototype._resetOption=function(n,r){var a=!1,i=this._optionManager;if(!n||n==="recreate"){var o=i.mountOption(n==="recreate");process.env.NODE_ENV!=="production"&&WB(o),!this.option||n==="recreate"?Py(this,o):(this.restoreData(),this._mergeOption(o,r)),a=!0}if((n==="timeline"||n==="media")&&this.restoreData(),!n||n==="recreate"||n==="timeline"){var l=i.getTimelineOption(this);l&&(a=!0,this._mergeOption(l,r))}if(!n||n==="recreate"||n==="media"){var c=i.getMediaOption(this);c.length&&q(c,function(u){a=!0,this._mergeOption(u,r)},this)}return a},t.prototype.mergeOption=function(n){this._mergeOption(n,null)},t.prototype._mergeOption=function(n,r){var a=this.option,i=this._componentsMap,o=this._componentsCount,l=[],c=Je(),u=r&&r.replaceMergeMainTypeMap;PB(this),q(n,function(f,h){f!=null&&(yt.hasClass(h)?h&&(l.push(h),c.set(h,!0)):a[h]=a[h]==null?ft(f):jt(a[h],f,!0))}),u&&u.each(function(f,h){yt.hasClass(h)&&!c.get(h)&&(l.push(h),c.set(h,!0))}),yt.topologicalTravel(l,yt.getAllClassMainTypes(),d,this);function d(f){var h=VB(this,f,pn(n[f])),p=i.get(f),g=p?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",v=NR(p,h,g);FR(v,f,yt),a[f]=null,i.set(f,null),o.set(f,0);var m=[],_=[],y=0,w,C;q(v,function(S,b){var x=S.existing,E=S.newOption;if(!E)x&&(x.mergeOption({},this),x.optionUpdated({},!1));else{var k=f==="series",T=yt.getClass(f,S.keyInfo.subType,!k);if(!T){if(process.env.NODE_ENV!=="production"){var R=S.keyInfo.subType,D=$B[R];Tc[R]||(Tc[R]=!0,At(D?"Series "+R+` is used but not imported.
|
|
10
|
+
import { `+D+` } from 'echarts/charts';
|
|
11
|
+
echarts.use([`+D+"]);":"Unknown series "+R))}return}if(f==="tooltip"){if(w){process.env.NODE_ENV!=="production"&&(C||(zr("Currently only one tooltip component is allowed."),C=!0));return}w=!0}if(x&&x.constructor===T)x.name=S.keyInfo.name,x.mergeOption(E,this),x.optionUpdated(E,!1);else{var A=Ce({componentIndex:b},S.keyInfo);x=new T(E,this,this,A),Ce(x,A),S.brandNew&&(x.__requireNewView=!0),x.init(E,this,this),x.optionUpdated(null,!0)}}x?(m.push(x.option),_.push(x),y++):(m.push(void 0),_.push(void 0))},this),a[f]=m,i.set(f,_),o.set(f,y),f==="series"&&kc(this)}this._seriesIndices||kc(this)},t.prototype.getOption=function(){var n=ft(this.option);return q(n,function(r,a){if(yt.hasClass(a)){for(var i=pn(r),o=i.length,l=!1,c=o-1;c>=0;c--)i[c]&&!ro(i[c])?l=!0:(i[c]=null,!l&&o--);i.length=o,n[a]=i}}),delete n[uh],n},t.prototype.setTheme=function(n){this._theme=new vn(n),this._resetOption("recreate",null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(n){this._payload=n},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(n,r){var a=this._componentsMap.get(n);if(a){var i=a[r||0];if(i)return i;if(r==null){for(var o=0;o<a.length;o++)if(a[o])return a[o]}}},t.prototype.queryComponents=function(n){var r=n.mainType;if(!r)return[];var a=n.index,i=n.id,o=n.name,l=this._componentsMap.get(r);if(!l||!l.length)return[];var c;return a!=null?(c=[],q(pn(a),function(u){l[u]&&c.push(l[u])})):i!=null?c=Ly("id",i,l):o!=null?c=Ly("name",o,l):c=Cn(l,function(u){return!!u}),Iy(c,n)},t.prototype.findComponents=function(n){var r=n.query,a=n.mainType,i=o(r);return l(Iy(i?this.queryComponents(i):Cn(this._componentsMap.get(a),function(c){return!!c}),n));function o(c){var u=a+"Index",d=a+"Id",f=a+"Name";return c&&(c[u]!=null||c[d]!=null||c[f]!=null)?{mainType:a,index:c[u],id:c[d],name:c[f]}:null}function l(c){return n.filter?Cn(c,n.filter):c}},t.prototype.eachComponent=function(n,r,a){var i=this._componentsMap;if(ot(n)){var o=r,l=n;i.each(function(f,h){for(var p=0;f&&p<f.length;p++){var g=f[p];g&&l.call(o,h,g,g.componentIndex)}})}else for(var c=Ge(n)?i.get(n):ze(n)?this.findComponents(n):null,u=0;c&&u<c.length;u++){var d=c[u];d&&r.call(a,d,d.componentIndex)}},t.prototype.getSeriesByName=function(n){var r=hr(n,null);return Cn(this._componentsMap.get("series"),function(a){return!!a&&r!=null&&a.name===r})},t.prototype.getSeriesByIndex=function(n){return this._componentsMap.get("series")[n]},t.prototype.getSeriesByType=function(n){return Cn(this._componentsMap.get("series"),function(r){return!!r&&r.subType===n})},t.prototype.getSeries=function(){return Cn(this._componentsMap.get("series"),function(n){return!!n})},t.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},t.prototype.eachSeries=function(n,r){El(this),q(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];n.call(r,i,a)},this)},t.prototype.eachRawSeries=function(n,r){q(this._componentsMap.get("series"),function(a){a&&n.call(r,a,a.componentIndex)})},t.prototype.eachSeriesByType=function(n,r,a){El(this),q(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];o.subType===n&&r.call(a,o,i)},this)},t.prototype.eachRawSeriesByType=function(n,r,a){return q(this.getSeriesByType(n),r,a)},t.prototype.isSeriesFiltered=function(n){return El(this),this._seriesIndicesMap.get(n.componentIndex)==null},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(n,r){El(this);var a=[];q(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];n.call(r,o,i)&&a.push(i)},this),this._seriesIndices=a,this._seriesIndicesMap=Je(a)},t.prototype.restoreData=function(n){kc(this);var r=this._componentsMap,a=[];r.each(function(i,o){yt.hasClass(o)&&a.push(o)}),yt.topologicalTravel(a,yt.getAllClassMainTypes(),function(i){q(r.get(i),function(o){o&&(i!=="series"||!UB(o,n))&&o.restoreData()})})},t.internalField=(function(){kc=function(n){var r=n._seriesIndices=[];q(n._componentsMap.get("series"),function(a){a&&r.push(a.componentIndex)}),n._seriesIndicesMap=Je(r)},El=function(n){if(process.env.NODE_ENV!=="production"&&!n._seriesIndices)throw new Error("Option should contains series.")},Py=function(n,r){n.option={},n.option[uh]=Ny,n._componentsMap=Je({series:[]}),n._componentsCount=Je();var a=r.aria;ze(a)&&a.enabled==null&&(a.enabled=!0),YB(r,n._theme.option),jt(r,BB,!1),n._mergeOption(r,null)}})(),t})(vn);function UB(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,a=t.seriesName;return n!=null&&e.componentIndex!==n||r!=null&&e.id!==r||a!=null&&e.name!==a}}function YB(e,t){var n=e.color&&!e.colorLayer;q(t,function(r,a){a==="colorLayer"&&n||a==="color"&&e.color||yt.hasClass(a)||(typeof r=="object"?e[a]=e[a]?jt(e[a],r,!1):ft(r):e[a]==null&&(e[a]=r))})}function Ly(e,t,n){if(Fe(t)){var r=Je();return q(t,function(i){i!=null&&hr(i,null)!=null&&r.set(i,!0)}),Cn(n,function(i){return i&&r.get(i[e])})}else{var a=hr(t,null);return Cn(n,function(i){return i&&a!=null&&i[e]===a})}}function Iy(e,t){return t.hasOwnProperty("subType")?Cn(e,function(n){return n&&n.subType===t.subType}):e}function Oy(e){var t=Je();return e&&q(pn(e.replaceMerge),function(n){process.env.NODE_ENV!=="production"&&je(yt.hasClass(n),'"'+n+'" is not valid component main type in "replaceMerge"'),t.set(n,!0)}),{replaceMergeMainTypeMap:t}}Lr(dh,ch);var GB=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],Vy=(function(){function e(t){q(GB,function(n){this[n]=Sn(t[n],t)},this)}return e})(),qB=/^(min|max)?(.+)$/,JB=(function(){function e(t){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=t}return e.prototype.setOption=function(t,n,r){t&&(q(pn(t.series),function(o){o&&o.data&&hn(o.data)&&Ds(o.data)}),q(pn(t.dataset),function(o){o&&o.source&&hn(o.source)&&Ds(o.source)})),t=ft(t);var a=this._optionBackup,i=XB(t,n,!a);this._newBaseOption=i.baseOption,a?(i.timelineOptions.length&&(a.timelineOptions=i.timelineOptions),i.mediaList.length&&(a.mediaList=i.mediaList),i.mediaDefault&&(a.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(t){var n=this._optionBackup;return this._timelineOptions=n.timelineOptions,this._mediaList=n.mediaList,this._mediaDefault=n.mediaDefault,this._currentMediaIndices=[],ft(t?n.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(t){var n,r=this._timelineOptions;if(r.length){var a=t.getComponent("timeline");a&&(n=ft(r[a.getCurrentIndex()]))}return n},e.prototype.getMediaOption=function(t){var n=this._api.getWidth(),r=this._api.getHeight(),a=this._mediaList,i=this._mediaDefault,o=[],l=[];if(!a.length&&!i)return l;for(var c=0,u=a.length;c<u;c++)KB(a[c].query,n,r)&&o.push(c);return!o.length&&i&&(o=[-1]),o.length&&!QB(o,this._currentMediaIndices)&&(l=bt(o,function(d){return ft(d===-1?i.option:a[d].option)})),this._currentMediaIndices=o,l},e})();function XB(e,t,n){var r=[],a,i,o=e.baseOption,l=e.timeline,c=e.options,u=e.media,d=!!e.media,f=!!(c||l||o&&o.timeline);o?(i=o,i.timeline||(i.timeline=l)):((f||d)&&(e.options=e.media=null),i=e),d&&(Fe(u)?q(u,function(p){process.env.NODE_ENV!=="production"&&p&&!p.option&&ze(p.query)&&ze(p.query.option)&&At("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),p&&p.option&&(p.query?r.push(p):a||(a=p))}):process.env.NODE_ENV!=="production"&&At("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }")),h(i),q(c,function(p){return h(p)}),q(r,function(p){return h(p.option)});function h(p){q(t,function(g){g(p,n)})}return{baseOption:i,timelineOptions:c||[],mediaDefault:a,mediaList:r}}function KB(e,t,n){var r={width:t,height:n,aspectratio:t/n},a=!0;return q(e,function(i,o){var l=o.match(qB);if(!(!l||!l[1]||!l[2])){var c=l[1];ZB(r[l[2].toLowerCase()],i,c)||(a=!1)}}),a}function ZB(e,t,n){return n==="min"?e>=t:n==="max"?e<=t:e===t}function QB(e,t){return e.join(",")===t.join(",")}var Un=q,kl=ze,zy=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function fh(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=zy.length;n<r;n++){var a=zy[n],i=t.normal,o=t.emphasis;i&&i[a]&&(process.env.NODE_ENV!=="production"&&Jt("itemStyle.normal."+a,a),e[a]=e[a]||{},e[a].normal?jt(e[a].normal,i[a]):e[a].normal=i[a],i[a]=null),o&&o[a]&&(process.env.NODE_ENV!=="production"&&Jt("itemStyle.emphasis."+a,"emphasis."+a),e[a]=e[a]||{},e[a].emphasis?jt(e[a].emphasis,o[a]):e[a].emphasis=o[a],o[a]=null)}}function dn(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,a=e[t].emphasis;r&&(process.env.NODE_ENV!=="production"&&Hr("'normal' hierarchy in "+t+" has been removed since 4.0. All style properties are configured in "+t+" directly now."),n?(e[t].normal=e[t].emphasis=null,sn(e[t],r)):e[t]=r),a&&(process.env.NODE_ENV!=="production"&&Hr(t+".emphasis has been changed to emphasis."+t+" since 4.0"),e.emphasis=e.emphasis||{},e.emphasis[t]=a,a.focus&&(e.emphasis.focus=a.focus),a.blurScope&&(e.emphasis.blurScope=a.blurScope))}}function Tl(e){dn(e,"itemStyle"),dn(e,"lineStyle"),dn(e,"areaStyle"),dn(e,"label"),dn(e,"labelLine"),dn(e,"upperLabel"),dn(e,"edgeLabel")}function Ht(e,t){var n=kl(e)&&e[t],r=kl(n)&&n.textStyle;if(r){process.env.NODE_ENV!=="production"&&Hr("textStyle hierarchy in "+t+" has been removed since 4.0. All textStyle properties are configured in "+t+" directly now.");for(var a=0,i=X0.length;a<i;a++){var o=X0[a];r.hasOwnProperty(o)&&(n[o]=r[o])}}}function Yn(e){e&&(Tl(e),Ht(e,"label"),e.emphasis&&Ht(e.emphasis,"label"))}function eD(e){if(kl(e)){fh(e),Tl(e),Ht(e,"label"),Ht(e,"upperLabel"),Ht(e,"edgeLabel"),e.emphasis&&(Ht(e.emphasis,"label"),Ht(e.emphasis,"upperLabel"),Ht(e.emphasis,"edgeLabel"));var t=e.markPoint;t&&(fh(t),Yn(t));var n=e.markLine;n&&(fh(n),Yn(n));var r=e.markArea;r&&Yn(r);var a=e.data;if(e.type==="graph"){a=a||e.nodes;var i=e.links||e.edges;if(i&&!hn(i))for(var o=0;o<i.length;o++)Yn(i[o]);q(e.categories,function(u){Tl(u)})}if(a&&!hn(a))for(var o=0;o<a.length;o++)Yn(a[o]);if(t=e.markPoint,t&&t.data)for(var l=t.data,o=0;o<l.length;o++)Yn(l[o]);if(n=e.markLine,n&&n.data)for(var c=n.data,o=0;o<c.length;o++)Fe(c[o])?(Yn(c[o][0]),Yn(c[o][1])):Yn(c[o]);e.type==="gauge"?(Ht(e,"axisLabel"),Ht(e,"title"),Ht(e,"detail")):e.type==="treemap"?(dn(e.breadcrumb,"itemStyle"),q(e.levels,function(u){Tl(u)})):e.type==="tree"&&Tl(e.leaves)}}function Yr(e){return Fe(e)?e:e?[e]:[]}function Hy(e){return(Fe(e)?e[0]:e)||{}}function tD(e,t){Un(Yr(e.series),function(r){kl(r)&&eD(r)});var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),Un(n,function(r){Un(Yr(e[r]),function(a){a&&(Ht(a,"axisLabel"),Ht(a.axisPointer,"label"))})}),Un(Yr(e.parallel),function(r){var a=r&&r.parallelAxisDefault;Ht(a,"axisLabel"),Ht(a&&a.axisPointer,"label")}),Un(Yr(e.calendar),function(r){dn(r,"itemStyle"),Ht(r,"dayLabel"),Ht(r,"monthLabel"),Ht(r,"yearLabel")}),Un(Yr(e.radar),function(r){Ht(r,"name"),r.name&&r.axisName==null&&(r.axisName=r.name,delete r.name,process.env.NODE_ENV!=="production"&&Hr("name property in radar component has been changed to axisName")),r.nameGap!=null&&r.axisNameGap==null&&(r.axisNameGap=r.nameGap,delete r.nameGap,process.env.NODE_ENV!=="production"&&Hr("nameGap property in radar component has been changed to axisNameGap")),process.env.NODE_ENV!=="production"&&Un(r.indicator,function(a){a.text&&Jt("text","name","radar.indicator")})}),Un(Yr(e.geo),function(r){kl(r)&&(Yn(r),Un(Yr(r.regions),function(a){Yn(a)}))}),Un(Yr(e.timeline),function(r){Yn(r),dn(r,"label"),dn(r,"itemStyle"),dn(r,"controlStyle",!0);var a=r.data;Fe(a)&&q(a,function(i){ze(i)&&(dn(i,"label"),dn(i,"itemStyle"))})}),Un(Yr(e.toolbox),function(r){dn(r,"iconStyle"),Un(r.feature,function(a){dn(a,"iconStyle")})}),Ht(Hy(e.axisPointer),"label"),Ht(Hy(e.tooltip).axisPointer,"label")}function nD(e,t){for(var n=t.split(","),r=e,a=0;a<n.length&&(r=r&&r[n[a]],r!=null);a++);return r}function rD(e,t,n,r){for(var a=t.split(","),i=e,o,l=0;l<a.length-1;l++)o=a[l],i[o]==null&&(i[o]={}),i=i[o];(r||i[a[l]]==null)&&(i[a[l]]=n)}function Fy(e){e&&q(aD,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}var aD=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],iD=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],hh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Rl(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<hh.length;n++){var r=hh[n][1],a=hh[n][0];t[r]!=null&&(t[a]=t[r],process.env.NODE_ENV!=="production"&&Jt(r,a))}}function jy(e){e&&e.alignTo==="edge"&&e.margin!=null&&e.edgeDistance==null&&(process.env.NODE_ENV!=="production"&&Jt("label.margin","label.edgeDistance","pie"),e.edgeDistance=e.margin)}function $y(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay,process.env.NODE_ENV!=="production"&&Jt("downplay","blur","sunburst"))}function oD(e){e&&e.focusNodeAdjacency!=null&&(e.emphasis=e.emphasis||{},e.emphasis.focus==null&&(process.env.NODE_ENV!=="production"&&Jt("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),e.emphasis.focus="adjacency"))}function Wy(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&Wy(e[n].children,t)}function Uy(e,t){tD(e,t),e.series=pn(e.series),q(e.series,function(n){if(ze(n)){var r=n.type;if(r==="line")n.clipOverflow!=null&&(n.clip=n.clipOverflow,process.env.NODE_ENV!=="production"&&Jt("clipOverflow","clip","line"));else if(r==="pie"||r==="gauge"){n.clockWise!=null&&(n.clockwise=n.clockWise,process.env.NODE_ENV!=="production"&&Jt("clockWise","clockwise")),jy(n.label);var a=n.data;if(a&&!hn(a))for(var i=0;i<a.length;i++)jy(a[i]);n.hoverOffset!=null&&(n.emphasis=n.emphasis||{},(n.emphasis.scaleSize=null)&&(process.env.NODE_ENV!=="production"&&Jt("hoverOffset","emphasis.scaleSize"),n.emphasis.scaleSize=n.hoverOffset))}else if(r==="gauge"){var o=nD(n,"pointer.color");o!=null&&rD(n,"itemStyle.color",o)}else if(r==="bar"){Rl(n),Rl(n.backgroundStyle),Rl(n.emphasis);var a=n.data;if(a&&!hn(a))for(var i=0;i<a.length;i++)typeof a[i]=="object"&&(Rl(a[i]),Rl(a[i]&&a[i].emphasis))}else if(r==="sunburst"){var l=n.highlightPolicy;l&&(n.emphasis=n.emphasis||{},n.emphasis.focus||(n.emphasis.focus=l,process.env.NODE_ENV!=="production"&&Jt("highlightPolicy","emphasis.focus","sunburst"))),$y(n),Wy(n.data,$y)}else r==="graph"||r==="sankey"?oD(n):r==="map"&&(n.mapType&&!n.map&&(process.env.NODE_ENV!=="production"&&Jt("mapType","map","map"),n.map=n.mapType),n.mapLocation&&(process.env.NODE_ENV!=="production"&&Hr("`mapLocation` is not used anymore."),sn(n,n.mapLocation)));n.hoverAnimation!=null&&(n.emphasis=n.emphasis||{},n.emphasis&&n.emphasis.scale==null&&(process.env.NODE_ENV!=="production"&&Jt("hoverAnimation","emphasis.scale"),n.emphasis.scale=n.hoverAnimation)),Fy(n)}}),e.dataRange&&(e.visualMap=e.dataRange),q(iD,function(n){var r=e[n];r&&(Fe(r)||(r=[r]),q(r,function(a){Fy(a)}))})}function lD(e){var t=Je();e.eachSeries(function(n){var r=n.get("stack");if(r){var a=t.get(r)||t.set(r,[]),i=n.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:n};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;a.push(o)}}),t.each(function(n){n.length!==0&&((n[0].seriesModel.get("stackOrder")||"seriesAsc")==="seriesDesc"&&n.reverse(),q(n,function(r,a){r.data.setCalculationInfo("stackedOnSeries",a>0?n[a-1].seriesModel:null)}),sD(n))})}function sD(e){q(e,function(t,n){var r=[],a=[NaN,NaN],i=[t.stackResultDimension,t.stackedOverDimension],o=t.data,l=t.isStackedByIndex,c=t.seriesModel.get("stackStrategy")||"samesign";o.modify(i,function(u,d,f){var h=o.get(t.stackedDimension,f);if(isNaN(h))return a;var p,g;l?g=o.getRawIndex(f):p=o.get(t.stackedByDimension,f);for(var v=NaN,m=n-1;m>=0;m--){var _=e[m];if(l||(g=_.data.rawIndexOf(_.stackedByDimension,p)),g>=0){var y=_.data.getByRawIndex(_.stackResultDimension,g);if(c==="all"||c==="positive"&&y>0||c==="negative"&&y<0||c==="samesign"&&h>=0&&y>0||c==="samesign"&&h<=0&&y<0){h=kR(h,y),v=y;break}}}return r[0]=h,r[1]=v,r})})}var Rc=(function(){function e(t){this.data=t.data||(t.sourceFormat==="keyedColumns"?{}:[]),this.sourceFormat=t.sourceFormat||"unknown",this.seriesLayoutBy=t.seriesLayoutBy||"column",this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var n=this.dimensionsDefine=t.dimensionsDefine;if(n)for(var r=0;r<n.length;r++){var a=n[r];a.type==null&&Dy(this,r)===An.Must&&(a.type="ordinal")}}return e})();function ph(e){return e instanceof Rc}function gh(e,t,n){n=n||Gy(e);var r=t.seriesLayoutBy,a=uD(e,n,r,t.sourceHeader,t.dimensions);return new Rc({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:ft(t)})}function Yy(e){return new Rc({data:e,sourceFormat:hn(e)?xl:si})}function cD(e){return new Rc({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:ft(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount})}function Gy(e){var t=DB;if(hn(e))t=xl;else if(Fe(e)){e.length===0&&(t=tr);for(var n=0,r=e.length;n<r;n++){var a=e[n];if(a!=null){if(Fe(a)||hn(a)){t=tr;break}else if(ze(a)){t=go;break}}}}else if(ze(e)){for(var i in e)if(ia(e,i)&&Bn(e[i])){t=vo;break}}return t}function uD(e,t,n,r,a){var i,o;if(!e)return{dimensionsDefine:qy(a),startIndex:o,dimensionsDetectedCount:i};if(t==="arrayRows"){var l=e;r==="auto"||r==null?Jy(function(u){u!=null&&u!=="-"&&(Ge(u)?o??=1:o=0)},n,l,10):o=Dt(r)?r:r?1:0,!a&&o===1&&(a=[],Jy(function(u,d){a[d]=u!=null?u+"":""},n,l,1/0)),i=a?a.length:n==="row"?l.length:l[0]?l[0].length:null}else if(t==="objectRows")a||(a=dD(e));else if(t==="keyedColumns")a||(a=[],q(e,function(u,d){a.push(d)}));else if(t==="original"){var c=Qs(e[0]);i=Fe(c)&&c.length||1}else t==="typedArray"&&process.env.NODE_ENV!=="production"&&je(!!a,"dimensions must be given if data is TypedArray.");return{startIndex:o,dimensionsDefine:qy(a),dimensionsDetectedCount:i}}function dD(e){for(var t=0,n;t<e.length&&!(n=e[t++]););if(n)return Vt(n)}function qy(e){if(e){var t=Je();return bt(e,function(n,r){n=ze(n)?n:{name:n};var a={name:n.name,displayName:n.displayName,type:n.type};if(a.name==null)return a;a.name+="",a.displayName==null&&(a.displayName=a.name);var i=t.get(a.name);return i?a.name+="-"+i.count++:t.set(a.name,{count:1}),a})}}function Jy(e,t,n,r){if(t==="row")for(var a=0;a<n.length&&a<r;a++)e(n[a]?n[a][0]:null,a);else for(var i=n[0]||[],a=0;a<i.length&&a<r;a++)e(i[a],a)}function Xy(e){var t=e.sourceFormat;return t==="objectRows"||t==="keyedColumns"}var ci,ui,di,fi,Ky,Zy,Qy=(function(){function e(t,n){var r=ph(t)?t:Yy(t);this._source=r;var a=this._data=r.data,i=r.sourceFormat,o=r.seriesLayoutBy;if(i==="typedArray"){if(process.env.NODE_ENV!=="production"&&n==null)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=n,this._data=a}if(process.env.NODE_ENV!=="production"){var l=fD[Bc(i,o)];l&&l(a,r.dimensionsDefine)}Zy(this,a,r)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(t,n){},e.prototype.appendData=function(t){},e.prototype.clean=function(){},e.protoInitialize=(function(){var t=e.prototype;t.pure=!1,t.persistent=!0})(),e.internalField=(function(){var t;Zy=function(o,l,c){var u=c.sourceFormat,d=c.seriesLayoutBy,f=c.startIndex,h=c.dimensionsDefine,p=Ky[Bc(u,d)];process.env.NODE_ENV!=="production"&&je(p,"Invalide sourceFormat: "+u),Ce(o,p),u==="typedArray"?(o.getItem=n,o.count=a,o.fillStorage=r):(o.getItem=Sn(t_(u,d),null,l,f,h),o.count=Sn(r_(u,d),null,l,f,h))};var n=function(o,l){o=o-this._offset,l=l||[];for(var c=this._data,u=this._dimSize,d=u*o,f=0;f<u;f++)l[f]=c[d+f];return l},r=function(o,l,c,u){for(var d=this._data,f=this._dimSize,h=0;h<f;h++){for(var p=u[h],g=p[0]==null?1/0:p[0],v=p[1]==null?-1/0:p[1],m=l-o,_=c[h],y=0;y<m;y++){var w=d[y*f+h];_[o+y]=w,w<g&&(g=w),w>v&&(v=w)}p[0]=g,p[1]=v}},a=function(){return this._data?this._data.length/this._dimSize:0};Ky=(t={},t[tr+"_"+Ur]={pure:!0,appendData:i},t[tr+"_row"]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[go]={pure:!0,appendData:i},t[vo]={pure:!0,appendData:function(o){var l=this._data;q(o,function(c,u){for(var d=l[u]||(l[u]=[]),f=0;f<(c||[]).length;f++)d.push(c[f])})}},t[si]={appendData:i},t[xl]={persistent:!1,pure:!0,appendData:function(o){process.env.NODE_ENV!=="production"&&je(hn(o),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},t);function i(o){for(var l=0;l<o.length;l++)this._data.push(o[l])}})(),e})(),Mc=function(e){Fe(e)||At("series.data or dataset.source must be an array.")},fD=(ci={},ci[tr+"_"+Ur]=Mc,ci[tr+"_row"]=Mc,ci[go]=Mc,ci[vo]=function(e,t){for(var n=0;n<t.length;n++)t[n].name==null&&At("dimension name must not be null/undefined.")},ci[si]=Mc,ci),e_=function(e,t,n,r){return e[r]},hD=(ui={},ui[tr+"_"+Ur]=function(e,t,n,r){return e[r+t]},ui[tr+"_row"]=function(e,t,n,r,a){r+=t;for(var i=a||[],o=e,l=0;l<o.length;l++){var c=o[l];i[l]=c?c[r]:null}return i},ui[go]=e_,ui[vo]=function(e,t,n,r,a){for(var i=a||[],o=0;o<n.length;o++){var l=n[o].name,c=l!=null?e[l]:null;i[o]=c?c[r]:null}return i},ui[si]=e_,ui);function t_(e,t){var n=hD[Bc(e,t)];return process.env.NODE_ENV!=="production"&&je(n,'Do not support get item on "'+e+'", "'+t+'".'),n}var n_=function(e,t,n){return e.length},pD=(di={},di[tr+"_"+Ur]=function(e,t,n){return Math.max(0,e.length-t)},di[tr+"_row"]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},di[go]=n_,di[vo]=function(e,t,n){var r=n[0].name,a=r!=null?e[r]:null;return a?a.length:0},di[si]=n_,di);function r_(e,t){var n=pD[Bc(e,t)];return process.env.NODE_ENV!=="production"&&je(n,'Do not support count on "'+e+'", "'+t+'".'),n}var vh=function(e,t,n){return e[t]},gD=(fi={},fi[tr]=vh,fi[go]=function(e,t,n){return e[n]},fi[vo]=vh,fi[si]=function(e,t,n){var r=Qs(e);return r instanceof Array?r[t]:r},fi[xl]=vh,fi);function a_(e){var t=gD[e];return process.env.NODE_ENV!=="production"&&je(t,'Do not support get value on "'+e+'".'),t}function Bc(e,t){return e==="arrayRows"?e+"_"+t:e}function Dc(e,t,n){if(e){var r=e.getRawDataItem(t);if(r!=null){var a=e.getStore(),i=a.getSource().sourceFormat;if(n!=null){var o=e.getDimensionIndex(n),l=a.getDimensionProperty(o);return a_(i)(r,o,l)}else{var c=r;return i==="original"&&(c=Qs(r)),c}}}}var vD=/\{@(.+?)\}/g,mD=(function(){function e(){}return e.prototype.getDataParams=function(t,n){var r=this.getData(n),a=this.getRawValue(t,n),i=r.getRawIndex(t),o=r.getName(t),l=r.getRawDataItem(t),c=r.getItemVisual(t,"style"),u=c&&c[r.getItemVisual(t,"drawType")||"fill"],d=c&&c.stroke,f=this.mainType,h=f==="series",p=r.userOutput&&r.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:l,dataType:n,value:a,color:u,borderColor:d,dimensionNames:p?p.fullDimensions:null,encode:p?p.encode:null,$vars:["seriesName","name","value"]}},e.prototype.getFormattedLabel=function(t,n,r,a,i,o){n=n||"normal";var l=this.getData(r),c=this.getDataParams(t,r);if(o&&(c.value=o.interpolatedValue),a!=null&&Fe(c.value)&&(c.value=c.value[a]),i||(i=l.getItemModel(t).get(n==="normal"?["label","formatter"]:[n,"label","formatter"])),ot(i))return c.status=n,c.dimensionIndex=a,i(c);if(Ge(i))return _B(i,c).replace(vD,function(u,d){var f=d.length,h=d;h.charAt(0)==="["&&h.charAt(f-1)==="]"&&(h=+h.slice(1,f-1),process.env.NODE_ENV!=="production"&&isNaN(h)&&At("Invalide label formatter: @"+d+", only support @[0], @[1], @[2], ..."));var p=Dc(l,t,h);if(o&&Fe(o.interpolatedValue)){var g=l.getDimensionIndex(h);g>=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})},e.prototype.getRawValue=function(t,n){return Dc(this.getData(n),t)},e.prototype.formatTooltip=function(t,n,r){},e})();function Ml(e){return new yD(e)}var yD=(function(){function e(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return e.prototype.perform=function(t){var n=this._upstream,r=t&&t.skip;if(this._dirty&&n){var a=this.context;a.data=a.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!r&&(i=this._plan(this.context));var o=d(this._modBy),l=this._modDataCount||0,c=d(t&&t.modBy),u=t&&t.modDataCount||0;(o!==c||l!==u)&&(i="reset");function d(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||i==="reset")&&(this._dirty=!1,f=this._doReset(r)),this._modBy=c,this._modDataCount=u;var h=t&&t.step;if(n?(process.env.NODE_ENV!=="production"&&je(n._outputDueEnd!=null),this._dueEnd=n._outputDueEnd):(process.env.NODE_ENV!=="production"&&je(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var p=this._dueIndex,g=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!r&&(f||p<g)){var v=this._progress;if(Fe(v))for(var m=0;m<v.length;m++)this._doProgress(v[m],p,g,c,u);else this._doProgress(v,p,g,c,u)}this._dueIndex=g;var _=this._settedOutputEnd!=null?this._settedOutputEnd:g;process.env.NODE_ENV!=="production"&&je(_>=this._outputDueEnd),this._outputDueEnd=_}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(t,n,r,a,i){i_.reset(n,r,a,i),this._callingProgress=t,this._callingProgress({start:n,end:r,count:r-n,next:i_.next},this.context)},e.prototype._doReset=function(t){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var n,r;!t&&this._reset&&(n=this._reset(this.context),n&&n.progress&&(r=n.forceFirstProgress,n=n.progress),Fe(n)&&!n.length&&(n=null)),this._progress=n,this._modBy=this._modDataCount=null;var a=this._downstream;return a&&a.dirty(),r},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(t){process.env.NODE_ENV!=="production"&&je(t&&!t._disposed&&t!==this),(this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},e.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t},e})(),i_=(function(){var e,t,n,r,a,i={reset:function(c,u,d,f){t=c,e=u,n=d,r=f,a=Math.ceil(r/n),i.next=n>1&&r>0?l:o}};return i;function o(){return t<e?t++:null}function l(){var c=t%a*n+Math.ceil(t/a),u=t>=e?null:c<r?c:t;return t++,u}})();function Ac(e,t){var n=t&&t.type;return n==="ordinal"?e:(n==="time"&&!Dt(e)&&e!=null&&e!=="-"&&(e=+j0(e)),e==null||e===""?NaN:Number(e))}var l4=Je({number:function(e){return parseFloat(e)},time:function(e){return+j0(e)},trim:function(e){return Ge(e)?aa(e):e}}),_D={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},s4=(function(){function e(t,n){if(!Dt(n)){var r="";process.env.NODE_ENV!=="production"&&(r='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),xn(r)}this._opFn=_D[t],this._rvalFloat=Ga(n)}return e.prototype.evaluate=function(t){return Dt(t)?this._opFn(t,this._rvalFloat):this._opFn(Ga(t),this._rvalFloat)},e})(),c4=(function(){function e(t,n){var r=t==="desc";this._resultLT=r?1:-1,n==null&&(n=r?"min":"max"),this._incomparable=n==="min"?-1/0:1/0}return e.prototype.evaluate=function(t,n){var r=Dt(t)?t:Ga(t),a=Dt(n)?n:Ga(n),i=isNaN(r),o=isNaN(a);if(i&&(r=this._incomparable),o&&(a=this._incomparable),i&&o){var l=Ge(t),c=Ge(n);l&&(r=c?t:0),c&&(a=l?n:0)}return r<a?this._resultLT:r>a?-this._resultLT:0},e})(),u4=(function(){function e(t,n){this._rval=n,this._isEQ=t,this._rvalTypeof=typeof n,this._rvalFloat=Ga(n)}return e.prototype.evaluate=function(t){var n=t===this._rval;if(!n){var r=typeof t;r!==this._rvalTypeof&&(r==="number"||this._rvalTypeof==="number")&&(n=Ga(t)===this._rvalFloat)}return this._isEQ?n:!n},e})(),wD=(function(){function e(){}return e.prototype.getRawData=function(){throw new Error("not supported")},e.prototype.getRawDataItem=function(t){throw new Error("not supported")},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(t){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(t,n){},e.prototype.retrieveValueFromItem=function(t,n){},e.prototype.convertValue=function(t,n){return Ac(t,n)},e})();function bD(e,t){var n=new wD,r=e.data,a=n.sourceFormat=e.sourceFormat,i=e.startIndex,o="";e.seriesLayoutBy!=="column"&&(process.env.NODE_ENV!=="production"&&(o='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),xn(o));var l=[],c={},u=e.dimensionsDefine;if(u)q(u,function(g,v){var m=g.name,_={index:v,name:m,displayName:g.displayName};if(l.push(_),m!=null){var y="";ia(c,m)&&(process.env.NODE_ENV!=="production"&&(y='dimension name "'+m+'" duplicated.'),xn(y)),c[m]=_}});else for(var d=0;d<e.dimensionsDetectedCount;d++)l.push({index:d});var f=t_(a,Ur);t.__isBuiltIn&&(n.getRawDataItem=function(g){return f(r,i,l,g)},n.getRawData=Sn(CD,null,e)),n.cloneRawData=Sn(SD,null,e),n.count=Sn(r_(a,Ur),null,r,i,l);var h=a_(a);n.retrieveValue=function(g,v){return p(f(r,i,l,g),v)};var p=n.retrieveValueFromItem=function(g,v){if(g!=null){var m=l[v];if(m)return h(g,v,m.name)}};return n.getDimensionInfo=Sn(xD,null,l,c),n.cloneAllDimensionInfo=Sn(ED,null,l),n}function CD(e){var t=e.sourceFormat;if(!mh(t)){var n="";process.env.NODE_ENV!=="production"&&(n="`getRawData` is not supported in source format "+t),xn(n)}return e.data}function SD(e){var t=e.sourceFormat,n=e.data;if(!mh(t)){var r="";process.env.NODE_ENV!=="production"&&(r="`cloneRawData` is not supported in source format "+t),xn(r)}if(t==="arrayRows"){for(var a=[],i=0,o=n.length;i<o;i++)a.push(n[i].slice());return a}else if(t==="objectRows"){for(var a=[],i=0,o=n.length;i<o;i++)a.push(Ce({},n[i]));return a}}function xD(e,t,n){if(n!=null){if(Dt(n)||!isNaN(n)&&!ia(t,n))return e[n];if(ia(t,n))return t[n]}}function ED(e){return ft(e)}var o_=Je();function kD(e){e=ft(e);var t=e.type,n="";t||(process.env.NODE_ENV!=="production"&&(n="Must have a `type` when `registerTransform`."),xn(n));var r=t.split(":");r.length!==2&&(process.env.NODE_ENV!=="production"&&(n='Name must include namespace like "ns:regression".'),xn(n));var a=!1;r[0]==="echarts"&&(t=r[1],a=!0),e.__isBuiltIn=a,o_.set(t,e)}function TD(e,t,n){var r=pn(e),a=r.length,i="";a||(process.env.NODE_ENV!=="production"&&(i="If `transform` declared, it should at least contain one transform."),xn(i));for(var o=0,l=a;o<l;o++){var c=r[o];t=RD(c,t,n,a===1?null:o),o!==l-1&&(t.length=Math.max(t.length,1))}return t}function RD(e,t,n,r){var a="";t.length||(process.env.NODE_ENV!=="production"&&(a="Must have at least one upstream dataset."),xn(a)),ze(e)||(process.env.NODE_ENV!=="production"&&(a="transform declaration must be an object rather than "+typeof e+"."),xn(a));var i=e.type,o=o_.get(i);o||(process.env.NODE_ENV!=="production"&&(a='Can not find transform on type "'+i+'".'),xn(a));var l=bt(t,function(u){return bD(u,o)}),c=pn(o.transform({upstream:l[0],upstreamList:l,config:ft(e.config)}));return process.env.NODE_ENV!=="production"&&e.print&&DR(bt(c,function(u){var d=r!=null?" === pipe index: "+r:"";return["=== dataset index: "+n.datasetIndex+d+" ===","- transform result data:",df(u.data),"- transform result dimensions:",df(u.dimensions)].join(`
|
|
12
|
+
`)}).join(`
|
|
13
|
+
`)),bt(c,function(u,d){var f="";ze(u)||(process.env.NODE_ENV!=="production"&&(f="A transform should not return some empty results."),xn(f)),u.data||(process.env.NODE_ENV!=="production"&&(f="Transform result data should be not be null or undefined"),xn(f)),mh(Gy(u.data))||(process.env.NODE_ENV!=="production"&&(f="Transform result data should be array rows or object rows."),xn(f));var h,p=t[0];if(p&&d===0&&!u.dimensions){var g=p.startIndex;g&&(u.data=p.data.slice(0,g).concat(u.data)),h={seriesLayoutBy:Ur,sourceHeader:g,dimensions:p.metaRawOption.dimensions}}else h={seriesLayoutBy:Ur,sourceHeader:0,dimensions:u.dimensions};return gh(u.data,h,null)})}function mh(e){return e==="arrayRows"||e==="objectRows"}var Pc="undefined",MD=typeof Uint32Array===Pc?Array:Uint32Array,BD=typeof Uint16Array===Pc?Array:Uint16Array,l_=typeof Int32Array===Pc?Array:Int32Array,s_=typeof Float64Array===Pc?Array:Float64Array,c_={float:s_,int:l_,ordinal:Array,number:Array,time:s_},yh;function mo(e){return e>65535?MD:BD}function yo(){return[1/0,-1/0]}function DD(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function u_(e,t,n,r,a){var i=c_[n||"float"];if(a){var o=e[t],l=o&&o.length;if(l!==r){for(var c=new i(r),u=0;u<l;u++)c[u]=o[u];e[t]=c}}else e[t]=new i(r)}var _h=(function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=Je()}return e.prototype.initData=function(t,n,r){process.env.NODE_ENV!=="production"&&je(ot(t.getItem)&&ot(t.count),"Invalid data provider."),this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var a=t.getSource(),i=this.defaultDimValueGetter=yh[a.sourceFormat];this._dimValueGetter=r||i,this._rawExtent=[];var o=Xy(a);this._dimensions=bt(n,function(l){return process.env.NODE_ENV!=="production"&&o&&je(l.property!=null),{type:l.type,property:l.property}}),this._initDataFromProvider(0,t.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(t,n){var r=this._calcDimNameToIdx,a=this._dimensions,i=r.get(t);if(i!=null){if(a[i].type===n)return i}else i=a.length;return a[i]={type:n},r.set(t,i),this._chunks[i]=new c_[n||"float"](this._rawCount),this._rawExtent[i]=yo(),i},e.prototype.collectOrdinalMeta=function(t,n){var r=this._chunks[t],a=this._dimensions[t],i=this._rawExtent,o=a.ordinalOffset||0,l=r.length;o===0&&(i[t]=yo());for(var c=i[t],u=o;u<l;u++){var d=r[u]=n.parseAndCollect(r[u]);isNaN(d)||(c[0]=Math.min(d,c[0]),c[1]=Math.max(d,c[1]))}a.ordinalMeta=n,a.ordinalOffset=l,a.type="ordinal"},e.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},e.prototype.getDimensionProperty=function(t){var n=this._dimensions[t];return n&&n.property},e.prototype.appendData=function(t){process.env.NODE_ENV!=="production"&&je(!this._indices,"appendData can only be called on raw data.");var n=this._provider,r=this.count();n.appendData(t);var a=n.count();return n.persistent||(a+=r),r<a&&this._initDataFromProvider(r,a,!0),[r,a]},e.prototype.appendValues=function(t,n){for(var r=this._chunks,a=this._dimensions,i=a.length,o=this._rawExtent,l=this.count(),c=l+Math.max(t.length,n||0),u=0;u<i;u++){var d=a[u];u_(r,u,d.type,c,!0)}for(var f=[],h=l;h<c;h++)for(var p=h-l,g=0;g<i;g++){var d=a[g],v=yh.arrayRows.call(this,t[p]||f,d.property,p,g);r[g][h]=v;var m=o[g];v<m[0]&&(m[0]=v),v>m[1]&&(m[1]=v)}return this._rawCount=this._count=c,{start:l,end:c}},e.prototype._initDataFromProvider=function(t,n,r){for(var a=this._provider,i=this._chunks,o=this._dimensions,l=o.length,c=this._rawExtent,u=bt(o,function(y){return y.property}),d=0;d<l;d++){var f=o[d];c[d]||(c[d]=yo()),u_(i,d,f.type,n,r)}if(a.fillStorage)a.fillStorage(t,n,i,c);else for(var h=[],p=t;p<n;p++){h=a.getItem(p,h);for(var g=0;g<l;g++){var v=i[g],m=this._dimValueGetter(h,u[g],p,g);v[p]=m;var _=c[g];m<_[0]&&(_[0]=m),m>_[1]&&(_[1]=m)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=n,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(t,n){if(!(n>=0&&n<this._count))return NaN;var r=this._chunks[t];return r?r[this.getRawIndex(n)]:NaN},e.prototype.getValues=function(t,n){var r=[],a=[];if(n==null){n=t,t=[];for(var i=0;i<this._dimensions.length;i++)a.push(i)}else a=t;for(var i=0,o=a.length;i<o;i++)r.push(this.get(a[i],n));return r},e.prototype.getByRawIndex=function(t,n){if(!(n>=0&&n<this._rawCount))return NaN;var r=this._chunks[t];return r?r[n]:NaN},e.prototype.getSum=function(t){var n=this._chunks[t],r=0;if(n)for(var a=0,i=this.count();a<i;a++){var o=this.get(t,a);isNaN(o)||(r+=o)}return r},e.prototype.getMedian=function(t){var n=[];this.each([t],function(i){isNaN(i)||n.push(i)});var r=n.sort(function(i,o){return i-o}),a=this.count();return a===0?0:a%2===1?r[(a-1)/2]:(r[a/2]+r[a/2-1])/2},e.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var n=this._indices,r=n[t];if(r!=null&&r<this._count&&r===t)return t;for(var a=0,i=this._count-1;a<=i;){var o=(a+i)/2|0;if(n[o]<t)a=o+1;else if(n[o]>t)i=o-1;else return o}return-1},e.prototype.getIndices=function(){var t,n=this._indices;if(n){var r=n.constructor,a=this._count;if(r===Array){t=new r(a);for(var i=0;i<a;i++)t[i]=n[i]}else t=new r(n.buffer,0,a)}else{var r=mo(this._rawCount);t=new r(this.count());for(var i=0;i<t.length;i++)t[i]=i}return t},e.prototype.filter=function(t,n){if(!this._count)return this;for(var r=this.clone(),a=r.count(),i=new(mo(r._rawCount))(a),o=[],l=t.length,c=0,u=t[0],d=r._chunks,f=0;f<a;f++){var h=void 0,p=r.getRawIndex(f);if(l===0)h=n(f);else if(l===1){var g=d[u][p];h=n(g,f)}else{for(var v=0;v<l;v++)o[v]=d[t[v]][p];o[v]=f,h=n.apply(null,o)}h&&(i[c++]=p)}return c<a&&(r._indices=i),r._count=c,r._extent=[],r._updateGetRawIdx(),r},e.prototype.selectRange=function(t){var n=this.clone(),r=n._count;if(!r)return this;var a=Vt(t),i=a.length;if(!i)return this;var o=n.count(),l=new(mo(n._rawCount))(o),c=0,u=a[0],d=t[u][0],f=t[u][1],h=n._chunks,p=!1;if(!n._indices){var g=0;if(i===1){for(var v=h[a[0]],m=0;m<r;m++){var _=v[m];(_>=d&&_<=f||isNaN(_))&&(l[c++]=g),g++}p=!0}else if(i===2){for(var v=h[a[0]],y=h[a[1]],w=t[a[1]][0],C=t[a[1]][1],m=0;m<r;m++){var _=v[m],S=y[m];(_>=d&&_<=f||isNaN(_))&&(S>=w&&S<=C||isNaN(S))&&(l[c++]=g),g++}p=!0}}if(!p)if(i===1)for(var m=0;m<o;m++){var b=n.getRawIndex(m),_=h[a[0]][b];(_>=d&&_<=f||isNaN(_))&&(l[c++]=b)}else for(var m=0;m<o;m++){for(var x=!0,b=n.getRawIndex(m),E=0;E<i;E++){var k=a[E],_=h[k][b];(_<t[k][0]||_>t[k][1])&&(x=!1)}x&&(l[c++]=n.getRawIndex(m))}return c<o&&(n._indices=l),n._count=c,n._extent=[],n._updateGetRawIdx(),n},e.prototype.map=function(t,n){var r=this.clone(t);return this._updateDims(r,t,n),r},e.prototype.modify=function(t,n){this._updateDims(this,t,n)},e.prototype._updateDims=function(t,n,r){for(var a=t._chunks,i=[],o=n.length,l=t.count(),c=[],u=t._rawExtent,d=0;d<n.length;d++)u[n[d]]=yo();for(var f=0;f<l;f++){for(var h=t.getRawIndex(f),p=0;p<o;p++)c[p]=a[n[p]][h];c[o]=f;var g=r&&r.apply(null,c);if(g!=null){typeof g!="object"&&(i[0]=g,g=i);for(var d=0;d<g.length;d++){var v=n[d],m=g[d],_=u[v],y=a[v];y&&(y[h]=m),m<_[0]&&(_[0]=m),m>_[1]&&(_[1]=m)}}}},e.prototype.lttbDownSample=function(t,n){var r=this.clone([t],!0),a=r._chunks[t],i=this.count(),o=0,l=Math.floor(1/n),c=this.getRawIndex(0),u,d,f,h=new(mo(this._rawCount))(Math.min((Math.ceil(i/l)+2)*2,i));h[o++]=c;for(var p=1;p<i-1;p+=l){for(var g=Math.min(p+l,i-1),v=Math.min(p+l*2,i),m=(v+g)/2,_=0,y=g;y<v;y++){var w=this.getRawIndex(y),C=a[w];isNaN(C)||(_+=C)}_/=v-g;var S=p,b=Math.min(p+l,i),x=p-1,E=a[c];u=-1,f=S;for(var k=-1,T=0,y=S;y<b;y++){var w=this.getRawIndex(y),C=a[w];if(isNaN(C)){T++,k<0&&(k=w);continue}d=Math.abs((x-m)*(C-E)-(x-y)*(_-E)),d>u&&(u=d,f=w)}T>0&&T<b-S&&(h[o++]=Math.min(k,f),f=Math.max(k,f)),h[o++]=f,c=f}return h[o++]=this.getRawIndex(i-1),r._count=o,r._indices=h,r.getRawIndex=this._getRawIdx,r},e.prototype.minmaxDownSample=function(t,n){for(var r=this.clone([t],!0),a=r._chunks,i=Math.floor(1/n),o=a[t],l=this.count(),c=new(mo(this._rawCount))(Math.ceil(l/i)*2),u=0,d=0;d<l;d+=i){var f=d,h=o[this.getRawIndex(f)],p=d,g=o[this.getRawIndex(p)],v=i;d+i>l&&(v=l-d);for(var m=0;m<v;m++){var _=o[this.getRawIndex(d+m)];_<h&&(h=_,f=d+m),_>g&&(g=_,p=d+m)}var y=this.getRawIndex(f),w=this.getRawIndex(p);f<p?(c[u++]=y,c[u++]=w):(c[u++]=w,c[u++]=y)}return r._count=u,r._indices=c,r._updateGetRawIdx(),r},e.prototype.downSample=function(t,n,r,a){for(var i=this.clone([t],!0),o=i._chunks,l=[],c=Math.floor(1/n),u=o[t],d=this.count(),f=i._rawExtent[t]=yo(),h=new(mo(this._rawCount))(Math.ceil(d/c)),p=0,g=0;g<d;g+=c){c>d-g&&(c=d-g,l.length=c);for(var v=0;v<c;v++)l[v]=u[this.getRawIndex(g+v)];var m=r(l),_=this.getRawIndex(Math.min(g+a(l,m)||0,d-1));u[_]=m,m<f[0]&&(f[0]=m),m>f[1]&&(f[1]=m),h[p++]=_}return i._count=p,i._indices=h,i._updateGetRawIdx(),i},e.prototype.each=function(t,n){if(this._count)for(var r=t.length,a=this._chunks,i=0,o=this.count();i<o;i++){var l=this.getRawIndex(i);switch(r){case 0:n(i);break;case 1:n(a[t[0]][l],i);break;case 2:n(a[t[0]][l],a[t[1]][l],i);break;default:for(var c=0,u=[];c<r;c++)u[c]=a[t[c]][l];u[c]=i,n.apply(null,u)}}},e.prototype.getDataExtent=function(t){var n=this._chunks[t],r=yo();if(!n)return r;var a=this.count(),i=!this._indices,o;if(i)return this._rawExtent[t].slice();if(o=this._extent[t],o)return o.slice();o=r;for(var l=o[0],c=o[1],u=0;u<a;u++){var d=n[this.getRawIndex(u)];d<l&&(l=d),d>c&&(c=d)}return o=[l,c],this._extent[t]=o,o},e.prototype.getRawDataItem=function(t){var n=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(n);for(var r=[],a=this._chunks,i=0;i<a.length;i++)r.push(a[i][n]);return r},e.prototype.clone=function(t,n){var r=new e,a=this._chunks,i=t&&Fi(t,function(l,c){return l[c]=!0,l},{});if(i)for(var o=0;o<a.length;o++)r._chunks[o]=i[o]?DD(a[o]):a[o];else r._chunks=a;return this._copyCommonProps(r),n||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},e.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=ft(this._extent),t._rawExtent=ft(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,n=void 0;if(t===Array){var r=this._indices.length;n=new t(r);for(var a=0;a<r;a++)n[a]=this._indices[a]}else n=new t(this._indices);return n}return null},e.prototype._getRawIdxIdentity=function(t){return t},e.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=(function(){function t(n,r,a,i){return Ac(n[i],this._dimensions[i])}yh={arrayRows:t,objectRows:function(n,r,a,i){return Ac(n[r],this._dimensions[i])},keyedColumns:t,original:function(n,r,a,i){var o=n&&(n.value==null?n:n.value);return Ac(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(n,r,a,i){return n[i]}}})(),e})(),d_=(function(){function e(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(t,n){this._sourceList=t,this._upstreamSignList=n,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var t=this._sourceHost,n=this._getUpstreamSourceManagers(),r=!!n.length,a,i;if(Bl(t)){var o=t,l=void 0,c=void 0,u=void 0;if(r){var d=n[0];d.prepareSource(),u=d.getSource(),l=u.data,c=u.sourceFormat,i=[d._getVersionSign()]}else l=o.get("data",!0),c=hn(l)?xl:si,i=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},p=qe(f.seriesLayoutBy,h.seriesLayoutBy)||null,g=qe(f.sourceHeader,h.sourceHeader),v=qe(f.dimensions,h.dimensions);a=p!==h.seriesLayoutBy||!!g!=!!h.sourceHeader||v?[gh(l,{seriesLayoutBy:p,sourceHeader:g,dimensions:v},c)]:[]}else{var m=t;if(r){var _=this._applyTransform(n);a=_.sourceList,i=_.upstreamSignList}else a=[gh(m.get("source",!0),this._getSourceMetaRawOption(),null)],i=[]}process.env.NODE_ENV!=="production"&&je(a&&i),this._setLocalSource(a,i)},e.prototype._applyTransform=function(t){var n=this._sourceHost,r=n.get("transform",!0),a=n.get("fromTransformResult",!0);if(process.env.NODE_ENV!=="production"&&je(a!=null||r!=null),a!=null){var i="";t.length!==1&&(process.env.NODE_ENV!=="production"&&(i="When using `fromTransformResult`, there should be only one upstream dataset"),h_(i))}var o,l=[],c=[];return q(t,function(u){u.prepareSource();var d=u.getSource(a||0),f="";a!=null&&!d&&(process.env.NODE_ENV!=="production"&&(f="Can not retrieve result by `fromTransformResult`: "+a),h_(f)),l.push(d),c.push(u._getVersionSign())}),r?o=TD(r,l,{datasetIndex:n.componentIndex}):a!=null&&(o=[cD(l[0])]),{sourceList:o,upstreamSignList:c}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),n=0;n<t.length;n++){var r=t[n];if(r._isDirty()||this._upstreamSignList[n]!==r._getVersionSign())return!0}},e.prototype.getSource=function(t){t=t||0;var n=this._sourceList[t];if(!n){var r=this._getUpstreamSourceManagers();return r[0]&&r[0].getSource(t)}return n},e.prototype.getSharedDataStore=function(t){process.env.NODE_ENV!=="production"&&je(Bl(this._sourceHost),"Can only call getDataStore on series source manager.");var n=t.makeStoreSchema();return this._innerGetDataStore(n.dimensions,t.source,n.hash)},e.prototype._innerGetDataStore=function(t,n,r){var a=0,i=this._storeList,o=i[a];o||(o=i[a]={});var l=o[r];if(!l){var c=this._getUpstreamSourceManagers()[0];Bl(this._sourceHost)&&c?l=c._innerGetDataStore(t,n,r):(l=new _h,l.initData(new Qy(n,t.length),t)),o[r]=l}return l},e.prototype._getUpstreamSourceManagers=function(){var t=this._sourceHost;if(Bl(t)){var n=NB(t);return n?[n.getSourceManager()]:[]}else return bt(LB(t),function(r){return r.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var t=this._sourceHost,n,r,a;if(Bl(t))n=t.get("seriesLayoutBy",!0),r=t.get("sourceHeader",!0),a=t.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=t;n=i.get("seriesLayoutBy",!0),r=i.get("sourceHeader",!0),a=i.get("dimensions",!0)}return{seriesLayoutBy:n,sourceHeader:r,dimensions:a}},e})();function f_(e){e.option.transform&&Ds(e.option.transform)}function Bl(e){return e.mainType==="series"}function h_(e){throw new Error(e)}function wh(e,t){return t.type=e,t}function AD(e,t){var n=e.getData().getItemVisual(t,"style")[e.visualDrawType];return CB(n)}var d4=(function(){function e(){this.richTextStyles={},this._nextStyleNameId=$0()}return e.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(t,n,r){var a=r==="richText"?this._generateStyleName():null,i=wB({color:n,type:t,renderMode:r,markerId:a});return Ge(i)?i:(process.env.NODE_ENV!=="production"&&je(a),this.richTextStyles[a]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(t,n){var r={};Fe(n)?q(n,function(i){return Ce(r,i)}):Ce(r,n);var a=this._generateStyleName();return this.richTextStyles[a]=r,"{"+a+"|"+t+"}"},e})();function PD(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,a=t.getData(),i=a.mapDimensionsAll("defaultedTooltip"),o=i.length,l=t.getRawValue(n),c=Fe(l),u=AD(t,n),d,f,h,p;if(o>1||c&&!o){var g=ND(l,t,n,i,u);d=g.inlineValues,f=g.inlineValueTypes,h=g.blocks,p=g.inlineValues[0]}else if(o){var v=a.getDimensionInfo(i[0]);p=d=Dc(a,n,i[0]),f=v.type}else p=d=c?l[0]:l;var m=em(t),_=m&&t.name||"",y=a.getName(n),w=r?_:y;return wh("section",{header:_,noHeader:r||!m,sortParam:p,blocks:[wh("nameValue",{markerType:"item",markerColor:u,name:w,noName:!aa(w),value:d,valueType:f,dataIndex:n})].concat(h||[])})}function ND(e,t,n,r,a){var i=t.getData(),o=Fi(e,function(f,h,p){var g=i.getDimensionInfo(p);return f=f||g&&g.tooltip!==!1&&g.displayName!=null},!1),l=[],c=[],u=[];r.length?q(r,function(f){d(Dc(i,n,f),f)}):q(e,d);function d(f,h){var p=i.getDimensionInfo(h);!p||p.otherDims.tooltip===!1||(o?u.push(wh("nameValue",{markerType:"subItem",markerColor:a,name:p.displayName,value:f,valueType:p.type})):(l.push(f),c.push(p.type)))}return{inlineValues:l,inlineValueTypes:c,blocks:u}}var fa=nn();function Nc(e,t){return e.getName(t)||e.getId(t)}var f4="__universalTransitionEnabled",Gr=(function(e){et(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._selectedDataIndicesMap={},n}return t.prototype.init=function(n,r,a){this.seriesIndex=this.componentIndex,this.dataTask=Ml({count:ID,reset:OD}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(n,a),(fa(this).sourceManager=new d_(this)).prepareSource();var i=this.getInitialData(n,a);g_(i,this),this.dataTask.context.data=i,process.env.NODE_ENV!=="production"&&je(i,"getInitialData returned invalid data."),fa(this).dataBeforeProcessed=i,p_(this),this._initSelectedMapFromData(i)},t.prototype.mergeDefaultAndTheme=function(n,r){var a=xc(this),i=a?Ty(n):{},o=this.subType;yt.hasClass(o)&&(o+="Series"),jt(n,r.getTheme().get(this.subType)),jt(n,this.getDefaultOption()),J0(n,"label",["show"]),this.fillDataTextStyle(n.data),a&&Ec(n,i,a)},t.prototype.mergeOption=function(n,r){n=jt(this.option,n,!0),this.fillDataTextStyle(n.data);var a=xc(this);a&&Ec(this.option,n,a);var i=fa(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(n,r);g_(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,fa(this).dataBeforeProcessed=o,p_(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(n){if(n&&!hn(n))for(var r=["show"],a=0;a<n.length;a++)n[a]&&n[a].label&&J0(n[a],"label",r)},t.prototype.getInitialData=function(n,r){},t.prototype.appendData=function(n){this.getRawData().appendData(n.data)},t.prototype.getData=function(n){var r=bh(this);if(r){var a=r.context.data;return n==null||!a.getLinkedData?a:a.getLinkedData(n)}else return fa(this).data},t.prototype.getAllData=function(){var n=this.getData();return n&&n.getLinkedDataAll?n.getLinkedDataAll():[{data:n}]},t.prototype.setData=function(n){var r=bh(this);if(r){var a=r.context;a.outputData=n,r!==this.dataTask&&(a.data=n)}fa(this).data=n},t.prototype.getEncode=function(){var n=this.get("encode",!0);if(n)return Je(n)},t.prototype.getSourceManager=function(){return fa(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return fa(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get("colorBy")||"series"},t.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},t.prototype.getBaseAxis=function(){var n=this.coordinateSystem;return n&&n.getBaseAxis&&n.getBaseAxis()},t.prototype.indicesOfNearest=function(n,r,a,i){var o=this.getData(),l=this.coordinateSystem,c=l&&l.getAxis(n);if(!l||!c)return[];var u=c.dataToCoord(a);i==null&&(i=1/0);var d=[],f=1/0,h=-1,p=0;return o.each(r,function(g,v){var m=u-c.dataToCoord(g),_=Math.abs(m);_<=i&&((_<f||_===f&&m>=0&&h<0)&&(f=_,h=m,p=0),m===h&&(d[p++]=v))}),d.length=p,d},t.prototype.formatTooltip=function(n,r,a){return PD({series:this,dataIndex:n,multipleSeries:r})},t.prototype.isAnimationEnabled=function(){var n=this.ecModel;if(it.node&&!(n&&n.ssr))return!1;var r=this.getShallow("animation");return r&&this.getData().count()>this.getShallow("animationThreshold")&&(r=!1),!!r},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(n,r,a){var i=this.ecModel,o=ch.prototype.getColorFromPalette.call(this,n,r,a);return o||(o=i.getColorFromPalette(n,r,a)),o},t.prototype.coordDimToDataDim=function(n){return this.getRawData().mapDimensionsAll(n)},t.prototype.getProgressive=function(){return this.get("progressive")},t.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},t.prototype.select=function(n,r){this._innerSelect(this.getData(r),n)},t.prototype.unselect=function(n,r){var a=this.option.selectedMap;if(a){var i=this.option.selectedMode,o=this.getData(r);if(i==="series"||a==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var l=0;l<n.length;l++){var c=n[l],u=Nc(o,c);a[u]=!1,this._selectedDataIndicesMap[u]=-1}}},t.prototype.toggleSelect=function(n,r){for(var a=[],i=0;i<n.length;i++)a[0]=n[i],this.isSelected(n[i],r)?this.unselect(a,r):this.select(a,r)},t.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var n=this._selectedDataIndicesMap,r=Vt(n),a=[],i=0;i<r.length;i++){var o=n[r[i]];o>=0&&a.push(o)}return a},t.prototype.isSelected=function(n,r){var a=this.option.selectedMap;if(!a)return!1;var i=this.getData(r);return(a==="all"||a[Nc(i,n)])&&!i.getItemModel(n).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var n=this.option.universalTransition;return n?n===!0?!0:n&&n.enabled:!1},t.prototype._innerSelect=function(n,r){var a,i,o=this.option,l=o.selectedMode,c=r.length;if(!(!l||!c)){if(l==="series")o.selectedMap="all";else if(l==="multiple"){ze(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,d=0;d<c;d++){var f=r[d],h=Nc(n,f);u[h]=!0,this._selectedDataIndicesMap[h]=n.getRawIndex(f)}}else if(l==="single"||l===!0){var p=r[c-1],h=Nc(n,p);o.selectedMap=(a={},a[h]=!0,a),this._selectedDataIndicesMap=(i={},i[h]=n.getRawIndex(p),i)}}},t.prototype._initSelectedMapFromData=function(n){if(!this.option.selectedMap){var r=[];n.hasItemOption&&n.each(function(a){var i=n.getRawDataItem(a);i&&i.selected&&r.push(a)}),r.length>0&&this._innerSelect(n,r)}},t.registerClass=function(n){return yt.registerClass(n)},t.protoInitialize=(function(){var n=t.prototype;n.type="series.__base__",n.seriesIndex=0,n.ignoreStyleOnData=!1,n.hasSymbolVisual=!1,n.defaultSymbol="circle",n.visualStyleAccessPath="itemStyle",n.visualDrawType="fill"})(),t})(yt);Lr(Gr,mD),Lr(Gr,ch),rm(Gr,yt);function p_(e){var t=e.name;em(e)||(e.name=LD(e)||t)}function LD(e){var t=e.getRawData(),n=t.mapDimensionsAll("seriesName"),r=[];return q(n,function(a){var i=t.getDimensionInfo(a);i.displayName&&r.push(i.displayName)}),r.join(" ")}function ID(e){return e.model.getRawData().count()}function OD(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),VD}function VD(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function g_(e,t){q(Zk(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,hd(zD,t))})}function zD(e,t){var n=bh(e);return n&&n.setOutputEnd((t||this).count()),t}function bh(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var a=r.agentStubMap;a&&(r=a.get(e.uid))}return r}}var _o=(function(){function e(){this.group=new fl,this.uid=_c("viewComponent")}return e.prototype.init=function(t,n){},e.prototype.render=function(t,n,r,a){},e.prototype.dispose=function(t,n){},e.prototype.updateView=function(t,n,r,a){},e.prototype.updateLayout=function(t,n,r,a){},e.prototype.updateVisual=function(t,n,r,a){},e.prototype.toggleBlurSeries=function(t,n,r){},e.prototype.eachRendered=function(t){var n=this.group;n&&n.traverse(t)},e})();pf(_o),gf(_o);function HD(){var e=nn();return function(t){var n=e(t),r=t.pipelineContext,a=!!n.large,i=!!n.progressiveRender,o=n.large=!!(r&&r.large),l=n.progressiveRender=!!(r&&r.progressiveRender);return(a!==o||i!==l)&&"reset"}}var v_=nn(),FD=HD(),qr=(function(){function e(){this.group=new fl,this.uid=_c("viewChart"),this.renderTask=Ml({plan:jD,reset:$D}),this.renderTask.context={view:this}}return e.prototype.init=function(t,n){},e.prototype.render=function(t,n,r,a){if(process.env.NODE_ENV!=="production")throw new Error("render method must been implemented")},e.prototype.highlight=function(t,n,r,a){var i=t.getData(a&&a.dataType);if(!i){process.env.NODE_ENV!=="production"&&At("Unknown dataType "+a.dataType);return}y_(i,a,"emphasis")},e.prototype.downplay=function(t,n,r,a){var i=t.getData(a&&a.dataType);if(!i){process.env.NODE_ENV!=="production"&&At("Unknown dataType "+a.dataType);return}y_(i,a,"normal")},e.prototype.remove=function(t,n){this.group.removeAll()},e.prototype.dispose=function(t,n){},e.prototype.updateView=function(t,n,r,a){this.render(t,n,r,a)},e.prototype.updateLayout=function(t,n,r,a){this.render(t,n,r,a)},e.prototype.updateVisual=function(t,n,r,a){this.render(t,n,r,a)},e.prototype.eachRendered=function(t){YM(this.group,t)},e.markUpdateMethod=function(t,n){v_(t).updateMethod=n},e.protoInitialize=(function(){var t=e.prototype;t.type="chart"})(),e})();function m_(e,t,n){e&&co(e)&&(t==="emphasis"?zf:Hf)(e,n)}function y_(e,t,n){var r=ec(e,t),a=t&&t.highlightKey!=null?uM(t.highlightKey):null;r!=null?q(pn(r),function(i){m_(e.getItemGraphicEl(i),n,a)}):e.eachItemGraphicEl(function(i){m_(i,n,a)})}pf(qr,["dispose"]),gf(qr);function jD(e){return FD(e.model)}function $D(e){var t=e.model,n=e.ecModel,r=e.api,a=e.payload,i=t.pipelineContext.progressiveRender,o=e.view,l=a&&v_(a).updateMethod,c=i?"incrementalPrepareRender":l&&o[l]?l:"render";return c!=="render"&&o[c](t,n,r,a),WD[c]}var WD={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}};function UD(e,t,n){var r,a=0,i=0,o=null,l,c,u,d;t=t||0;function f(){i=new Date().getTime(),o=null,e.apply(c,u||[])}var h=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];r=new Date().getTime(),c=this,u=p;var v=d||t,m=d||n;d=null,l=r-(m?a:i)-v,clearTimeout(o),m?o=setTimeout(f,v):l>=0?f():o=setTimeout(f,-l),a=r};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(p){d=p},h}var __=nn(),w_={itemStyle:vl(Cy,!0),lineStyle:vl(by,!0)},YD={lineStyle:"stroke",itemStyle:"fill"};function b_(e,t){var n=e.visualStyleMapper||w_[t];return n||(console.warn("Unknown style type '"+t+"'."),w_.itemStyle)}function C_(e,t){var n=e.visualDrawType||YD[t];return n||(console.warn("Unknown style type '"+t+"'."),"fill")}var GD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",a=e.getModel(r),i=b_(e,r)(a),o=a.getShallow("decal");o&&(n.setVisual("decal",o),o.dirty=!0);var l=C_(e,r),c=i[l],u=ot(c)?c:null,d=i.fill==="auto"||i.stroke==="auto";if(!i[l]||u||d){var f=e.getColorFromPalette(e.name,null,t.getSeriesCount());i[l]||(i[l]=f,n.setVisual("colorFromPalette",!0)),i.fill=i.fill==="auto"||ot(i.fill)?f:i.fill,i.stroke=i.stroke==="auto"||ot(i.stroke)?f:i.stroke}if(n.setVisual("style",i),n.setVisual("drawType",l),!t.isSeriesFiltered(e)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(h,p){var g=e.getDataParams(p),v=Ce({},i);v[l]=u(g),h.setItemVisual(p,"style",v)}}}},Dl=new vn,qD={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),r=e.visualStyleAccessPath||"itemStyle",a=b_(e,r),i=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(o,l){var c=o.getRawDataItem(l);if(c&&c[r]){Dl.option=c[r];var u=a(Dl);Ce(o.ensureUniqueItemVisual(l,"style"),u),Dl.option.decal&&(o.setItemVisual(l,"decal",Dl.option.decal),Dl.option.decal.dirty=!0),i in u&&o.setItemVisual(l,"colorFromPalette",!1)}}:null}}}},JD={performRawSeries:!0,overallReset:function(e){var t=Je();e.eachSeries(function(n){var r=n.getColorBy();if(!n.isColorBySeries()){var a=n.type+"-"+r,i=t.get(a);i||(i={},t.set(a,i)),__(n).scope=i}}),e.eachSeries(function(n){if(!(n.isColorBySeries()||e.isSeriesFiltered(n))){var r=n.getRawData(),a={},i=n.getData(),o=__(n).scope,l=C_(n,n.visualStyleAccessPath||"itemStyle");i.each(function(c){var u=i.getRawIndex(c);a[u]=c}),r.each(function(c){var u=a[c];if(i.getItemVisual(u,"colorFromPalette")){var d=i.ensureUniqueItemVisual(u,"style"),f=r.getName(c)||c+"",h=r.count();d[l]=n.getColorFromPalette(f,o,h)}})}})}},Lc=Math.PI;function XD(e,t){t=t||{},sn(t,{text:"loading",textColor:Wn.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:Wn.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new fl,r=new $r({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var a=new cc({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),i=new $r({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:t.zlevel,z:10001});n.add(i);var o;return t.showSpinner&&(o=new Kf({shape:{startAngle:-Lc/2,endAngle:-Lc/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Lc*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Lc*3/2}).delay(300).start("circularInOut"),n.add(o)),n.resize=function(){var l=a.getBoundingRect().width,c=t.showSpinner?t.spinnerRadius:0,u=(e.getWidth()-c*2-(t.showSpinner&&l?10:0)-l)/2-(t.showSpinner&&l?0:5+l/2)+(t.showSpinner?0:l/2)+(l?0:c),d=e.getHeight()/2;t.showSpinner&&o.setShape({cx:u,cy:d}),i.setShape({x:u-c,y:d-c,width:c*2,height:c*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var S_=(function(){function e(t,n,r,a){this._stageTaskMap=Je(),this.ecInstance=t,this.api=n,r=this._dataProcessorHandlers=r.slice(),a=this._visualHandlers=a.slice(),this._allHandlers=r.concat(a)}return e.prototype.restoreData=function(t,n){t.restoreData(n),this._stageTaskMap.each(function(r){var a=r.overallTask;a&&a.dirty()})},e.prototype.getPerformArgs=function(t,n){if(t.__pipeline){var r=this._pipelineMap.get(t.__pipeline.id),a=r.context,i=!n&&r.progressiveEnabled&&(!a||a.progressiveRender)&&t.__idxInPipeline>r.blockIndex?r.step:null,o=a&&a.modDataCount;return{step:i,modBy:o!=null?Math.ceil(o/i):null,modDataCount:o}}},e.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},e.prototype.updateStreamModes=function(t,n){var r=this._pipelineMap.get(t.uid),a=t.getData().count(),i=r.progressiveEnabled&&n.incrementalPrepareRender&&a>=r.threshold,o=t.get("large")&&a>=t.get("largeThreshold");t.pipelineContext=r.context={progressiveRender:i,modDataCount:t.get("progressiveChunkMode")==="mod"?a:null,large:o}},e.prototype.restorePipelines=function(t){var n=this,r=n._pipelineMap=Je();t.eachSeries(function(a){var i=a.getProgressive(),o=a.uid;r.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:i&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(a,a.dataTask)})},e.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,n=this.api.getModel(),r=this.api;q(this._allHandlers,function(a){var i=t.get(a.uid)||t.set(a.uid,{}),o="";process.env.NODE_ENV!=="production"&&(o='"reset" and "overallReset" must not be both specified.'),je(!(a.reset&&a.overallReset),o),a.reset&&this._createSeriesStageTask(a,i,n,r),a.overallReset&&this._createOverallStageTask(a,i,n,r)},this)},e.prototype.prepareView=function(t,n,r,a){var i=t.renderTask,o=i.context;o.model=n,o.ecModel=r,o.api=a,i.__block=!t.incrementalPrepareRender,this._pipe(n,i)},e.prototype.performDataProcessorTasks=function(t,n){this._performStageTasks(this._dataProcessorHandlers,t,n,{block:!0})},e.prototype.performVisualTasks=function(t,n,r){this._performStageTasks(this._visualHandlers,t,n,r)},e.prototype._performStageTasks=function(t,n,r,a){a=a||{};var i=!1,o=this;q(t,function(c,u){if(!(a.visualType&&a.visualType!==c.visualType)){var d=o._stageTaskMap.get(c.uid),f=d.seriesTaskMap,h=d.overallTask;if(h){var p,g=h.agentStubMap;g.each(function(m){l(a,m)&&(m.dirty(),p=!0)}),p&&h.dirty(),o.updatePayload(h,r);var v=o.getPerformArgs(h,a.block);g.each(function(m){m.perform(v)}),h.perform(v)&&(i=!0)}else f&&f.each(function(m,_){l(a,m)&&m.dirty();var y=o.getPerformArgs(m,a.block);y.skip=!c.performRawSeries&&n.isSeriesFiltered(m.context.model),o.updatePayload(m,r),m.perform(y)&&(i=!0)})}});function l(c,u){return c.setDirty&&(!c.dirtyMap||c.dirtyMap.get(u.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(t){var n;t.eachSeries(function(r){n=r.dataTask.perform()||n}),this.unfinished=n||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(t){var n=t.tail;do{if(n.__block){t.blockIndex=n.__idxInPipeline;break}n=n.getUpstream()}while(n)})},e.prototype.updatePayload=function(t,n){n!=="remain"&&(t.context.payload=n)},e.prototype._createSeriesStageTask=function(t,n,r,a){var i=this,o=n.seriesTaskMap,l=n.seriesTaskMap=Je(),c=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?r.eachRawSeries(d):c?r.eachRawSeriesByType(c,d):u&&u(r,a).each(d);function d(f){var h=f.uid,p=l.set(h,o&&o.get(h)||Ml({plan:tA,reset:nA,count:aA}));p.context={model:f,ecModel:r,api:a,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:i},i._pipe(f,p)}},e.prototype._createOverallStageTask=function(t,n,r,a){var i=this,o=n.overallTask=n.overallTask||Ml({reset:KD});o.context={ecModel:r,api:a,overallReset:t.overallReset,scheduler:i};var l=o.agentStubMap,c=o.agentStubMap=Je(),u=t.seriesType,d=t.getTargetSeries,f=!0,h=!1,p="";process.env.NODE_ENV!=="production"&&(p='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),je(!t.createOnAllSeries,p),u?r.eachRawSeriesByType(u,g):d?d(r,a).each(g):(f=!1,q(r.getSeries(),g));function g(v){var m=v.uid,_=c.set(m,l&&l.get(m)||(h=!0,Ml({reset:ZD,onDirty:eA})));_.context={model:v,overallProgress:f},_.agent=o,_.__block=f,i._pipe(v,_)}h&&o.dirty()},e.prototype._pipe=function(t,n){var r=t.uid,a=this._pipelineMap.get(r);!a.head&&(a.head=n),a.tail&&a.tail.pipe(n),a.tail=n,n.__idxInPipeline=a.count++,n.__pipeline=a},e.wrapStageHandler=function(t,n){return ot(t)&&(t={overallReset:t,seriesType:iA(t)}),t.uid=_c("stageHandler"),n&&(t.visualType=n),t},e})();function KD(e){e.overallReset(e.ecModel,e.api,e.payload)}function ZD(e){return e.overallProgress&&QD}function QD(){this.agent.dirty(),this.getDownstream().dirty()}function eA(){this.agent&&this.agent.dirty()}function tA(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function nA(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=pn(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?bt(t,function(n,r){return x_(r)}):rA}var rA=x_(0);function x_(e){return function(t,n){var r=n.data,a=n.resetDefines[e];if(a&&a.dataEach)for(var i=t.start;i<t.end;i++)a.dataEach(r,i);else a&&a.progress&&a.progress(t,r)}}function aA(e){return e.data.count()}function iA(e){Ic=null;try{e(Al,E_)}catch{}return Ic}var Al={},E_={},Ic;k_(Al,dh),k_(E_,Vy),Al.eachSeriesByType=Al.eachRawSeriesByType=function(e){Ic=e},Al.eachComponent=function(e){e.mainType==="series"&&e.subType&&(Ic=e.subType)};function k_(e,t){for(var n in t.prototype)e[n]=Vn}var me=Wn.darkColor,oA=me.background,Pl=function(){return{axisLine:{lineStyle:{color:me.axisLine}},splitLine:{lineStyle:{color:me.axisSplitLine}},splitArea:{areaStyle:{color:[me.backgroundTint,me.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:me.axisMinorSplitLine}},axisLabel:{color:me.axisLabel},axisName:{}}},T_={label:{color:me.secondary},itemStyle:{borderColor:me.borderTint},dividerLineStyle:{color:me.border}},R_={darkMode:!0,color:me.theme,backgroundColor:oA,axisPointer:{lineStyle:{color:me.border},crossStyle:{color:me.borderShade},label:{color:me.tertiary}},legend:{textStyle:{color:me.secondary},pageTextStyle:{color:me.tertiary}},textStyle:{color:me.secondary},title:{textStyle:{color:me.primary},subtextStyle:{color:me.quaternary}},toolbox:{iconStyle:{borderColor:me.accent50}},tooltip:{backgroundColor:me.neutral20,defaultBorderColor:me.border,textStyle:{color:me.tertiary}},dataZoom:{borderColor:me.accent10,textStyle:{color:me.tertiary},brushStyle:{color:me.backgroundTint},handleStyle:{color:me.neutral00,borderColor:me.accent20},moveHandleStyle:{color:me.accent40},emphasis:{handleStyle:{borderColor:me.accent50}},dataBackground:{lineStyle:{color:me.accent30},areaStyle:{color:me.accent20}},selectedDataBackground:{lineStyle:{color:me.accent50},areaStyle:{color:me.accent30}}},visualMap:{textStyle:{color:me.secondary},handleStyle:{borderColor:me.neutral30}},timeline:{lineStyle:{color:me.accent10},label:{color:me.tertiary},controlStyle:{color:me.accent30,borderColor:me.accent30}},calendar:{itemStyle:{color:me.neutral00,borderColor:me.neutral20},dayLabel:{color:me.tertiary},monthLabel:{color:me.secondary},yearLabel:{color:me.secondary}},matrix:{x:T_,y:T_,backgroundColor:{borderColor:me.axisLine},body:{itemStyle:{borderColor:me.borderTint}}},timeAxis:Pl(),logAxis:Pl(),valueAxis:Pl(),categoryAxis:Pl(),line:{symbol:"circle"},graph:{color:me.theme},gauge:{title:{color:me.secondary},axisLine:{lineStyle:{color:[[1,me.neutral05]]}},axisLabel:{color:me.axisLabel},detail:{color:me.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:me.background}},radar:(function(){var e=Pl();return e.axisName={color:me.axisLabel},e.axisLine.lineStyle.color=me.neutral20,e})(),treemap:{breadcrumb:{itemStyle:{color:me.neutral20,textStyle:{color:me.secondary}},emphasis:{itemStyle:{color:me.neutral30}}}},sunburst:{itemStyle:{borderColor:me.background}},map:{itemStyle:{borderColor:me.border,areaColor:me.neutral10},label:{color:me.tertiary},emphasis:{label:{color:me.primary},itemStyle:{areaColor:me.highlight}},select:{label:{color:me.primary},itemStyle:{areaColor:me.highlight}}},geo:{itemStyle:{borderColor:me.border,areaColor:me.neutral10},emphasis:{label:{color:me.primary},itemStyle:{areaColor:me.highlight}},select:{label:{color:me.primary},itemStyle:{color:me.highlight}}}};R_.categoryAxis.splitLine.show=!1;var lA=(function(){function e(){}return e.prototype.normalizeQuery=function(t){var n={},r={},a={};if(Ge(t)){var i=pr(t);n.mainType=i.main||null,n.subType=i.sub||null}else{var o=["Index","Name","Id"],l={name:1,dataIndex:1,dataType:1};q(t,function(c,u){for(var d=!1,f=0;f<o.length;f++){var h=o[f],p=u.lastIndexOf(h);if(p>0&&p===u.length-h.length){var g=u.slice(0,p);g!=="data"&&(n.mainType=g,n[h.toLowerCase()]=c,d=!0)}}l.hasOwnProperty(u)&&(r[u]=c,d=!0),d||(a[u]=c)})}return{cptQuery:n,dataQuery:r,otherQuery:a}},e.prototype.filter=function(t,n){var r=this.eventInfo;if(!r)return!0;var a=r.targetEl,i=r.packedEvent,o=r.model,l=r.view;if(!o||!l)return!0;var c=n.cptQuery,u=n.dataQuery;return d(c,o,"mainType")&&d(c,o,"subType")&&d(c,o,"index","componentIndex")&&d(c,o,"name")&&d(c,o,"id")&&d(u,i,"name")&&d(u,i,"dataIndex")&&d(u,i,"dataType")&&(!l.filterForExposedEvent||l.filterForExposedEvent(t,n.otherQuery,a,i));function d(f,h,p,g){return f[p]==null||h[g||p]===f[p]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e})(),Ch=["symbol","symbolSize","symbolRotate","symbolOffset"],M_=Ch.concat(["symbolKeepAspect"]),sA={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual("legendIcon",e.legendIcon),!e.hasSymbolVisual)return;for(var r={},a={},i=!1,o=0;o<Ch.length;o++){var l=Ch[o],c=e.get(l);ot(c)?(i=!0,a[l]=c):r[l]=c}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(Ce({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},r)),t.isSeriesFiltered(e))return;var u=Vt(a);function d(f,h){for(var p=e.getRawValue(h),g=e.getDataParams(h),v=0;v<u.length;v++){var m=u[v];f.setItemVisual(h,m,a[m](p,g))}}return{dataEach:i?d:null}}},cA={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.hasSymbolVisual||t.isSeriesFiltered(e))return;var n=e.getData();function r(a,i){for(var o=a.getItemModel(i),l=0;l<M_.length;l++){var c=M_[l],u=o.getShallow(c,!0);u!=null&&a.setItemVisual(i,c,u)}}return{dataEach:n.hasItemOption?r:null}}};function uA(e,t,n){switch(n){case"color":return e.getItemVisual(t,"style")[e.getVisual("drawType")];case"opacity":return e.getItemVisual(t,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getItemVisual(t,n);default:process.env.NODE_ENV!=="production"&&console.warn("Unknown visual type "+n)}}function dA(e,t){switch(t){case"color":return e.getVisual("style")[e.getVisual("drawType")];case"opacity":return e.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return e.getVisual(t);default:process.env.NODE_ENV!=="production"&&console.warn("Unknown visual type "+t)}}function wo(e,t,n,r,a){var i=e+t;n.isSilent(i)||(process.env.NODE_ENV!=="production"&&Hr("event "+i+" is deprecated."),r.eachComponent({mainType:"series",subType:"pie"},function(o){for(var l=o.seriesIndex,c=o.option.selectedMap,u=a.selected,d=0;d<u.length;d++)if(u[d].seriesIndex===l){var f=o.getData(),h=ec(f,a.fromActionPayload);n.trigger(i,{type:i,seriesId:o.id,name:Fe(h)?f.getName(h[0]):f.getName(h),selected:Ge(c)?c:Ce({},c)})}}))}function fA(e,t,n){e.on("selectchanged",function(r){var a=n.getModel();r.isFromClick?(wo("map","selectchanged",t,a,r),wo("pie","selectchanged",t,a,r)):r.fromAction==="select"?(wo("map","selected",t,a,r),wo("pie","selected",t,a,r)):r.fromAction==="unselect"&&(wo("map","unselected",t,a,r),wo("pie","unselected",t,a,r))})}function Oc(e,t,n){for(var r;e&&!(t(e)&&(r=e,n));)e=e.__hostTarget||e.parent;return r}var hA=Math.round(Math.random()*9),pA=typeof Object.defineProperty=="function",gA=(function(){function e(){this._id="__ec_inner_"+hA++}return e.prototype.get=function(t){return this._guard(t)[this._id]},e.prototype.set=function(t,n){var r=this._guard(t);return pA?Object.defineProperty(r,this._id,{value:n,enumerable:!1,configurable:!0}):r[this._id]=n,this},e.prototype.delete=function(t){return this.has(t)?(delete this._guard(t)[this._id],!0):!1},e.prototype.has=function(t){return!!this._guard(t)[this._id]},e.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},e})(),vA=zt.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,a=t.width/2,i=t.height/2;e.moveTo(n,r-i),e.lineTo(n+a,r+i),e.lineTo(n-a,r+i),e.closePath()}}),mA=zt.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,a=t.width/2,i=t.height/2;e.moveTo(n,r-i),e.lineTo(n+a,r),e.lineTo(n,r+i),e.lineTo(n-a,r),e.closePath()}}),yA=zt.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,a=t.width/5*3,i=Math.max(a,t.height),o=a/2,l=o*o/(i-o),c=r-i+o+l,u=Math.asin(l/o),d=Math.cos(u)*o,f=Math.sin(u),h=Math.cos(u),p=o*.6,g=o*.7;e.moveTo(n-d,c+l),e.arc(n,c,o,Math.PI-u,Math.PI*2+u),e.bezierCurveTo(n+d-f*p,c+l+h*p,n,r-g,n,r),e.bezierCurveTo(n,r-g,n-d+f*p,c+l+h*p,n-d,c+l),e.closePath()}}),_A=zt.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,a=t.x,i=t.y,o=r/3*2;e.moveTo(a,i),e.lineTo(a+o,i+n),e.lineTo(a,i+n/4*3),e.lineTo(a-o,i+n),e.lineTo(a,i),e.closePath()}}),wA={line:Xf,rect:$r,roundRect:$r,square:$r,circle:Gf,diamond:mA,pin:yA,arrow:_A,triangle:vA},bA={line:function(e,t,n,r,a){a.x1=e,a.y1=t+r/2,a.x2=e+n,a.y2=t+r/2},rect:function(e,t,n,r,a){a.x=e,a.y=t,a.width=n,a.height=r},roundRect:function(e,t,n,r,a){a.x=e,a.y=t,a.width=n,a.height=r,a.r=Math.min(n,r)/4},square:function(e,t,n,r,a){var i=Math.min(n,r);a.x=e,a.y=t,a.width=i,a.height=i},circle:function(e,t,n,r,a){a.cx=e+n/2,a.cy=t+r/2,a.r=Math.min(n,r)/2},diamond:function(e,t,n,r,a){a.cx=e+n/2,a.cy=t+r/2,a.width=n,a.height=r},pin:function(e,t,n,r,a){a.x=e+n/2,a.y=t+r/2,a.width=n,a.height=r},arrow:function(e,t,n,r,a){a.x=e+n/2,a.y=t+r/2,a.width=n,a.height=r},triangle:function(e,t,n,r,a){a.cx=e+n/2,a.cy=t+r/2,a.width=n,a.height=r}},Sh={};q(wA,function(e,t){Sh[t]=new e});var CA=zt.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=I0(e,t,n),a=this.shape;return a&&a.symbolType==="pin"&&t.position==="inside"&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!=="none"){var a=Sh[r];a||(r="rect",a=Sh[r]),bA[r](t.x,t.y,t.width,t.height,a.shape),a.buildPath(e,a.shape,n)}}});function SA(e,t){if(this.type!=="image"){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Wn.color.neutral00,n.lineWidth=2):this.shape.symbolType==="line"?n.stroke=e:n.fill=e,this.markRedraw()}}function xA(e,t,n,r,a,i,o){var l=e.indexOf("empty")===0;l&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c;return e.indexOf("image://")===0?c=WM(e.slice(8),new lt(t,n,r,a),o?"center":"cover"):e.indexOf("path://")===0?c=$M(e.slice(7),{},new lt(t,n,r,a),o?"center":"cover"):c=new CA({shape:{symbolType:e,x:t,y:n,width:r,height:a}}),c.__isEmptyBrush=l,c.setColor=SA,i&&c.setColor(i),c}function hi(e){return isFinite(e)}function EA(e,t,n){var r=t.x==null?0:t.x,a=t.x2==null?1:t.x2,i=t.y==null?0:t.y,o=t.y2==null?0:t.y2;return t.global||(r=r*n.width+n.x,a=a*n.width+n.x,i=i*n.height+n.y,o=o*n.height+n.y),r=hi(r)?r:0,a=hi(a)?a:1,i=hi(i)?i:0,o=hi(o)?o:0,e.createLinearGradient(r,i,a,o)}function kA(e,t,n){var r=n.width,a=n.height,i=Math.min(r,a),o=t.x==null?.5:t.x,l=t.y==null?.5:t.y,c=t.r==null?.5:t.r;return t.global||(o=o*r+n.x,l=l*a+n.y,c=c*i),o=hi(o)?o:.5,l=hi(l)?l:.5,c=c>=0&&hi(c)?c:.5,e.createRadialGradient(o,l,0,o,l,c)}function xh(e,t,n){for(var r=t.type==="radial"?kA(e,t,n):EA(e,t,n),a=t.colorStops,i=0;i<a.length;i++)r.addColorStop(a[i].offset,a[i].color);return r}function TA(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Vc(e){return parseInt(e,10)}function zc(e,t,n){var r=["width","height"][t],a=["clientWidth","clientHeight"][t],i=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(n[r]!=null&&n[r]!=="auto")return parseFloat(n[r]);var l=document.defaultView.getComputedStyle(e);return(e[a]||Vc(l[r])||Vc(e.style[r]))-(Vc(l[i])||0)-(Vc(l[o])||0)|0}function RA(e,t){return!e||e==="solid"||!(t>0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:Dt(e)?[e]:Fe(e)?e:null}function B_(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&RA(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var a=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&a!==1&&(n=bt(n,function(i){return i/a}),r/=a)}return[n,r]}var MA=new ti(!0);function Hc(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function D_(e){return typeof e=="string"&&e!=="none"}function Fc(e){var t=e.fill;return t!=null&&t!=="none"}function A_(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function P_(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function Eh(e,t,n){var r=am(t.image,t.__image,n);if(nc(r)){var a=e.createPattern(r,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var i=new DOMMatrix;i.translateSelf(t.x||0,t.y||0),i.rotateSelf(0,0,(t.rotation||0)*Qk),i.scaleSelf(t.scaleX||1,t.scaleY||1),a.setTransform(i)}return a}}function BA(e,t,n,r){var a,i=Hc(n),o=Fc(n),l=n.strokePercent,c=l<1,u=!t.path;(!t.silent||c)&&u&&t.createPathProxy();var d=t.path||MA,f=t.__dirty;if(!r){var h=n.fill,p=n.stroke,g=o&&!!h.colorStops,v=i&&!!p.colorStops,m=o&&!!h.image,_=i&&!!p.image,y=void 0,w=void 0,C=void 0,S=void 0,b=void 0;(g||v)&&(b=t.getBoundingRect()),g&&(y=f?xh(e,h,b):t.__canvasFillGradient,t.__canvasFillGradient=y),v&&(w=f?xh(e,p,b):t.__canvasStrokeGradient,t.__canvasStrokeGradient=w),m&&(C=f||!t.__canvasFillPattern?Eh(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=C),_&&(S=f||!t.__canvasStrokePattern?Eh(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),g?e.fillStyle=y:m&&(C?e.fillStyle=C:o=!1),v?e.strokeStyle=w:_&&(S?e.strokeStyle=S:i=!1)}var x=t.getGlobalScale();d.setScale(x[0],x[1],t.segmentIgnoreThreshold);var E,k;e.setLineDash&&n.lineDash&&(a=B_(t),E=a[0],k=a[1]);var T=!0;(u||f&4)&&(d.setDPR(e.dpr),c?d.setContext(null):(d.setContext(e),T=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),T&&d.rebuildPath(e,c?l:1),E&&(e.setLineDash(E),e.lineDashOffset=k),r||(n.strokeFirst?(i&&P_(e,n),o&&A_(e,n)):(o&&A_(e,n),i&&P_(e,n))),E&&e.setLineDash([])}function DA(e,t,n){var r=t.__image=am(n.image,t.__image,t,t.onload);if(!(!r||!nc(r))){var a=n.x||0,i=n.y||0,o=t.getWidth(),l=t.getHeight(),c=r.width/r.height;if(o==null&&l!=null?o=l*c:l==null&&o!=null?l=o/c:o==null&&l==null&&(o=r.width,l=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,d=n.sy||0;e.drawImage(r,u,d,n.sWidth,n.sHeight,a,i,o,l)}else if(n.sx&&n.sy){var u=n.sx,d=n.sy,f=o-u,h=l-d;e.drawImage(r,u,d,f,h,a,i,o,l)}else e.drawImage(r,a,i,o,l)}}function AA(e,t,n){var r,a=n.text;if(a!=null&&(a+=""),a){e.font=n.font||"12px sans-serif",e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var i=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=B_(t),i=r[0],o=r[1]),i&&(e.setLineDash(i),e.lineDashOffset=o),n.strokeFirst?(Hc(n)&&e.strokeText(a,n.x,n.y),Fc(n)&&e.fillText(a,n.x,n.y)):(Fc(n)&&e.fillText(a,n.x,n.y),Hc(n)&&e.strokeText(a,n.x,n.y)),i&&e.setLineDash([])}}var N_=["shadowBlur","shadowOffsetX","shadowOffsetY"],L_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function I_(e,t,n,r,a){var i=!1;if(!r&&(n=n||{},t===n))return!1;if(r||t.opacity!==n.opacity){Tn(e,a),i=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?Ja.opacity:o}(r||t.blend!==n.blend)&&(i||(Tn(e,a),i=!0),e.globalCompositeOperation=t.blend||Ja.blend);for(var l=0;l<N_.length;l++){var c=N_[l];(r||t[c]!==n[c])&&(i||(Tn(e,a),i=!0),e[c]=e.dpr*(t[c]||0))}return(r||t.shadowColor!==n.shadowColor)&&(i||(Tn(e,a),i=!0),e.shadowColor=t.shadowColor||Ja.shadowColor),i}function O_(e,t,n,r,a){var i=Nl(t,a.inHover),o=r?null:n&&Nl(n,a.inHover)||{};if(i===o)return!1;var l=I_(e,i,o,r,a);if((r||i.fill!==o.fill)&&(l||(Tn(e,a),l=!0),D_(i.fill)&&(e.fillStyle=i.fill)),(r||i.stroke!==o.stroke)&&(l||(Tn(e,a),l=!0),D_(i.stroke)&&(e.strokeStyle=i.stroke)),(r||i.opacity!==o.opacity)&&(l||(Tn(e,a),l=!0),e.globalAlpha=i.opacity==null?1:i.opacity),t.hasStroke()){var c=i.lineWidth/(i.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==c&&(l||(Tn(e,a),l=!0),e.lineWidth=c)}for(var u=0;u<L_.length;u++){var d=L_[u],f=d[0];(r||i[f]!==o[f])&&(l||(Tn(e,a),l=!0),e[f]=i[f]||d[1])}return l}function PA(e,t,n,r,a){return I_(e,Nl(t,a.inHover),n&&Nl(n,a.inHover),r,a)}function V_(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}function NA(e,t,n){for(var r=!1,a=0;a<e.length;a++){var i=e[a];r=r||i.isZeroArea(),V_(t,i),t.beginPath(),i.buildPath(t,i.shape),t.clip()}n.allClipped=r}function LA(e,t){return e&&t?e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||e[4]!==t[4]||e[5]!==t[5]:!(!e&&!t)}var z_=1,H_=2,F_=3,j_=4;function IA(e){var t=Fc(e),n=Hc(e);return!(e.lineDash||!(+t^+n)||t&&typeof e.fill!="string"||n&&typeof e.stroke!="string"||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}function Tn(e,t){t.batchFill&&e.fill(),t.batchStroke&&e.stroke(),t.batchFill="",t.batchStroke=""}function Nl(e,t){return t&&e.__hoverStyle||e.style}function $_(e,t){pi(e,t,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function pi(e,t,n,r){var a=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1)){t.__dirty&=-2,t.__isRendered=!1;return}var i=t.__clipPaths,o=n.prevElClipPaths,l=!1,c=!1;if((!o||TA(i,o))&&(o&&o.length&&(Tn(e,n),e.restore(),c=l=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),i&&i.length&&(Tn(e,n),e.save(),NA(i,e,n),l=!0),n.prevElClipPaths=i),n.allClipped){t.__isRendered=!1;return}t.beforeBrush&&t.beforeBrush(),t.innerBeforeBrush();var u=n.prevEl;u||(c=l=!0);var d=t instanceof zt&&t.autoBatch&&IA(t.style);l||LA(a,u.transform)?(Tn(e,n),V_(e,t)):d||Tn(e,n);var f=Nl(t,n.inHover);t instanceof zt?(n.lastDrawType!==z_&&(c=!0,n.lastDrawType=z_),O_(e,t,u,c,n),(!d||!n.batchFill&&!n.batchStroke)&&e.beginPath(),BA(e,t,f,d),d&&(n.batchFill=f.fill||"",n.batchStroke=f.stroke||"")):t instanceof sc?(n.lastDrawType!==F_&&(c=!0,n.lastDrawType=F_),O_(e,t,u,c,n),AA(e,t,f)):t instanceof _l?(n.lastDrawType!==H_&&(c=!0,n.lastDrawType=H_),PA(e,t,u,c,n),DA(e,t,f)):t.getTemporalDisplayables&&(n.lastDrawType!==j_&&(c=!0,n.lastDrawType=j_),OA(e,t,n)),d&&r&&Tn(e,n),t.innerAfterBrush(),t.afterBrush&&t.afterBrush(),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}function OA(e,t,n){var r=t.getDisplayables(),a=t.getTemporalDisplayables();e.save();var i={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover},o,l;for(o=t.getCursor(),l=r.length;o<l;o++){var c=r[o];c.beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),pi(e,c,i,o===l-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),i.prevEl=c}for(var u=0,d=a.length;u<d;u++){var c=a[u];c.beforeBrush&&c.beforeBrush(),c.innerBeforeBrush(),pi(e,c,i,u===d-1),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),i.prevEl=c}t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}var kh=new gA,W_=new Xi(100),U_=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Y_(e,t){if(e==="none")return null;var n=t.getDevicePixelRatio(),r=t.getZr(),a=r.painter.type==="svg";e.dirty&&kh.delete(e);var i=kh.get(e);if(i)return i;var o=sn(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var l={repeat:"repeat"};return c(l),l.rotation=o.rotation,l.scaleX=l.scaleY=a?1:1/n,kh.set(e,l),e.dirty=!1,l;function c(u){for(var d=[n],f=!0,h=0;h<U_.length;++h){var p=o[U_[h]];if(p!=null&&!Fe(p)&&!Ge(p)&&!Dt(p)&&typeof p!="boolean"){f=!1;break}d.push(p)}var g;if(f){g=d.join(",")+(a?"-svg":"");var v=W_.get(g);v&&(a?u.svgElement=v:u.image=v)}var m=q_(o.dashArrayX),_=VA(o.dashArrayY),y=G_(o.symbol),w=zA(m),C=J_(_),S=!a&&ur.createCanvas(),b=a&&{tag:"g",attrs:{},key:"dcl",children:[]},x=k(),E;S&&(S.width=x.width*n,S.height=x.height*n,E=S.getContext("2d")),T(),f&&W_.put(g,S||b),u.image=S,u.svgElement=b,u.svgWidth=x.width,u.svgHeight=x.height;function k(){for(var R=1,D=0,A=w.length;D<A;++D)R=U0(R,w[D]);for(var L=1,D=0,A=y.length;D<A;++D)L=U0(L,y[D].length);R*=L;var N=C*w.length*y.length;if(process.env.NODE_ENV!=="production"){var M=function(I){console.warn("Calculated decal size is greater than "+I+" due to decal option settings so "+I+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+I+" to be larger to avoid incontinuity.")};R>o.maxTileWidth&&M("maxTileWidth"),N>o.maxTileHeight&&M("maxTileHeight")}return{width:Math.max(1,Math.min(R,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function T(){E&&(E.clearRect(0,0,S.width,S.height),o.backgroundColor&&(E.fillStyle=o.backgroundColor,E.fillRect(0,0,S.width,S.height)));for(var R=0,D=0;D<_.length;++D)R+=_[D];if(R<=0)return;for(var A=-C,L=0,N=0,M=0;A<x.height;){if(L%2===0){for(var I=N/2%y.length,$=0,ee=0,oe=0;$<x.width*2;){for(var j=0,D=0;D<m[M].length;++D)j+=m[M][D];if(j<=0)break;if(ee%2===0){var U=(1-o.symbolSize)*.5,H=$+m[M][ee]*U,B=A+_[L]*U,W=m[M][ee]*o.symbolSize,X=_[L]*o.symbolSize,K=oe/2%y[I].length;ne(H,B,W,X,y[I][K])}$+=m[M][ee],++oe,++ee,ee===m[M].length&&(ee=0)}++M,M===m.length&&(M=0)}A+=_[L],++N,++L,L===_.length&&(L=0)}function ne(he,O,Z,ue,se){var we=a?1:n,Te=xA(se,he*we,O*we,Z*we,ue*we,o.color,o.symbolKeepAspect);if(a){var Ee=r.painter.renderOneToVNode(Te);Ee&&b.children.push(Ee)}else $_(E,Te)}}}}function G_(e){if(!e||e.length===0)return[["rect"]];if(Ge(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!Ge(e[n])){t=!1;break}if(t)return G_([e]);for(var r=[],n=0;n<e.length;++n)Ge(e[n])?r.push([e[n]]):r.push(e[n]);return r}function q_(e){if(!e||e.length===0)return[[0,0]];if(Dt(e)){var t=Math.ceil(e);return[[t,t]]}for(var n=!0,r=0;r<e.length;++r)if(!Dt(e[r])){n=!1;break}if(n)return q_([e]);for(var a=[],r=0;r<e.length;++r)if(Dt(e[r])){var t=Math.ceil(e[r]);a.push([t,t])}else{var t=bt(e[r],function(l){return Math.ceil(l)});t.length%2===1?a.push(t.concat(t)):a.push(t)}return a}function VA(e){if(!e||typeof e=="object"&&e.length===0)return[0,0];if(Dt(e)){var t=Math.ceil(e);return[t,t]}var n=bt(e,function(r){return Math.ceil(r)});return e.length%2?n.concat(n):n}function zA(e){return bt(e,function(t){return J_(t)})}function J_(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2===1?t*2:t}function HA(e,t){e.eachRawSeries(function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each(function(o){var l=r.getItemVisual(o,"decal");if(l){var c=r.ensureUniqueItemVisual(o,"style");c.decal=Y_(l,t)}});var a=r.getVisual("decal");if(a){var i=r.getVisual("style");i.decal=Y_(a,t)}}})}var br=new dr,jc={};function FA(e,t){process.env.NODE_ENV!=="production"&&jc[e]&&At("Already has an implementation of "+e+"."),jc[e]=t}function jA(e){return process.env.NODE_ENV!=="production"&&(jc[e]||At("Implementation of "+e+" doesn't exists.")),jc[e]}var $A={};function WA(e,t){$A[e]=t}var UA=1,YA=800,GA=900,qA=1e3,JA=2e3,XA=5e3,X_=1e3,KA=1100,Th=2e3,K_=3e3,ZA=4e3,$c=4500,QA=4600,eP=5e3,tP=6e3,Z_=7e3,nP={PROCESSOR:{FILTER:qA,SERIES_FILTER:YA,STATISTIC:XA},VISUAL:{LAYOUT:X_,PROGRESSIVE_LAYOUT:KA,GLOBAL:Th,CHART:K_,POST_CHART_LAYOUT:QA,COMPONENT:ZA,BRUSH:eP,CHART_ITEM:$c,ARIA:tP,DECAL:Z_}},$t="__flagInMainProcess",Wc="__mainProcessVersion",Kt="__pendingUpdate",Rh="__needsUpdateStatus",Q_=/^[a-zA-Z0-9_]+$/,Mh="__connectUpdateStatus",ew=0,rP=1,aP=2;function tw(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(this.isDisposed()){Rn(this.id);return}return rw(this,e,t)}}function nw(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rw(this,e,t)}}function rw(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),dr.prototype[t].apply(e,n)}var aw=(function(e){et(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(dr),iw=aw.prototype;iw.on=nw("on"),iw.off=nw("off");var gi,Bh,Uc,Jr,Yc,Dh,Ah,bo,Co,ow,lw,Ph,sw,Gc,cw,iP,Gn,uw,So,oP=(function(e){et(t,e);function t(n,r,a){var i=e.call(this,new lA)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],a=a||{},i._dom=n;var o="canvas",l="auto",c=!1;if(i[Wc]=1,process.env.NODE_ENV!=="production"){var u=it.hasGlobalWindow?window:global;u&&(o=qe(u.__ECHARTS__DEFAULT__RENDERER__,o),l=qe(u.__ECHARTS__DEFAULT__COARSE_POINTER,l),c=qe(u.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,c))}a.ssr&&_R(function(p){var g=En(p),v=g.dataIndex;if(v!=null){var m=Je();return m.set("series_index",g.seriesIndex),m.set("data_index",v),g.ssrType&&m.set("ssr_type",g.ssrType),m}});var d=i._zr=H0(n,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:qe(a.useDirtyRect,c),useCoarsePointer:qe(a.useCoarsePointer,l),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=UD(Sn(d.flush,d),17),i._updateTheme(r),i._locale=mB(a.locale||vB),i._coordSysMgr=new Ey;var f=i._api=cw(i);function h(p,g){return p.__prio-g.__prio}return Ps(Xc,h),Ps(Ih,h),i._scheduler=new S_(i,f,Ih,Xc),i._messageCenter=new aw,i._initEvents(),i.resize=Sn(i.resize,i),d.animation.on("frame",i._onframe,i),ow(d,i),lw(d,i),Ds(i),i}return t.prototype._onframe=function(){if(!this._disposed){uw(this);var n=this._scheduler;if(this[Kt]){var r=this[Kt].silent;this[$t]=!0,So(this);try{gi(this),Jr.update.call(this,null,this[Kt].updateParams)}catch(c){throw this[$t]=!1,this[Kt]=null,c}this._zr.flush(),this[$t]=!1,this[Kt]=null,bo.call(this,r),Co.call(this,r)}else if(n.unfinished){var a=UA,i=this._model,o=this._api;n.unfinished=!1;do{var l=+new Date;n.performSeriesTasks(i),n.performDataProcessorTasks(i),Dh(this,i),n.performVisualTasks(i),Gc(this,this._model,o,"remain",{}),a-=+new Date-l}while(a>0&&n.unfinished);n.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(n,r,a){if(this[$t]){process.env.NODE_ENV!=="production"&&At("`setOption` should not be called during main process.");return}if(this._disposed){Rn(this.id);return}var i,o,l;if(ze(r)&&(a=r.lazyUpdate,i=r.silent,o=r.replaceMerge,l=r.transition,r=r.notMerge),this[$t]=!0,So(this),!this._model||r){var c=new JB(this._api),u=this._theme,d=this._model=new dh;d.scheduler=this._scheduler,d.ssr=this._ssr,d.init(null,null,null,u,this._locale,c)}this._model.setOption(n,{replaceMerge:o},Oh);var f={seriesTransition:l,optionChanged:!0};if(a)this[Kt]={silent:i,updateParams:f},this[$t]=!1,this.getZr().wakeUp();else{try{gi(this),Jr.update.call(this,null,f)}catch(h){throw this[Kt]=null,this[$t]=!1,h}this._ssr||this._zr.flush(),this[Kt]=null,this[$t]=!1,bo.call(this,i),Co.call(this,i)}},t.prototype.setTheme=function(n,r){if(this[$t]){process.env.NODE_ENV!=="production"&&At("`setTheme` should not be called during main process.");return}if(this._disposed){Rn(this.id);return}var a=this._model;if(a){var i=r&&r.silent,o=null;this[Kt]&&(i==null&&(i=this[Kt].silent),o=this[Kt].updateParams,this[Kt]=null),this[$t]=!0,So(this);try{this._updateTheme(n),a.setTheme(this._theme),gi(this),Jr.update.call(this,{type:"setTheme"},o)}catch(l){throw this[$t]=!1,l}this[$t]=!1,bo.call(this,i),Co.call(this,i)}},t.prototype._updateTheme=function(n){Ge(n)&&(n=dw[n]),n&&(n=ft(n),n&&Uy(n,!0),this._theme=n)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||it.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(n){return process.env.NODE_ENV!=="production"&&Jt("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(n)},t.prototype.renderToCanvas=function(n){n=n||{};var r=this._zr.painter;if(process.env.NODE_ENV!=="production"&&r.type!=="canvas")throw new Error("renderToCanvas can only be used in the canvas renderer.");return r.getRenderedCanvas({backgroundColor:n.backgroundColor||this._model.get("backgroundColor"),pixelRatio:n.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(n){n=n||{};var r=this._zr.painter;if(process.env.NODE_ENV!=="production"&&r.type!=="svg")throw new Error("renderToSVGString can only be used in the svg renderer.");return r.renderToString({useViewBox:n.useViewBox})},t.prototype.getSvgDataURL=function(){var n=this._zr;return q(n.storage.getDisplayList(),function(r){r.stopAnimation(null,!0)}),n.painter.toDataURL()},t.prototype.getDataURL=function(n){if(this._disposed){Rn(this.id);return}n=n||{};var r=n.excludeComponents,a=this._model,i=[],o=this;q(r,function(c){a.eachComponent({mainType:c},function(u){var d=o._componentsMap[u.__viewId];d.group.ignore||(i.push(d),d.group.ignore=!0)})});var l=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(n).toDataURL("image/"+(n&&n.type||"png"));return q(i,function(c){c.group.ignore=!1}),l},t.prototype.getConnectedDataURL=function(n){if(this._disposed){Rn(this.id);return}var r=n.type==="svg",a=this.group,i=Math.min,o=Math.max,l=1/0;if(fw[a]){var c=l,u=l,d=-l,f=-l,h=[],p=n&&n.pixelRatio||this.getDevicePixelRatio();q(zh,function(w,C){if(w.group===a){var S=r?w.getZr().painter.getSvgDom().innerHTML:w.renderToCanvas(ft(n)),b=w.getDom().getBoundingClientRect();c=i(b.left,c),u=i(b.top,u),d=o(b.right,d),f=o(b.bottom,f),h.push({dom:S,left:b.left,top:b.top})}}),c*=p,u*=p,d*=p,f*=p;var g=d-c,v=f-u,m=ur.createCanvas(),_=H0(m,{renderer:r?"svg":"canvas"});if(_.resize({width:g,height:v}),r){var y="";return q(h,function(w){var C=w.left-c,S=w.top-u;y+='<g transform="translate('+C+","+S+')">'+w.dom+"</g>"}),_.painter.getSvgRoot().innerHTML=y,n.connectedBackgroundColor&&_.painter.setBackgroundColor(n.connectedBackgroundColor),_.refreshImmediately(),_.painter.toDataURL()}else return n.connectedBackgroundColor&&_.add(new $r({shape:{x:0,y:0,width:g,height:v},style:{fill:n.connectedBackgroundColor}})),q(h,function(w){var C=new _l({style:{x:w.left*p-c,y:w.top*p-u,image:w.dom}});_.add(C)}),_.refreshImmediately(),m.toDataURL("image/"+(n&&n.type||"png"))}else return this.getDataURL(n)},t.prototype.convertToPixel=function(n,r,a){return Yc(this,"convertToPixel",n,r,a)},t.prototype.convertToLayout=function(n,r,a){return Yc(this,"convertToLayout",n,r,a)},t.prototype.convertFromPixel=function(n,r,a){return Yc(this,"convertFromPixel",n,r,a)},t.prototype.containPixel=function(n,r){if(this._disposed){Rn(this.id);return}var a=this._model,i;return q(ff(a,n),function(o,l){l.indexOf("Models")>=0&&q(o,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)i=i||!!u.containPoint(r);else if(l==="seriesModels"){var d=this._chartsMap[c.__viewId];d&&d.containPoint?i=i||d.containPoint(r,c):process.env.NODE_ENV!=="production"&&zr(l+": "+(d?"The found component do not support containPoint.":"No view mapping to the found component."))}else process.env.NODE_ENV!=="production"&&zr(l+": containPoint is not supported")},this)},this),!!i},t.prototype.getVisual=function(n,r){var a=this._model,i=ff(a,n,{defaultMainType:"series"}),o=i.seriesModel;process.env.NODE_ENV!=="production"&&(o||zr("There is no specified series model"));var l=o.getData(),c=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?l.indexOfRawIndex(i.dataIndex):null;return c!=null?uA(l,c,r):dA(l,r)},t.prototype.getViewOfComponentModel=function(n){return this._componentsMap[n.__viewId]},t.prototype.getViewOfSeriesModel=function(n){return this._chartsMap[n.__viewId]},t.prototype._initEvents=function(){var n=this;q(lP,function(a){var i=function(o){var l=n.getModel(),c=o.target,u,d=a==="globalout";if(d?u={}:c&&Oc(c,function(v){var m=En(v);if(m&&m.dataIndex!=null){var _=m.dataModel||l.getSeriesByIndex(m.seriesIndex);return u=_&&_.getDataParams(m.dataIndex,m.dataType,c)||{},!0}else if(m.eventData)return u=Ce({},m.eventData),!0},!0),u){var f=u.componentType,h=u.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=u.seriesIndex);var p=f&&h!=null&&l.getComponent(f,h),g=p&&n[p.mainType==="series"?"_chartsMap":"_componentsMap"][p.__viewId];process.env.NODE_ENV!=="production"&&!d&&!(p&&g)&&zr("model or view can not be found by params"),u.event=o,u.type=a,n._$eventProcessor.eventInfo={targetEl:c,packedEvent:u,model:p,view:g},n.trigger(a,u)}};i.zrEventfulCallAtLast=!0,n._zr.on(a,i,n)});var r=this._messageCenter;q(Lh,function(a,i){r.on(i,function(o){n.trigger(i,o)})}),fA(r,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){Rn(this.id);return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){Rn(this.id);return}this._disposed=!0,this.getDom()&&WR(this.getDom(),sP,"");var n=this,r=n._api,a=n._model;q(n._componentsViews,function(i){i.dispose(a,r)}),q(n._chartsViews,function(i){i.dispose(a,r)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete zh[n.id]},t.prototype.resize=function(n){if(this[$t]){process.env.NODE_ENV!=="production"&&At("`resize` should not be called during main process.");return}if(this._disposed){Rn(this.id);return}this._zr.resize(n);var r=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!r){var a=r.resetOption("media"),i=n&&n.silent;this[Kt]&&(i==null&&(i=this[Kt].silent),a=!0,this[Kt]=null),this[$t]=!0,So(this);try{a&&gi(this),Jr.update.call(this,{type:"resize",animation:Ce({duration:0},n&&n.animation)})}catch(o){throw this[$t]=!1,o}this[$t]=!1,bo.call(this,i),Co.call(this,i)}},t.prototype.showLoading=function(n,r){if(this._disposed){Rn(this.id);return}if(ze(n)&&(r=n,n=""),n=n||"default",this.hideLoading(),!Vh[n]){process.env.NODE_ENV!=="production"&&zr("Loading effects "+n+" not exists.");return}var a=Vh[n](this._api,r),i=this._zr;this._loadingFX=a,i.add(a)},t.prototype.hideLoading=function(){if(this._disposed){Rn(this.id);return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(n){var r=Ce({},n);return r.type=Jc[n.type],r},t.prototype.dispatchAction=function(n,r){if(this._disposed){Rn(this.id);return}if(ze(r)||(r={silent:!!r}),!!qc[n.type]&&this._model){if(this[$t]){this._pendingActions.push(n);return}var a=r.silent;Ah.call(this,n,a);var i=r.flush;i?this._zr.flush():i!==!1&&it.browser.weChat&&this._throttledZrFlush(),bo.call(this,a),Co.call(this,a)}},t.prototype.updateLabelLayout=function(){br.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(n){if(this._disposed){Rn(this.id);return}var r=n.seriesIndex,a=this.getModel().getSeriesByIndex(r);process.env.NODE_ENV!=="production"&&je(n.data&&a),a.appendData(n),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=(function(){gi=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),Bh(f,!0),Bh(f,!1),h.plan()},Bh=function(f,h){for(var p=f._model,g=f._scheduler,v=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,_=f._zr,y=f._api,w=0;w<v.length;w++)v[w].__alive=!1;h?p.eachComponent(function(b,x){b!=="series"&&C(x)}):p.eachSeries(C);function C(b){var x=b.__requireNewView;b.__requireNewView=!1;var E="_ec_"+b.id+"_"+b.type,k=!x&&m[E];if(!k){var T=pr(b.type),R=h?_o.getClass(T.main,T.sub):qr.getClass(T.sub);process.env.NODE_ENV!=="production"&&je(R,T.sub+" does not exist."),k=new R,k.init(p,y),m[E]=k,v.push(k),_.add(k.group)}b.__viewId=k.__id=E,k.__alive=!0,k.__model=b,k.group.__ecComponentInfo={mainType:b.mainType,index:b.componentIndex},!h&&g.prepareView(k,b,p,y)}for(var w=0;w<v.length;){var S=v[w];S.__alive?w++:(!h&&S.renderTask.dispose(),_.remove(S.group),S.dispose(p,y),v.splice(w,1),m[S.__id]===S&&delete m[S.__id],S.__id=S.group.__ecComponentInfo=null)}},Uc=function(f,h,p,g,v){var m=f._model;if(m.setUpdatePayload(p),!g){q([].concat(f._componentsViews).concat(f._chartsViews),S);return}var _={};_[g+"Id"]=p[g+"Id"],_[g+"Index"]=p[g+"Index"],_[g+"Name"]=p[g+"Name"];var y={mainType:g,query:_};v&&(y.subType=v);var w=p.excludeSeriesId,C;w!=null&&(C=Je(),q(pn(w),function(b){var x=hr(b,null);x!=null&&C.set(x,!0)})),m&&m.eachComponent(y,function(b){if(!(C&&C.get(b.id)!=null))if(Jm(p))if(b instanceof Gr)p.type==="highlight"&&!p.notBlur&&!b.get(["emphasis","disabled"])&&nM(b,p,f._api);else{var x=$f(b.mainType,b.componentIndex,p.name,f._api),E=x.focusSelf,k=x.dispatchers;p.type==="highlight"&&E&&!p.notBlur&&jf(b.mainType,b.componentIndex,f._api),k&&q(k,function(T){p.type==="highlight"?zf(T):Hf(T)})}else Wf(p)&&b instanceof Gr&&(iM(b,p,f._api),qm(b),Gn(f))},f),m&&m.eachComponent(y,function(b){C&&C.get(b.id)!=null||S(f[g==="series"?"_chartsMap":"_componentsMap"][b.__viewId])},f);function S(b){b&&b.__alive&&b[h]&&b[h](b.__model,m,f._api,p)}},Jr={prepareAndUpdate:function(f){gi(this),Jr.update.call(this,f,f&&{optionChanged:f.newOption!=null})},update:function(f,h){var p=this._model,g=this._api,v=this._zr,m=this._coordSysMgr,_=this._scheduler;if(p){p.setUpdatePayload(f),_.restoreData(p,f),_.performSeriesTasks(p),m.create(p,g),_.performDataProcessorTasks(p,f),Dh(this,p),m.update(p,g),r(p),_.performVisualTasks(p,f);var y=p.get("backgroundColor")||"transparent";v.setBackgroundColor(y);var w=p.get("darkMode");w!=null&&w!=="auto"&&v.setDarkMode(w),Ph(this,p,g,f,h),br.trigger("afterupdate",p,g)}},updateTransform:function(f){var h=this,p=this._model,g=this._api;if(p){p.setUpdatePayload(f);var v=[];p.eachComponent(function(_,y){if(_!=="series"){var w=h.getViewOfComponentModel(y);if(w&&w.__alive)if(w.updateTransform){var C=w.updateTransform(y,p,g,f);C&&C.update&&v.push(w)}else v.push(w)}});var m=Je();p.eachSeries(function(_){var y=h._chartsMap[_.__viewId];if(y.updateTransform){var w=y.updateTransform(_,p,g,f);w&&w.update&&m.set(_.uid,1)}else m.set(_.uid,1)}),r(p),this._scheduler.performVisualTasks(p,f,{setDirty:!0,dirtyMap:m}),Gc(this,p,g,f,{},m),br.trigger("afterupdate",p,g)}},updateView:function(f){var h=this._model;h&&(h.setUpdatePayload(f),qr.markUpdateMethod(f,"updateView"),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0}),Ph(this,h,this._api,f,{}),br.trigger("afterupdate",h,this._api))},updateVisual:function(f){var h=this,p=this._model;p&&(p.setUpdatePayload(f),p.eachSeries(function(g){g.getData().clearAllVisual()}),qr.markUpdateMethod(f,"updateVisual"),r(p),this._scheduler.performVisualTasks(p,f,{visualType:"visual",setDirty:!0}),p.eachComponent(function(g,v){if(g!=="series"){var m=h.getViewOfComponentModel(v);m&&m.__alive&&m.updateVisual(v,p,h._api,f)}}),p.eachSeries(function(g){h._chartsMap[g.__viewId].updateVisual(g,p,h._api,f)}),br.trigger("afterupdate",p,this._api))},updateLayout:function(f){Jr.update.call(this,f)}};function n(f,h,p,g,v){if(f._disposed){Rn(f.id);return}for(var m=f._model,_=f._coordSysMgr.getCoordinateSystems(),y,w=ff(m,p),C=0;C<_.length;C++){var S=_[C];if(S[h]&&(y=S[h](m,w,g,v))!=null)return y}process.env.NODE_ENV!=="production"&&zr("No coordinate system that supports "+h+" found by the given finder.")}Yc=n,Dh=function(f,h){var p=f._chartsMap,g=f._scheduler;h.eachSeries(function(v){g.updateStreamModes(v,p[v.__viewId])})},Ah=function(f,h){var p=this,g=this.getModel(),v=f.type,m=f.escapeConnect,_=qc[v],y=(_.update||"update").split(":"),w=y.pop(),C=y[0]!=null&&pr(y[0]);this[$t]=!0,So(this);var S=[f],b=!1;f.batch&&(b=!0,S=bt(f.batch,function(M){return M=sn(Ce({},M),f),M.batch=null,M}));var x=[],E,k=[],T=_.nonRefinedEventType,R=Wf(f),D=Jm(f);if(D&&Gm(this._api),q(S,function(M){var I=_.action(M,g,p._api);if(_.refineEvent?k.push(I):E=I,E=E||Ce({},M),E.type=T,x.push(E),D){var $=tm(f),ee=$.queryOptionMap,oe=$.mainTypeSpecified?ee.keys()[0]:"series";Uc(p,w,M,oe),Gn(p)}else R?(Uc(p,w,M,"series"),Gn(p)):C&&Uc(p,w,M,C.main,C.sub)}),w!=="none"&&!D&&!R&&!C)try{this[Kt]?(gi(this),Jr.update.call(this,f),this[Kt]=null):Jr[w].call(this,f)}catch(M){throw this[$t]=!1,M}if(b?E={type:T,escapeConnect:m,batch:x}:E=x[0],this[$t]=!1,!h){var A=void 0;if(_.refineEvent){var L=_.refineEvent(k,f,g,this._api).eventContent;je(ze(L)),A=sn({type:_.refinedEventType},L),A.fromAction=f.type,A.fromActionPayload=f,A.escapeConnect=!0}var N=this._messageCenter;N.trigger(E.type,E),A&&N.trigger(A.type,A)}},bo=function(f){for(var h=this._pendingActions;h.length;){var p=h.shift();Ah.call(this,p,f)}},Co=function(f){!f&&this.trigger("updated")},ow=function(f,h){f.on("rendered",function(p){h.trigger("rendered",p),f.animation.isFinished()&&!h[Kt]&&!h._scheduler.unfinished&&!h._pendingActions.length&&h.trigger("finished")})},lw=function(f,h){f.on("mouseover",function(p){var g=p.target,v=Oc(g,co);v&&(rM(v,p,h._api),Gn(h))}).on("mouseout",function(p){var g=p.target,v=Oc(g,co);v&&(aM(v,p,h._api),Gn(h))}).on("click",function(p){var g=p.target,v=Oc(g,function(y){return En(y).dataIndex!=null},!0);if(v){var m=v.selected?"unselect":"select",_=En(v);h._api.dispatchAction({type:m,dataType:_.dataType,dataIndexInside:_.dataIndex,seriesIndex:_.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(h){h.clearColorPalette()})}function a(f){var h=[],p=[],g=!1;if(f.eachComponent(function(y,w){var C=w.get("zlevel")||0,S=w.get("z")||0,b=w.getZLevelKey();g=g||!!b,(y==="series"?p:h).push({zlevel:C,z:S,idx:w.componentIndex,type:y,key:b})}),g){var v=h.concat(p),m,_;Ps(v,function(y,w){return y.zlevel===w.zlevel?y.z-w.z:y.zlevel-w.zlevel}),q(v,function(y){var w=f.getComponent(y.type,y.idx),C=y.zlevel,S=y.key;m!=null&&(C=Math.max(m,C)),S?(C===m&&S!==_&&C++,_=S):_&&(C===m&&C++,_=""),m=C,w.setZLevel(C)})}}Ph=function(f,h,p,g,v){a(h),sw(f,h,p,g,v),q(f._chartsViews,function(m){m.__alive=!1}),Gc(f,h,p,g,v),q(f._chartsViews,function(m){m.__alive||m.remove(h,p)})},sw=function(f,h,p,g,v,m){q(m||f._componentsViews,function(_){var y=_.__model;u(y,_),_.render(y,h,p,g),c(y,_),d(y,_)})},Gc=function(f,h,p,g,v,m){var _=f._scheduler;v=Ce(v||{},{updatedSeries:h.getSeries()}),br.trigger("series:beforeupdate",h,p,v);var y=!1;h.eachSeries(function(w){var C=f._chartsMap[w.__viewId];C.__alive=!0;var S=C.renderTask;_.updatePayload(S,g),u(w,C),m&&m.get(w.uid)&&S.dirty(),S.perform(_.getPerformArgs(S))&&(y=!0),C.group.silent=!!w.get("silent"),l(w,C),qm(w)}),_.unfinished=y||_.unfinished,br.trigger("series:layoutlabels",h,p,v),br.trigger("series:transition",h,p,v),h.eachSeries(function(w){var C=f._chartsMap[w.__viewId];c(w,C),d(w,C)}),o(f,h),br.trigger("series:afterupdate",h,p,v)},Gn=function(f){f[Rh]=!0,f.getZr().wakeUp()},So=function(f){f[Wc]=(f[Wc]+1)%1e3},uw=function(f){f[Rh]&&(f.getZr().storage.traverse(function(h){mc(h)||i(h)}),f[Rh]=!1)};function i(f){for(var h=[],p=f.currentStates,g=0;g<p.length;g++){var v=p[g];v==="emphasis"||v==="blur"||v==="select"||h.push(v)}f.selected&&f.states.select&&h.push("select"),f.hoverState===2&&f.states.emphasis?h.push("emphasis"):f.hoverState===1&&f.states.blur&&h.push("blur"),f.useStates(h)}function o(f,h){var p=f._zr.storage,g=0;p.traverse(function(v){v.isGroup||g++}),g>h.get("hoverLayerThreshold")&&!it.node&&!it.worker&&h.eachSeries(function(v){if(!v.preventUsingHoverLayer){var m=f._chartsMap[v.__viewId];m.__alive&&m.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function l(f,h){var p=f.get("blendMode")||null;h.eachRendered(function(g){g.isGroup||(g.style.blend=p)})}function c(f,h){if(!f.preventAutoZ){var p=JM(f);h.eachRendered(function(g){return XM(g,p.z,p.zlevel),!0})}}function u(f,h){h.eachRendered(function(p){if(!mc(p)){var g=p.getTextContent(),v=p.getTextGuideLine();p.stateTransition&&(p.stateTransition=null),g&&g.stateTransition&&(g.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),p.hasState()?(p.prevStates=p.currentStates,p.clearStates()):p.prevStates&&(p.prevStates=null)}})}function d(f,h){var p=f.getModel("stateAnimation"),g=f.isAnimationEnabled(),v=p.get("duration"),m=v>0?{duration:v,delay:p.get("delay"),easing:p.get("easing")}:null;h.eachRendered(function(_){if(_.states&&_.states.emphasis){if(mc(_))return;if(_ instanceof zt&&dM(_),_.__dirty){var y=_.prevStates;y&&_.useStates(y)}if(g){_.stateTransition=m;var w=_.getTextContent(),C=_.getTextGuideLine();w&&(w.stateTransition=m),C&&(C.stateTransition=m)}_.__dirty&&i(_)}})}cw=function(f){return new((function(h){et(p,h);function p(){return h!==null&&h.apply(this,arguments)||this}return p.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},p.prototype.getComponentByElement=function(g){for(;g;){var v=g.__ecComponentInfo;if(v!=null)return f._model.getComponent(v.mainType,v.index);g=g.parent}},p.prototype.enterEmphasis=function(g,v){zf(g,v),Gn(f)},p.prototype.leaveEmphasis=function(g,v){Hf(g,v),Gn(f)},p.prototype.enterBlur=function(g){tM(g),Gn(f)},p.prototype.leaveBlur=function(g){$m(g),Gn(f)},p.prototype.enterSelect=function(g){Wm(g),Gn(f)},p.prototype.leaveSelect=function(g){Um(g),Gn(f)},p.prototype.getModel=function(){return f.getModel()},p.prototype.getViewOfComponentModel=function(g){return f.getViewOfComponentModel(g)},p.prototype.getViewOfSeriesModel=function(g){return f.getViewOfSeriesModel(g)},p.prototype.getMainProcessVersion=function(){return f[Wc]},p})(Vy))(f)},iP=function(f){function h(p,g){for(var v=0;v<p.length;v++){var m=p[v];m[Mh]=g}}q(Jc,function(p,g){f._messageCenter.on(g,function(v){if(fw[f.group]&&f[Mh]!==ew){if(v&&v.escapeConnect)return;var m=f.makeActionFromEvent(v),_=[];q(zh,function(y){y!==f&&y.group===f.group&&_.push(y)}),h(_,ew),q(_,function(y){y[Mh]!==rP&&y.dispatchAction(m)}),h(_,aP)}})})}})(),t})(dr),Nh=oP.prototype;Nh.on=tw("on"),Nh.off=tw("off"),Nh.one=function(e,t,n){var r=this;Hr("ECharts#one is deprecated.");function a(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];t&&t.apply&&t.apply(this,i),r.off(e,a)}this.on.call(this,e,a,n)};var lP=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Rn(e){process.env.NODE_ENV!=="production"&&zr("Instance "+e+" has been disposed")}var qc={},Jc={},Lh={},Ih=[],Oh=[],Xc=[],dw={},Vh={},zh={},fw={},h4=+new Date-0,p4=+new Date-0,sP="_echarts_instance_";function hw(e,t){dw[e]=t}function Hh(e){kt(Oh,e)<0&&Oh.push(e)}function pw(e,t){jh(Ih,e,t,JA)}function cP(e){Fh("afterinit",e)}function uP(e){Fh("afterupdate",e)}function Fh(e,t){br.on(e,t)}function xo(e,t,n){var r,a,i,o,l;ot(t)&&(n=t,t=""),ze(e)?(r=e.type,a=e.event,o=e.update,l=e.publishNonRefinedEvent,n||(n=e.action),i=e.refineEvent):(r=e,a=t);function c(d){return d.toLowerCase()}a=c(a||r);var u=i?c(r):a;qc[r]||(je(Q_.test(r)&&Q_.test(a)),i&&je(a!==r),qc[r]={actionType:r,refinedEventType:a,nonRefinedEventType:u,update:o,action:n,refineEvent:i},Lh[a]=1,i&&l&&(Lh[u]=1),process.env.NODE_ENV!=="production"&&Jc[u]&&At(u+' must not be shared; use "refineEvent" if you intend to share an event name.'),Jc[u]=r)}function dP(e,t){Ey.register(e,t)}function gw(e,t){jh(Xc,e,t,X_,"layout")}function vi(e,t){jh(Xc,e,t,K_,"visual")}var vw=[];function jh(e,t,n,r,a){if((ot(t)||ze(t))&&(n=t,t=r),process.env.NODE_ENV!=="production"){if(isNaN(t)||t==null)throw new Error("Illegal priority");q(e,function(o){je(o.__raw!==n)})}if(!(kt(vw,n)>=0)){vw.push(n);var i=S_.wrapStageHandler(n,a);i.__prio=t,i.__raw=n,e.push(i)}}function mw(e,t){Vh[e]=t}function fP(e,t,n){var r=jA("registerMap");r&&r(e,t,n)}var hP=kD;vi(Th,GD),vi($c,qD),vi($c,JD),vi(Th,sA),vi($c,cA),vi(Z_,HA),Hh(Uy),pw(GA,lD),mw("default",XD),xo({type:Nf,event:Nf,update:Nf},Vn),xo({type:Lf,event:Lf,update:Lf},Vn),xo({type:Nm,event:If,update:Nm,action:Vn,refineEvent:$h,publishNonRefinedEvent:!0}),xo({type:Lm,event:If,update:Lm,action:Vn,refineEvent:$h,publishNonRefinedEvent:!0}),xo({type:Im,event:If,update:Im,action:Vn,refineEvent:$h,publishNonRefinedEvent:!0});function $h(e,t,n,r){return{eventContent:{selected:oM(n),isFromClick:t.isFromClick||!1}}}hw("default",{}),hw("dark",R_);function Ll(e){return e==null?0:e.length||1}function yw(e){return e}var pP=(function(){function e(t,n,r,a,i,o){this._old=t,this._new=n,this._oldKeyGetter=r||yw,this._newKeyGetter=a||yw,this.context=i,this._diffModeMultiple=o==="multiple"}return e.prototype.add=function(t){return this._add=t,this},e.prototype.update=function(t){return this._update=t,this},e.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},e.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},e.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},e.prototype.remove=function(t){return this._remove=t,this},e.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},e.prototype._executeOneToOne=function(){var t=this._old,n=this._new,r={},a=new Array(t.length),i=new Array(n.length);this._initIndexMap(t,null,a,"_oldKeyGetter"),this._initIndexMap(n,r,i,"_newKeyGetter");for(var o=0;o<t.length;o++){var l=a[o],c=r[l],u=Ll(c);if(u>1){var d=c.shift();c.length===1&&(r[l]=c[0]),this._update&&this._update(d,o)}else u===1?(r[l]=null,this._update&&this._update(c,o)):this._remove&&this._remove(o)}this._performRestAdd(i,r)},e.prototype._executeMultiple=function(){var t=this._old,n=this._new,r={},a={},i=[],o=[];this._initIndexMap(t,r,i,"_oldKeyGetter"),this._initIndexMap(n,a,o,"_newKeyGetter");for(var l=0;l<i.length;l++){var c=i[l],u=r[c],d=a[c],f=Ll(u),h=Ll(d);if(f>1&&h===1)this._updateManyToOne&&this._updateManyToOne(d,u),a[c]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(d,u),a[c]=null;else if(f===1&&h===1)this._update&&this._update(d,u),a[c]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(d,u),a[c]=null;else if(f>1)for(var p=0;p<f;p++)this._remove&&this._remove(u[p]);else this._remove&&this._remove(u)}this._performRestAdd(o,a)},e.prototype._performRestAdd=function(t,n){for(var r=0;r<t.length;r++){var a=t[r],i=n[a],o=Ll(i);if(o>1)for(var l=0;l<o;l++)this._add&&this._add(i[l]);else o===1&&this._add&&this._add(i);n[a]=null}},e.prototype._initIndexMap=function(t,n,r,a){for(var i=this._diffModeMultiple,o=0;o<t.length;o++){var l="_ec_"+this[a](t[o],o);if(i||(r[o]=l),!!n){var c=n[l],u=Ll(c);u===0?(n[l]=o,i&&r.push(l)):u===1?n[l]=[c,o]:c.push(o)}}},e})(),gP=(function(){function e(t,n){this._encode=t,this._schema=n}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},e})();function vP(e,t){var n={},r=n.encode={},a=Je(),i=[],o=[],l={};q(e.dimensions,function(h){var p=e.getDimensionInfo(h),g=p.coordDim;if(g){process.env.NODE_ENV!=="production"&&je(sh.get(g)==null);var v=p.coordDimIndex;Wh(r,g)[v]=h,p.isExtraCoord||(a.set(g,1),mP(p.type)&&(i[0]=h),Wh(l,g)[v]=e.getDimensionIndex(p.name)),p.defaultTooltip&&o.push(h)}sh.each(function(m,_){var y=Wh(r,_),w=p.otherDims[_];w!=null&&w!==!1&&(y[w]=p.name)})});var c=[],u={};a.each(function(h,p){var g=r[p];u[p]=g[0],c=c.concat(g)}),n.dataDimsOnCoord=c,n.dataDimIndicesOnCoord=bt(c,function(h){return e.getDimensionInfo(h).storeDimIndex}),n.encodeFirstDimNotExtra=u;var d=r.label;d&&d.length&&(i=d.slice());var f=r.tooltip;return f&&f.length?o=f.slice():o.length||(o=i.slice()),r.defaultedLabel=i,r.defaultedTooltip=o,n.userOutput=new gP(l,t),n}function Wh(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function mP(e){return!(e==="ordinal"||e==="time")}var Kc=(function(){function e(t){this.otherDims={},t!=null&&Ce(this,t)}return e})(),yP=nn(),_P={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},_w=(function(){function e(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=bw(this.source)))},e.prototype.getSourceDimensionIndex=function(t){return qe(this._dimNameMap.get(t),-1)},e.prototype.getSourceDimension=function(t){var n=this.source.dimensionsDefine;if(n)return n[t]},e.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,n=Xy(this.source),r=!Cw(t),a="",i=[],o=0,l=0;o<t;o++){var c=void 0,u=void 0,d=void 0,f=this.dimensions[l];if(f&&f.storeDimIndex===o)c=n?f.name:null,u=f.type,d=f.ordinalMeta,l++;else{var h=this.getSourceDimension(o);h&&(c=n?h.name:null,u=h.type)}i.push({property:c,type:u,ordinalMeta:d}),n&&c!=null&&(!f||!f.isCalculationCoord)&&(a+=r?c.replace(/\`/g,"`1").replace(/\$/g,"`2"):c),a+="$",a+=_P[u]||"f",d&&(a+=d.uid),a+="$"}var p=this.source;return{dimensions:i,hash:[p.seriesLayoutBy,p.startIndex,a].join("$$")}},e.prototype.makeOutputDimensionNames=function(){for(var t=[],n=0,r=0;n<this._fullDimCount;n++){var a=void 0,i=this.dimensions[r];if(i&&i.storeDimIndex===n)i.isCalculationCoord||(a=i.name),r++;else{var o=this.getSourceDimension(n);o&&(a=o.name)}t.push(a)}return t},e.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e})();function wP(e){return e instanceof _w}function ww(e){for(var t=Je(),n=0;n<(e||[]).length;n++){var r=e[n],a=ze(r)?r.name:r;a!=null&&t.get(a)==null&&t.set(a,n)}return t}function bw(e){var t=yP(e);return t.dimNameMap||(t.dimNameMap=ww(e.dimensionsDefine))}function Cw(e){return e>30}var Il=ze,ha=bt,bP=typeof Int32Array>"u"?Array:Int32Array,CP="e\0\0",Sw=-1,SP=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],xP=["_approximateExtent"],xw,Zc,Ol,Eo,Uh,Vl,Yh,EP=(function(){function e(t,n){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var r,a=!1;wP(t)?(r=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(a=!0,r=t),r=r||["x","y"];for(var i={},o=[],l={},c=!1,u={},d=0;d<r.length;d++){var f=r[d],h=Ge(f)?new Kc({name:f}):f instanceof Kc?f:new Kc(f),p=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=p,h.coordDimIndex=0);var g=h.otherDims=h.otherDims||{};o.push(p),i[p]=h,u[p]!=null&&(c=!0),h.createInvertedIndices&&(l[p]=[]);var v=d;Dt(h.storeDimIndex)&&(v=h.storeDimIndex),g.itemName===0&&(this._nameDimIdx=v),g.itemId===0&&(this._idDimIdx=v),process.env.NODE_ENV!=="production"&&je(a||h.storeDimIndex>=0),a&&(h.storeDimIndex=d)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(c),this.hostModel=n,this._invertedIndicesMap=l,this._dimOmitted){var m=this._dimIdxToName=Je();q(o,function(_){m.set(i[_].storeDimIndex,_)})}}return e.prototype.getDimension=function(t){var n=this._recognizeDimIndex(t);if(n==null)return t;if(n=t,!this._dimOmitted)return this.dimensions[n];var r=this._dimIdxToName.get(n);if(r!=null)return r;var a=this._schema.getSourceDimension(n);if(a)return a.name},e.prototype.getDimensionIndex=function(t){var n=this._recognizeDimIndex(t);if(n!=null)return n;if(t==null)return-1;var r=this._getDimInfo(t);return r?r.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},e.prototype._recognizeDimIndex=function(t){if(Dt(t)||t!=null&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},e.prototype._getStoreDimIndex=function(t){var n=this.getDimensionIndex(t);if(process.env.NODE_ENV!=="production"&&n==null)throw new Error("Unknown dimension "+t);return n},e.prototype.getDimensionInfo=function(t){return this._getDimInfo(this.getDimension(t))},e.prototype._initGetDimensionInfo=function(t){var n=this._dimInfos;this._getDimInfo=t?function(r){return n.hasOwnProperty(r)?n[r]:void 0}:function(r){return n[r]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(t,n){var r=this._dimSummary;if(n==null)return r.encodeFirstDimNotExtra[t];var a=r.encode[t];return a?a[n]:null},e.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(t,n,r){var a=this,i;if(t instanceof _h&&(i=t),!i){var o=this.dimensions,l=ph(t)||Bn(t)?new Qy(t,o.length):t;i=new _h;var c=ha(o,function(u){return{type:a._dimInfos[u].type,property:u}});i.initData(l,c,r)}this._store=i,this._nameList=(n||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=vP(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(t){var n=this._store.appendData(t);this._doInit(n[0],n[1])},e.prototype.appendValues=function(t,n){var r=this._store.appendValues(t,n&&n.length),a=r.start,i=r.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),n)for(var l=a;l<i;l++){var c=l-a;this._nameList[l]=n[c],o&&Yh(this,l)}},e.prototype._updateOrdinalMeta=function(){for(var t=this._store,n=this.dimensions,r=0;r<n.length;r++){var a=this._dimInfos[n[r]];a.ordinalMeta&&t.collectOrdinalMeta(a.storeDimIndex,a.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return this._idDimIdx==null&&t.getSource().sourceFormat!=="typedArray"&&!t.fillStorage},e.prototype._doInit=function(t,n){if(!(t>=n)){var r=this._store.getProvider();this._updateOrdinalMeta();var a=this._nameList,i=this._idList;if(r.getSource().sourceFormat==="original"&&!r.pure)for(var o=[],l=t;l<n;l++){var c=r.getItem(l,o);if(!this.hasItemOption&&PR(c)&&(this.hasItemOption=!0),c){var u=c.name;a[l]==null&&u!=null&&(a[l]=hr(u,null));var d=c.id;i[l]==null&&d!=null&&(i[l]=hr(d,null))}}if(this._shouldMakeIdFromName())for(var l=t;l<n;l++)Yh(this,l);xw(this)}},e.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},e.prototype.setApproximateExtent=function(t,n){n=this.getDimension(n),this._approximateExtent[n]=t.slice()},e.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},e.prototype.setCalculationInfo=function(t,n){Il(t)?Ce(this._calculationInfo,t):this._calculationInfo[t]=n},e.prototype.getName=function(t){var n=this.getRawIndex(t),r=this._nameList[n];return r==null&&this._nameDimIdx!=null&&(r=Ol(this,this._nameDimIdx,n)),r==null&&(r=""),r},e.prototype._getCategory=function(t,n){var r=this._store.get(t,n),a=this._store.getOrdinalMeta(t);return a?a.categories[r]:r},e.prototype.getId=function(t){return Zc(this,this.getRawIndex(t))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(t,n){var r=this._store,a=this._dimInfos[t];if(a)return r.get(a.storeDimIndex,n)},e.prototype.getByRawIndex=function(t,n){var r=this._store,a=this._dimInfos[t];if(a)return r.getByRawIndex(a.storeDimIndex,n)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},e.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},e.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},e.prototype.getValues=function(t,n){var r=this,a=this._store;return Fe(t)?a.getValues(ha(t,function(i){return r._getStoreDimIndex(i)}),n):a.getValues(t)},e.prototype.hasValue=function(t){for(var n=this._dimSummary.dataDimIndicesOnCoord,r=0,a=n.length;r<a;r++)if(isNaN(this._store.get(n[r],t)))return!1;return!0},e.prototype.indexOfName=function(t){for(var n=0,r=this._store.count();n<r;n++)if(this.getName(n)===t)return n;return-1},e.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},e.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},e.prototype.rawIndexOf=function(t,n){var r=t&&this._invertedIndicesMap[t];if(process.env.NODE_ENV!=="production"&&!r)throw new Error("Do not supported yet");var a=r&&r[n];return a==null||isNaN(a)?Sw:a},e.prototype.each=function(t,n,r){"use strict";ot(t)&&(r=n,n=t,t=[]);var a=r||this,i=ha(Eo(t),this._getStoreDimIndex,this);this._store.each(i,a?Sn(n,a):n)},e.prototype.filterSelf=function(t,n,r){"use strict";ot(t)&&(r=n,n=t,t=[]);var a=r||this,i=ha(Eo(t),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Sn(n,a):n),this},e.prototype.selectRange=function(t){"use strict";var n=this,r={},a=Vt(t),i=[];return q(a,function(o){var l=n._getStoreDimIndex(o);r[l]=t[o],i.push(l)}),this._store=this._store.selectRange(r),this},e.prototype.mapArray=function(t,n,r){"use strict";ot(t)&&(r=n,n=t,t=[]),r=r||this;var a=[];return this.each(t,function(){a.push(n&&n.apply(this,arguments))},r),a},e.prototype.map=function(t,n,r,a){"use strict";var i=r||a||this,o=ha(Eo(t),this._getStoreDimIndex,this),l=Vl(this);return l._store=this._store.map(o,i?Sn(n,i):n),l},e.prototype.modify=function(t,n,r,a){var i=this,o=r||a||this;process.env.NODE_ENV!=="production"&&q(Eo(t),function(c){i.getDimensionInfo(c).isCalculationCoord||console.error("Danger: only stack dimension can be modified")});var l=ha(Eo(t),this._getStoreDimIndex,this);this._store.modify(l,o?Sn(n,o):n)},e.prototype.downSample=function(t,n,r,a){var i=Vl(this);return i._store=this._store.downSample(this._getStoreDimIndex(t),n,r,a),i},e.prototype.minmaxDownSample=function(t,n){var r=Vl(this);return r._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),n),r},e.prototype.lttbDownSample=function(t,n){var r=Vl(this);return r._store=this._store.lttbDownSample(this._getStoreDimIndex(t),n),r},e.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},e.prototype.getItemModel=function(t){var n=this.hostModel;return new vn(this.getRawDataItem(t),n,n&&n.ecModel)},e.prototype.diff=function(t){var n=this;return new pP(t?t.getStore().getIndices():[],this.getStore().getIndices(),function(r){return Zc(t,r)},function(r){return Zc(n,r)})},e.prototype.getVisual=function(t){var n=this._visual;return n&&n[t]},e.prototype.setVisual=function(t,n){this._visual=this._visual||{},Il(t)?Ce(this._visual,t):this._visual[t]=n},e.prototype.getItemVisual=function(t,n){var r=this._itemVisuals[t],a=r&&r[n];return a??this.getVisual(n)},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(t,n){var r=this._itemVisuals,a=r[t];a||(a=r[t]={});var i=a[n];return i==null&&(i=this.getVisual(n),Fe(i)?i=i.slice():Il(i)&&(i=Ce({},i)),a[n]=i),i},e.prototype.setItemVisual=function(t,n,r){var a=this._itemVisuals[t]||{};this._itemVisuals[t]=a,Il(n)?Ce(a,n):a[n]=r},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,n){Il(t)?Ce(this._layout,t):this._layout[t]=n},e.prototype.getLayout=function(t){return this._layout[t]},e.prototype.getItemLayout=function(t){return this._itemLayouts[t]},e.prototype.setItemLayout=function(t,n,r){this._itemLayouts[t]=r?Ce(this._itemLayouts[t]||{},n):n},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(t,n){G2(this.hostModel&&this.hostModel.seriesIndex,this.dataType,t,n),this._graphicEls[t]=n},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,n){q(this._graphicEls,function(r,a){r&&t&&t.call(n,r,a)})},e.prototype.cloneShallow=function(t){return t||(t=new e(this._schema?this._schema:ha(this.dimensions,this._getDimInfo,this),this.hostModel)),Uh(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,n){var r=this[t];ot(r)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var a=r.apply(this,arguments);return n.apply(this,[a].concat(gd(arguments)))})},e.internalField=(function(){xw=function(t){var n=t._invertedIndicesMap;q(n,function(r,a){var i=t._dimInfos[a],o=i.ordinalMeta,l=t._store;if(o){r=n[a]=new bP(o.categories.length);for(var c=0;c<r.length;c++)r[c]=Sw;for(var c=0;c<l.count();c++)r[l.get(i.storeDimIndex,c)]=c}})},Ol=function(t,n,r){return hr(t._getCategory(n,r),null)},Zc=function(t,n){var r=t._idList[n];return r==null&&t._idDimIdx!=null&&(r=Ol(t,t._idDimIdx,n)),r==null&&(r=CP+n),r},Eo=function(t){return Fe(t)||(t=t!=null?[t]:[]),t},Vl=function(t){var n=new e(t._schema?t._schema:ha(t.dimensions,t._getDimInfo,t),t.hostModel);return Uh(n,t),n},Uh=function(t,n){q(SP.concat(n.__wrappedMethods||[]),function(r){n.hasOwnProperty(r)&&(t[r]=n[r])}),t.__wrappedMethods=n.__wrappedMethods,q(xP,function(r){t[r]=ft(n[r])}),t._calculationInfo=Ce({},n._calculationInfo)},Yh=function(t,n){var r=t._nameList,a=t._idList,i=t._nameDimIdx,o=t._idDimIdx,l=r[n],c=a[n];if(l==null&&i!=null&&(r[n]=l=Ol(t,i,n)),c==null&&o!=null&&(a[n]=c=Ol(t,o,n)),c==null&&l!=null){var u=t._nameRepeatCount,d=u[l]=(u[l]||0)+1;c=l,d>1&&(c+="__ec__"+d),a[n]=c}}})(),e})();function kP(e,t){return TP(e,t).dimensions}function TP(e,t){ph(e)||(e=Yy(e)),t=t||{};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],a=Je(),i=[],o=MP(e,n,r,t.dimensionsCount),l=t.canOmitUnusedDimensions&&Cw(o),c=r===e.dimensionsDefine,u=c?bw(e):ww(r),d=t.encodeDefine;!d&&t.encodeDefaulter&&(d=t.encodeDefaulter(e,o));for(var f=Je(d),h=new l_(o),p=0;p<h.length;p++)h[p]=-1;function g(E){var k=h[E];if(k<0){var T=r[E],R=ze(T)?T:{name:T},D=new Kc,A=R.name;return A!=null&&u.get(A)!=null&&(D.name=D.displayName=A),R.type!=null&&(D.type=R.type),R.displayName!=null&&(D.displayName=R.displayName),h[E]=i.length,D.storeDimIndex=E,i.push(D),D}return i[k]}if(!l)for(var p=0;p<o;p++)g(p);f.each(function(E,k){var T=pn(E).slice();if(T.length===1&&!Ge(T[0])&&T[0]<0){f.set(k,!1);return}var R=f.set(k,[]);q(T,function(D,A){var L=Ge(D)?u.get(D):D;L!=null&&L<o&&(R[A]=L,m(g(L),k,A))})});var v=0;q(n,function(E){var k,T,R,D;if(Ge(E))k=E,D={};else{D=E,k=D.name;var A=D.ordinalMeta;D.ordinalMeta=null,D=Ce({},D),D.ordinalMeta=A,T=D.dimsDef,R=D.otherDims,D.name=D.coordDim=D.coordDimIndex=D.dimsDef=D.otherDims=null}var L=f.get(k);if(L!==!1){if(L=pn(L),!L.length)for(var N=0;N<(T&&T.length||1);N++){for(;v<o&&g(v).coordDim!=null;)v++;v<o&&L.push(v++)}q(L,function(M,I){var $=g(M);if(c&&D.type!=null&&($.type=D.type),m(sn($,D),k,I),$.name==null&&T){var ee=T[I];!ze(ee)&&(ee={name:ee}),$.name=$.displayName=ee.name,$.defaultTooltip=ee.defaultTooltip}R&&sn($.otherDims,R)})}});function m(E,k,T){sh.get(k)!=null?E.otherDims[k]=T:(E.coordDim=k,E.coordDimIndex=T,a.set(k,!0))}var _=t.generateCoord,y=t.generateCoordCount,w=y!=null;y=_?y||1:0;var C=_||"value";function S(E){E.name==null&&(E.name=E.coordDim)}if(l)q(i,function(E){S(E)}),i.sort(function(E,k){return E.storeDimIndex-k.storeDimIndex});else for(var b=0;b<o;b++){var x=g(b);x.coordDim==null&&(x.coordDim=BP(C,a,w),x.coordDimIndex=0,(!_||y<=0)&&(x.isExtraCoord=!0),y--),S(x),x.type==null&&(Dy(e,b)===An.Must||x.isExtraCoord&&(x.otherDims.itemName!=null||x.otherDims.seriesName!=null))&&(x.type="ordinal")}return RP(i),new _w({source:e,dimensions:i,fullDimensionCount:o,dimensionOmitted:l})}function RP(e){for(var t=Je(),n=0;n<e.length;n++){var r=e[n],a=r.name,i=t.get(a)||0;i>0&&(r.name=a+(i-1)),i++,t.set(a,i)}}function MP(e,t,n,r){var a=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return q(t,function(i){var o;ze(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function BP(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}function Gh(e,t){return t=t||{},QM(e,null,null,t.state!=="normal")}var Ew=[],DP={registerPreprocessor:Hh,registerProcessor:pw,registerPostInit:cP,registerPostUpdate:uP,registerUpdateLifecycle:Fh,registerAction:xo,registerCoordinateSystem:dP,registerLayout:gw,registerVisual:vi,registerTransform:hP,registerLoading:mw,registerMap:fP,registerImpl:FA,PRIORITY:nP,ComponentModel:yt,ComponentView:_o,SeriesModel:Gr,ChartView:qr,registerComponentModel:function(e){yt.registerClass(e)},registerComponentView:function(e){_o.registerClass(e)},registerSeriesModel:function(e){Gr.registerClass(e)},registerChartView:function(e){qr.registerClass(e)},registerCustomSeries:function(e,t){WA(e,t)},registerSubTypeDefaulter:function(e,t){yt.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){mR(e,t)}};function qh(e){if(Fe(e)){q(e,function(t){qh(t)});return}kt(Ew,e)>=0||(Ew.push(e),ot(e)&&(e={install:e}),e.install(DP))}function AP(e){var t=Gr.extend(e);return Gr.registerClass(t),t}function PP(e){var t=qr.extend(e);return qr.registerClass(t),t}var zl=Math.PI*2,mi=ti.CMD,NP=["top","right","bottom","left"];function LP(e,t,n,r,a){var i=n.width,o=n.height;switch(e){case"top":r.set(n.x+i/2,n.y-t),a.set(0,-1);break;case"bottom":r.set(n.x+i/2,n.y+o+t),a.set(0,1);break;case"left":r.set(n.x-t,n.y+o/2),a.set(-1,0);break;case"right":r.set(n.x+i+t,n.y+o/2),a.set(1,0);break}}function IP(e,t,n,r,a,i,o,l,c){o-=e,l-=t;var u=Math.sqrt(o*o+l*l);o/=u,l/=u;var d=o*n+e,f=l*n+t;if(Math.abs(r-a)%zl<1e-4)return c[0]=d,c[1]=f,u-n;if(i){var h=r;r=jr(a),a=jr(h)}else r=jr(r),a=jr(a);r>a&&(a+=zl);var p=Math.atan2(l,o);if(p<0&&(p+=zl),p>=r&&p<=a||p+zl>=r&&p+zl<=a)return c[0]=d,c[1]=f,u-n;var g=n*Math.cos(r)+e,v=n*Math.sin(r)+t,m=n*Math.cos(a)+e,_=n*Math.sin(a)+t,y=(g-o)*(g-o)+(v-l)*(v-l),w=(m-o)*(m-o)+(_-l)*(_-l);return y<w?(c[0]=g,c[1]=v,Math.sqrt(y)):(c[0]=m,c[1]=_,Math.sqrt(w))}function Jh(e,t,n,r,a,i,o,l){var c=a-e,u=i-t,d=n-e,f=r-t,h=Math.sqrt(d*d+f*f);d/=h,f/=h;var p=(c*d+u*f)/h;l&&(p=Math.min(Math.max(p,0),1)),p*=h;var g=o[0]=e+p*d,v=o[1]=t+p*f;return Math.sqrt((g-a)*(g-a)+(v-i)*(v-i))}function kw(e,t,n,r,a,i,o){n<0&&(e=e+n,n=-n),r<0&&(t=t+r,r=-r);var l=e+n,c=t+r,u=o[0]=Math.min(Math.max(a,e),l),d=o[1]=Math.min(Math.max(i,t),c);return Math.sqrt((u-a)*(u-a)+(d-i)*(d-i))}var nr=[];function OP(e,t,n){var r=kw(t.x,t.y,t.width,t.height,e.x,e.y,nr);return n.set(nr[0],nr[1]),r}function VP(e,t,n){for(var r=0,a=0,i=0,o=0,l,c,u=1/0,d=t.data,f=e.x,h=e.y,p=0;p<d.length;){var g=d[p++];p===1&&(r=d[p],a=d[p+1],i=r,o=a);var v=u;switch(g){case mi.M:i=d[p++],o=d[p++],r=i,a=o;break;case mi.L:v=Jh(r,a,d[p],d[p+1],f,h,nr,!0),r=d[p++],a=d[p++];break;case mi.C:v=u0(r,a,d[p++],d[p++],d[p++],d[p++],d[p],d[p+1],f,h,nr),r=d[p++],a=d[p++];break;case mi.Q:v=h0(r,a,d[p++],d[p++],d[p],d[p+1],f,h,nr),r=d[p++],a=d[p++];break;case mi.A:var m=d[p++],_=d[p++],y=d[p++],w=d[p++],C=d[p++],S=d[p++];p+=1;var b=!!(1-d[p++]);l=Math.cos(C)*y+m,c=Math.sin(C)*w+_,p<=1&&(i=l,o=c);var x=(f-m)*w/y+m;v=IP(m,_,w,C,C+S,b,x,h,nr),r=Math.cos(C+S)*y+m,a=Math.sin(C+S)*w+_;break;case mi.R:i=r=d[p++],o=a=d[p++];var E=d[p++],k=d[p++];v=kw(i,o,E,k,f,h,nr);break;case mi.Z:v=Jh(r,a,i,o,f,h,nr,!0),r=i,a=o;break}v<u&&(u=v,n.set(nr[0],nr[1]))}return u}var yi=new tt,Zt=new tt,Pn=new tt,ko=new tt,Hl=new tt;function Tw(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var a=e.textGuideLineConfig||{},i=[[0,0],[0,0],[0,0]],o=a.candidates||NP,l=r.getBoundingRect().clone();l.applyTransform(r.getComputedTransform());var c=1/0,u=a.anchor,d=e.getComputedTransform(),f=d&&Rd([],d),h=t.get("length2")||0;u&&Pn.copy(u);for(var p=0;p<o.length;p++){var g=o[p];LP(g,0,l,yi,ko),tt.scaleAndAdd(Zt,yi,ko,h),Zt.transform(f);var v=e.getBoundingRect(),m=u?u.distance(Zt):e instanceof zt?VP(Zt,e.path,Pn):OP(Zt,v,Pn);m<c&&(c=m,Zt.transform(d),Pn.transform(d),Pn.toArray(i[0]),Zt.toArray(i[1]),yi.toArray(i[2]))}zP(i,t.get("minTurnAngle")),n.setShape({points:i})}}}var Rw=[],_i=new tt;function zP(e,t){if(t<=180&&t>0){t=t/180*Math.PI,yi.fromArray(e[0]),Zt.fromArray(e[1]),Pn.fromArray(e[2]),tt.sub(ko,yi,Zt),tt.sub(Hl,Pn,Zt);var n=ko.len(),r=Hl.len();if(!(n<.001||r<.001)){ko.scale(1/n),Hl.scale(1/r);var a=ko.dot(Hl);if(Math.cos(t)<a){var i=Jh(Zt.x,Zt.y,Pn.x,Pn.y,yi.x,yi.y,Rw,!1);_i.fromArray(Rw),_i.scaleAndAdd(Hl,i/Math.tan(Math.PI-t));var o=Pn.x!==Zt.x?(_i.x-Zt.x)/(Pn.x-Zt.x):(_i.y-Zt.y)/(Pn.y-Zt.y);if(isNaN(o))return;o<0?tt.copy(_i,Zt):o>1&&tt.copy(_i,Pn),_i.toArray(e[1])}}}}function Xh(e,t,n,r){var a=n==="normal",i=a?e:e.ensureState(n);i.ignore=t;var o=r.get("smooth");o&&o===!0&&(o=.3),i.shape=i.shape||{},o>0&&(i.shape.smooth=o);var l=r.getModel("lineStyle").getLineStyle();a?e.useStyle(l):i.style=l}function HP(e,t){var n=t.smooth,r=t.points;if(r)if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var a=_d(r[0],r[1]),i=_d(r[1],r[2]);if(!a||!i){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(a,i)*n,l=wd([],r[1],r[0],o/a),c=wd([],r[1],r[2],o/i),u=wd([],l,c,.5);e.bezierCurveTo(l[0],l[1],l[0],l[1],u[0],u[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var d=1;d<r.length;d++)e.lineTo(r[d][0],r[d][1])}function FP(e,t,n){var r=e.getTextGuideLine(),a=e.getTextContent();if(!a){r&&e.removeTextGuideLine();return}for(var i=t.normal,o=i.get("show"),l=a.ignore,c=0;c<Pm.length;c++){var u=Pm[c],d=t[u],f=u==="normal";if(d){var h=d.get("show");if((f?l:qe(a.states[u]&&a.states[u].ignore,l))||!qe(h,o)){var p=f?r:r&&r.states[u];p&&(p.ignore=!0),r&&Xh(r,!0,u,d);continue}r||(r=new Jf,e.setTextGuideLine(r),!f&&(l||!o)&&Xh(r,!0,"normal",t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),Xh(r,!1,u,d)}}if(r){sn(r.style,n),r.style.fill=null;var g=i.get("showAbove"),v=e.textGuideLineConfig=e.textGuideLineConfig||{};v.showAbove=g||!1,r.buildPath=HP}}function jP(e,t){t=t||"labelLine";for(var n={normal:e.getModel(t)},r=0;r<lo.length;r++){var a=lo[r];n[a]=e.getModel([a,t])}return n}var Mw=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"],$P=1,Qc=2,Bw=$P|Qc;function Kh(e,t,n){n=n||Bw,t?e.dirty|=n:e.dirty&=~n}function Dw(e,t){return t=t||Bw,e.dirty==null||!!(e.dirty&t)}function Aw(e){if(e)return Dw(e)&&WP(e,e.label,e),e}function WP(e,t,n){var r=t.getComputedTransform();e.transform=qM(e.transform,r);var a=e.localRect=py(e.localRect,t.getBoundingRect()),i=t.style,o=i.margin,l=n&&n.marginForce,c=n&&n.minMarginForce,u=n&&n.marginDefault,d=i.__marginType;d==null&&u&&(o=u,d=ho.textMargin);for(var f=0;f<4;f++)Zh[f]=d===ho.minMargin&&c&&c[f]!=null?c[f]:l&&l[f]!=null?l[f]:o?o[f]:0;d===ho.textMargin&&dy(a,Zh,!1,!1);var h=e.rect=py(e.rect,a);return r&&h.applyTransform(r),d===ho.minMargin&&dy(h,Zh,!1,!1),e.axisAligned=GM(r),(e.label=e.label||{}).ignore=t.ignore,Kh(e,!1),Kh(e,!0,Qc),e}var Zh=[0,0,0,0];function UP(e,t){for(var n=0;n<Mw.length;n++){var r=Mw[n];e[r]==null&&(e[r]=t[r])}return Aw(e)}function Pw(e){var t=e.obb;return(!t||Dw(e,Qc))&&(e.obb=t=t||new VM,t.fromBoundingRect(e.localRect,e.transform),Kh(e,!1,Qc)),t}function Nw(e,t,n,r,a){var i=e.length,o=FM[t],l=jM[t];if(i<2)return!1;e.sort(function(k,T){return k.rect[o]-T.rect[o]});for(var c=0,u,d=!1,f=0,h=0;h<i;h++){var p=e[h],g=p.rect;u=g[o]-c,u<0&&(g[o]-=u,p.label[o]-=u,d=!0);var v=Math.max(-u,0);f+=v,c=g[o]+g[l]}f>0&&a&&b(-f/i,0,i);var m=e[0],_=e[i-1],y,w;C(),y<0&&x(-y,.8),w<0&&x(w,.8),C(),S(y,w,1),S(w,y,-1),C(),y<0&&E(-y),w<0&&E(w);function C(){y=m.rect[o]-n,w=r-_.rect[o]-_.rect[l]}function S(k,T,R){if(k<0){var D=Math.min(T,-k);if(D>0){b(D*R,0,i);var A=D+k;A<0&&x(-A*R,1)}else x(-k*R,1)}}function b(k,T,R){k!==0&&(d=!0);for(var D=T;D<R;D++){var A=e[D],L=A.rect;L[o]+=k,A.label[o]+=k}}function x(k,T){for(var R=[],D=0,A=1;A<i;A++){var L=e[A-1].rect,N=Math.max(e[A].rect[o]-L[o]-L[l],0);R.push(N),D+=N}if(D){var M=Math.min(Math.abs(k)/D,T);if(k>0)for(var A=0;A<i-1;A++){var I=R[A]*M;b(I,0,A+1)}else for(var A=i-1;A>0;A--){var I=R[A-1]*M;b(-I,A,i)}}}function E(k){var T=k<0?-1:1;k=Math.abs(k);for(var R=Math.ceil(k/(i-1)),D=0;D<i-1;D++)if(T>0?b(R,0,D+1):b(-R,i-D-1,i),k-=R,k<=0)return}return d}function YP(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.defaultAttr,a=n.labelLine;n.label.attr("ignore",r.ignore),a&&a.attr("ignore",r.labelGuideIgnore)}}function GP(e){var t=[];e.sort(function(u,d){return(d.suggestIgnore?1:0)-(u.suggestIgnore?1:0)||d.priority-u.priority});function n(u){if(!u.ignore){var d=u.ensureState("emphasis");d.ignore==null&&(d.ignore=!1)}u.ignore=!0}for(var r=0;r<e.length;r++){var a=Aw(e[r]);if(!a.label.ignore){for(var i=a.label,o=a.labelLine,l=!1,c=0;c<t.length;c++)if(qP(a,t[c],null,{touchThreshold:.05})){l=!0;break}l?(n(i),o&&n(o)):t.push(a)}}}function qP(e,t,n,r){return!e||!t||e.label&&e.label.ignore||t.label&&t.label.ignore||!e.rect.intersect(t.rect,n,r)?!1:e.axisAligned&&t.axisAligned?!0:Pw(e).intersect(Pw(t),n,r)}function JP(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function XP(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:JP(r&&r.shape.points)}}var Lw=["align","verticalAlign","width","height","fontSize"],mn=new rf,Qh=nn(),KP=nn();function eu(e,t,n){for(var r=0;r<n.length;r++){var a=n[r];t[a]!=null&&(e[a]=t[a])}}var tu=["x","y","rotation"],ZP=(function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(t,n,r,a,i){var o=a.style,l=a.__hostTarget.textConfig||{},c=a.getComputedTransform(),u=a.getBoundingRect().plain();lt.applyTransform(u,u,c),c?mn.setLocalTransform(c):(mn.x=mn.y=mn.rotation=mn.originX=mn.originY=0,mn.scaleX=mn.scaleY=1),mn.rotation=jr(mn.rotation);var d=a.__hostTarget,f;if(d){f=d.getBoundingRect().plain();var h=d.getComputedTransform();lt.applyTransform(f,f,h)}var p=f&&d.getTextGuideLine();this._labelList.push({label:a,labelLine:p,seriesModel:r,dataIndex:t,dataType:n,layoutOptionOrCb:i,layoutOption:null,rect:u,hostRect:f,priority:f?f.width*f.height:0,defaultAttr:{ignore:a.ignore,labelGuideIgnore:p&&p.ignore,x:mn.x,y:mn.y,scaleX:mn.scaleX,scaleY:mn.scaleY,rotation:mn.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:a.cursor,attachedPos:l.position,attachedRot:l.rotation}})},e.prototype.addLabelsOfSeries=function(t){var n=this;this._chartViewList.push(t);var r=t.__model,a=r.get("labelLayout");(ot(a)||Vt(a).length)&&t.group.traverse(function(i){if(i.ignore)return!0;var o=i.getTextContent(),l=En(i);o&&!o.disableLabelLayout&&n._addLabel(l.dataIndex,l.dataType,r,o,a)})},e.prototype.updateLayoutConfig=function(t){var n=t.getWidth(),r=t.getHeight();function a(y,w){return function(){Tw(y,w)}}for(var i=0;i<this._labelList.length;i++){var o=this._labelList[i],l=o.label,c=l.__hostTarget,u=o.defaultAttr,d=void 0;ot(o.layoutOptionOrCb)?d=o.layoutOptionOrCb(XP(o,c)):d=o.layoutOptionOrCb,d=d||{},o.layoutOption=d;var f=Math.PI/180;c&&c.setTextConfig({local:!1,position:d.x!=null||d.y!=null?null:u.attachedPos,rotation:d.rotate!=null?d.rotate*f:u.attachedRot,offset:[d.dx||0,d.dy||0]});var h=!1;if(d.x!=null?(l.x=sa(d.x,n),l.setStyle("x",0),h=!0):(l.x=u.x,l.setStyle("x",u.style.x)),d.y!=null?(l.y=sa(d.y,r),l.setStyle("y",0),h=!0):(l.y=u.y,l.setStyle("y",u.style.y)),d.labelLinePoints){var p=c.getTextGuideLine();p&&(p.setShape({points:d.labelLinePoints}),h=!1)}var g=Qh(l);g.needsUpdateLabelLine=h,l.rotation=d.rotate!=null?d.rotate*f:u.rotation,l.scaleX=u.scaleX,l.scaleY=u.scaleY;for(var v=0;v<Lw.length;v++){var m=Lw[v];l.setStyle(m,d[m]!=null?d[m]:u.style[m])}if(d.draggable){if(l.draggable=!0,l.cursor="move",c){var _=o.seriesModel;o.dataIndex!=null&&(_=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex)),l.on("drag",a(c,_.getModel("labelLine")))}}else l.off("drag"),l.cursor=u.cursor}},e.prototype.layout=function(t){var n=t.getWidth(),r=t.getHeight(),a=[];q(this._labelList,function(c){c.defaultAttr.ignore||a.push(UP({},c))});var i=Cn(a,function(c){return c.layoutOption.moveOverlap==="shiftX"}),o=Cn(a,function(c){return c.layoutOption.moveOverlap==="shiftY"});Nw(i,0,0,n),Nw(o,1,0,r);var l=Cn(a,function(c){return c.layoutOption.hideOverlap});YP(l),GP(l)},e.prototype.processLabelsOverall=function(){var t=this;q(this._chartViewList,function(n){var r=n.__model,a=n.ignoreLabelLineUpdate,i=r.isAnimationEnabled();n.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var l=!a,c=o.getTextContent();!l&&c&&(l=Qh(c).needsUpdateLabelLine),l&&t._updateLabelLine(o,r),i&&t._animateLabels(o,r)})})},e.prototype._updateLabelLine=function(t,n){var r=t.getTextContent(),a=En(t),i=a.dataIndex;if(r&&i!=null){var o=n.getData(a.dataType),l=o.getItemModel(i),c={},u=o.getItemVisual(i,"style");u&&(c.stroke=u[o.getVisual("drawType")]);var d=l.getModel("labelLine");FP(t,jP(l),c),Tw(t,d)}},e.prototype._animateLabels=function(t,n){var r=t.getTextContent(),a=t.getTextGuideLine();if(r&&(t.forceLabelAnimation||!r.ignore&&!r.invisible&&!t.disableLabelAnimation&&!mc(t))){var i=Qh(r),o=i.oldLayout,l=En(t),c=l.dataIndex,u={x:r.x,y:r.y,rotation:r.rotation},d=n.getData(l.dataType);if(o){r.attr(o);var h=t.prevStates;h&&(kt(h,"select")>=0&&r.attr(i.oldLayoutSelect),kt(h,"emphasis")>=0&&r.attr(i.oldLayoutEmphasis)),Qf(r,u,n,c)}else if(r.attr(u),!wy(r).valueAnimation){var f=qe(r.style.opacity,1);r.style.opacity=0,eh(r,{style:{opacity:f}},n,c)}if(i.oldLayout=u,r.states.select){var p=i.oldLayoutSelect={};eu(p,u,tu),eu(p,r.states.select,tu)}if(r.states.emphasis){var g=i.oldLayoutEmphasis={};eu(g,u,tu),eu(g,r.states.emphasis,tu)}rB(r,c,d,n,n)}if(a&&!a.ignore&&!a.invisible){var i=KP(a),o=i.oldLayout,v={points:a.shape.points};o?(a.attr({shape:o}),Qf(a,{shape:v},n)):(a.setShape(v),a.style.strokePercent=0,eh(a,{style:{strokePercent:1}},n)),i.oldLayout=v}},e})(),ep=nn();function QP(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,n,r){var a=ep(n).labelManager;a||(a=ep(n).labelManager=new ZP),a.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,n,r){var a=ep(n).labelManager;r.updatedSeries.forEach(function(i){a.addLabelsOfSeries(n.getViewOfSeriesModel(i))}),a.updateLayoutConfig(n),a.layout(n),a.processLabelsOverall()})}function Iw(e,t,n){var r=ur.createCanvas(),a=t.getWidth(),i=t.getHeight(),o=r.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=a+"px",o.height=i+"px",r.setAttribute("data-zr-dom-id",e)),r.width=a*n,r.height=i*n,r}var tp=(function(e){et(t,e);function t(n,r,a){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var o;a=a||qs,typeof n=="string"?o=Iw(n,r,a):ze(n)&&(o=n,n=o.id),i.id=n,i.dom=o;var l=o.style;return l&&(Ov(o),o.onselectstart=function(){return!1},l.padding="0",l.margin="0",l.borderWidth="0"),i.painter=r,i.dpr=a,i}return t.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},t.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},t.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var n=this.dpr;this.domBack=Iw("back-"+this.id,this.painter,n),this.ctxBack=this.domBack.getContext("2d"),n!==1&&this.ctxBack.scale(n,n)},t.prototype.createRepaintRects=function(n,r,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],l=this.maxRepaintRectCount,c=!1,u=new lt(0,0,0,0);function d(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var w=new lt(0,0,0,0);w.copy(y),o.push(w)}else{for(var C=!1,S=1/0,b=0,x=0;x<o.length;++x){var E=o[x];if(E.intersect(y)){var k=new lt(0,0,0,0);k.copy(E),k.union(y),o[x]=k,C=!0;break}else if(c){u.copy(y),u.union(E);var T=y.width*y.height,R=E.width*E.height,D=u.width*u.height-T-R;D<S&&(S=D,b=x)}}if(c&&(o[b].union(y),C=!0),!C){var w=new lt(0,0,0,0);w.copy(y),o.push(w)}c||(c=o.length>=l)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=n[f];if(h){var p=h.shouldBePainted(a,i,!0,!0),g=h.__isRendered&&(h.__dirty&1||!p)?h.getPrevPaintRect():null;g&&d(g);var v=p&&(h.__dirty&1||!h.__isRendered)?h.getPaintRect():null;v&&d(v)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=r[f],p=h&&h.shouldBePainted(a,i,!0,!0);if(h&&(!p||!h.__zr)&&h.__isRendered){var g=h.getPrevPaintRect();g&&d(g)}}var m;do{m=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var _=f+1;_<o.length;)o[f].intersect(o[_])?(m=!0,o[f].union(o[_]),o.splice(_,1)):_++;f++}}while(m);return this._paintRects=o,o},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(n,r){var a=this.dpr,i=this.dom,o=i.style,l=this.domBack;o&&(o.width=n+"px",o.height=r+"px"),i.width=n*a,i.height=r*a,l&&(l.width=n*a,l.height=r*a,a!==1&&this.ctxBack.scale(a,a))},t.prototype.clear=function(n,r,a){var i=this.dom,o=this.ctx,l=i.width,c=i.height;r=r||this.clearColor;var u=this.motionBlur&&!n,d=this.lastFrameAlpha,f=this.dpr,h=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,l/f,c/f));var p=this.domBack;function g(v,m,_,y){if(o.clearRect(v,m,_,y),r&&r!=="transparent"){var w=void 0;Bs(r)?(w=(r.global||r.__width===_&&r.__height===y)&&r.__canvasGradient||xh(o,r,{x:0,y:0,width:_,height:y}),r.__canvasGradient=w,r.__width=_,r.__height=y):Gk(r)&&(r.scaleX=r.scaleX||f,r.scaleY=r.scaleY||f,w=Eh(o,r,{dirty:function(){h.setUnpainted(),h.painter.refresh()}})),o.save(),o.fillStyle=w||r,o.fillRect(v,m,_,y),o.restore()}u&&(o.save(),o.globalAlpha=d,o.drawImage(p,v,m,_,y),o.restore())}!a||u?g(0,0,l,c):a.length&&q(a,function(v){g(v.x*f,v.y*f,v.width*f,v.height*f)})},t})(dr),Ow=1e5,wi=314159,nu=.01,eN=.001;function tN(e){return e?e.__builtin__?!0:!(typeof e.resize!="function"||typeof e.refresh!="function"):!1}function nN(e,t){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}var rN=(function(){function e(t,n,r,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!t.nodeName||t.nodeName.toUpperCase()==="CANVAS";this._opts=r=Ce({},r||{}),this.dpr=r.devicePixelRatio||qs,this._singleCanvas=i,this.root=t,t.style&&(Ov(t),t.innerHTML=""),this.storage=n;var o=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=t,d=u.width,f=u.height;r.width!=null&&(d=r.width),r.height!=null&&(f=r.height),this.dpr=r.devicePixelRatio||1,u.width=d*this.dpr,u.height=f*this.dpr,this._width=d,this._height=f;var h=new tp(u,this,this.dpr);h.__builtin__=!0,h.initContext(),l[wi]=h,h.zlevel=wi,o.push(wi),this._domRoot=t}else{this._width=zc(t,0,r),this._height=zc(t,1,r);var c=this._domRoot=nN(this._width,this._height);t.appendChild(c)}}return e.prototype.getType=function(){return"canvas"},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.refresh=function(t){var n=this.storage.getDisplayList(!0),r=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(n,r,t,this._redrawId);for(var i=0;i<a.length;i++){var o=a[i],l=this._layers[o];if(!l.__builtin__&&l.refresh){var c=i===0?this._backgroundColor:null;l.refresh(c)}}return this._opts.useDirtyRect&&(this._prevDisplayList=n.slice()),this},e.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},e.prototype._paintHoverList=function(t){var n=t.length,r=this._hoverlayer;if(r&&r.clear(),!!n){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,o=0;o<n;o++){var l=t[o];l.__inHover&&(r||(r=this._hoverlayer=this.getLayer(Ow)),i||(i=r.ctx,i.save()),pi(i,l,a,o===n-1))}i&&i.restore()}},e.prototype.getHoverLayer=function(){return this.getLayer(Ow)},e.prototype.paintOne=function(t,n){$_(t,n)},e.prototype._paintList=function(t,n,r,a){if(this._redrawId===a){r=r||!1,this._updateLayerStatus(t);var i=this._doPaintList(t,n,r),o=i.finished,l=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),l&&this._paintHoverList(t),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var c=this;Ld(function(){c._paintList(t,n,r,a)})}}},e.prototype._compositeManually=function(){var t=this.getLayer(wi).ctx,n=this._domRoot.width,r=this._domRoot.height;t.clearRect(0,0,n,r),this.eachBuiltinLayer(function(a){a.virtual&&t.drawImage(a.dom,0,0,n,r)})},e.prototype._doPaintList=function(t,n,r){for(var a=this,i=[],o=this._opts.useDirtyRect,l=0;l<this._zlevelList.length;l++){var c=this._zlevelList[l],u=this._layers[c];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||r)&&i.push(u)}for(var d=!0,f=!1,h=function(v){var m=i[v],_=m.ctx,y=o&&m.createRepaintRects(t,n,p._width,p._height),w=r?m.__startIndex:m.__drawIndex,C=!r&&m.incremental&&Date.now,S=C&&Date.now(),b=m.zlevel===p._zlevelList[0]?p._backgroundColor:null;if(m.__startIndex===m.__endIndex)m.clear(!1,b,y);else if(w===m.__startIndex){var x=t[w];(!x.incremental||!x.notClear||r)&&m.clear(!1,b,y)}w===-1&&(console.error("For some unknown reason. drawIndex is -1"),w=m.__startIndex);var E,k=function(A){var L={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(E=w;E<m.__endIndex;E++){var N=t[E];if(N.__inHover&&(f=!0),a._doPaintEl(N,m,o,A,L,E===m.__endIndex-1),C&&Date.now()-S>15)break}L.prevElClipPaths&&_.restore()};if(y)if(y.length===0)E=m.__endIndex;else for(var T=p.dpr,R=0;R<y.length;++R){var D=y[R];_.save(),_.beginPath(),_.rect(D.x*T,D.y*T,D.width*T,D.height*T),_.clip(),k(D),_.restore()}else _.save(),k(),_.restore();m.__drawIndex=E,m.__drawIndex<m.__endIndex&&(d=!1)},p=this,g=0;g<i.length;g++)h(g);return it.wxa&&q(this._layers,function(v){v&&v.ctx&&v.ctx.draw&&v.ctx.draw()}),{finished:d,needsRefreshHover:f}},e.prototype._doPaintEl=function(t,n,r,a,i,o){var l=n.ctx;if(r){var c=t.getPaintRect();(!a||c&&c.intersect(a))&&(pi(l,t,i,o),t.setPrevPaintRect(c))}else pi(l,t,i,o)},e.prototype.getLayer=function(t,n){this._singleCanvas&&!this._needsManuallyCompositing&&(t=wi);var r=this._layers[t];return r||(r=new tp("zr_"+t,this,this.dpr),r.zlevel=t,r.__builtin__=!0,this._layerConfig[t]?jt(r,this._layerConfig[t],!0):this._layerConfig[t-nu]&&jt(r,this._layerConfig[t-nu],!0),n&&(r.virtual=n),this.insertLayer(t,r),r.initContext()),r},e.prototype.insertLayer=function(t,n){var r=this._layers,a=this._zlevelList,i=a.length,o=this._domRoot,l=null,c=-1;if(r[t]){process.env.NODE_ENV!=="production"&&Ia("ZLevel "+t+" has been used already");return}if(!tN(n)){process.env.NODE_ENV!=="production"&&Ia("Layer of zlevel "+t+" is not valid");return}if(i>0&&t>a[0]){for(c=0;c<i-1&&!(a[c]<t&&a[c+1]>t);c++);l=r[a[c]]}if(a.splice(c+1,0,t),r[t]=n,!n.virtual)if(l){var u=l.dom;u.nextSibling?o.insertBefore(n.dom,u.nextSibling):o.appendChild(n.dom)}else o.firstChild?o.insertBefore(n.dom,o.firstChild):o.appendChild(n.dom);n.painter||(n.painter=this)},e.prototype.eachLayer=function(t,n){for(var r=this._zlevelList,a=0;a<r.length;a++){var i=r[a];t.call(n,this._layers[i],i)}},e.prototype.eachBuiltinLayer=function(t,n){for(var r=this._zlevelList,a=0;a<r.length;a++){var i=r[a],o=this._layers[i];o.__builtin__&&t.call(n,o,i)}},e.prototype.eachOtherLayer=function(t,n){for(var r=this._zlevelList,a=0;a<r.length;a++){var i=r[a],o=this._layers[i];o.__builtin__||t.call(n,o,i)}},e.prototype.getLayers=function(){return this._layers},e.prototype._updateLayerStatus=function(t){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function n(f){i&&(i.__endIndex!==f&&(i.__dirty=!0),i.__endIndex=f)}if(this._singleCanvas)for(var r=1;r<t.length;r++){var a=t[r];if(a.zlevel!==t[r-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,o=0,l,c;for(c=0;c<t.length;c++){var a=t[c],u=a.zlevel,d=void 0;l!==u&&(l=u,o=0),a.incremental?(d=this.getLayer(u+eN,this._needsManuallyCompositing),d.incremental=!0,o=1):d=this.getLayer(u+(o>0?nu:0),this._needsManuallyCompositing),d.__builtin__||Ia("ZLevel "+u+" has been used by unkown layer "+d.id),d!==i&&(d.__used=!0,d.__startIndex!==c&&(d.__dirty=!0),d.__startIndex=c,d.incremental?d.__drawIndex=-1:d.__drawIndex=c,n(c),i=d),a.__dirty&1&&!a.__inHover&&(d.__dirty=!0,d.incremental&&d.__drawIndex<0&&(d.__drawIndex=c))}n(c),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,q(this._layers,function(n){n.setUnpainted()})},e.prototype.configLayer=function(t,n){if(n){var r=this._layerConfig;r[t]?jt(r[t],n,!0):r[t]=n;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===t||i===t+nu){var o=this._layers[i];jt(o,r[t],!0)}}}},e.prototype.delLayer=function(t){var n=this._layers,r=this._zlevelList,a=n[t];a&&(a.dom.parentNode.removeChild(a.dom),delete n[t],r.splice(kt(r,t),1))},e.prototype.resize=function(t,n){if(this._domRoot.style){var r=this._domRoot;r.style.display="none";var a=this._opts,i=this.root;if(t!=null&&(a.width=t),n!=null&&(a.height=n),t=zc(i,0,a),n=zc(i,1,a),r.style.display="",this._width!==t||n!==this._height){r.style.width=t+"px",r.style.height=n+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(t,n);this.refresh(!0)}this._width=t,this._height=n}else{if(t==null||n==null)return;this._width=t,this._height=n,this.getLayer(wi).resize(t,n)}return this},e.prototype.clearLayer=function(t){var n=this._layers[t];n&&n.clear()},e.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},e.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[wi].dom;var n=new tp("image",this,t.pixelRatio||this.dpr);n.initContext(),n.clear(!1,t.backgroundColor||this._backgroundColor);var r=n.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var a=n.dom.width,i=n.dom.height;this.eachLayer(function(f){f.__builtin__?r.drawImage(f.dom,0,0,a,i):f.renderToCanvas&&(r.save(),f.renderToCanvas(r),r.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},l=this.storage.getDisplayList(!0),c=0,u=l.length;c<u;c++){var d=l[c];pi(r,d,o,c===u-1)}return n.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e})();function aN(e){e.registerPainter("canvas",rN)}var iN=(function(e){et(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="dataset",n}return t.prototype.init=function(n,r,a){e.prototype.init.call(this,n,r,a),this._sourceManager=new d_(this),f_(this)},t.prototype.mergeOption=function(n,r){e.prototype.mergeOption.call(this,n,r),f_(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:Ur},t})(yt),oN=(function(e){et(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="dataset",n}return t.type="dataset",t})(_o);function lN(e){e.registerComponentModel(iN),e.registerComponentView(oN)}qh([aN,lN]),qh(QP),AP({type:"series.wordCloud",visualStyleAccessPath:"textStyle",visualStyleMapper:function(e){return{fill:e.get("color")}},visualDrawType:"fill",optionUpdated:function(){var e=this.option;e.gridSize=Math.max(Math.floor(e.gridSize),4)},getInitialData:function(e,t){var n=kP(e.data,{coordDimensions:["value"]}),r=new EP(n,this);return r.initData(e.data),r},defaultOption:{maskImage:null,shape:"circle",keepAspect:!1,left:"center",top:"center",width:"70%",height:"80%",sizeRange:[12,60],rotationRange:[-90,90],rotationStep:45,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,textStyle:{fontWeight:"normal"}}}),PP({type:"wordCloud",render:function(e,t,n){var r=this.group;r.removeAll();var a=e.getData(),i=e.get("gridSize");e.layoutInstance.ondraw=function(o,l,c,u){var d=a.getItemModel(c),f=d.getModel("textStyle"),h=new cc({style:Gh(f),scaleX:1/u.info.mu,scaleY:1/u.info.mu,x:(u.gx+u.info.gw/2)*i,y:(u.gy+u.info.gh/2)*i,rotation:u.rot});h.setStyle({x:u.info.fillTextOffsetX,y:u.info.fillTextOffsetY+l*.5,text:o,verticalAlign:"middle",fill:a.getItemVisual(c,"style").fill,fontSize:l}),r.add(h),a.setItemGraphicEl(c,h),h.ensureState("emphasis").style=Gh(d.getModel(["emphasis","textStyle"]),{state:"emphasis"}),h.ensureState("blur").style=Gh(d.getModel(["blur","textStyle"]),{state:"blur"}),lM(h,d.get(["emphasis","focus"]),d.get(["emphasis","blurScope"])),h.stateTransition={duration:e.get("animation")?e.get(["stateAnimation","duration"]):0,easing:e.get(["stateAnimation","easing"])},h.__highDownDispatcher=!0},this._model=e},remove:function(){this.group.removeAll(),this._model.layoutInstance.dispose()},dispose:function(){this._model.layoutInstance.dispose()}}),window.setImmediate||(window.setImmediate=(function(){return window.msSetImmediate||window.webkitSetImmediate||window.mozSetImmediate||window.oSetImmediate||(function(){if(!window.postMessage||!window.addEventListener)return null;var n=[void 0],r="zero-timeout-message",a=function(o){var l=n.length;return n.push(o),window.postMessage(r+l.toString(36),"*"),l};return window.addEventListener("message",function(o){if(!(typeof o.data!="string"||o.data.substr(0,r.length)!==r)){o.stopImmediatePropagation();var l=parseInt(o.data.substr(r.length),36);n[l]&&(n[l](),n[l]=void 0)}},!0),window.clearImmediate=function(o){n[o]&&(n[o]=void 0)},a})()||function(n){window.setTimeout(n,0)}})()),window.clearImmediate||(window.clearImmediate=(function(){return window.msClearImmediate||window.webkitClearImmediate||window.mozClearImmediate||window.oClearImmediate||function(n){window.clearTimeout(n)}})());var np=(function(){var t=document.createElement("canvas");if(!t||!t.getContext)return!1;var n=t.getContext("2d");return!(!n||!n.getImageData||!n.fillText||!Array.prototype.some||!Array.prototype.push)})(),rp=(function(){if(np){for(var t=document.createElement("canvas").getContext("2d"),n=20,r,a;n;){if(t.font=n.toString(10)+"px sans-serif",t.measureText("W").width===r&&t.measureText("m").width===a)return n+1;r=t.measureText("W").width,a=t.measureText("m").width,n--}return 0}})(),sN=function(e){if(Array.isArray(e)){var t=e.slice();return t.splice(0,2),t}else return[]},cN=function(t){for(var n,r,a=t.length;a;)n=Math.floor(Math.random()*a),r=t[--a],t[a]=t[n],t[n]=r;return t},To={},ru=function(t,n){if(!np)return;var r=Math.floor(Math.random()*Date.now());Array.isArray(t)||(t=[t]),t.forEach(function(H,B){if(typeof H=="string"){if(t[B]=document.getElementById(H),!t[B])throw new Error("The element id specified is not found.")}else if(!H.tagName&&!H.appendChild)throw new Error("You must pass valid HTML elements, or ID of the element.")});var a={list:[],fontFamily:'"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',fontWeight:"normal",color:"random-dark",minSize:0,weightFactor:1,clearCanvas:!0,backgroundColor:"#fff",gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,origin:null,drawMask:!1,maskColor:"rgba(255,0,0,0.3)",maskGapWidth:.3,layoutAnimation:!0,wait:0,abortThreshold:0,abort:function(){},minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationStep:.1,shuffle:!0,rotateRatio:.1,shape:"circle",ellipticity:.65,classes:null,hover:null,click:null};if(n)for(var i in n)i in a&&(a[i]=n[i]);if(typeof a.weightFactor!="function"){var o=a.weightFactor;a.weightFactor=function(B){return B*o}}if(typeof a.shape!="function")switch(a.shape){case"circle":default:a.shape="circle";break;case"cardioid":a.shape=function(B){return 1-Math.sin(B)};break;case"diamond":a.shape=function(B){var W=B%(2*Math.PI/4);return 1/(Math.cos(W)+Math.sin(W))};break;case"square":a.shape=function(B){return Math.min(1/Math.abs(Math.cos(B)),1/Math.abs(Math.sin(B)))};break;case"triangle-forward":a.shape=function(B){var W=B%(2*Math.PI/3);return 1/(Math.cos(W)+Math.sqrt(3)*Math.sin(W))};break;case"triangle":case"triangle-upright":a.shape=function(B){var W=(B+Math.PI*3/2)%(2*Math.PI/3);return 1/(Math.cos(W)+Math.sqrt(3)*Math.sin(W))};break;case"pentagon":a.shape=function(B){var W=(B+.955)%(2*Math.PI/5);return 1/(Math.cos(W)+.726543*Math.sin(W))};break;case"star":a.shape=function(B){var W=(B+.955)%(2*Math.PI/10);return(B+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-W)+3.07768*Math.sin(2*Math.PI/10-W)):1/(Math.cos(W)+3.07768*Math.sin(W))};break}a.gridSize=Math.max(Math.floor(a.gridSize),4);var l=a.gridSize,c=l-a.maskGapWidth,u=Math.abs(a.maxRotation-a.minRotation),d=Math.min(a.maxRotation,a.minRotation),f=a.rotationStep,h,p,g,v,m,_,y;function w(H,B){return"hsl("+(Math.random()*360).toFixed()+","+(Math.random()*30+70).toFixed()+"%,"+(Math.random()*(B-H)+H).toFixed()+"%)"}switch(a.color){case"random-dark":y=function(){return w(10,50)};break;case"random-light":y=function(){return w(50,90)};break;default:typeof a.color=="function"&&(y=a.color);break}var C;typeof a.fontWeight=="function"&&(C=a.fontWeight);var S=null;typeof a.classes=="function"&&(S=a.classes);var b=!1,x=[],E,k=function(B){var W=B.currentTarget,X=W.getBoundingClientRect(),K,ne;B.touches?(K=B.touches[0].clientX,ne=B.touches[0].clientY):(K=B.clientX,ne=B.clientY);var he=K-X.left,O=ne-X.top,Z=Math.floor(he*(W.width/X.width||1)/l),ue=Math.floor(O*(W.height/X.height||1)/l);return x[Z]?x[Z][ue]:null},T=function(B){var W=k(B);if(E!==W){if(E=W,!W){a.hover(void 0,void 0,B);return}a.hover(W.item,W.dimension,B)}},R=function(B){var W=k(B);W&&(a.click(W.item,W.dimension,B),B.preventDefault())},D=[],A=function(B){if(D[B])return D[B];var W=B*8,X=W,K=[];for(B===0&&K.push([v[0],v[1],0]);X--;){var ne=1;a.shape!=="circle"&&(ne=a.shape(X/W*2*Math.PI)),K.push([v[0]+B*ne*Math.cos(-X/W*2*Math.PI),v[1]+B*ne*Math.sin(-X/W*2*Math.PI)*a.ellipticity,X/W*2*Math.PI])}return D[B]=K,K},L=function(){return a.abortThreshold>0&&new Date().getTime()-_>a.abortThreshold},N=function(){return a.rotateRatio===0||Math.random()>a.rotateRatio?0:u===0?d:d+Math.round(Math.random()*u/f)*f},M=function(B,W,X,K){var ne=!1,he=a.weightFactor(W);if(he<=a.minSize)return!1;var O=1;he<rp&&(O=(function(){for(var rt=2;rt*he<rp;)rt+=2;return rt})());var Z;C?Z=C(B,W,he,K):Z=a.fontWeight;var ue=document.createElement("canvas"),se=ue.getContext("2d",{willReadFrequently:!0});se.font=Z+" "+(he*O).toString(10)+"px "+a.fontFamily;var we=se.measureText(B).width/O,Te=Math.max(he*O,se.measureText("m").width,se.measureText("W").width)/O,Ee=we+Te*2,Ye=Te*3,_t=Math.ceil(Ee/l),$e=Math.ceil(Ye/l);Ee=_t*l,Ye=$e*l;var Re=-we/2,Oe=-Te*.4,Ne=Math.ceil((Ee*Math.abs(Math.sin(X))+Ye*Math.abs(Math.cos(X)))/l),nt=Math.ceil((Ee*Math.abs(Math.cos(X))+Ye*Math.abs(Math.sin(X)))/l),Qt=nt*l,J=Ne*l;ue.setAttribute("width",Qt),ue.setAttribute("height",J),ne&&(document.body.appendChild(ue),se.save()),se.scale(1/O,1/O),se.translate(Qt*O/2,J*O/2),se.rotate(-X),se.font=Z+" "+(he*O).toString(10)+"px "+a.fontFamily,se.fillStyle="#000",se.textBaseline="middle",se.fillText(B,Re*O,(Oe+he*.5)*O);var de=se.getImageData(0,0,Qt,J).data;if(L())return!1;ne&&(se.strokeRect(Re*O,Oe,we*O,Te*O),se.restore());for(var re=[],ie=nt,fe,ke,Le,Ie=[Ne/2,nt/2,Ne/2,nt/2];ie--;)for(fe=Ne;fe--;){Le=l;e:for(;Le--;)for(ke=l;ke--;)if(de[((fe*l+Le)*Qt+(ie*l+ke))*4+3]){re.push([ie,fe]),ie<Ie[3]&&(Ie[3]=ie),ie>Ie[1]&&(Ie[1]=ie),fe<Ie[0]&&(Ie[0]=fe),fe>Ie[2]&&(Ie[2]=fe),ne&&(se.fillStyle="rgba(255, 0, 0, 0.5)",se.fillRect(ie*l,fe*l,l-.5,l-.5));break e}ne&&(se.fillStyle="rgba(0, 0, 255, 0.5)",se.fillRect(ie*l,fe*l,l-.5,l-.5))}return ne&&(se.fillStyle="rgba(0, 255, 0, 0.5)",se.fillRect(Ie[3]*l,Ie[0]*l,(Ie[1]-Ie[3]+1)*l,(Ie[2]-Ie[0]+1)*l)),{mu:O,occupied:re,bounds:Ie,gw:nt,gh:Ne,fillTextOffsetX:Re,fillTextOffsetY:Oe,fillTextWidth:we,fillTextHeight:Te,fontSize:he}},I=function(B,W,X,K,ne){for(var he=ne.length;he--;){var O=B+ne[he][0],Z=W+ne[he][1];if(O>=p||Z>=g||O<0||Z<0){if(!a.drawOutOfBound)return!1;continue}if(!h[O][Z])return!1}return!0},$=function(B,W,X,K,ne,he,O,Z,ue,se){var we=X.fontSize,Te;y?Te=y(K,ne,we,he,O,se):Te=a.color;var Ee;C?Ee=C(K,ne,we,se):Ee=a.fontWeight;var Ye;S?Ye=S(K,ne,we,se):Ye=a.classes,t.forEach(function(_t){if(_t.getContext){var $e=_t.getContext("2d"),Re=X.mu;$e.save(),$e.scale(1/Re,1/Re),$e.font=Ee+" "+(we*Re).toString(10)+"px "+a.fontFamily,$e.fillStyle=Te,$e.translate((B+X.gw/2)*l*Re,(W+X.gh/2)*l*Re),Z!==0&&$e.rotate(-Z),$e.textBaseline="middle",$e.fillText(K,X.fillTextOffsetX*Re,(X.fillTextOffsetY+we*.5)*Re),$e.restore()}else{var Oe=document.createElement("span"),Ne="";Ne="rotate("+-Z/Math.PI*180+"deg) ",X.mu!==1&&(Ne+="translateX(-"+X.fillTextWidth/4+"px) scale("+1/X.mu+")");var nt={position:"absolute",display:"block",font:Ee+" "+we*X.mu+"px "+a.fontFamily,left:(B+X.gw/2)*l+X.fillTextOffsetX+"px",top:(W+X.gh/2)*l+X.fillTextOffsetY+"px",width:X.fillTextWidth+"px",height:X.fillTextHeight+"px",lineHeight:we+"px",whiteSpace:"nowrap",transform:Ne,webkitTransform:Ne,msTransform:Ne,transformOrigin:"50% 40%",webkitTransformOrigin:"50% 40%",msTransformOrigin:"50% 40%"};Te&&(nt.color=Te),Oe.textContent=K;for(var Qt in nt)Oe.style[Qt]=nt[Qt];if(ue)for(var J in ue)Oe.setAttribute(J,ue[J]);Ye&&(Oe.className+=Ye),_t.appendChild(Oe)}})},ee=function(B,W,X,K,ne){B>=p||W>=g||B<0||W<0||(h[B][W]=!1,X&&t[0].getContext("2d").fillRect(B*l,W*l,c,c),b&&(x[B][W]={item:ne,dimension:K}))},oe=function(B,W,X,K,ne,he){var O=ne.occupied,Z=a.drawMask,ue;Z&&(ue=t[0].getContext("2d"),ue.save(),ue.fillStyle=a.maskColor);var se;if(b){var we=ne.bounds;se={x:(B+we[3])*l,y:(W+we[0])*l,w:(we[1]-we[3]+1)*l,h:(we[2]-we[0]+1)*l}}for(var Te=O.length;Te--;){var Ee=B+O[Te][0],Ye=W+O[Te][1];Ee>=p||Ye>=g||Ee<0||Ye<0||ee(Ee,Ye,Z,se,he)}Z&&ue.restore()},j=function H(B,W){if(W>20)return null;var X,K,ne;Array.isArray(B)?(X=B[0],K=B[1]):(X=B.word,K=B.weight,ne=B.attributes);var he=N(),O=sN(B),Z=M(X,K,he,O);if(!Z||L())return!1;if(!a.drawOutOfBound&&!a.shrinkToFit){var ue=Z.bounds;if(ue[1]-ue[3]+1>p||ue[2]-ue[0]+1>g)return!1}for(var se=m+1,we=function(_t){var $e=Math.floor(_t[0]-Z.gw/2),Re=Math.floor(_t[1]-Z.gh/2),Oe=Z.gw,Ne=Z.gh;return I($e,Re,Oe,Ne,Z.occupied)?($($e,Re,Z,X,K,m-se,_t[2],he,ne,O),oe($e,Re,Oe,Ne,Z,B),{gx:$e,gy:Re,rot:he,info:Z}):!1};se--;){var Te=A(m-se);a.shuffle&&(Te=[].concat(Te),cN(Te));for(var Ee=0;Ee<Te.length;Ee++){var Ye=we(Te[Ee]);if(Ye)return Ye}}return a.shrinkToFit?(Array.isArray(B)?B[1]=B[1]*3/4:B.weight=B.weight*3/4,H(B,W+1)):null},U=function(B,W,X){if(W)return!t.some(function(K){var ne=new CustomEvent(B,{detail:X||{}});return!K.dispatchEvent(ne)},this);t.forEach(function(K){var ne=new CustomEvent(B,{detail:X||{}});K.dispatchEvent(ne)},this)};(function(){var B=t[0];if(B.getContext)p=Math.ceil(B.width/l),g=Math.ceil(B.height/l);else{var W=B.getBoundingClientRect();p=Math.ceil(W.width/l),g=Math.ceil(W.height/l)}if(U("wordcloudstart",!0)){v=a.origin?[a.origin[0]/l,a.origin[1]/l]:[p/2,g/2],m=Math.floor(Math.sqrt(p*p+g*g)),h=[];var X,K,ne;if(!B.getContext||a.clearCanvas)for(t.forEach(function(Re){if(Re.getContext){var Oe=Re.getContext("2d");Oe.fillStyle=a.backgroundColor,Oe.clearRect(0,0,p*(l+1),g*(l+1)),Oe.fillRect(0,0,p*(l+1),g*(l+1))}else Re.textContent="",Re.style.backgroundColor=a.backgroundColor,Re.style.position="relative"}),X=p;X--;)for(h[X]=[],K=g;K--;)h[X][K]=!0;else{var he=document.createElement("canvas").getContext("2d");he.fillStyle=a.backgroundColor,he.fillRect(0,0,1,1);var O=he.getImageData(0,0,1,1).data,Z=B.getContext("2d").getImageData(0,0,p*l,g*l).data;X=p;for(var ue,se;X--;)for(h[X]=[],K=g;K--;){se=l;e:for(;se--;)for(ue=l;ue--;)for(ne=4;ne--;)if(Z[((K*l+se)*p*l+(X*l+ue))*4+ne]!==O[ne]){h[X][K]=!1;break e}h[X][K]!==!1&&(h[X][K]=!0)}Z=he=O=void 0}if(a.hover||a.click){for(b=!0,X=p+1;X--;)x[X]=[];a.hover&&B.addEventListener("mousemove",T),a.click&&(B.addEventListener("click",R),B.addEventListener("touchstart",R),B.addEventListener("touchend",function(Re){Re.preventDefault()}),B.style.webkitTapHighlightColor="rgba(0, 0, 0, 0)"),B.addEventListener("wordcloudstart",function Re(){B.removeEventListener("wordcloudstart",Re),B.removeEventListener("mousemove",T),B.removeEventListener("click",R),E=void 0})}ne=0;var we,Te,Ee=!0;a.layoutAnimation?a.wait!==0?(we=window.setTimeout,Te=window.clearTimeout):(we=window.setImmediate,Te=window.clearImmediate):(we=function(Re){Re()},Te=function(){Ee=!1});var Ye=function(Oe,Ne){t.forEach(function(nt){nt.addEventListener(Oe,Ne)},this)},_t=function(Oe,Ne){t.forEach(function(nt){nt.removeEventListener(Oe,Ne)},this)},$e=function Re(){_t("wordcloudstart",Re),Te(To[r])};Ye("wordcloudstart",$e),To[r]=(a.layoutAnimation?we:setTimeout)(function Re(){if(Ee){if(ne>=a.list.length){Te(To[r]),U("wordcloudstop",!1),_t("wordcloudstart",$e),delete To[r];return}_=new Date().getTime();var Oe=j(a.list[ne],0),Ne=!U("wordclouddrawn",!0,{item:a.list[ne],drawn:Oe});if(L()||Ne){Te(To[r]),a.abort(),U("wordcloudabort",!1),U("wordcloudstop",!1),_t("wordcloudstart",$e);return}ne++,To[r]=we(Re,a.wait)}},a.wait)}})()};if(ru.isSupported=np,ru.minFontSize=rp,!ru.isSupported)throw new Error("Sorry your browser not support wordCloud");function uN(e){for(var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),r=t.createImageData(n),a=0,i=0,o=0;o<n.data.length;o+=4){var l=n.data[o+3];if(l>128){var c=n.data[o]+n.data[o+1]+n.data[o+2];a+=c,++i}}for(var u=a/i,o=0;o<n.data.length;o+=4){var c=n.data[o]+n.data[o+1]+n.data[o+2],l=n.data[o+3];l<128||c>u?(r.data[o]=0,r.data[o+1]=0,r.data[o+2]=0,r.data[o+3]=0):(r.data[o]=255,r.data[o+1]=255,r.data[o+2]=255,r.data[o+3]=255)}t.putImageData(r,0,0)}gw(function(e,t){e.eachSeriesByType("wordCloud",function(n){var r=EB(n.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),a=n.get("keepAspect"),i=n.get("maskImage"),o=i?i.width/i.height:1;a&&dN(r,o);var l=n.getData(),c=document.createElement("canvas");c.width=r.width,c.height=r.height;var u=c.getContext("2d");if(i)try{u.drawImage(i,0,0,c.width,c.height),uN(c)}catch(m){console.error("Invalid mask image"),console.error(m.toString())}var d=n.get("sizeRange"),f=n.get("rotationRange"),h=l.getDataExtent("value"),p=Math.PI/180,g=n.get("gridSize");ru(c,{list:l.mapArray("value",function(m,_){var y=l.getItemModel(_);return[l.getName(_),y.get("textStyle.fontSize",!0)||CR(m,h,d),_]}).sort(function(m,_){return _[1]-m[1]}),fontFamily:n.get("textStyle.fontFamily")||n.get("emphasis.textStyle.fontFamily")||e.get("textStyle.fontFamily"),fontWeight:n.get("textStyle.fontWeight")||n.get("emphasis.textStyle.fontWeight")||e.get("textStyle.fontWeight"),gridSize:g,ellipticity:r.height/r.width,minRotation:f[0]*p,maxRotation:f[1]*p,clearCanvas:!i,rotateRatio:1,rotationStep:n.get("rotationStep")*p,drawOutOfBound:n.get("drawOutOfBound"),shrinkToFit:n.get("shrinkToFit"),layoutAnimation:n.get("layoutAnimation"),shuffle:!1,shape:n.get("shape")});function v(m){var _=m.detail.item;m.detail.drawn&&n.layoutInstance.ondraw&&(m.detail.drawn.gx+=r.x/g,m.detail.drawn.gy+=r.y/g,n.layoutInstance.ondraw(_[0],_[1],_[2],m.detail.drawn))}c.addEventListener("wordclouddrawn",v),n.layoutInstance&&n.layoutInstance.dispose(),n.layoutInstance={ondraw:null,dispose:function(){c.removeEventListener("wordclouddrawn",v),c.addEventListener("wordclouddrawn",function(m){m.preventDefault()})}}})}),Hh(function(e){var t=(e||{}).series;!Fe(t)&&(t=t?[t]:[]);var n=["shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];q(t,function(a){if(a&&a.type==="wordCloud"){var i=a.textStyle||{};r(i.normal),r(i.emphasis)}});function r(a){a&&q(n,function(i){a.hasOwnProperty(i)&&(a["text"+bB(i)]=a[i])})}});function dN(e,t){var n=e.width,r=e.height;n>r*t?(e.x+=(n-r*t)/2,e.width=r*t):(e.y+=(r-n/t)/2,e.height=n/t)}var fN=(0,s.defineComponent)({name:"JEcharts",__name:"echarts",props:{option:{type:Object,required:!0},theme:{type:[String,Object],default:""},initOptions:{type:Object,default:()=>({})},notMerge:{type:Boolean,default:!1},updateDelay:{type:Number,default:0}},emits:["click","ready"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o=(0,s.shallowRef)();let l=null,c=null;const u=async()=>{i.value&&(o.value=Gu.init(i.value,r.theme,r.initOptions),d(r.option),o.value&&o.value.on("click",g=>{a("click",g)}),typeof window<"u"&&window.ResizeObserver&&(l=new ResizeObserver(()=>{o.value?.resize()}),l.observe(i.value)),o.value&&a("ready",o.value))},d=g=>{o.value&&(c&&clearTimeout(c),r.updateDelay>0?c=setTimeout(()=>{o.value?.setOption(g,r.notMerge)},r.updateDelay):o.value.setOption(g,r.notMerge))};return(0,s.watch)(()=>r.option,g=>{d(g)},{deep:!0}),(0,s.onMounted)(()=>{u()}),(0,s.onUnmounted)(()=>{c&&clearTimeout(c),l&&i.value&&(l.unobserve(i.value),l.disconnect(),l=null),o.value&&(o.value.dispose(),o.value=void 0)}),t({getInstance:()=>o.value,resize:g=>{o.value?.resize(g)},clear:()=>{o.value?.clear()}}),(g,v)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"chartRef",ref:i,class:"j-echarts"},null,512))}}),Vw=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},hN=Vw(fN,[["__scopeId","data-v-396b8d8b"]]),zw=be(hN),pN=["innerHTML"],gN={key:1,class:"j-barcode-error"},vN=(0,s.defineComponent)({name:"JBarcode",inheritAttrs:!1,__name:"barcode",props:{bcid:{type:String,required:!0},modelValue:{type:String,required:!0},scale:{type:Number,default:2},scaleX:{type:Number,default:null},scaleY:{type:Number,default:null},height:{type:Number,default:10},width:{type:Number,default:void 0},rotate:{type:String,default:"N"},barcolor:{type:String,default:"000000"},backgroundcolor:{type:String,default:""},padding:{type:Number,default:0},paddingwidth:{type:Number,default:null},paddingheight:{type:Number,default:null},inkspread:{type:Number,default:0},includetext:{type:Boolean,default:!0},alttext:{type:String,default:""},textfont:{type:String,default:"OCR-B"},textsize:{type:Number,default:10},textxalign:{type:String,default:"center"},textyalign:{type:String,default:void 0},textxoffset:{type:Number,default:0},textyoffset:{type:Number,default:0},textcolor:{type:String,default:""},includecheck:{type:Boolean,default:!1},includecheckintext:{type:Boolean,default:!1},parse:{type:Boolean,default:!1},parsefnc:{type:Boolean,default:!1},guardwhitespace:{type:Boolean,default:!1},guardwidth:{type:Number,default:null},eclevel:{type:[String,Number],default:"M"},version:{type:[Number,String],default:""},format:{type:String,default:""},columns:{type:Number,default:null},rows:{type:Number,default:null},errorlevel:{type:Number,default:null}},setup(e){const t=e,n=(0,s.ref)(""),r=(0,s.ref)(""),a=d=>{if(d.length!==13)throw new Error("GTIN must be 13 digits for checksum calculation");let f=0;for(let h=12;h>=0;h--){const p=parseInt(d[h]),g=(13-h)%2===1?3:1;f+=p*g}return(10-f%10)%10},i=d=>{const f=/\(01\)(\d{14})/,h=d.match(f);if(!h)return d;const p=h[1],g=p.substring(0,13),v=parseInt(p[13]),m=a(g);if(v!==m){const _=g+m;return d.replace(f,`(01)${_}`)}return d},o=d=>{if(!/^\d+$/.test(d))return d;const f={11:10,45:18,59:18,62:25},h=Object.keys(f);let p=null;for(const _ of h)if(d.startsWith(_)){p=_;break}let g=d,v=!1;if(!p){const _=d.length;if(_<=8)g="11"+d.substring(0,8),v=!0,p="11";else if(_<=16){const y=d.substring(0,8),w=d.substring(8,16);g="59"+y+w,v=!0,p="59"}else{const y=d.substring(0,23),w=y.substring(0,8),C=y.substring(8,23);g="62"+w+C,g.length!==25&&(g=g.substring(0,25)),v=!0,p="62"}}if(p&&!v){const _=f[p];g.length>_&&(g=g.substring(0,_))}let m=null;for(const _ of h)if(g.startsWith(_)){m=_;break}if(m){const _=f[m];g.length>_&&(g=g.substring(0,_))}else console.error("AUSPOST: 无法检测到有效的FCC,结果:",g);return/^\d+$/.test(g)?(g.length>25&&(console.error("AUSPOST: 返回值长度超过25位:",g.length,g),g=g.substring(0,25)),g):(console.error("AUSPOST: 返回值不是纯数字:",g),d)},l=d=>{if(!/^\d+$/.test(d))throw new Error("PZN must contain only digits");if(d.length===7){const f=d.substring(0,6);let h=0;for(let g=0;g<6;g++){const v=parseInt(f[g]),m=g+2;h+=v*m}const p=h%11;return p===10?null:p}else if(d.length===8){const f=d.substring(0,7);let h=0;for(let g=0;g<7;g++){const v=parseInt(f[g]),m=g+1;h+=v*m}const p=h%11;return p===10?null:p}else throw new Error("PZN must be 7 or 8 digits")},c=d=>{if(!/^\d+$/.test(d)||d.length!==7&&d.length!==8)return d;try{const f=l(d);if(f===null)return d;if(d.length===7){const h=d.substring(0,6);if(parseInt(d[6])!==f)return h+f}else if(d.length===8){const h=d.substring(0,7);if(parseInt(d[7])!==f)return h+f}}catch(f){console.warn("PZN checksum calculation failed:",f.message)}return d},u=()=>{try{r.value="";const d={...t};Object.keys(d).forEach(p=>{(d[p]===null||d[p]===""||d[p]===void 0)&&delete d[p]}),d.bcid==="codabar"&&(d.bcid="rationalizedCodabar"),d.bcid==="uspsonecode"&&(d.bcid="onecode"),d.bcid==="datamatrixrect"&&(d.bcid="datamatrix",d.format||(d.format="rectangle")),d.bcid==="datamatrix"&&d.format==="rect"&&(d.format="rectangle");const f=["offleft","left","center","right","offright"];if(d.textxalign&&!f.includes(d.textxalign)&&(console.warn(`Invalid textxalign value: ${d.textxalign}. Using default 'center'. Valid values: ${f.join(", ")}`),d.textxalign="center"),(d.bcid==="pdf417"||d.bcid==="micropdf417")&&delete d.eclevel,(d.bcid==="qrcode"||d.bcid==="microqrcode")&&delete d.errorlevel,d.bcid==="azteccode"&&(delete d.errorlevel,d.eclevel&&typeof d.eclevel=="string"&&/^[LMQH]$/i.test(d.eclevel)&&delete d.eclevel),d.bcid==="hanxin")if(delete d.errorlevel,d.eclevel&&typeof d.eclevel=="string"){const p={L:"L1",M:"L2",Q:"L3",H:"L4"},g=d.eclevel.toUpperCase();p[g]?d.eclevel=p[g]:/^L[1-4]$/i.test(d.eclevel)||(d.eclevel="L1")}else d.eclevel||(d.eclevel="L1");let h=d.modelValue;if(t.bcid==="gs1-128"&&typeof h=="string")try{h=i(h),h!==d.modelValue&&console.warn(`GS1-128 AI 01 checksum corrected: ${d.modelValue} -> ${h}`)}catch(p){console.warn("GS1 checksum validation failed:",p.message)}if(t.bcid==="auspost"&&typeof h=="string")try{const p=h;if(h=o(h),h!==p){const g=p.length>h.length,v=h.match(/^(11|45|59|62)/),m=v?v[1]:"unknown";console.warn(g?`AUSPOST 值已调整: ${p} -> ${h} (长度: ${p.length} -> ${h.length}, FCC: ${m})`:`AUSPOST FCC 已添加: ${p} -> ${h} (FCC: ${m}, 长度: ${h.length})`)}}catch(p){console.error("[AUSPOST] FCC validation failed:",p),console.warn("AUSPOST FCC validation failed:",p.message)}if(t.bcid==="pzn"&&typeof h=="string")try{const p=h;h=c(h),h!==p&&console.warn(`PZN checksum corrected: ${p} -> ${h}`)}catch(p){console.warn("PZN checksum validation failed:",p.message)}d.text=h,delete d.modelValue,t.bcid==="auspost"&&typeof h=="string"&&h.match(/^(11|45|59|62)/)&&(h.length>20?(d.custinfoenc="numeric",console.log(`[AUSPOST] 值长度 ${h.length} > 20,使用数字编码 (custinfoenc=numeric)`)):/^\d+$/.test(h)&&(d.custinfoenc="numeric",console.log("[AUSPOST] 值全是数字,使用数字编码 (custinfoenc=numeric)"))),t.scaleX||(d.scaleX=t.scale),t.scaleY||(d.scaleY=d.scaleX),["qrcode","microqrcode","datamatrix","datamatrixrect","pdf417","micropdf417","azteccode","hanxin"].includes(d.bcid)&&(d.width||(d.width=d.height)),n.value=qu.default.toSVG(d)}catch(d){console.error("BWIP-JS Render Error:",d);let f=d.message||"条码数据或参数错误";d.message&&d.message.includes("Bad checksum")&&t.bcid==="gs1-128"?f=`GS1-128 校验位错误: ${d.message}。请确保 AI 01 的14位数字包含正确的校验位。`:d.message&&d.message.includes("GS1badChecksum")?f=`GS1 校验位错误: ${d.message}。请检查应用标识符 (AI) 的数据格式和校验位是否正确。`:d.message&&d.message.includes("auspostBadFCC")&&t.bcid==="auspost"?f=`AUSPOST FCC 错误: ${d.message}。AUSPOST 条码必须以有效的 FCC (Format Control Code) 开头:11, 45, 59 或 62。如果值未以有效的 FCC 开头,系统会自动添加合适的 FCC。`:d.message&&d.message.includes("auspostTooLong")&&t.bcid==="auspost"?f=`AUSPOST 长度错误: ${d.message}。AUSPOST 条码长度限制:FCC 11 (10位), FCC 59 (18位), FCC 62 (25位,最大容量)。如果值超过限制,系统会自动截断并使用合适的 FCC。`:d.message&&d.message.includes("pznBadCheckDigit")&&t.bcid==="pzn"&&(f=`PZN 校验位错误: ${d.message}。PZN (德国医药产品编号) 必须是7位或8位数字,包含正确的校验位。如果校验位不正确,系统会自动修复。`),r.value=f,n.value=""}};return(0,s.watchEffect)(u),(d,f)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[n.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-barcode",innerHTML:n.value},null,8,pN)):(0,s.createCommentVNode)("",!0),r.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",gN,(0,s.toDisplayString)(r.value),1)):(0,s.createCommentVNode)("",!0)],64))}}),mN=vN,Hw=be(mN),yN=(0,s.defineComponent)({name:"JCount",__name:"count",props:{modelValue:{default:void 0},formatJson:{default:void 0},decimal:{default:void 0},thousandSeparator:{type:Boolean,default:!1},isChinese:{type:Boolean,default:!1},tableIndex:{default:void 0},getData:{type:Function,default:void 0},size:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=(...b)=>{b=b.flat();let x=0;for(let E=0;E<b.length;E++)x+=b[E];return x/b.length},a=(b,x)=>x<0?-Math.ceil(b/Math.abs(x))*x||0:Math.ceil(b/x)*x||0,i=(...b)=>(b=b.flat(),b.length),o=(b,x)=>{let E=0;if(Array.isArray(b))if(/[><=]/.test(x)){const k=x.match(/^([><=]+)(.+)$/);if(k){const T=k[1],R=Number(k[2]);for(let D=0;D<b.length;D++)try{const A=Number(b[D]);let L=!1;switch(T){case">":L=A>R;break;case"<":L=A<R;break;case">=":L=A>=R;break;case"<=":L=A<=R;break;case"==":case"===":L=A===R;break;case"!=":case"!==":L=A!==R;break}L&&E++}catch{console.log("计算失败");break}}}else for(let k=0;k<b.length;k++)b[k]===x&&E++;return E},l=(b,x)=>b.toFixed(x),c=(b,x)=>x<0?-Math.floor(b/Math.abs(x))*x||0:Math.floor(b/x)*x||0,u=(b,x)=>{if(Array.isArray(b))return b.sort((E,k)=>k-E),b[x-1]},d=(b,x)=>{if(Array.isArray(b))return b.sort((E,k)=>E-k),b[x-1]},f=(b,x)=>Math.log(b)/Math.log(x),h=(b,x)=>b%x,p=(...b)=>{b=b.flat();let x=1;for(let E=0;E<b.length;E++)x*=b[E];return x},g=(b,x)=>{const E=b.toFixed(x);return Number(E)},v=(...b)=>{b=b.flat();let x=0;for(let E=0;E<b.length;E++)x+=Number(b[E]);return x},m=(...b)=>b[0].map((x,E)=>{let k=x;for(let T=1;T<b.length;T++)k*=b[T][E]||0;return k}).reduce((x,E)=>x+E,0),_=t,{getValue:y}=ra(),w=b=>{const x=y({id:b});if(ms(x)){const k=[];return x.forEach(T=>{const R=Number(T);Number.isNaN(R)?k.push(0):k.push(R)}),k}const E=Number(x);return Number.isNaN(E)?0:E},C=(0,s.computed)(()=>{if(!y)return"";const b=JSON.parse(n.formatJson||"[]");let x="";for(let T=0;T<b.length;T++){const R=b[T];if(R.type==="fun"&&R.value!=="("&&R.value!==")")if(["abs","max","min","sqrt"].includes(R.value))x+=`Math.${R.value}`;else if(["int","power","rand"].includes(R.value))switch(R.value){case"int":x+="Math.floor";break;case"power":x+="Math.pow";break;case"rand":x+="Math.random";break}else x+=`${R.value}Fun`;else R.type==="comp"?x+=`getCompValue('${R.value}')`:R.value==="i"&&n.tableIndex!==void 0?x+=n.tableIndex:x+=R.value}if(!x)return"";x=`(
|
|
2
14
|
averageFun,
|
|
3
15
|
ceilingFun,
|
|
4
16
|
countFun,
|
|
@@ -13,4 +25,4 @@
|
|
|
13
25
|
roundFun,
|
|
14
26
|
sumFun,
|
|
15
27
|
sumproductFun,
|
|
16
|
-
getCompValue)=>{ return ${x} }`;let E;const _=pr(x);if(_.res)try{E=_.fn(a,r,i,l,s,d,c,f,p,u,h,g,m,w,y)}catch(T){console.log(T,"计算组件公式运行错误")}else return console.log(_.msg),"";return Number.isNaN(E)?"":(o.decimal!==void 0&&(E=E.toFixed(o.decimal)),E)}),S=(0,n.computed)(()=>{let v=C.value;return o.thousandSeparator&&(v=Pi(v)),o.isChinese&&(v=ji(v)),v});return(0,n.watch)(C,v=>{k("update:modelValue",v),k("change",{value:v,data:S.value})}),(v,x)=>{const E=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createBlock)(E,{modelValue:S.value,"onUpdate:modelValue":x[0]||(x[0]=_=>S.value=_),readonly:"",size:e.size},null,8,["modelValue","size"])}}}),Jh=Uh,Gl=fe(Jh),Yh={class:"j-block j-input-count"},Gh={class:"j-input-count-top"},Kh={class:"j-input-count-tool"},qh={style:{"font-weight":"600"}},Xh={class:"j-input-count-codebox"},Zh={key:0,class:"j-input-count-cursor"},Qh={key:0,class:"fun_color"},eg={key:1,class:"comp_color"},tg={key:2,class:"num_color"},ng={key:3,class:"j-input-count-cursor"},og={class:"j-input-count-bottom"},ag={class:"j-input-count-left"},rg={class:"mb-8px fw-600"},ig={class:"j-input-count-right"},lg={class:"j-input-count-funs"},sg={style:{"font-weight":"600",padding:"8px"}},cg={class:"j-input-count-funs-content"},dg={class:"j-input-count-fundes"},ug={style:{"font-size":"14px","font-weight":"300"}},fg=(0,n.defineComponent)({name:"JInputCount",__name:"input-count",props:{modelValue:String,list:{type:Array,default:()=>[]},type:{type:String,default:"primary"},size:{type:String},label:{type:String,default:"公式设置"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const{t:o}=Ye(),a=e,r=t,i=[{label:1,value:1},{label:2,value:2},{label:3,value:3},{label:4,value:4},{label:5,value:5},{label:6,value:6},{label:7,value:7},{label:8,value:8},{label:9,value:9},{label:0,value:0},{label:"i",value:"i"},{label:"+",value:"+"},{label:"-",value:"-"},{label:"*",value:"*"},{label:"/",value:"/"},{label:">",value:">"},{label:"<",value:"<"},{label:"=",value:"="},{label:"(",value:"("},{label:")",value:")"},{label:"[",value:"["},{label:"]",value:"]"},{label:"'",value:"'"},{label:'"',value:'"'},{label:",",value:","},{label:".",value:"."}],l=[{label:"ABS",value:"abs",des:["ABS函数可以获取一个数的绝对值","用法:ABS(数字)","示例:ABS(-8)可以返回8,也就是-8的绝对值"]},{label:"AVERAGE",value:"average",des:["AVERAGE函数可以获取一组数值的算术平均值","用法:AVERAGE(数字1,数字2,...)","示例:AVERAGE({语文成绩},{数学成绩}, {英语成绩})返回三门课程的平均分"]},{label:"CEILING",value:"ceiling",des:["CEILING函数可以将数字增大到最接近原值的指定因数的倍数","用法:CEILING(数字,因数)","示例:CEILING(7,6)返回12,因为12比7大的同时,也是6的倍数中最接近7的数字"]},{label:"COUNT",value:"count",des:["COUNT函数可以获取参数的数量","用法:COUNT(值,值,...)","示例:COUNT(小明,小王,小张,小李)返回4,也就是人员的数量"]},{label:"COUNTIF",value:"countif",des:["COUNTIF函数可以获取数组中满足条件的参数个数","用法:COUNTIF(数组,'条件')","示例:COUNTIF(子表单.性别, '女'),可得到子表单中性别填的是'女'的数据条数;COUNTIF([1,2,3,4],'>2'),可得到1,2,3,4中大于2的数字数量,结果为2。"]},{label:"FIXED",value:"fixed",des:["FIXED函数可将数字舍入到指定的小数位数并输出为文本","用法:FIXED(数字,小数位数)","示例:FIXED(3.1415,2)返回'3.14'"]},{label:"FLOOR",value:"floor",des:["FLOOR函数可将数字减小到最接近原值的指定因数的倍数","用法:FLOOR(数字,因数)","示例:FLOOR(7,6)返回6,因为6比7小的同时,也是6的倍数中最接近7的数字"]},{label:"INT",value:"int",des:["INT函数可以获取一个数的整数部分","用法:INT(数字)","示例:INT(3.1415)返回3,也就是3.1415的整数部分"]},{label:"LARGE",value:"large",des:["LARGE函数可以获取数据集中第k个最大值","用法:LARGE(数组,k)","示例:LARGE({学生成绩.数学成绩},1)返回子表单'学生成绩'中排名第1的'数学成绩'"]},{label:"LOG",value:"log",des:["LOG函数可以根据指定底数返回数字的对数","用法:LOG(数字,底数)","示例:LOG(100,10)返回2,也就是以10为底数100的对数"]},{label:"MAX",value:"max",des:["MAX函数可以获取一组数值的最大值","用法:MAX(数字1,数字2,...)","示例:MAX({语文成绩},{数学成绩},{英语成绩})返回三门课程中的最高分"]},{label:"MIN",value:"min",des:["MIN函数可以获取一组数值的最小值","用法:MIN(数字1,数字2,...)","示例:MIN({语文成绩},{数学成绩},{英语成绩})返回三门课程中的最低分"]},{label:"MOD",value:"mod",des:["MOD函数可以获取两数相除的余数","用法:MOD(被除数,除数)","示例:MOD(4,3)返回1,也就是4/3的余数"]},{label:"POWER",value:"power",des:["POWER函数可以获取数字乘幂的结果","用法:POWER(数字,指数)","示例:POWER(3,2)返回9,也就是3的2次方"]},{label:"PRODUCT",value:"product",des:["PRODUCT函数可以获取一组数值的乘积","用法:PRODUCT(数字1,数字2,...)","示例:PRODUCT({单价}, {数量})获取总价,也就是单价和数量的乘积"]},{label:"RAND",value:"rand",des:["RAND函数可返回大于等于0且小于1的均匀分布随机实数","用法:RAND()","示例:RAND()返回0.424656"]},{label:"ROUND",value:"round",des:["ROUND函数可以将数字四舍五入到指定的位数","用法:ROUND(数字,数字位数)","示例:ROUND(3.1485,2)返回3.15"]},{label:"SMALL",value:"small",des:["SMALL函数可以返回数据集中第k个最小值","用法:SMALL(数组,k)","示例:SMALL({学生成绩.数学成绩}, 1)返回子表单'学生成绩'中排名倒数第一的'数学成绩'"]},{label:"SQRT",value:"sqrt",des:["SQRT函数可以获取一个数字的正平方根","用法:SQRT(数字)","示例:SQRT(9)返回3,也就是9的正平方根"]},{label:"SUM",value:"sum",des:["SUM函数可以获取一组数值的总和","用法:SUM(数字1,数字2,...)","示例:SUM({语文成绩},{数学成绩}, {英语成绩})返回三门课程的总分"]},{label:"SUMPRODUCT",value:"sumproduct",des:["SUMPRODUCT函数可以将数组间对应的元素相乘,并返回乘积之和,适用于加权求和","用法:SUMPRODUCT(数组,数组...)","示例:SUMPRODUCT([1,2,3],[0.1,0.2,0.3])返回1.4,也就是 1×0.1 + 2×0.2 + 3×0.3的值"]}],s=(0,n.ref)(!1),d=(0,n.ref)([]),c=(0,n.reactive)({cells:[],cursor:0}),f=(0,n.computed)({get(){return JSON.parse(a.modelValue||"[]")},set(v){r("update:modelValue",v.length>0?JSON.stringify(v):""),r("change",{value:v.length>0?JSON.stringify(v):"",data:v})}}),p=v=>{d.value=v},u=(v,x)=>{const E={value:v,type:x};if(c.cells.splice(c.cursor,0,E),c.cursor+=1,x==="fun"){const _={value:"(",type:x},T={value:")",type:x};c.cells.splice(c.cursor,0,_,T),c.cursor+=1}},h=()=>{c.cursor>0&&(c.cursor-=1)},g=()=>{c.cursor<c.cells.length&&(c.cursor+=1)},m=()=>{c.cursor>0&&(c.cells.splice(c.cursor-1,1),c.cursor-=1)},w=()=>{c.cells=[],c.cursor=0},k=()=>{c.cells=Vt(f.value),c.cursor=c.cells.length,s.value=!0},b=()=>{f.value=c.cells,s.value=!1},y=()=>{c.cells=[],c.cursor=0,s.value=!1},C=(0,n.computed)(()=>{const v={};return a.list.forEach(x=>{x.children.forEach(E=>{v[E.value]=`${x.label}.${E.label}`})}),v}),S=v=>C.value[v]||v;return(v,x)=>{const E=(0,n.resolveComponent)("j-button"),_=(0,n.resolveComponent)("j-icon"),T=(0,n.resolveComponent)("el-space"),V=(0,n.resolveComponent)("j-dialog");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(E,(0,n.mergeProps)(v.$attrs,{type:e.type,size:e.size,label:e.label,onClick:k}),null,16,["type","size","label"]),(0,n.createVNode)(V,{visible:s.value,title:(0,n.unref)(o)("公式设置"),height:800,width:1200,onOk:b,onClosed:y},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",Yh,[(0,n.createElementVNode)("div",Gh,[(0,n.createElementVNode)("div",Kh,[(0,n.createElementVNode)("span",qh,(0,n.toDisplayString)((0,n.unref)(o)("计算公式"))+"=",1),(0,n.createVNode)(T,null,{default:(0,n.withCtx)(()=>[(0,n.createVNode)(E,{type:"text",onClick:h},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(_,{icon:"arrowLeft"})]),_:1}),(0,n.createVNode)(E,{type:"text",onClick:g},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(_,{icon:"arrowRight"})]),_:1}),(0,n.createVNode)(E,{type:"link",label:"退格",onClick:m}),(0,n.createVNode)(E,{type:"link",danger:"",label:"清空",onClick:w})]),_:1})]),(0,n.createElementVNode)("div",Xh,[c.cells.length==0?((0,n.openBlock)(),(0,n.createElementBlock)("span",Zh)):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(c.cells,(N,z)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:z},[N.type=="fun"?((0,n.openBlock)(),(0,n.createElementBlock)("span",Qh,(0,n.toDisplayString)(N.value.toUpperCase()),1)):N.type=="comp"?((0,n.openBlock)(),(0,n.createElementBlock)("span",eg," #"+(0,n.toDisplayString)(S(N.value))+"# ",1)):N.type=="num"?((0,n.openBlock)(),(0,n.createElementBlock)("span",tg,(0,n.toDisplayString)(N.value),1)):(0,n.createCommentVNode)("",!0),z+1==c.cursor?((0,n.openBlock)(),(0,n.createElementBlock)("span",ng)):(0,n.createCommentVNode)("",!0)],64))),128))])]),(0,n.createVNode)(T,{class:"j-input-count-mid"},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i,(N,z)=>(0,n.createVNode)(E,{key:z,label:N.label+"",onClick:j=>u(N.value,"num")},null,8,["label","onClick"])),64))]),_:1}),(0,n.createElementVNode)("div",og,[(0,n.createElementVNode)("div",ag,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.list,(N,z)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:z},[(0,n.createElementVNode)("div",rg,(0,n.toDisplayString)((0,n.unref)(o)(N.label)),1),(0,n.createVNode)(T,{size:[8,8],wrap:"",style:{"margin-bottom":"16px"}},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(N.children,j=>((0,n.openBlock)(),(0,n.createBlock)(E,{key:j.value,onClick:A=>u(j.value,"comp"),label:(0,n.unref)(o)(j.label)},null,8,["onClick","label"]))),128))]),_:2},1024)],64))),128))]),(0,n.createElementVNode)("div",ig,[(0,n.createElementVNode)("div",lg,[(0,n.createElementVNode)("span",sg,(0,n.toDisplayString)((0,n.unref)(o)("函数列表")),1),(0,n.createElementVNode)("div",cg,[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(l,(N,z)=>(0,n.createVNode)(E,{type:"text",style:{"border-radius":"0","justify-content":"left"},key:z,onMouseover:j=>p(N.des),onClick:j=>u(N.value,"fun"),label:N.label},null,8,["onMouseover","onClick","label"])),64))])]),(0,n.createElementVNode)("div",dg,[(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("ul",null,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(d.value,(N,z)=>((0,n.openBlock)(),(0,n.createElementBlock)("li",{key:z,style:{"margin-bottom":"8px"}},[(0,n.createElementVNode)("span",ug,(0,n.toDisplayString)((0,n.unref)(o)(N)),1)]))),128))])])])])])])]),_:1},8,["visible","title"])])}}}),pg=fg,Kl=fe(pg),hg={key:0},gg=(0,n.defineComponent)({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(e,{expose:t}){const o=e,a=(0,n.computed)(()=>({...o})),r=(0,n.ref)(),i=(0,n.ref)(null),l=(0,n.computed)(()=>o.options);(0,n.onMounted)(()=>{o.animation&&s()}),(0,n.watch)(()=>o.decimals,()=>{i.value&&i.value.update&&(i.value.options.decimalPlaces=o.decimals,i.value.reset(),i.value.update(o.endValue))},{deep:!0}),(0,n.watch)(()=>o.endValue,u=>{i.value&&i.value.update&&i.value.update(u)});const s=()=>{i.value||(l.value.startVal=o.startValue,l.value.decimalPlaces=o.decimals,l.value.duration=o.duration,i.value=new Au.CountUp(r.value,Number(o.endValue),l.value),i.value.start(()=>{o.callback?.(i.value)}))};return(0,n.onUnmounted)(()=>{i.value=null}),(0,n.onBeforeUnmount)(()=>{i.value=null}),t({myProps:a,el:r,init:s,start:u=>{i.value&&i.value.start&&i.value.start(()=>{u?.(i.value)})},pauseResume:()=>{i.value&&i.value.pauseResume&&i.value.pauseResume()},reset:()=>{i.value&&i.value.reset&&i.value.reset()},update:u=>{i.value&&i.value.update&&i.value.update(u)}}),(u,h)=>((0,n.openBlock)(),(0,n.createElementBlock)("span",{ref_key:"el",ref:r},[e.animation?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("span",hg,(0,n.toDisplayString)(e.endValue),1))],512))}}),mg=gg,ql=fe(mg),yg={class:"j-block j-data-panel"},vg={key:0,class:"j-data-panel-header"},bg={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},wg={class:"j-data-panel-header-right"},Cg={class:"j-data-panel-body"},xg=(0,n.defineComponent)({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(e){return(t,o)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",yg,[e.title?((0,n.openBlock)(),(0,n.createElementBlock)("div",vg,[(0,n.createElementVNode)("div",bg,(0,n.toDisplayString)(e.title),1),(0,n.createElementVNode)("div",wg,[(0,n.renderSlot)(t.$slots,"titleRight")])])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",Cg,[(0,n.renderSlot)(t.$slots,"default")])]))}}),kg=xg,Xl=fe(kg),Sg={class:"j-divider-content"},Eg=(0,n.defineComponent)({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(e){const t=e,o=(0,n.computed)(()=>{const r={color:t.color};return t.size&&Number(t.size)&&(r.fontSize=`${t.size}px`),r}),a=(0,n.computed)(()=>({borderTopStyle:t.borderStyle}));return(r,i)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(`j-divider-container j-divider-${e.contentPosition}`),style:(0,n.normalizeStyle)(o.value)},[(0,n.createElementVNode)("div",{class:"j-divider-line j-divider-line-left",style:(0,n.normalizeStyle)(a.value)},null,4),(0,n.createElementVNode)("div",Sg,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.content||""),1)]),(0,n.createElementVNode)("div",{class:"j-divider-line j-divider-line-right",style:(0,n.normalizeStyle)(a.value)},null,4)],6))}}),_g=Eg,Zl=fe(_g),Bg={class:"j-hpanel"},Rg={class:"j-hpanel-main"},Tg=(0,n.defineComponent)({name:"JHpanel",__name:"hpanel",setup(e){return(t,o)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",Bg,[(0,n.renderSlot)(t.$slots,"left"),(0,n.createElementVNode)("div",Rg,[(0,n.renderSlot)(t.$slots,"default")]),(0,n.renderSlot)(t.$slots,"right")]))}}),Vg=Tg,Ql=fe(Vg),Mg={class:"j-vpanel"},Ag={class:"j-vpanel-main"},Ng=(0,n.defineComponent)({name:"JVpanel",__name:"vpanel",setup(e){return(t,o)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",Mg,[(0,n.renderSlot)(t.$slots,"top"),(0,n.createElementVNode)("div",Ag,[(0,n.renderSlot)(t.$slots,"default")]),(0,n.renderSlot)(t.$slots,"bottom")]))}}),jg=Ng,es=fe(jg),Pg=(0,n.defineComponent)({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(),i=(0,n.ref)(),l=async(f,p)=>{o.ok&&(f("保存数据中..."),i.value=await o.ok(),a("update:modelValue",i.value),a("change",{value:i.value}),p(),r.value.close())},s=()=>o.beforeClose?o.beforeClose(i.value):!0,d=()=>{o.closed?.()},c=()=>{r.value.open(o.title||o.btnText,o.layerType),setTimeout(()=>{o.open?.(i.value)},200)};return(0,n.watch)(()=>o.modelValue,f=>{i.value=f},{immediate:!0}),(f,p)=>{const u=(0,n.resolveComponent)("j-button"),h=(0,n.resolveComponent)("j-layer");return(0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[(0,n.createVNode)(u,(0,n.mergeProps)({style:{width:"auto"}},f.$attrs,{type:e.type,label:e.btnText,size:e.size,onClick:c}),null,16,["type","label","size"]),(0,n.createVNode)(h,{ref_key:"layerRef",ref:r,height:e.height,width:e.width,"destroy-on-close":e.destroyOnClose,"btn-text":"确定","before-close":s,onOk:l,onClosed:d},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(f.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}}),Hg=Pg,ts=fe(Hg),zg=(0,n.defineComponent)({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get:()=>o.modelValue,set:p=>{a("update:modelValue",p)}}),i=(0,n.ref)(""),l=p=>{i.value=p},s=()=>i.value,d=p=>o.beforeClose?o.beforeClose(p):!0,c=p=>{a("change",p)},f=(0,n.computed)(()=>o.modelValue&&o.modelValue.trim()?`${o.btnText}(已设置)`:o.btnText);return(p,u)=>{const h=(0,n.resolveComponent)("j-code-mirror"),g=(0,n.resolveComponent)("j-layout"),m=(0,n.resolveComponent)("j-input-button");return(0,n.openBlock)(),(0,n.createBlock)(m,{modelValue:r.value,"onUpdate:modelValue":u[1]||(u[1]=w=>r.value=w),type:e.type,"btn-text":f.value,title:e.title,size:e.size,width:e.width,height:e.height,"before-close":d,ok:s,open:l,onChange:c},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(g,{"right-move":!1,right:560},(0,n.createSlots)({default:(0,n.withCtx)(()=>[(0,n.createVNode)(h,{modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=w=>i.value=w),mode:e.mode,"is-hint":e.isHint,"handle-hint":e.handleHint},null,8,["modelValue","mode","is-hint","handle-hint"])]),_:2},[e.example?{name:"right",fn:(0,n.withCtx)(()=>[(0,n.createVNode)(h,{"model-value":e.example,mode:e.mode,readonly:""},null,8,["model-value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}}),Og=zg,ns=fe(Og),Lg=(0,n.defineComponent)({name:"JInputColor",__name:"input-color",props:{modelValue:{},placeholder:{default:"请选择颜色"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},onlyButton:{type:Boolean,default:!1},inputType:{default:"append"},showAlpha:{type:Boolean,default:!0},predefineColors:{default:()=>["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]},colorFormat:{default:"hex"},name:{},autofocus:{type:Boolean},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})}},emits:["update:modelValue","input","focus","blur","clear","change","color-change","active-change"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l=(0,n.ref)(),s=(0,n.computed)({get(){return a.modelValue===null||a.modelValue===void 0?l.value:a.modelValue},set(m){l.value=m,r("update:modelValue",m),r("input",m)}}),d=m=>{r("input",m)},c=m=>{r("focus",m)},f=m=>{r("blur",m)},p=()=>{r("clear"),r("update:modelValue","")},u=m=>{r("change",m)},h=m=>{r("color-change",m),r("change",m)},g=m=>{r("active-change",m)};return t({focus:()=>{i.value?.focus()},blur:()=>{i.value?.blur()},select:()=>{i.value?.select()}}),(m,w)=>{const k=(0,n.resolveComponent)("el-color-picker"),b=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-input-color",{"j-input-color-only-button":e.onlyButton},{"j-input-color-disabled":e.disabled},`j-input-color-${e.size}`])},[(0,n.createVNode)(b,(0,n.mergeProps)({ref_key:"inputRef",ref:i,modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=y=>s.value=y),placeholder:e.placeholder,size:e.size,readonly:e.readonly||e.onlyButton,clearable:e.readonly||e.onlyButton?!1:e.clearable,disabled:e.disabled,name:e.name,autofocus:e.autofocus,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle},m.$attrs,{onInput:d,onFocus:c,onBlur:f,onClear:p,onChange:u}),{[e.inputType]:(0,n.withCtx)(()=>[(0,n.createVNode)(k,{modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=y=>s.value=y),size:e.size,disabled:e.disabled||e.readonly,"show-alpha":e.showAlpha,predefine:e.predefineColors,"color-format":e.colorFormat,onChange:h,onActiveChange:g},null,8,["modelValue","size","disabled","show-alpha","predefine","color-format"])]),_:2},1040,["modelValue","placeholder","size","readonly","clearable","disabled","name","autofocus","tabindex","validate-event","input-style"])],2)}}}),Dg=Lg,os=fe(Dg),Ig=(0,n.defineComponent)({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"},align:{default:"left"}},setup(e){const t=e,o=(0,n.computed)(()=>t.class||""),a=(0,n.computed)(()=>{const r={...t.style};return t.color&&(r.color=t.color),t.size&&(typeof t.size=="number"?r.fontSize=`${t.size}px`:r.fontSize=t.size),t.weight&&(r.fontWeight=t.weight),t.align&&(r.textAlign=t.align),r});return(r,i)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-title",o.value]),style:(0,n.normalizeStyle)(a.value)},(0,n.toDisplayString)(e.title),7))}}),Fg=Ig,as=fe(Fg),$g={class:"j-decorated-title-wrapper1"},Wg={class:"j-decorated-title-wrapper1-line"},Ug={key:3,class:"j-decorated-title-wrapper2"},Jg={class:"wrapper2"},Yg={class:"wrapper2-line"},Gg={key:4,class:"j-decorated-title-wrapper3"},Kg={class:"wrapper3"},qg={class:"wrapper3-line"},Xg={key:5,class:"j-decorated-title-wrapper4"},Zg={class:"wrapper4"},Qg={class:"wrapper4-center"},e0={key:6,class:"j-decorated-title-wrapper5"},t0={class:"wrapper5"},n0={class:"wrapper5-left"},o0={class:"wrapper5-right"},a0=(0,n.defineComponent)({name:"JDecoratedTitle",__name:"decorated-title",props:{title:{default:""},content:{},style:{default:void 0},class:{default:void 0},color:{default:void 0},contentColor:{},backgroundColor:{},size:{default:14},contentSize:{default:12},align:{default:void 0},weight:{default:"normal"},titleType:{default:"title1"}},setup(e){const{t}=Ye(),o=e,a=(0,n.computed)(()=>o.class||""),r=(0,n.computed)(()=>({"font-size":o.size?`${["title5","title7","title8","title9"].includes(o.titleType)?14:o.size}px`:"","font-weight":o.weight,color:o.color})),i=(0,n.computed)(()=>({"font-size":o.contentSize?`${o.contentSize}px`:"",color:o.contentColor})),l=(0,n.computed)(()=>({"--el-border-style":o.titleType==="title3"?"solid":"dashed",borderColor:o.backgroundColor||"var(--j-color-primary)",margin:"0 !important"})),s=(0,n.computed)(()=>o.backgroundColor||"var(--j-color-primary-hover)"),d=(0,n.computed)(()=>({...o.style}));return(c,f)=>{const p=(0,n.resolveComponent)("el-divider");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-decorated-title",a.value]),style:(0,n.normalizeStyle)(d.value)},[e.titleType==="title2"?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5),(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)],64)):["title3","title4"].includes(e.titleType||"")?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5),(0,n.createVNode)(p,{class:"m-0",style:(0,n.normalizeStyle)(l.value)},null,8,["style"]),(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)],64)):e.titleType==="title5"?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:2},[(0,n.createElementVNode)("div",$g,[(0,n.createElementVNode)("div",{class:"j-decorated-title-wrapper1-title",style:(0,n.normalizeStyle)([r.value,{backgroundColor:s.value}])},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5),(0,n.createElementVNode)("div",Wg,[(0,n.createElementVNode)("div",{class:"wrapper-line",style:(0,n.normalizeStyle)({borderColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram1",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram2",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram3",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4)])]),(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)([i.value,{textAlign:"left"}])},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)],64)):e.titleType==="title6"?((0,n.openBlock)(),(0,n.createElementBlock)("div",Ug,[(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5),(0,n.createElementVNode)("div",Jg,[(0,n.createElementVNode)("div",Yg,[(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)({borderColor:s.value})},null,4)]),(0,n.createElementVNode)("div",{class:"wrapper2-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5)],4)]),(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)])):e.titleType==="title7"?((0,n.openBlock)(),(0,n.createElementBlock)("div",Gg,[(0,n.createElementVNode)("div",Kg,[(0,n.createElementVNode)("div",qg,[(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4)]),(0,n.createElementVNode)("div",{class:"wrapper3-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5)],4)]),(0,n.createElementVNode)("p",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)])):e.titleType==="title8"?((0,n.openBlock)(),(0,n.createElementBlock)("div",Xg,[(0,n.createElementVNode)("div",Zg,[(0,n.createElementVNode)("div",{class:"wrapper4-bg",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",Qg,[(0,n.createElementVNode)("div",{class:"wrapper4-center-label",style:(0,n.normalizeStyle)({backgroundColor:s.value})},[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5)],4),(0,n.createElementVNode)("div",{class:"wrapper4-center-triangle left-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper4-center-triangle right-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper4-center-border left-border",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper4-center-border right-border",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4)])]),(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)])):e.titleType==="title9"?((0,n.openBlock)(),(0,n.createElementBlock)("div",e0,[(0,n.createElementVNode)("div",t0,[(0,n.createElementVNode)("div",n0,[(0,n.createElementVNode)("div",{class:"wrapper5-triangle wrapper5-left-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper5-block wrapper5-left-block",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),f[0]||(f[0]=(0,n.createElementVNode)("div",{class:"wrapper5-square wrapper5-left-square"},null,-1)),(0,n.createElementVNode)("div",{class:"wrapper5-line1 wrapper5-left-line1",style:(0,n.normalizeStyle)({borderColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper5-line2 wrapper5-left-line2",style:(0,n.normalizeStyle)({borderColor:s.value})},null,4)]),(0,n.createElementVNode)("div",{class:"wrapper5-center",style:(0,n.normalizeStyle)([{backgroundColor:s.value}])},[(0,n.createElementVNode)("span",{style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5)],4),(0,n.createElementVNode)("div",o0,[(0,n.createElementVNode)("div",{class:"wrapper5-triangle wrapper5-right-triangle",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper5-block wrapper5-right-block",style:(0,n.normalizeStyle)({backgroundColor:s.value})},null,4),f[1]||(f[1]=(0,n.createElementVNode)("div",{class:"wrapper5-square wrapper5-right-square"},null,-1)),(0,n.createElementVNode)("div",{class:"wrapper5-line1 wrapper5-right-line1",style:(0,n.normalizeStyle)({borderColor:s.value})},null,4),(0,n.createElementVNode)("div",{class:"wrapper5-line2 wrapper5-right-line2",style:(0,n.normalizeStyle)({borderColor:s.value})},null,4)])]),(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)(i.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.content||"")),5)])):((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:7,style:(0,n.normalizeStyle)(r.value)},(0,n.toDisplayString)((0,n.unref)(t)(e.title||"")),5))],6)}}}),r0=a0,rs=fe(r0),i0={class:"j-block"},l0={class:"j-input-decorated-title-wrapper mb-0px"},s0=(0,n.defineComponent)({name:"JInputDecoratedTitle",__name:"input-decorated-title",props:{modelValue:{default:"title1"},backgroundColor:{default:void 0},color:{default:void 0},weight:{default:void 0},contentColor:{default:void 0},align:{default:void 0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const{t:o}=Ye(),a=t,r=(0,n.ref)(),i=c=>{r.value?.hide(),a("update:modelValue",c),a("change",c)},l=(0,n.ref)("mdi:chevron-down"),s=()=>{l.value="mdi:chevron-up"},d=()=>{l.value="mdi:chevron-down"};return(c,f)=>{const p=(0,n.resolveComponent)("j-decorated-title"),u=(0,n.resolveComponent)("j-icon"),h=(0,n.resolveComponent)("el-popover");return(0,n.openBlock)(),(0,n.createElementBlock)("div",i0,[(0,n.createVNode)(h,{width:270,placement:"top-start",trigger:"click","popper-class":"j-input-decorated-title-popover",ref_key:"popoverRef",ref:r,onShow:s,onHide:d},{reference:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",l0,[(0,n.createVNode)(p,{title:(0,n.unref)(o)("这里是标题"),content:(0,n.unref)(o)("这里是信息描述"),titleType:e.modelValue,backgroundColor:e.backgroundColor,color:e.color,weight:e.weight,contentColor:e.contentColor,align:e.align},null,8,["title","content","titleType","backgroundColor","color","weight","contentColor","align"]),(0,n.createVNode)(u,{icon:l.value,size:20},null,8,["icon"])])]),default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(8,g=>(0,n.createElementVNode)("div",{class:"j-input-decorated-title-wrapper",key:g},[(0,n.createVNode)(p,{title:(0,n.unref)(o)("这里是标题"),content:(0,n.unref)(o)("这里是信息描述"),titleType:`title${g}`,backgroundColor:e.backgroundColor,color:e.color,weight:e.weight,contentColor:e.contentColor,align:e.align,onClick:m=>i(`title${g}`)},null,8,["title","content","titleType","backgroundColor","color","weight","contentColor","align","onClick"])])),64))]),_:1},512)])}}}),c0=s0,is=fe(c0),d0=(0,n.defineComponent)({name:"JCodeMirror",__name:"code-mirror",props:{modelValue:{default:""},mode:{default:"javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l=(0,n.ref)("");let s=null;const d=m=>{switch(m){case"application/javascript":case"javascript":case"text/javascript":return(0,Zn.javascript)();case"css":case"text/css":return(0,Pu.css)();case"html":case"text/html":return(0,Hu.html)();case"json":case"application/json":return(0,zu.json)();case"sql":case"text/x-sql":return(0,Ou.sql)();case"xml":case"text/xml":return(0,Lu.xml)();case"python":case"text/x-python":return(0,Du.python)();case"markdown":case"text/markdown":return(0,Iu.markdown)();case"java":case"text/x-java":return(0,Fu.java)();case"vue":case"text/x-vue":return(0,Zn.javascript)({jsx:!0,typescript:!1});case"typescript":case"application/typescript":return(0,Zn.javascript)({jsx:!1,typescript:!0});case"jsx":return(0,Zn.javascript)({jsx:!0,typescript:!1});case"tsx":return(0,Zn.javascript)({jsx:!0,typescript:!0});default:return(0,Zn.javascript)()}},c=()=>{const m=[ju.basicSetup,(0,Wt.lineNumbers)(),(0,Wt.highlightActiveLineGutter)(),(0,Wt.highlightSpecialChars)(),(0,sr.history)(),(0,Wt.drawSelection)(),(0,Wt.dropCursor)(),(0,Qn.indentOnInput)(),(0,Qn.bracketMatching)(),(0,lr.closeBrackets)(),(0,Wt.rectangularSelection)(),(0,Qn.foldGutter)(),Wt.keymap.of([...lr.closeBracketsKeymap,...sr.defaultKeymap,...sr.historyKeymap,...Qn.foldKeymap]),(0,Qn.syntaxHighlighting)(Qn.defaultHighlightStyle)];return m.push(d(a.mode)),a.readonly&&m.push(ir.EditorState.readOnly.of(!0)),a.isHint&&a.handleHint&&m.push((0,lr.autocompletion)({override:[w=>{const k=w.matchBefore(/\w*/);if(!k||k.from===k.to)return null;const b=a.handleHint(k.text);return b.length===0?null:{from:k.from,options:b.map(y=>({label:typeof y=="string"?y:y.label||y.name||"",detail:typeof y=="string"?"":y.detail||"",type:typeof y=="string"?"variable":y.type||"variable",apply:typeof y=="string"?y:y.apply||y.name||y.label||""}))}}]})),m.push(Wt.EditorView.updateListener.of(w=>{if(w.docChanged){const k=w.state.doc.toString();l.value=k,r("update:modelValue",k),r("change",{value:k})}})),m},f=async()=>{i.value&&(s=new Wt.EditorView({state:ir.EditorState.create({doc:a.modelValue,extensions:c()}),parent:i.value}),l.value=a.modelValue)},p=()=>{if(!s)return;const m=s.state.doc.toString();s&&s.destroy();const w=ir.EditorState.create({doc:m,extensions:c()});i.value&&(s=new Wt.EditorView({state:w,parent:i.value}));const k=s.state.doc.toString();k!==a.modelValue&&s.dispatch({changes:{from:0,to:k.length,insert:a.modelValue}})},u=()=>{if(!s)return;const m=s.state.doc.length;s.dispatch({selection:{anchor:m,head:m},scrollIntoView:!0}),setTimeout(()=>{if(s){const w=s.state.doc.length;s.dispatch({selection:{anchor:w,head:w},scrollIntoView:!0})}},100)},h=()=>{let m=(0,Nu.format)(a.modelValue);m=m.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),r("update:modelValue",m),r("change",{value:m})};let g=null;return(0,n.watch)(()=>a.modelValue,m=>{m!==l.value&&(l.value=m,s&&p(),setTimeout(()=>{s&&a.isScrollToBottom&&u()}))}),(0,n.watch)(()=>a.mode,()=>{s&&p()}),(0,n.onMounted)(async()=>{await(0,n.nextTick)(),await f(),typeof window<"u"&&window.ResizeObserver&&i.value&&(g=new ResizeObserver(()=>{s&&s.dispatch({scrollIntoView:!0})}),g.observe(i.value))}),(0,n.onUnmounted)(()=>{g&&i.value&&(g.unobserve(i.value),g.disconnect(),g=null),s&&(s.destroy(),s=null)}),t({sqlFormatter:h}),(m,w)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"codeWraperRef",ref:i,class:"j-code-mirror",style:(0,n.normalizeStyle)({height:e.height?`${e.height}px`:""})},null,4))}}),u0=d0,ls=fe(u0),f0=(0,n.defineComponent)({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,a=(0,n.useTemplateRef)("actionRef"),r=(0,n.ref)("0"),i=(0,n.computed)(()=>{const{actionStyle:s,toLeft:d}=o;return{...s,left:d?"0":r.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:l.value?"6px":void 0,transition:d?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),l=(0,n.computed)(()=>Number.parseInt(r.value)>10&&!o.isPassing);return t({getEl:()=>a.value,getStyle:()=>a?.value?.style,setLeft:s=>{r.value=s}}),(s,d)=>{const c=(0,n.resolveComponent)("j-icon");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"actionRef",ref:a,style:(0,n.normalizeStyle)(i.value),class:"j-slider-captcha-action",name:"captcha-action"},[e.isPassing?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:check-circle-outline"})):((0,n.openBlock)(),(0,n.createBlock)(c,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:chevron-double-right"}))],4)}}}),p0=f0,h0=(0,n.defineComponent)({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(e,{expose:t}){const o=e,a=(0,n.useTemplateRef)("barRef"),r=(0,n.ref)("0"),i=(0,n.computed)(()=>{const{barStyle:l,toLeft:s}=o;return{...l,width:s?"0":r.value,transition:s?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return t({getEl:()=>a.value,setWidth:l=>{r.value=l}}),(l,s)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"barRef",ref:a,style:(0,n.normalizeStyle)(i.value)},null,4))}}),g0=h0,m0=(0,n.defineComponent)({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(e,{expose:t}){const o=e,a=(0,n.useTemplateRef)("contentRef"),r=(0,n.computed)(()=>{const{contentStyle:l}=o;return{...l,fontSize:"12px"}});t({getEl:()=>a.value});const i=(0,n.computed)(()=>({animation:`shine ${o.animationDuration}s linear ${o.animationIterationCount}`}));return(l,s)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"contentRef",ref:a,class:(0,n.normalizeClass)([{success:e.isPassing},"j-slider-captcha-content"]),style:(0,n.normalizeStyle)(r.value)},[(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)(i.value),class:"j-spine-text"},(0,n.toDisplayString)(e.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),y0=m0,v0=(0,n.defineComponent)({name:"JSliderCaptcha",__name:"slider-captcha",props:(0,n.mergeModels)({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:(0,n.mergeModels)(["end","move","start","success"],["update:modelValue"]),setup(e,{emit:t}){const o=e,a=t,r=(0,n.useModel)(e,"modelValue"),i=(0,n.reactive)({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),l=(0,n.useTemplateRef)("wrapperRef"),s=(0,n.useTemplateRef)("barRef"),d=(0,n.useTemplateRef)("contentRef"),c=(0,n.useTemplateRef)("actionRef");(0,n.watch)(()=>i.isPassing,k=>{if(k){const{endTime:b,startTime:y}=i;a("success",{isPassing:k,time:((b-y)/1e3).toFixed(1)}),r.value=k}}),(0,n.watchEffect)(()=>{i.isPassing=!!r.value});function f(k){return"pageX"in k?k.pageX:"touches"in k&&k.touches[0]?k.touches[0].pageX:0}function p(k){i.isPassing||c.value&&(a("start",k),i.moveDistance=f(k)-Number.parseInt(c.value.getStyle().left.replace("px","")||"0",10),i.startTime=Date.now(),i.isMoving=!0)}function u(k){const b=l.value?.offsetWidth??220,y=k?.offsetWidth??40;return{actionWidth:y,offset:b-y-6,wrapperWidth:b}}function h(k){const{isMoving:b,moveDistance:y}=i;if(b){const C=(0,n.unref)(c),S=(0,n.unref)(s);if(!C||!S)return;const{actionWidth:v,offset:x,wrapperWidth:E}=u(C.getEl()),_=f(k)-y;a("move",{event:k,moveDistance:y,moveX:_}),_>0&&_<=x?(C.setLeft(`${_}px`),S.setWidth(`${_+v/2}px`)):_>x&&(C.setLeft(`${E-v}px`),S.setWidth(`${E-v/2}px`),m())}}function g(k){const{isMoving:b,isPassing:y,moveDistance:C}=i;if(b&&!y){a("end",k);const S=c.value,v=(0,n.unref)(s);if(!S||!v)return;const x=f(k)-C,{actionWidth:E,offset:_,wrapperWidth:T}=u(S.getEl());x<_?w():(S.setLeft(`${T-E}px`),v.setWidth(`${T-E/2}px`),m()),i.isMoving=!1}}function m(){i.endTime=Date.now(),i.isPassing=!0,i.isMoving=!1}function w(){i.isMoving=!1,i.isPassing=!1,i.moveDistance=0,i.toLeft=!1,i.startTime=0,i.endTime=0;const k=(0,n.unref)(c),b=(0,n.unref)(s),y=(0,n.unref)(d);!k||!b||!y||(y.getEl().style.width="100%",i.toLeft=!0,setTimeout(()=>{i.toLeft=!1,k.setLeft("0"),b.setWidth("0")},300))}return(k,b)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"wrapperRef",ref:l,class:(0,n.normalizeClass)(["j-slider-captcha slider-border",o.class]),style:(0,n.normalizeStyle)([{"background-color":"var(--j-color-bg)"},e.wrapperStyle]),onMouseleave:g,onMousemove:h,onMouseup:g,onTouchend:g,onTouchmove:h},[(0,n.createVNode)(g0,{ref_key:"barRef",ref:s,"bar-style":e.barStyle,"to-left":i.toLeft},null,8,["bar-style","to-left"]),(0,n.createVNode)(y0,{ref_key:"contentRef",ref:d,"content-style":e.contentStyle,"is-passing":i.isPassing},null,8,["content-style","is-passing"]),(0,n.createVNode)(p0,{ref_key:"actionRef",ref:c,"action-style":e.actionStyle,"is-passing":i.isPassing,"to-left":i.toLeft,onMousedown:p,onTouchstart:p},null,8,["action-style","is-passing","to-left"])],38))}}),b0=v0,ss=fe(b0),w0=(0,n.defineComponent)({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(e,{emit:t}){const o=e,a=t,{getMenuMap:r,toArray:i,activeMenu:l,theme:s}=to(),{getHMoreMenus:d}=ll(),c=(0,n.ref)([]);o.pId==="moreId"?c.value=d.value:c.value=i(r()[o.pId||""]||[],[]);const f=g=>{const m=c.value.find(w=>w.active);m?.value!==g.value&&(m&&(m.active=!1),a("click",g))},{list:p,containerProps:u,wrapperProps:h}=(0,cr.useVirtualList)(c,{itemHeight:44});return(g,m)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({class:["j-sub-menu-content",{"j-menu-dark":(0,n.unref)(s)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},(0,n.unref)(u)),[(0,n.createElementVNode)("div",(0,n.normalizeProps)((0,n.guardReactiveProps)((0,n.unref)(h))),[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(p),w=>((0,n.openBlock)(),(0,n.createBlock)(ga,{key:w.data.value,"parent-actives":(0,n.unref)(l)?.pid?.split(".")||[],item:w.data,"is-sub":"",onClick:f},null,8,["parent-actives","item"]))),128))],16)],16))}}),C0=w0,x0={class:"j-menu-item-label"},k0={class:"j-menu-item-label"},S0={key:1,class:(0,n.normalizeClass)(["j-menu-item-arrow","sub"])},E0={class:"j-menu-item-label"},_0=(0,n.defineComponent)({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(e,{emit:t}){const{t:o}=Ye(),{activeMenuId:a}=to(),r=t,i=l=>{r("click",l)};return(l,s)=>{const d=(0,n.resolveComponent)("j-icon"),c=(0,n.resolveComponent)("el-tooltip"),f=(0,n.resolveComponent)("el-popover");return e.collapsed&&!e.item.hasChildren?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,placement:"right"},{content:(0,n.withCtx)(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)((0,n.unref)(o)(e.item.label)),1)]),default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-menu-item",{collapsed:e.collapsed}]),onClick:s[0]||(s[0]=(0,n.withModifiers)(p=>i(e.item),["stop"]))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,n.unref)(a),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,n.normalizeStyle)({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?((0,n.openBlock)(),(0,n.createBlock)(d,{key:0,icon:e.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",x0,(0,n.toDisplayString)((0,n.unref)(o)(e.item.label)),1),e.item.hasChildren?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(["j-menu-item-arrow",{open:e.item.open}])},null,2)):(0,n.createCommentVNode)("",!0)],6)],2)]),_:1})):(e.collapsed||e.isSub||e.isHorizontal||e.isVertical)&&e.item.hasChildren?((0,n.openBlock)(),(0,n.createBlock)(f,{key:1,placement:e.isHorizontal?"bottom-start":"right-start","show-arrow":!1,width:"200px","popper-class":"j-sub-menu"},{reference:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-menu-item",{collapsed:e.collapsed}])},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,n.unref)(a),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,n.normalizeStyle)({"padding-left":`${e.item.indent*34+16}px`})},[e.item.icon?((0,n.openBlock)(),(0,n.createBlock)(d,{key:0,icon:e.item.icon,style:(0,n.normalizeStyle)({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",k0,(0,n.toDisplayString)((0,n.unref)(o)(e.item.label)),1),e.item.hasChildren&&!e.isHorizontal&&!e.isVertical?((0,n.openBlock)(),(0,n.createElementBlock)("div",S0)):(0,n.createCommentVNode)("",!0)],6)],2)]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(C0,{"p-id":e.item.value,onClick:i},null,8,["p-id"])]),_:1},8,["placement"])):((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)(["j-menu-item",{collapsed:e.collapsed,sub:e.item.indent>0}]),onClick:s[1]||(s[1]=(0,n.withModifiers)(p=>i(e.item),["stop"]))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,n.unref)(a),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,n.normalizeStyle)({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?((0,n.openBlock)(),(0,n.createBlock)(d,{key:0,icon:e.item.icon,class:"j-menu-item-icon",style:(0,n.normalizeStyle)({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),size:18},null,8,["icon","style"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",E0,(0,n.toDisplayString)((0,n.unref)(o)(e.item.label)),1),e.item.hasChildren?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(["j-menu-item-arrow",{open:e.item.open}])},null,2)):(0,n.createCommentVNode)("",!0)],6)],2))}}}),ga=_0,B0=(0,n.defineComponent)({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(e,{emit:t}){const o=e,a=t,{activeMenu:r,theme:i}=to(),l=f=>{a("click",f)},{list:s,containerProps:d,wrapperProps:c}=(0,cr.useVirtualList)((0,n.computed)(()=>o.menuList),{itemHeight:44});return(f,p)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({class:["j-menu",{collapsed:e.collapsed,"j-menu-dark":(0,n.unref)(i)==="dark"}]},(0,n.unref)(d)),[(0,n.createElementVNode)("div",(0,n.normalizeProps)((0,n.guardReactiveProps)((0,n.unref)(c))),[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(s),u=>((0,n.openBlock)(),(0,n.createBlock)(ga,{key:u.data.value,"parent-actives":(0,n.unref)(r)?.pid?.split(".")||[],item:u.data,collapsed:e.collapsed,class:(0,n.normalizeClass)({"menu-item-entering":u.data.entering,"menu-item-leaving":u.data.leaving}),onClick:l},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),R0=B0,T0=(0,n.defineComponent)({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,a=t,{activeMenu:r,theme:i}=to(),l=(0,n.ref)(),s=(0,n.ref)(0);let d=null;(0,n.onMounted)(()=>{typeof window<"u"&&window.ResizeObserver&&l.value&&(d=new ResizeObserver(()=>{l.value&&(s.value=l.value.offsetWidth)}),d.observe(l.value))});const c=(0,n.computed)(()=>{const h=[];let g=0,m=0;const w=o.menuList.length;return o.menuList.forEach(k=>{m++;const b=(At(k.label)||0)+32+16+4+8;g+=b,(m===w&&g<=s.value||m<w&&g+56<=s.value)&&h.push(k)}),h.length<o.menuList.length&&h.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),h}),f=(0,n.computed)(()=>{const h=[];let g=0;const m=c.value.length;return o.menuList.forEach(w=>{g++,g>=m&&h.push(w)}),h}),p=(0,n.computed)(()=>{const h=r.value?.pid?.split(".")||[];return(h.length>1&&f.value.findIndex(g=>g.value===h[1])>-1||f.value.findIndex(g=>g.value===r.value?.value)>-1)&&h.push("moreId"),h}),u=h=>{a("click",h)};return sl({getHMoreMenus:f}),(0,n.onUnmounted)(()=>{d&&l.value&&(d.unobserve(l.value),d.disconnect(),d=null)}),(h,g)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"menuRef",ref:l,class:(0,n.normalizeClass)(["j-menu-horizontal",{"j-menu-dark":(0,n.unref)(i)==="dark"}])},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(c.value,m=>((0,n.openBlock)(),(0,n.createBlock)(ga,{key:m.value,"parent-actives":p.value,item:m,"is-horizontal":"",onClick:u},null,8,["parent-actives","item"]))),128))],2))}}),V0=T0,M0=(0,n.defineComponent)({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const o=e,a=t,{activeMenu:r,theme:i}=to(),l=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],s=(0,n.computed)(()=>(o.menuList.forEach((h,g)=>{h.color=l[g%l.length]}),o.menuList)),d=(0,n.computed)(()=>r.value?.pid?.split(".")||[]),c=h=>{a("click",h)},{list:f,containerProps:p,wrapperProps:u}=(0,cr.useVirtualList)(s,{itemHeight:96});return(h,g)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({class:["j-menu-vertical",{"j-menu-dark":(0,n.unref)(i)==="dark"}]},(0,n.unref)(p)),[(0,n.createElementVNode)("div",(0,n.normalizeProps)((0,n.guardReactiveProps)((0,n.unref)(u))),[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(f),m=>((0,n.openBlock)(),(0,n.createBlock)(ga,{key:m.data.value,"parent-actives":d.value,item:m.data,"is-vertical":"",onClick:c},null,8,["parent-actives","item"]))),128))],16)],16))}}),A0=M0,N0=(0,n.defineComponent)({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(e,{emit:t}){const o=e,a=t;let r={};const i=(0,n.ref)("");i.value=o.activeId||"";const l=(m,w,k,b,y)=>{k=k||[];for(let C=0,S=k.length;C<S;C++){const v=k[C],x={};x.pid=w,x.indent=b,i.value===v.value&&(x.active=!0),Object.keys(v).forEach(_=>{_!=="children"&&(x[_]=v[_])}),y&&y.includes(v.value)&&(x.open=!0),m.push(x);const E=v.children||[];E.length>0&&(x.hasChildren=!0,y||(r[x.value]=E),(!y||x.open&&!o.collapsed)&&l(m,`${w}.${x.value}`,E,b+1,y))}},s=(m,w)=>{const k=[];return l(k,"0",m,0,w),k},d=(0,n.ref)([]);let c=[];const f=()=>{r={},c=s(o.menus);const m=[];if(i.value&&o.mode==="inline"){const w=c.find(k=>k.value===i.value);w&&m.push(...w.pid.split("."))}d.value=s(o.menus,m)};(0,n.watch)(()=>o.menus,()=>{f()},{immediate:!0}),(0,n.watch)(()=>o.mode,()=>{f()});const p=()=>{if(d.value.find(m=>m.active)?.value!==i.value){const m=c.find(w=>w.value===i.value);if(m){const w=[];o.mode==="inline"&&w.push(...m.pid.split(".")),d.value=s(o.menus,w)}}},u=(0,n.computed)(()=>c.find(m=>m.value===i.value));(0,n.watch)(()=>o.activeId,()=>{i.value=o.activeId||"",p()}),(0,n.watch)(()=>o.collapsed,()=>{if(o.collapsed)d.value=s(o.menus,[]);else{const m=[];if(i.value){const w=c.find(k=>k.value===i.value);w&&m.push(...w.pid.split("."))}d.value=s(o.menus,m)}});const h=(0,n.computed)(()=>o.theme),g=m=>{if(console.log(m),m.hasChildren){if(o.collapsed)return;const w=[];w.push(...m.pid.split(".")),m.open||w.push(m.value);const k=s(o.menus,w),b=new Set(d.value.map(C=>C.value)),y=new Set(k.map(C=>C.value));k.forEach(C=>{b.has(C.value)||(C.entering=!0)}),d.value.forEach(C=>{y.has(C.value)||(C.leaving=!0)}),d.value=k,setTimeout(()=>{d.value.forEach(C=>{C.entering=!1,C.leaving=!1})},300)}else{if(i.value===m.value)return;i.value=m.value,a("click",m)}};return il({getMenuMap:()=>r,toArray:s,activeMenu:u,activeMenuId:i,theme:h}),(m,w)=>e.mode==="inline"?((0,n.openBlock)(),(0,n.createBlock)(R0,{key:0,"menu-list":d.value,collapsed:e.collapsed,onClick:g},null,8,["menu-list","collapsed"])):e.mode==="horizontal"?((0,n.openBlock)(),(0,n.createBlock)(V0,{key:1,"menu-list":d.value,onClick:g},null,8,["menu-list"])):((0,n.openBlock)(),(0,n.createBlock)(A0,{key:2,"menu-list":d.value,onClick:g},null,8,["menu-list"]))}}),j0=N0,cs=fe(j0),P0={class:"j-keyword-panel"},H0={key:0},z0={key:1,class:"columns-wrapper"},O0=(0,n.defineComponent)({name:"JKeywordPanel",__name:"keyword-panel",props:(0,n.mergeModels)({columns:{type:Array,default:()=>[]}},{checkAll:{default:!0},checkAllModifiers:{},checkFields:{default:()=>[]},checkFieldsModifiers:{}}),emits:["update:checkAll","update:checkFields"],setup(e,{expose:t}){const{t:o}=Ye(),a=e,r=(0,n.useModel)(e,"checkAll"),i=(0,n.useModel)(e,"checkFields"),l=(0,n.ref)(!1),s=(0,n.ref)(""),d=(0,n.computed)(()=>a.columns.filter(u=>u.config?.filter?.isSearchKeyword?s.value?u.config?.label?.indexOf(s.value)!=-1:!0:!1).map(u=>({label:u.config?.label,value:u.id}))),c=()=>{r.value||(r.value=!0,l.value=!1,i.value=[])},f=u=>{u.length>0?r.value=!1:r.value=!0};return t({init:()=>{r.value?l.value=!1:l.value=!0}}),(u,h)=>{const g=(0,n.resolveComponent)("j-icon"),m=(0,n.resolveComponent)("el-input"),w=(0,n.resolveComponent)("j-checkbox");return(0,n.openBlock)(),(0,n.createElementBlock)("div",P0,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["range-item",{active:r.value}]),onClick:c},[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(o)("搜索全部")),1),r.value?((0,n.openBlock)(),(0,n.createBlock)(g,{key:0,icon:"mdi:check"})):(0,n.createCommentVNode)("",!0)],2),(0,n.createElementVNode)("div",{class:"range-item",onClick:h[0]||(h[0]=k=>l.value=!l.value)},[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(o)("搜索特定字段")),1),(0,n.createVNode)(g,{icon:l.value?"mdi:keyboard-arrow-up":"mdi:keyboard-arrow-down"},null,8,["icon"])]),l.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",H0,[(0,n.createVNode)(m,{modelValue:s.value,"onUpdate:modelValue":h[1]||(h[1]=k=>s.value=k),modelModifiers:{trim:!0},class:"no-border background",placeholder:(0,n.unref)(o)("搜索"),clearable:""},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(g,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])])):(0,n.createCommentVNode)("",!0),l.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",z0,[(0,n.createVNode)(w,{modelValue:i.value,"onUpdate:modelValue":h[2]||(h[2]=k=>i.value=k),options:d.value,style:{display:"flex","flex-direction":"column"},onChange:f},null,8,["modelValue","options"])])):(0,n.createCommentVNode)("",!0)])}}}),L0=O0,D0={key:0,class:"title"},I0={class:"content"},F0={class:"relation"},$0={style:{width:"72px"}},W0={class:"btn-wrapper"},U0={class:"field-wrapper"},J0={class:"buttons"},Y0=(0,n.defineComponent)({name:"JFilterPanel",__name:"filter-panel",props:(0,n.mergeModels)({columns:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},{relation:{default:"and"},relationModifiers:{},isPin:{default:!1},isPinModifiers:{}}),emits:(0,n.mergeModels)(["filter","close"],["update:relation","update:isPin"]),setup(e,{expose:t,emit:o}){const{t:a}=Ye(),r=e,i=(0,n.useModel)(e,"relation"),l=(0,n.useModel)(e,"isPin"),s=(0,n.ref)([]),d=()=>{l.value=!l.value},c=[{id:"field",type:"j-select",getCompConfig:()=>({selectData:p.value.join(","),options:f.value}),config:{style:{width:l.value?"132px":"160px"},appendTo:l.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",isShowTooltip:!0,isSelectOnlyone:!0,change:({value:b,row:y})=>{const C=r.columns.find(x=>x.id===b)?.config||{};let S="eq",v="text";["options"].includes(C.dataType||"")?S="in":["dateTime"].includes(C.type||"")?(S="range",v="dateTime"):["number"].includes(C.type||"")&&(v="number"),y.method=S,y.type=C.valueType||v,y.value=void 0}}},{id:"method",type:"j-select",getCompConfig:({row:b})=>{const y=r.columns.find(C=>C.id===b.field)?.config||{};return["options","switch","dataItem","dataView"].includes(y.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"in",label:"等于任意一个"},{value:"nin",label:"不等于任意一个"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["dateTime"].includes(y.type||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"range",label:"选择范围"},{value:"formula",label:"动态筛选"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["number"].includes(y.type||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"like",label:"包含"},{value:"unlike",label:"不包含"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}},config:{style:{width:l.value?"134px":"130px"},appendTo:l.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",noBorder:!0,change:({row:b})=>{b.value=void 0}}},{id:"value",type:"input",getCompType:({row:b})=>{const y=r.columns.find(C=>C.id===b.field)?.config||{};if(["options","dataItem","switch"].includes(y.dataType||"")){if(["in","nin"].includes(b.method)||["eq","ne"].includes(b.method))return"j-select"}else{if(["dateTime"].includes(y.type||""))return["formula"].includes(b.method)?"j-select":"j-date";if(["number"].includes(y.type||""))return"j-number"}return"j-input"},getCompConfig:({row:b})=>{if(["empty","not_empty"].includes(b.method||""))return{display:!1};const y=r.columns.find(S=>S.id===b.field)?.config||{},C={display:!0,placeholder:"",clearable:!0,filterable:!0};return["in","nin"].includes(b.method||"")&&(C.multiple=!0,C.collapseTags=!0,C.collapseTagsTooltip=!0),["options","dataItem"].includes(y.dataType||"")?(C.collapseTags=!0,C.collapseTagsTooltip=!0,C.dataType=y.dataType,C.dataCode=y.dataCode,C.options=y.options):["switch"].includes(y.dataType||"")?(C.options=[],C.dataType="options",y.activeValue==null?C.options.push({label:"是",value:"1"}):C.options.push({label:"是",value:y.activeValue}),y.inactiveValue==null?C.options.push({label:"否",value:"0"}):C.options.push({label:"否",value:y.inactiveValue})):["dateTime"].includes(y.type||"")&&(["formula"].includes(b.method)?(C.placeholder="",C.options=[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"明天",value:"tomorrow"},{label:"最近7天",value:"last7days"},{label:"最近30天",value:"last30days"},{label:"本周",value:"thisWeek"},{label:"上周",value:"lastWeek"},{label:"下周",value:"nextWeek"},{label:"本月",value:"thisMonth"},{label:"上月",value:"lastMonth"},{label:"下月",value:"nextMonth"},{label:"本季度",value:"thisQuarter"},{label:"上季度",value:"lastQuarter"},{label:"下季度",value:"nextQuarter"},{label:"今年",value:"thisYear"},{label:"去年",value:"lastYear"},{label:"明年",value:"nextYear"}],C.dataType="options"):(C.selectType="datetime",["range"].includes(b.method)?(C.selectType="datetimerange",C.startPlaceholder="开始时间",C.endPlaceholder="结束时间",C.defaultTime=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)]):C.placeholder="")),C},config:{style:{width:l.value?"246px":"296px",flex:l.value?"auto":"1"},appendTo:l.value?void 0:".j-filter-panel"}}];(0,n.onMounted)(()=>{s.value=r.searchFieldList});const f=(0,n.computed)(()=>r.columns.filter(b=>!b.children?.length&&!b.config?.isNotFilter).map(b=>({label:b.config?.label,value:b.id,dataType:b.config?.dataType,options:b.config?.options}))),p=(0,n.computed)(()=>s.value.map(b=>b.field)),u=({data:b})=>{if(p.value.includes(b.value))return;const y=r.columns.find(v=>v.id===b.value)?.config||{};let C="eq",S="text";["options","dataItem"].includes(y.dataType||"")?C="in":["dateTime"].includes(y.type||"")&&(C="range",S="dateTime"),s.value.push({field:b.value,method:C,type:y.valueType||S})},h=o,g=()=>{s.value.length=0},m=()=>{l.value?h("filter"):h("close",!0)},w=()=>{s.value.forEach(b=>{b.value=void 0}),h("filter")};return t({getSearchFields:()=>s.value}),(b,y)=>{const C=(0,n.resolveComponent)("j-icon"),S=(0,n.resolveComponent)("j-select"),v=(0,n.resolveComponent)("j-button-select"),x=(0,n.resolveComponent)("j-button"),E=(0,n.resolveComponent)("j-input-rows"),_=(0,n.resolveComponent)("el-tooltip");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-filter-panel",{"is-pin":l.value}])},[l.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",D0,[(0,n.createVNode)(C,{icon:"mdi:filter-outline"}),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(a)("筛选")),1)])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",I0,[(0,n.createElementVNode)("div",F0,[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(a)("筛选出符合以下")),1),(0,n.createElementVNode)("div",$0,[(0,n.createVNode)(S,{modelValue:i.value,"onUpdate:modelValue":y[0]||(y[0]=T=>i.value=T),teleported:!1,"no-border":!0,options:[{value:"and",label:"所有"},{value:"or",label:"任一"}]},null,8,["modelValue"])]),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(a)("条件的数据")),1)]),(0,n.createElementVNode)("div",W0,[(0,n.createVNode)(v,{label:"添加过滤条件",options:f.value,"model-value":p.value.join(","),onChange:u},null,8,["options","model-value"]),s.value.length>0?((0,n.openBlock)(),(0,n.createBlock)(x,{key:0,type:"text",danger:"",label:"删除全部",onClick:g})):(0,n.createCommentVNode)("",!0)]),(0,n.createElementVNode)("div",U0,[(0,n.createVNode)(E,{modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=T=>s.value=T),columns:c,"edit-config":{isAddBtn:!1},"is-wrap":l.value},null,8,["modelValue","is-wrap"])]),(0,n.createVNode)(_,{placement:"bottom",content:l.value?(0,n.unref)(a)("取消固定"):(0,n.unref)(a)("固定显示")},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",{class:"pin-btn",onClick:d},[(0,n.createVNode)(C,{rotate:45,icon:l.value?"mdi:keep-off":"mdi:keep"},null,8,["icon"])])]),_:1},8,["content"])]),(0,n.createElementVNode)("div",J0,[(0,n.createVNode)(x,{label:(0,n.unref)(a)("筛选"),type:"primary",onClick:m},null,8,["label"]),(0,n.createVNode)(x,{label:(0,n.unref)(a)("清空"),icon:"mdi:delete-sweep-outline",type:"text",onClick:w},null,8,["label"])])],2)}}}),ds=Y0,G0={class:"j-order-panel"},K0={class:"content"},q0={class:"btn-wrapper"},X0={class:"field-wrapper"},Z0={class:"buttons"},Q0=(0,n.defineComponent)({name:"JOrderPanel",__name:"order-panel",props:{columns:{type:Array,default:()=>[]}},emits:["save","clear"],setup(e,{expose:t,emit:o}){const{t:a}=Ye(),r=e,i=o,l=(0,n.computed)(()=>r.columns.filter(g=>!g.children?.length&&g.config?.sorter?.isNot!==!0).map(g=>({label:g.config?.label,value:g.id}))),s=(0,n.ref)([]),d=(0,n.computed)(()=>s.value.map(g=>g.value)),c=[{id:"label",type:"j-title",getCompConfig:({row:g})=>({title:g?.label}),config:{style:{width:"180px"}}},{id:"sord",type:"j-radio",config:{dataType:"options",options:[{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],isButton:!0}}],f=({data:g})=>{d.value.includes(g.value)||s.value.push({label:g.label,value:g.value,sord:"ASC"})},p=g=>{s.value=JSON.parse(JSON.stringify(g))},u=()=>{i("save",JSON.parse(JSON.stringify(s.value)))},h=()=>{s.value=[],i("clear")};return t({init:p}),(g,m)=>{const w=(0,n.resolveComponent)("j-button-select"),k=(0,n.resolveComponent)("j-input-rows"),b=(0,n.resolveComponent)("j-button");return(0,n.openBlock)(),(0,n.createElementBlock)("div",G0,[(0,n.createElementVNode)("div",K0,[(0,n.createElementVNode)("div",q0,[(0,n.createVNode)(w,{label:"添加排序规则",options:l.value,"model-value":d.value.join(","),onChange:f},null,8,["options","model-value"])]),(0,n.createElementVNode)("div",X0,[(0,n.createVNode)(k,{modelValue:s.value,"onUpdate:modelValue":m[0]||(m[0]=y=>s.value=y),columns:c,"edit-config":{isAddBtn:!1,drag:!0}},null,8,["modelValue"])])]),(0,n.createElementVNode)("div",Z0,[(0,n.createVNode)(b,{label:(0,n.unref)(a)("排序"),type:"primary",onClick:u},null,8,["label"]),s.value.length>0?((0,n.openBlock)(),(0,n.createBlock)(b,{key:0,label:(0,n.unref)(a)("清空排序"),icon:"mdi:delete-sweep",type:"text",onClick:h},null,8,["label"])):(0,n.createCommentVNode)("",!0)])])}}}),em=Q0,tm={class:"j-column-panel"},nm={class:"content"},om={class:"search-wrapper"},am={class:"tree-wrapper"},rm={class:"buttons"},im=(0,n.defineComponent)({name:"JColumnPanel",__name:"column-panel",props:{columns:{type:Array,default:()=>[]},columnConfig:{type:Array}},emits:["save"],setup(e,{expose:t,emit:o}){const{t:a}=Ye(),r=e,i=o,l=(0,n.ref)(),s=(0,n.ref)(""),d={},c=(0,n.ref)([]),f=(0,n.ref)([]),p=(v,x)=>{const E=[],_=new Map;v.forEach(V=>{_.set(V.id||"",V),d[V.id||""]=V});const T=new Set;return x&&x.length>0&&x.forEach(V=>{const N=_.get(V.id);if(N){T.add(N.id||"");const z={id:N.id||"",label:N.config?.label||N.id||"",type:N.type,display:N.config?.display!==!1};N.children&&N.children.length>0&&(z.children=p(N.children,V.children)),E.push(z)}}),v.forEach(V=>{if(!T.has(V.id||"")){const N={id:V.id||"",label:V.config?.label||V.id||"",type:V.type,display:V.config?.display!==!1};V.children&&V.children.length>0&&(N.children=p(V.children)),E.push(N)}}),E},u=(v,x)=>x.length===0?v:v.map(E=>{const _=x.some(V=>E.label.toLowerCase().includes(V.toLowerCase())),T=E.children?u(E.children,x):[];return _||T.length>0?{...E,children:T.length>0?T:E.children}:null}).filter(Boolean),h=(0,n.computed)(()=>{if(!s.value)return f.value;const v=s.value.split(/\s+/).filter(Boolean);return u(f.value,v)}),g=(0,n.ref)([]),m=(0,n.computed)(()=>{const v=new Map;if(r.columnConfig&&r.columnConfig.length>0){const x=E=>{E.forEach(_=>{v.set(_.id,_),_.children&&x(_.children)})};x(r.columnConfig)}return v}),w=()=>{const v=x=>{const E=[];return x.forEach(_=>{let T=!0;if(m.value.size>0){const V=m.value.get(_.id||"");V?T=V.display:T=_.config?.display!==!1}else T=_.config?.display!==!1;T&&(E.push(_.id||""),_.children&&E.push(...v(_.children)))}),E};g.value=v(r.columns)},k=(v,{node:x})=>{v.includes(x.id)?g.value.push(x.id):g.value=g.value.filter(E=>E!==x.id)},b=(v,x,E)=>E==="inner"?!1:v.parent===x.parent,y=()=>{const v=x=>x.map(E=>{const _={...E,display:g.value.includes(E.id)};return E.children&&(_.children=v(E.children)),_});i("save",v(f.value))},C=()=>{if(w(),f.value=JSON.parse(JSON.stringify(c.value)),s.value="",l.value){const v=l.value;v.setCheck&&v.setCheck(g.value);const x=v.$refs?.treeRef||v;x?.setCheckedKeys&&x.setCheckedKeys(g.value)}i("save",void 0)};return t({init:()=>{w(),c.value=p(r.columns,r.columnConfig),f.value=JSON.parse(JSON.stringify(c.value))}}),(v,x)=>{const E=(0,n.resolveComponent)("j-icon"),_=(0,n.resolveComponent)("el-input"),T=(0,n.resolveComponent)("j-tree"),V=(0,n.resolveComponent)("j-button");return(0,n.openBlock)(),(0,n.createElementBlock)("div",tm,[(0,n.createElementVNode)("div",nm,[(0,n.createElementVNode)("div",om,[(0,n.createVNode)(_,{modelValue:s.value,"onUpdate:modelValue":x[0]||(x[0]=N=>s.value=N),modelModifiers:{trim:!0},placeholder:(0,n.unref)(a)("搜索 (多个关键词用空格隔开)"),clearable:""},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(E,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),(0,n.createElementVNode)("div",am,[(0,n.createVNode)(T,{ref_key:"treeRef",ref:l,list:h.value,"is-tree-data":!0,"default-checked-keys":g.value,"default-expand-all":!0,checkable:"","id-key":"id",draggable:!s.value,"allow-drop":b,check:k},null,8,["list","default-checked-keys","draggable"])])]),(0,n.createElementVNode)("div",rm,[(0,n.createVNode)(V,{label:(0,n.unref)(a)("确定"),type:"primary",onClick:y},null,8,["label"]),(0,n.createVNode)(V,{label:(0,n.unref)(a)("重置"),icon:"mdi:restore",type:"text",onClick:C},null,8,["label"])])])}}}),lm=im,sm={class:"j-table-panel-left"},cm={class:"j-table-panel-top"},dm={class:"j-table-panel-top-right"},um={key:0,style:{width:"200px"}},fm={class:"j-table-panel-main"},pm={key:0,class:"j-block j-table-panel-vnode"},hm=["onClick"],gm={key:0,class:"j-table-panel-filter-panel"},mm=(0,n.defineComponent)({name:"JTablePanel",__name:"table-panel",props:{columns:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!1},parentKey:{type:String,default:""},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},selectStateKey:{type:String,default:""},isPage:{type:Boolean,default:!1},pageSizes:Array,pageSize:{type:Number,default:100},subColumns:{type:Array,default:()=>[]},isSubShowNumber:{type:Boolean,default:!0},subActions:{type:Array,default:()=>[]},loadChildren:{type:Function,default:null},rowKey:{type:String,default:void 0},sort:String,buttons:{type:Array,default:()=>[]},batchButtons:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},actionFilter:{type:Function,default:null},loadData:Function,immediate:{type:Boolean,default:!0},noPadding:Boolean,highlightMode:{type:String,default:"row"},showFilterButton:{type:Boolean,default:!0},showOrderButton:{type:Boolean,default:!0},showColumnButton:{type:Boolean,default:!0},showRefreshButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},renderVNode:Function},emits:["select","ready"],setup(e,{expose:t,emit:o}){const{t:a}=Ye(),{openLayer:r}=zn(),i=e,l=o;i.isMultiple&&!i.rowKey&&console.warn("rowKey is required when isMultiple is true");const s=(0,n.ref)();let d=[];const c=(0,n.ref)(0),f=(0,n.ref)(1);let p=i.pageSize||100;const u=(0,n.ref)(0),h=(0,n.computed)(()=>u.value>0),g=(0,n.ref)([]),m=(0,n.ref)(!1),w=(0,n.computed)(()=>i.batchButtons&&i.batchButtons.length>0),k=(0,n.computed)(()=>g.value.length>0),b=(0,n.computed)(()=>w.value&&k.value&&i.isMultiple||m.value),y=(0,n.computed)(()=>i.isPage&&!b.value);w.value&&!i.isMultiple&&console.warn("batchButtons is only valid when isMultiple is true");const C=he=>i.rowKey?i.rowKey.split(",").map(xe=>he[xe.trim()]).join("::"):"",S=(he,xe)=>{if(!xe||xe.length===0)return he.filter(ue=>ue.config?.display!==!1).map(ue=>ue.children&&ue.children.length>0?{...ue,children:S(ue.children)}:ue);const ze=new Map(he.map(ue=>[ue.id,ue])),ut=[];return xe.forEach(ue=>{const qe=ze.get(ue.id);if(qe){if(ue.display){let Et=qe;qe.children&&qe.children.length>0&&(Et={...qe,children:S(qe.children,ue.children)}),ut.push(Et)}ze.delete(ue.id)}}),he.forEach(ue=>{if(ze.has(ue.id)&&ue.config?.display!==!1){let qe=ue;ue.children&&ue.children.length>0&&(qe={...ue,children:S(ue.children)}),ut.push(qe)}}),ut},v=(0,n.computed)(()=>S(i.columns,Te.value)),x=(0,n.computed)(()=>$i(i.columns,he=>he.config.label)),E=(0,n.ref)(""),_=(0,n.computed)(()=>x.value.some(he=>he.config?.filter?.isSearchKeyword)),T=(0,n.ref)(),V=(0,n.ref)(!0),N=(0,n.ref)([]),z=(0,n.computed)(()=>V.value?"搜索全部":`搜索范围:${x.value.filter(he=>N.value.includes(he.id)).map(he=>he.config?.label).join("、")}`),j=()=>{T.value.init()},A=(0,n.ref)(),B=(0,n.ref)(!1),L=(0,n.ref)(!1),U=(0,n.ref)(!1),te=(0,n.ref)([]),se=(0,n.ref)("and"),I=(0,n.ref)(),$=(0,n.ref)(!1),Y=(0,n.ref)([]),M=()=>{I.value.init(Y.value)},oe=he=>{Y.value=he,$.value=!1,ne()},me=()=>{Y.value=[],ne()},ce=(0,n.ref)(),Be=(0,n.ref)(!1),Te=(0,n.ref)(),q=(0,n.computed)(()=>Te.value!=null),ge=()=>{ce.value?.init()},we=he=>{Te.value=he,Be.value=!1},Se=(0,n.ref)(!1),lt=()=>{Se.value=!Se.value},Qe=()=>{g.value=[],s.value&&(s.value.setSelection?.([]),m.value&&(m.value=!1,s.value.setRecords(d)))},Ae=()=>{m.value=!m.value,m.value?s.value?.setRecords(g.value):s.value?.setRecords(d),s.value?.setSelection?.(g.value)},kt=(0,n.computed)(()=>{if(g.value.length>0&&i.isMultiple){const he=[{id:"selection_count",label:`已选${g.value.length}条`,config:{type:"text"}},{id:"toggle_selection",label:m.value?"全部":"仅选中",config:{type:"text"},click:Ae},{id:"clear_selection",label:"清空选中",config:{type:"text"},click:Qe}],xe=i.batchButtons.map(ze=>({...ze,click:()=>{ze.click&&ze.click({data:g.value,openLayer:r})}}));return[...he,...xe]}return i.buttons}),Ht=(0,n.computed)(()=>kt.value.filter(he=>he.config?.display!==!1)),St=(0,n.ref)(null),ct=(0,n.ref)(0),dt=()=>{ct.value=St.value?.clientWidth||0};let $e;(0,n.onMounted)(()=>{(0,n.nextTick)(dt),$e=new ResizeObserver(()=>{dt()}),St.value&&$e.observe(St.value)}),(0,n.onBeforeUnmount)(()=>{$e?.disconnect()}),(0,n.watch)(()=>Ht.value,()=>{(0,n.nextTick)(dt)},{deep:!0}),(0,n.watch)(Se,()=>{(0,n.nextTick)(dt)});const yt=(0,n.computed)(()=>{const he=Ht.value;if(he.length===0)return[];const xe=ct.value;if(xe<=0)return he;const ze=Math.max(0,xe-4),ut=(Xe,wt)=>Xe.groupId||`__auto_${wt}`,ue=Xe=>{if(Xe.config?.notLabel===!0||!Xe.label)return 28;const wt=24,zt=At(Xe.label||"")||0,Bt=Xe.config?.icon?18:0;return Math.ceil(zt+wt+Bt+2)};if((Xe=>{let wt=0,zt=null;return Xe.forEach((Bt,qo)=>{const It=ut(Bt,qo);zt!==null&&(wt+=It===zt?-1:8),wt+=ue(Bt),zt=It}),wt})(he)<=ze)return he;const Et={id:"__table_panel_more__",label:"",config:{icon:"mdi:dots-horizontal",notLabel:!0},children:[]},gt=28,mt=[];let Mt=0,Me=null;for(let Xe=0;Xe<he.length;Xe++){const wt=he[Xe],zt=ut(wt,Xe);let Bt=Mt;Me!==null&&(Bt+=zt===Me?-1:8),Bt+=ue(wt);const qo=he.length-(Xe+1)>0?(Bt>0?8:0)+gt:0;if(Bt+qo<=ze)mt.push(wt),Mt=Bt,Me=zt;else break}const fn=he.slice(mt.length);if(fn.length===0)return he;const et={...Et,children:fn};return mt.length===0?[et]:[...mt,et]});let Qt;const W=async he=>{u.value++;const xe={};he&&(Qt=he),Qt&&(xe.query=Qt);try{const ze={};ze.rel=se.value,ze.cond=(A.value?.getSearchFields?.()||te.value).filter(ue=>ue.value!==void 0&&ue.value!==null&&ue.value!==""||["empty","not_empty"].includes(ue.method)).map(ue=>({field:ue.field,method:ue.method,value:ue.value,type:ue.type})),ze.cond.length>0?U.value=!0:U.value=!1,xe.filter=ze;const ut=Y.value.map(ue=>ue.value+" "+ue.sord).join(",");if(E.value&&(xe.keyword={value:E.value,fields:V.value?x.value.filter(ue=>ue.config?.filter?.isSearchKeyword).map(ue=>ue.id):(0,n.unref)(N)}),i.loadData){if(i.isPage){xe.pagination={rows:p,page:f.value,sort:ut||i.sort||i.rowKey};const ue=await i.loadData(xe)||{};d=ue.rows||[],c.value=ue.records||0}else xe.sort=ut,d=await i.loadData(xe)||[],c.value=d.length;s.value?.setRecords(d),w.value?(g.value=[],m.value=!1):i.rowKey&&g.value.length>0&&s.value?.setSelection?.(g.value)}}finally{u.value=Math.max(0,u.value-1)}},ne=async()=>{f.value=1,await W()},X=({rows:he,page:xe})=>{p=he,f.value=xe,W()},Q=async()=>{g.value=[],m.value=!1,f.value=1,Qt=void 0,await W()},le=async he=>{g.value=[],m.value=!1,await W(he)},Ce=async()=>{await Q()},Ee=he=>{l("ready",he)},Le=({selections:he,record:xe,checked:ze,isMultiple:ut})=>{let ue=[];if(!i.isMultiple){g.value=he,l("select",{selections:he,record:xe,checked:ze,isMultiple:ut});return}if(w.value)ue=he;else if(!i.rowKey)ue=he;else{const qe=new Map(he.map(gt=>[C(gt),gt])),Et=new Map(g.value.map(gt=>[C(gt),gt]));d.forEach(gt=>{const mt=C(gt);qe.has(mt)?Et.set(mt,qe.get(mt)):Et.delete(mt)}),ue=Array.from(Et.values())}g.value=ue,l("select",{selections:ue,record:xe,checked:ze,isMultiple:ut}),m.value&&ue.length===0?(m.value=!1,s.value&&s.value.setRecords(d)):m.value&&ue.length>0&&s.value&&(s.value.setRecords(ue),s.value.setSelection?.(ue))},ot=he=>{g.value=he},We=he=>{g.value=[he],l("select",{selections:[he],record:he,checked:!0,isMultiple:!1})},en=()=>g.value||[],tn=he=>{g.value=he,s.value?.setSelection?.(he)},Pn=()=>s.value;return(0,n.onMounted)(async()=>{i.immediate&&await le()}),t({refreshData:le,resetData:Q,getSelection:en,setSelection:tn,clearSelection:()=>{Qe()},getTableRef:Pn}),(he,xe)=>{const ze=(0,n.resolveComponent)("j-buttons"),ut=(0,n.resolveComponent)("j-icon"),ue=(0,n.resolveComponent)("el-popover"),qe=(0,n.resolveComponent)("el-tooltip"),Et=(0,n.resolveComponent)("el-input"),gt=(0,n.resolveComponent)("j-button"),mt=(0,n.resolveComponent)("j-table"),Mt=(0,n.resolveDirective)("loading");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-table-panel-wrapper",{fullscreen:Se.value,"no-padding":e.noPadding||Se.value}])},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-table-panel",{"j-table-panel-fullscreen":Se.value}])},[(0,n.createElementVNode)("div",sm,[(0,n.createElementVNode)("div",cm,[(0,n.createElementVNode)("div",{ref_key:"topLeftRef",ref:St,class:"j-table-panel-top-left"},[(0,n.createVNode)(ze,{list:yt.value},null,8,["list"])],512),(0,n.createElementVNode)("div",dm,[_.value&&!b.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",um,[(0,n.createVNode)(Et,{modelValue:E.value,"onUpdate:modelValue":xe[2]||(xe[2]=Me=>E.value=Me),modelModifiers:{trim:!0},placeholder:(0,n.unref)(a)("搜索数据"),clearable:"",class:"j-suffix",onKeyup:(0,n.withKeys)(ne,["enter"]),onClear:ne},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(ut,{icon:"mdi:search"})]),suffix:(0,n.withCtx)(()=>[(0,n.createVNode)(qe,{placement:"bottom",content:z.value},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",null,[(0,n.createVNode)(ue,{placement:"bottom-end","popper-style":"padding: 0",width:200,trigger:"click","show-arrow":!1,onShow:j,onHide:ne},{reference:(0,n.withCtx)(()=>[(0,n.createVNode)(ut,{icon:"mdi:keyboard-arrow-down",style:{cursor:"pointer"}})]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(L0,{ref_key:"keywordPanelRef",ref:T,"check-all":V.value,"onUpdate:checkAll":xe[0]||(xe[0]=Me=>V.value=Me),"check-fields":N.value,"onUpdate:checkFields":xe[1]||(xe[1]=Me=>N.value=Me),columns:x.value},null,8,["check-all","check-fields","columns"])]),_:1})])]),_:1},8,["content"])]),_:1},8,["modelValue","placeholder"])])):(0,n.createCommentVNode)("",!0),e.showFilterButton&&!B.value&&!b.value?((0,n.openBlock)(),(0,n.createBlock)(ue,{key:1,visible:L.value,"onUpdate:visible":xe[6]||(xe[6]=Me=>L.value=Me),placement:"bottom","popper-style":"padding: 0",width:664,trigger:"click",persistent:!1,onHide:ne},{reference:(0,n.withCtx)(()=>[(0,n.createVNode)(gt,{icon:"mdi:filter-outline",label:"筛选",type:"text",class:(0,n.normalizeClass)({active:U.value})},null,8,["class"])]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(ds,{ref_key:"filterPanelRef",ref:A,"is-pin":B.value,"onUpdate:isPin":xe[3]||(xe[3]=Me=>B.value=Me),relation:se.value,"onUpdate:relation":xe[4]||(xe[4]=Me=>se.value=Me),"search-field-list":te.value,columns:x.value,onFilter:ne,onClose:xe[5]||(xe[5]=Me=>L.value=!1)},null,8,["is-pin","relation","search-field-list","columns"])]),_:1},8,["visible"])):(0,n.createCommentVNode)("",!0),e.showOrderButton&&!b.value?((0,n.openBlock)(),(0,n.createBlock)(qe,{key:2,placement:"bottom",content:(0,n.unref)(a)("排序")},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",null,[(0,n.createVNode)(ue,{visible:$.value,"onUpdate:visible":xe[7]||(xe[7]=Me=>$.value=Me),placement:"bottom","popper-style":"padding: 0",width:380,trigger:"click",onShow:M},{reference:(0,n.withCtx)(()=>[(0,n.createVNode)(gt,{class:(0,n.normalizeClass)({active:Y.value.length>0}),type:"text",icon:"mdi:sort"},null,8,["class"])]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(em,{ref_key:"orderPanelRef",ref:I,columns:x.value,onSave:oe,onClear:me},null,8,["columns"])]),_:1},8,["visible"])])]),_:1},8,["content"])):(0,n.createCommentVNode)("",!0),e.showColumnButton&&!b.value?((0,n.openBlock)(),(0,n.createBlock)(qe,{key:3,placement:"bottom",content:(0,n.unref)(a)("显示字段")},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",null,[(0,n.createVNode)(ue,{visible:Be.value,"onUpdate:visible":xe[8]||(xe[8]=Me=>Be.value=Me),placement:"bottom","popper-style":"padding: 0",width:400,trigger:"click",onShow:ge},{reference:(0,n.withCtx)(()=>[(0,n.createVNode)(gt,{class:(0,n.normalizeClass)({active:q.value}),type:"text",icon:"mdi:table-headers-eye"},null,8,["class"])]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(lm,{ref_key:"columnPanelRef",ref:ce,columns:e.columns,"column-config":Te.value,onSave:we},null,8,["columns","column-config"])]),_:1},8,["visible"])])]),_:1},8,["content"])):(0,n.createCommentVNode)("",!0),e.showRefreshButton&&!b.value?((0,n.openBlock)(),(0,n.createBlock)(qe,{key:4,placement:"bottom",content:(0,n.unref)(a)("刷新")},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(gt,{type:"text",icon:"mdi:refresh",onClick:Ce})]),_:1},8,["content"])):(0,n.createCommentVNode)("",!0),e.showFullscreenButton?((0,n.openBlock)(),(0,n.createBlock)(qe,{key:5,placement:"bottom",content:Se.value?(0,n.unref)(a)("退出全屏"):(0,n.unref)(a)("全屏")},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(gt,{type:"text",icon:Se.value?"mdi:fullscreen-exit":"mdi:fullscreen",onClick:lt},null,8,["icon"])]),_:1},8,["content"])):(0,n.createCommentVNode)("",!0)])]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",fm,[e.renderVNode?((0,n.openBlock)(),(0,n.createElementBlock)("div",pm,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(d),(Me,fn)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.rowKey?C(Me):fn,onClick:et=>We(Me)},[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.renderVNode(Me))))],8,hm))),128))])):((0,n.openBlock)(),(0,n.createBlock)(mt,{key:1,ref_key:"tableRef",ref:s,"table-page":f.value,"onUpdate:tablePage":xe[9]||(xe[9]=Me=>f.value=Me),columns:v.value,"sub-columns":e.subColumns,records:(0,n.unref)(d),"is-tree":e.isTree,"default-expand-all":e.defaultExpandAll,"parent-key":e.parentKey,"is-show-number":e.isShowNumber,"is-sub-show-number":e.isSubShowNumber,"is-multiple":e.isMultiple&&!!e.rowKey,"select-state-key":e.selectStateKey,"is-page":y.value,"page-sizes":e.pageSizes,"page-size":e.pageSize,"page-total":c.value,"row-key":e.rowKey,actions:e.actions,"sub-actions":e.subActions,"actions-max-count":e.actionsMaxCount,"actions-label":e.actionsLabel,"action-filter":e.actionFilter,"highlight-mode":e.highlightMode,"load-children":e.loadChildren,onLoadPageData:X,onReady:Ee,onSelectionChanged:Le,onSelectRecordsChanged:ot},null,8,["table-page","columns","sub-columns","records","is-tree","default-expand-all","parent-key","is-show-number","is-sub-show-number","is-multiple","select-state-key","is-page","page-sizes","page-size","page-total","row-key","actions","sub-actions","actions-max-count","actions-label","action-filter","highlight-mode","load-children"]))])),[[Mt,h.value]])]),e.showFilterButton&&B.value&&!b.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",gm,[(0,n.createVNode)(ds,{ref_key:"filterPanelRef",ref:A,"is-pin":B.value,"onUpdate:isPin":xe[10]||(xe[10]=Me=>B.value=Me),relation:se.value,"onUpdate:relation":xe[11]||(xe[11]=Me=>se.value=Me),"search-field-list":te.value,columns:x.value,onFilter:ne},null,8,["is-pin","relation","search-field-list","columns"])])):(0,n.createCommentVNode)("",!0)],2)],2)}}}),ym=mm,Cr=fe(ym),vm={class:"j-button-select"},bm={class:"search-wraper"},wm={class:"options-wraper"},Cm=["onClick"],xm=(0,n.defineComponent)({name:"JButtonSelect",__name:"button-select",props:{modelValue:{default:void 0},label:{default:"添加"},popoverWidth:{default:240},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Ye(),i=(0,n.ref)(""),l=(0,n.computed)(()=>i.value===""?o.options:o.options.filter(c=>(c.label||"").includes(i.value))),s=(0,n.computed)(()=>o.modelValue?(o.modelValue+"").split(",").filter(Boolean):[]),d=c=>{if(c.disabled||s.value.includes(c.value))return;const f=[...s.value,c.value].join(",");a("update:modelValue",f),a("change",{value:f,data:c})};return(c,f)=>{const p=(0,n.resolveComponent)("j-button"),u=(0,n.resolveComponent)("j-icon"),h=(0,n.resolveComponent)("el-input"),g=(0,n.resolveComponent)("el-popover");return(0,n.openBlock)(),(0,n.createBlock)(g,{teleported:!1,placement:"bottom-start","popper-style":"padding: 0",width:e.popoverWidth,trigger:"click","show-arrow":!1,offset:4},{reference:(0,n.withCtx)(()=>[(0,n.createVNode)(p,{style:{"justify-content":"flex-start",padding:"4px 0",border:"0"},icon:"mdi:add",label:e.label,type:"link"},null,8,["label"])]),default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",vm,[(0,n.createElementVNode)("div",bm,[(0,n.createVNode)(h,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=m=>i.value=m),modelModifiers:{trim:!0},placeholder:(0,n.unref)(r)("搜索"),class:"no-border",clearable:""},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(u,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),(0,n.createElementVNode)("div",wm,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(l.value,m=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:m.value,class:(0,n.normalizeClass)(["option-item",{active:s.value.includes(m.value)||m.disabled}]),onClick:(0,n.withModifiers)(w=>d(m),["stop"])},[m.icon?((0,n.openBlock)(),(0,n.createBlock)(u,{key:0,class:"j-button-select-icon",icon:m.icon},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(r)(m.label)),1)],10,Cm))),128))])])]),_:1},8,["width"])}}}),km=xm,us=fe(km),Sm={class:"j-tree-item-text"},Em={key:2,class:"j-tree-item-button-group"},_m={key:1,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center"}},Bm=(0,n.defineComponent)({name:"JTree",__name:"tree",props:{loadData:Function,afterLoadData:Function,click:Function,immediate:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array,default:()=>[]},defaultExpandedKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightCurrent:{type:Boolean,default:!0},filterNode:Function,renderAfterExpand:{type:Boolean,default:!0},iconKey:{type:String,default:"nodeIcon"},iconColorKey:{type:String,default:"nodeIconColor"},list:{type:Array},dataType:String,dataCode:String,checkable:Boolean,check:Function,emptyDes:{type:String,default:"暂无数据"},defaultIcon:{type:String,default:""},defaultIconColor:{type:String,default:""},treeButtons:{type:Array,default:()=>[]},filterButton:Function,buttonDefaultIcon:{type:String,default:""},buttonIconColor:{type:String,default:""},runFlow:{type:Function},nodeClickFlow:{type:String},isHeightAuto:{type:Boolean,default:!1},theme:{type:String,default:"default"},draggable:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!1},allowDrop:Function},emits:["node-drop"],setup(e,{expose:t,emit:o}){const a=e,r=o,{useData:i,t:l}=Ye(),{getDataByComp:s,loadDataByComp:d}=i(),c=(0,n.ref)(),f=(0,n.ref)(!1),p=(0,n.ref)(""),u=(0,n.ref)([]),h={children:"children",label:"label",disabled:"disabled"},g=(0,n.computed)(()=>s?s({config:a})||[]:[]),m=(0,n.computed)(()=>a.dataCode||a.dataType?g.value:a.list?(0,n.unref)(a.list):u.value),w=async()=>{f.value=!0,a.loadData&&(u.value=await a.loadData()||[]),d&&await d({type:"j-tree",config:a}),f.value=!1,(0,n.nextTick)(()=>{a.afterLoadData&&a.afterLoadData(m.value||[])})},k=(j,A=!0)=>{c.value?.setCurrentKey(j,A)},b=()=>c.value?.getCurrentKey(),y=(j,A=!1)=>{c.value?.setCheckedKeys(j,A)},C=(j=!1)=>c.value?.getCheckedKeys(j),S=async(j,A,B,L)=>{if(p.value=j.value,a.nodeClickFlow&&a.runFlow){const U=JSON.parse(a.nodeClickFlow);await a.runFlow(U,{value:j.value})}a.click&&a.click(j.value,j,L)},v=(j,{checkedKeys:A,checkedNodes:B,halfCheckedKeys:L,halfCheckedNodes:U})=>{a.check&&a.check(A,{node:j,checkedNodes:B,halfCheckedKeys:L,halfCheckedNodes:U})},x=(j,A,B,L)=>{r("node-drop",j,A,B,L)},E=j=>{const A=Vt(a.treeButtons);return j&&a.filterButton?a.filterButton({buttons:A,node:j}):A},{openLayer:_}=zn(),T=(j,A)=>{j.config?.disabled||j.click&&j.click({data:A,openLayer:_})},V=(0,n.ref)(""),N=(j,A)=>{V.value=j?A.value:""},z=(j,A,B)=>a.allowDrop?a.allowDrop(j,A,B):!(B=="inner"&&!A.data.canInner);return(0,n.onMounted)(async()=>{(a.immediate&&a.loadData||a.dataType||a.dataCode)&&await w()}),(0,n.watch)(()=>a.dataCode||a.dataType,()=>{w()}),t({refreshData:w,setValue:k,getValue:b,setCheck:y,getCheck:C}),(j,A)=>{const B=(0,n.resolveComponent)("j-icon"),L=(0,n.resolveComponent)("j-button"),U=(0,n.resolveComponent)("el-dropdown-item"),te=(0,n.resolveComponent)("el-dropdown-menu"),se=(0,n.resolveComponent)("el-dropdown"),I=(0,n.resolveComponent)("el-tree"),$=(0,n.resolveComponent)("el-empty"),Y=(0,n.resolveDirective)("loading");return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(["j-block","j-tree",{"j-tree-menu":e.theme==="menu"}]),style:{"min-height":"60px"}},[!f.value&&m.value.length>0?((0,n.openBlock)(),(0,n.createBlock)(I,{key:0,ref_key:"treeRef",ref:c,"node-key":"value","default-checked-keys":e.defaultCheckedKeys,"default-expanded-keys":e.defaultExpandedKeys,"current-node-key":p.value,data:m.value,"default-expand-all":e.defaultExpandAll,"show-checkbox":e.checkable,props:h,"highlight-current":e.highlightCurrent,accordion:e.accordion,"filter-node-method":e.filterNode,"render-after-expand":e.renderAfterExpand,draggable:e.draggable,"allow-drop":z,"expand-on-click-node":e.expandOnClickNode,onNodeClick:S,onCheck:v,onNodeDrop:x},{default:(0,n.withCtx)(({node:M})=>[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["j-tree-item-wraper",{"is-focus":V.value===M.data.value}])},[M.data.openIcon?((0,n.openBlock)(),(0,n.createBlock)(B,{key:0,class:"j-tree-item-open-icon",size:18,icon:M.data.openIcon,color:M.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):(0,n.createCommentVNode)("",!0),M.data[e.iconKey]||e.defaultIcon?((0,n.openBlock)(),(0,n.createBlock)(B,{key:1,class:"j-tree-item-default-icon",size:18,icon:M.data[e.iconKey]||e.defaultIcon||"",color:M.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",Sm,(0,n.toDisplayString)(M.label),1),E(M.data).length?((0,n.openBlock)(),(0,n.createElementBlock)("div",Em,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(E(M.data),(oe,me)=>((0,n.openBlock)(),(0,n.createBlock)(se,{key:me,trigger:"click",onVisibleChange:ce=>N(ce,M.data)},{dropdown:(0,n.withCtx)(()=>[(0,n.createVNode)(te,null,{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(oe.children,(ce,Be)=>((0,n.openBlock)(),(0,n.createBlock)(U,{key:Be,disabled:ce.disabled,divided:ce.divided,onClick:(0,n.withModifiers)(Te=>T(ce,M.data),["stop"])},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)("div",{class:"j-flex-item",style:(0,n.normalizeStyle)({color:ce.danger?"var(--j-color-danger)":ce.color||e.buttonIconColor||"var(--j-color-text-2)"})},[ce.icon||e.buttonDefaultIcon?((0,n.openBlock)(),(0,n.createBlock)(B,{key:0,icon:ce.icon||e.buttonDefaultIcon},null,8,["icon"])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",null,(0,n.toDisplayString)((0,n.unref)(l)(ce.label)),1)],4)]),_:2},1032,["disabled","divided","onClick"]))),128))]),_:2},1024)]),default:(0,n.withCtx)(()=>[(0,n.createVNode)(L,{icon:oe.icon,type:"text"},null,8,["icon"])]),_:2},1032,["onVisibleChange"]))),128))])):(0,n.createCommentVNode)("",!0)],2)]),_:1},8,["default-checked-keys","default-expanded-keys","current-node-key","data","default-expand-all","show-checkbox","highlight-current","accordion","filter-node-method","render-after-expand","draggable","expand-on-click-node"])):((0,n.openBlock)(),(0,n.createElementBlock)("div",_m,[(0,n.createVNode)($,{description:(0,n.unref)(l)(e.emptyDes)},null,8,["description"])]))],2)),[[Y,f.value]])}}}),Rm=Bm,fs=fe(Rm),Tm=(0,n.defineComponent)({name:"JTreeSelect",__name:"tree-select",props:{modelValue:{},options:{},checkStrictly:{type:Boolean,default:!0},renderAfterExpand:{type:Boolean,default:!0},props:{default:()=>({children:"children",label:"label",value:"value"})},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},placeholder:{default:"请选择"},dataType:{default:""},dataCode:{default:""},labelKey:{default:""},valueKey:{default:""},pidKey:{default:""},idKey:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,{useData:a}=Ye(),{getDataByComp:r}=a(),i=(0,n.computed)(()=>r?r({type:"j-tree-select",config:o})||[]:[]),l=(0,n.computed)(()=>o.options?o.options:o.dataCode||o.dataType?i.value:[]),s=t,d=(0,n.computed)({get(){return o.modelValue},set(f){s("update:modelValue",f)}}),c=f=>{s("change",f)};return(f,p)=>{const u=(0,n.resolveComponent)("el-tree-select");return(0,n.openBlock)(),(0,n.createBlock)(u,{modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=h=>d.value=h),style:{width:"100%"},data:l.value,"check-strictly":e.checkStrictly,"render-after-expand":e.renderAfterExpand,props:o,size:e.size,disabled:e.disabled||e.readonly,clearable:e.clearable,placeholder:e.placeholder,onChange:c},null,8,["modelValue","data","check-strictly","render-after-expand","size","disabled","clearable","placeholder"])}}}),Vm=Tm,ps=fe(Vm),hs=fe(Nl),Mm=dr.default;async function Am(e,t,o){const a={...o};delete a.ruleIndex,delete a.trigger;const r=new Mm({[e]:[a]});let i=[];try{await r.validate({[e]:t})}catch(l){l.errors?i=l.errors.map(({message:s})=>s):i=[a.message||"校验错误"]}return i.length>0?i[0]:""}async function Nm(e,t,o){const a=o.map((r,i)=>({...r,ruleIndex:i})).sort(({warningOnly:r,ruleIndex:i},{warningOnly:l,ruleIndex:s})=>!!r==!!l?i-s:r?1:-1);for(let r=0;r<a.length;r+=1){const i=a[r];"pattern"in i&&(t+="");const l=await Am(e,t,i);if(l!=="")return{name:e,errors:l}}}function jm(e,t){const o=(i,l,s,d,c)=>{Object.keys(l).forEach(f=>{let p=f;s&&(p=`${s}.${f}`);const u=l[f],{rules:h,myGridtableId:g}=t(p,s?l:void 0,()=>d,c);if(h.length){const m=a(p,u,h);i.push(m)}g&&u.forEach(m=>{o(i,m,g,u,s?l:void 0)})})},a=(i,l,s)=>Nm(i,l,s);return{validateForm:async()=>{const i=(0,n.unref)(e),l=[];o(l,i,"");const s=await Promise.all(l),d={};return s.forEach(c=>{c&&(d[c.name]={msg:c.errors})}),d},validateField:a}}var gs=({data:e,actions:t,utils:o,inputParams:a,notRunActions:r})=>{const i=s=>e.filter(d=>d.source===s).map(d=>d.target),l=async s=>{s=s||"start";const d=e.find(c=>c.id===s);if(d.config.type==="start"){const c=i(s);for(let f=0;f<c.length;f++)await l(c[f])}else{const c=t[d.config.type];c&&await c(d.config,o,async f=>{if(f=f||{},f.nodeId=s,f.next!==!1){const p=i(f.nodeId);for(let u=0;u<p.length;u++)await l(p[u])}},a,f=>{r[f]={data:e,inputParams:a}})}};return{run:l}},Pm=(0,n.defineComponent)({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1},actions:{type:Object,default:()=>({})}},emits:["change"],setup(e,{expose:t,emit:o}){const a=e,r=o,{useData:i,existField:l,httpGet:s,httpPost:d,success:c,warning:f,error:p,info:u,t:h}=Ye();let g;i&&(g=i());const m=W=>{p&&p(W)},w=(0,n.ref)(!1),k=(0,n.computed)(()=>a.config?.gutter||16),b=(0,n.computed)(()=>a.config?.span||24),y=(0,n.computed)(()=>a.config?.labelWidth),C=(0,n.computed)(()=>a.config?.labelPosition||"right"),S=(0,n.computed)(()=>E.length===1&&(E[0].type==="j-tabs"||E[0].type==="j-layout"||E[0].config?.isAutoWindow)),v=(0,n.reactive)({}),x=(0,n.ref)({}),E=[],_={};let T={},V={},N=[],z={};const j=async W=>{w.value&&L&&(W.getTableData||hr(L,W.id,W.formData[W.id])),r("change",W),_[W.id]?.config?.codeChange&&await yt(JSON.parse(_[W.id]?.config?.codeChange),{param:W}),a.config?.codeChange&&await yt(JSON.parse(a.config?.codeChange),{param:W})},A=W=>la(_[W]?.type||"")&&!_[W]?.config?.notInput||_[W]?.config?.isInput,B=W=>["j-table","j-input-rows","j-input-cards"].includes(_[W]?.type||"");let L;const U=(W,ne)=>{Object.keys(W).forEach(X=>{const Q=W[X];ne&&(X=ne+"."+X),Q!=null&&typeof Q=="object"&&!aa(Q)&&U(Q,X),v[X]=Q})},te=(W,ne)=>{let X=W.id;return X||(W.config?.table&&W.config?.field?X=`${W.config.table}.${W.config.field}`:W.config?.table?X=W.config?.table:W.config?.field&&(X=W.config?.field),ne&&B(ne)&&(X=`${ne}.${X}`)),X||ia("j")},se=(W,ne,X,Q="")=>{W.forEach(le=>{le.id=te(le,Q);const Ce={id:le.id,slot:le.slot,type:le.type||"",getCompType:le.getCompType,getCompConfig:le.getCompConfig,config:{},children:[]};ne.push(Ce);const{children:Ee}=le;ko(Ce,le,["children","config"]),ko(Ce.config,le.config||{},[]),_[le.id]&&console.warn("有重复的组件id:"+le.id),_[le.id]=Ce,a.readonly===!0&&(Ce.config.readonly=!0);let Le=!1,ot;Q!==""&&B(Q)&&(Le=!0,Ce.config=le.config||{},Ce.config.parentTableId=Q,ot=_[Q]?.config?.table);const We=Ce.config||{};if(A(le.id))!X&&Le===!1&&(We?.defaultValue===0?v[le.id]=We?.defaultValue:v[le.id]=We?.defaultValue||void 0),We.table&&We.field?T[`${We.table}_${We.field}`.toLowerCase()]=le.id:We.field&&(Le?T[`${ot}_${We.field}`.toLowerCase()]=le.id:T[`${We.field}`.toLowerCase()]=le.id);else if(Le&&We.field)T[`${ot}_${We.field}`.toLowerCase()]=le.id;else if(B(le.id))!X&&!We.isSubTable&&(v[le.id]=[]),We.table&&(T[We.table.toLowerCase()||""]=le.id),We.isSubTable||N.push(Ce);else if(We?.defaultValue)v[le.id]=We?.defaultValue;else if(le.type==="collapse"&&We?.isExpand){const en=[];(We?.groups||[]).forEach(tn=>{en.push(tn.i)}),v[le.id]=en}Ee&&Ee.length>0&&se(Ee,Ce.children,X,Ce.id)})},I=async(W,ne)=>{w.value=!1;const X=!!ne;E.splice(0,E.length),T={},V={},N=[],L=ne,eo(v),eo(_),X&&U(ne,""),se(W,E,X),z=Vt(v),await(0,n.nextTick)(),w.value=!0,await(0,n.nextTick)(),a.config?.codeInit&&await yt(JSON.parse(a.config?.codeInit),{param:{}})},$=(W,ne,X)=>{const Q=[];return ne.forEach(le=>{const Ce={};Object.keys(le).forEach(Ee=>{if(!X||X(Ee,le[Ee],W)){const Le=we(Ee);if(Le?.type==="j-table")Ce[Le?.id||""]=$(Ee,le[Ee],X);else{let ot=T[`${W}_${Ee}`.toLowerCase()]||Ee;ot=ot.indexOf(".")!==-1?ot.split(".")[1]:ot,Ce[ot]=le[Ee]}}}),Q.push(Ce)}),Q},Y=(W,ne)=>{Object.keys(W||{}).forEach(X=>{let Q=W[X];const le=we(X);if(le===void 0)Q&&(aa(Q)&&(Q=Q[0]||{}),typeof Q=="object"?Object.keys(Q).forEach(Ce=>{if(!ne||ne(X,Q[Ce],X)){let Ee=Ce;X!=="main"&&(Ee=`${X}_${Ce}`),V[Ee]=X,v[T[Ee.toLowerCase()]||Ce]=Q[Ce]}}):v[X]=Q);else if(B(le.id||"")){if(!Array.isArray(Q)){console.warn("表格数据不是数组:"+X);return}Q?.length>0?v[T[X.toLowerCase()]||X]=$(X,Q,ne):v[T[X.toLowerCase()]||X]=[]}else(!ne||ne(X,Q,X))&&(v[T[X.toLowerCase()]||X]=Q)}),L&&Object.keys(v).forEach(X=>{const Q=we(X);(Q===void 0||!["j-tabs","j-collapse"].includes(Q.type||""))&&hr(L,X,v[X])})},M=new Set(["parentRow","_i","_compTypeByRender"]),oe=(W,ne=!1)=>{const X={};return Object.keys(W).forEach(Q=>{if(M.has(Q))return;const le=_[Q];if(le){const Ce=le.config?.table,Ee=le.config?.field;if(ne)Ee?X[Ee]=W[Q]:X[Q]=W[Q];else if(B(Q)){const Le=[];W[Q].forEach(ot=>{Le.push(oe(ot,!0))}),X[Ce||Q]=Le}else Ce&&Ee?(X[Ce]=X[Ce]||{},X[Ce][Ee]=W[Q]):Ee&&(X[Ee]=W[Q])}else ne?Q!=="_X_ROW_KEY"&&Q!=="_isHover"&&(X[Q]=W[Q]):V[Q]?(X[V[Q]]=X[V[Q]]||{},X[V[Q]][Q.replace(`${V[Q]}_`,"")]=W[Q]):X[Q]=W[Q]}),X},me=(W=!0)=>W?oe(v):v,ce=(W,ne,X,Q)=>{let le=_[W];if(le==null){const Ee=W.split(".");le=_[Ee[Ee.length-1]]||{}}if(!le)return{};const Ce=Nt({config:le.config||{},getCompConfig:le.getCompConfig,formData:v,getTableData:X,row:ne,pRowData:Q});return Ce._componentId=le?.id,Ce},Be=(W,ne,X,Q)=>{const le=ce(W,ne,X,Q);if(le.isNotRule!==!0&&le.display!==!1){const Ce=le.rule||[],Ee=Ce.find(Le=>Le.type==="only");return Ee&&(Ee.validator=async(Le,ot)=>{if(ot&&!await l({table:Le.table,key:Le.key,keyName:Le.keyName,field:Le.field,keyValue:Le.getKeyValue?Le.getKeyValue():"",value:ot,paramNames:Le.paramNames,getParams:Le.getParams,withProjectId:Le.withProjectId,getValue:Le.getValue,formData:v}))throw h(Le.message)||h("数据值重复")}),{rules:Ce,myGridtableId:B(le._componentId)?le._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:Te}=jm(v,Be),q=async()=>{x.value={};const W=await Te();return Object.keys(W).length>0?(x.value=W,m(`${h(_[Object.keys(W)[0]]?.config?.label)}:${h(W[Object.keys(W)[0]].msg)}`),!1):!0},ge=()=>{x.value={},eo(v),Object.keys(z||{}).forEach(W=>{v[W]=z[W]})},we=W=>{let ne=_[W];return ne===void 0&&T[W.toLowerCase()]&&(ne=_[T[W.toLowerCase()]]),ne},Se=({id:W,i:ne,value:X,type:Q})=>{if(Q==="add")v[W].push(X);else if(Q==="delete")v[W].splice(ne,1);else{const le=we(W);le&&(le.config.parentTableId?v[le.config.parentTableId][ne][W]=X:v[W]=X)}},lt=({id:W,i:ne})=>{const X=we(W);if(X){if(X.config.parentTableId){const Q=v[X.config.parentTableId],le=X.id?X.id.replace(`${X.config.parentTableId}.`,""):"";if(ne!=null)return(Q[ne]||{})[le||""];const Ce=[];return Q&&Q.forEach(Ee=>{Ce.push(Ee[le||""])}),Ce}if(B(X.id||"")){const Q=[];return v[X.id||""].forEach(le=>{Q.push(oe(le,!0))}),Q}return v[X.id||""]}if(v[W])return v[W]},Qe=async({id:W,i:ne})=>{const X=lt({id:W,i:ne}),Q=we(W);if(Q&&g?.getLabel)if(ne!==void 0){const le=X[ne],Ce=v[Q.config.parentTableId||""][ne],Ee=Nt({config:Q.config,getCompConfig:Q.getCompConfig,formData:v,tableData:v[Q.config.parentTableId||""],row:Ce});return await g?.getLabel({value:le,config:Ee,formData:v,tableData:v[Q.config.parentTableId||""],row:Ce})}else{const le=Nt({config:Q.config,getCompConfig:Q.getCompConfig,formData:v});return await g?.getLabel({value:X,config:le,formData:v})}return X},Ae=async(W,ne)=>g?.loadViewDataList?await g?.loadViewDataList(W,ne,!1):[],kt=W=>(W.set=Se,W.get=lt,W.setFormData=Y,W.getFormData=me,W.getLabel=Qe,W.getViewData=Ae,W.getDateNow=ne=>ca(new Date,ne||"YYYY-MM-DD HH:mm:ss"),W.httpGet=s||(()=>{console.log("当前状态不支持")}),W.httpPost=d||(()=>{console.log("当前状态不支持")}),W.loading=ne=>{hn(ne)},W.showMsg=({text:ne,type:X})=>{switch(X){case"success":c&&c(ne);break;case"warning":f&&f(ne);break;case"error":p&&p(ne);break;case"info":u&&u(ne);break;default:u&&u(ne);break}console.log("showMsg",ne,X)},W),Ht=async(W,ne)=>{if(W&&W.trim()){W=`async (jcode) => {${W}}`;const{res:X,fn:Q}=pr(W);X&&await Q(kt(ne))}},St=async()=>{a.config?.codeAfterSetData&&await yt(JSON.parse(a.config?.codeAfterSetData),{param:{}})},ct=async()=>{a.config?.codeBeforeSave&&await yt(JSON.parse(a.config?.codeBeforeSave),{param:{}})},dt=async()=>{a.config?.codeAfterSave&&await yt(JSON.parse(a.config?.codeAfterSave),{param:{}})};a.schema&&I(a.schema);const $e={},yt=async(W,ne)=>{const{run:X}=gs({data:W,actions:a.actions,utils:{showLoading:hn,executeEvent:Ht},inputParams:ne,notRunActions:$e});await X()};return yr({formData:v,components:_,errorFields:x,isAutoWindow:S,gutter:k,span:b,labelWidth:y,labelPosition:C,getValue:lt,formChange:j,runFlow:yt,runFlowByNotRunActions:async W=>{const ne=$e[W];ne&&(delete $e[W],await yt(ne.data,ne.inputParams))}}),vr({contextType:"form"}),t({init:I,reset:ge,validate:q,setValue:Se,getValue:lt,getLabel:Qe,setFormData:Y,getFormData:me,afterSetData:St,beforeSave:ct,afterSave:dt}),(W,ne)=>{const X=(0,n.resolveComponent)("j-form-item"),Q=(0,n.resolveComponent)("el-row"),le=(0,n.resolveComponent)("el-form");return w.value?((0,n.openBlock)(),(0,n.createBlock)(le,{key:0,class:(0,n.normalizeClass)(["j-form",e.isAutoSize&&"j-block",e.isAutoSize&&"j-form-auto"]),"label-position":C.value,"label-width":y.value,size:e.config?.size,onSubmit:ne[0]||(ne[0]=(0,n.withModifiers)(()=>{},["prevent"]))},{default:(0,n.withCtx)(()=>[S.value?((0,n.openBlock)(),(0,n.createBlock)(X,(0,n.mergeProps)({key:0},E[0],{"is-not-col":""}),null,16)):((0,n.openBlock)(),(0,n.createBlock)(Q,{key:1,gutter:k.value},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(E,Ce=>(0,n.createVNode)(X,(0,n.mergeProps)({key:Ce.id},{ref_for:!0},Ce),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):(0,n.createCommentVNode)("",!0)}}}),Hm=Pm,ms=fe(Hm),ys=fe(Al),zm={class:"j-page"},Om=(0,n.defineComponent)({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(e,{expose:t}){const o=e,a=(0,n.ref)(!1),r=(0,n.reactive)([]),i={},l=(0,n.reactive)({}),s=(b,y)=>{b.forEach(C=>{C.id=C.id||ia("c");const S={id:C.id,slot:C.slot,type:C.type||"",getCompConfig:C.getCompConfig,getCompType:C.getCompType},{children:v}=C;i[C.id]=S,S.config=[],ko(S.config,C.config||{},["defaultValue"]),C?.config?.defaultValue!==void 0&&(l[C.id]=C.config.defaultValue),y.push(S),v&&v.length>0&&(S.children=[],s(v,S.children))})},d=b=>{a.value=!1,r.splice(0,r.length),eo(i),eo(l),s(b,r),(0,n.nextTick)(()=>{a.value=!0})};o.schema&&d(o.schema);const{openLayer:c}=zn(),f={},p=async(b,y)=>{const{run:C}=gs({data:b,actions:o.actions,utils:{showLoading:hn,openLayer:c,call:m},inputParams:y,notRunActions:f});await C()},u=async b=>{const y=f[b];y&&(delete f[b],await p(y.data,y.inputParams))},h=new mr,g=new Map,m=(b,y,C,...S)=>{if(C?.immediate){const v=g.get(b)||new Map;v.set(y,S),g.set(b,v)}return h.emit(b,y,...S)},w=(b,y)=>{h.on(b,y);const C=g.get(b);C&&(g.delete(b),C.forEach((S,v)=>{y(v,...S||[])}))},k=(b,y)=>{h.off(b,y)};return pl({registerMethod:(b,y)=>(w(b,y),()=>{k(b,y)}),runFlow:p,runFlowByNotRunActions:u}),vr({contextType:"page"}),t({init:d,call:m,on:w,off:k}),(b,y)=>{const C=(0,n.resolveComponent)("j-comp");return(0,n.openBlock)(),(0,n.createElementBlock)("div",zm,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(r,S=>((0,n.openBlock)(),(0,n.createBlock)(C,{key:S.id,id:S.id,type:S.type,config:S.config,children:S.children},null,8,["id","type","config","children"]))),128))])}}}),Lm=Om,vs=fe(Lm),Dm=(0,n.defineComponent)({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)("");return(0,n.watch)(()=>o.modelValue,i=>{i?r.value=i:(r.value=ln(),a("update:modelValue",r.value))},{immediate:!0}),(i,l)=>{const s=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createBlock)(s,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=d=>r.value=d),readonly:"",size:e.size},null,8,["modelValue","size"])}}}),Im=Dm,bs=fe(Im),Fm={key:0,class:"j-panel-top"},$m=["title"],Wm={style:{margin:"0","font-size":"14px"}},Um={key:1},Jm={key:1,class:"j-panel-bottom"},Ym=(0,n.defineComponent)({name:"JPanel",__name:"panel",props:{title:{},toolBtns:{default:()=>[]},bootmBtns:{default:()=>[]},bootmRightBtns:{default:()=>[]},bodyStyle:{default:()=>({padding:"8px"})},noPadding:{type:Boolean,default:!1},notTitle:{type:Boolean,default:!1},flexWidth:{},height:{},unit:{default:"%"},notSetWidth:{type:Boolean,default:!1},size:{default:"default"}},setup(e){const{openLayer:t}=zn(),o=a=>{a.config?.disabled||a.click&&a.click({openLayer:t})};return(a,r)=>{const i=(0,n.resolveComponent)("j-button"),l=(0,n.resolveComponent)("el-tooltip"),s=(0,n.resolveComponent)("j-buttons");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"j-block",style:(0,n.normalizeStyle)({padding:e.noPadding?void 0:"4px",width:(e.notSetWidth?100:e.flexWidth||100)+"%",height:`${e.height?e.height+(e.unit||"%"):"100%"}`})},[(0,n.createElementVNode)("div",{class:"j-panel",style:(0,n.normalizeStyle)({"border-radius":e.noPadding?"0px":"4px"})},[e.title&&!e.notTitle||e.toolBtns&&e.toolBtns.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("div",Fm,[e.notTitle?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"j-panel-top-left",title:e.title||""},[(0,n.renderSlot)(a.$slots,"title",{},()=>[(0,n.createElementVNode)("span",Wm,(0,n.toDisplayString)(e.title||""),1)])],8,$m)),e.toolBtns&&e.toolBtns.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("span",Um,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.toolBtns,d=>((0,n.openBlock)(),(0,n.createBlock)(l,{key:d.id,placement:"top",content:d.label||""},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(i,(0,n.mergeProps)({ref_for:!0},d.config,{onClick:c=>o(d),type:"text",size:e.size}),null,16,["onClick","size"])]),_:2},1032,["content"]))),128))])):(0,n.createCommentVNode)("",!0)])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",{class:"j-panel-body",style:(0,n.normalizeStyle)(e.bodyStyle)},[(0,n.renderSlot)(a.$slots,"default")],4),e.bootmBtns&&e.bootmBtns.length>0||e.bootmRightBtns&&e.bootmRightBtns.length>0?((0,n.openBlock)(),(0,n.createElementBlock)("div",Jm,[(0,n.createVNode)(s,{list:e.bootmBtns},null,8,["list"]),(0,n.createVNode)(s,{list:e.bootmRightBtns},null,8,["list"])])):(0,n.createCommentVNode)("",!0)],4)],4)}}}),Gm=Ym,ws=fe(Gm),Km={class:"j-input-rows"},qm={key:0,class:"j-input-rows-num"},Xm={key:1,class:"j-input-rows-char"},Zm=(0,n.defineComponent)({name:"JInputRows",__name:"input-rows",props:{modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},isCompact:{type:Boolean,default:!1},showNum:{type:Boolean,default:!1},showChar:{type:Boolean,default:!1},isWrap:{type:Boolean,default:!1},id:{type:String,default:""},actions:{type:Array,default:()=>[]}},emits:["update:modelValue","change","rowChange"],setup(e,{emit:t}){const o=v=>v==null,a=e,r=t,{formData:i}=gn(),l=(0,n.computed)(()=>a.editConfig.isAddBtn!==!1),s=(0,n.computed)(()=>a.editConfig.addBtnText||"添加"),d=(0,n.computed)(()=>a.editConfig.buttonsAlign||"left"),c=(0,n.computed)(()=>a.editConfig.isRemoveBtn!==!1),f=(0,n.computed)(()=>a.editConfig.readonly),p=(0,n.computed)(()=>a.editConfig.drag),u=(0,n.computed)(()=>a.editConfig.isNullValue!==!1),h=(0,n.ref)(),g=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],m=(0,n.ref)([]);a.modelValue&&a.modelValue.length>0?(m.value=a.modelValue||[],m.value.forEach(v=>{v._i||(v._i=ln())})):(m.value=[],r("update:modelValue",m.value)),(0,n.watch)(()=>a.modelValue,v=>{m.value=a.modelValue||[],m.value=v||[],m.value.forEach(x=>{x._i||(x._i=ln())})},{deep:!0});const k=v=>{const x={};return!a.isCompact&&v.config?.colWidth&&(x.width=`${v.config.colWidth}px`),x},b=()=>{const v={_i:ln()};a.columns.forEach(x=>{const E=x.config?.valueRowKey||x.id||"";x.type==="j-layer-form"?x.config?.defaultValue&&Object.prototype.toString.call(x.config.defaultValue)==="[object Object]"&&Object.assign(v,Vt(x.config?.defaultValue)):E&&(v[E]=Vt(x.config?.defaultValue))}),m.value.push(v),r("change",{id:a.id,value:v,data:v,formData:i,tableData:m.value,type:"add"})},y=v=>{const x=m.value[v];m.value.splice(v,1),r("change",{id:a.id,value:x,data:x,formData:i,tableData:m.value,type:"delete"})},C=v=>{r("rowChange",v)};(0,n.onMounted)(()=>{if(!p.value||!h.value)return;const v=h.value,{initSortable:x}=ol(v,{handle:".j-input-rows-drag",onEnd:E=>{const{oldIndex:_,newIndex:T}=E;if(o(_)||o(T)||_===T||_<0||T<0)return;const V=m.value.splice(_,1)[0];m.value.splice(T,0,V),r("change",{id:a.id,value:V,data:V,formData:i,tableData:m.value,type:"sort"})}});x()});const{row:S}=ua();return _o({getTableData:()=>m.value,rowChange:C,pRowData:S}),(v,x)=>{const E=(0,n.resolveComponent)("j-comp"),_=(0,n.resolveComponent)("j-icon"),T=(0,n.resolveComponent)("j-button"),V=(0,n.resolveComponent)("j-buttons");return(0,n.openBlock)(),(0,n.createElementBlock)("div",Km,[(0,n.createElementVNode)("div",{ref_key:"inputRowsRef",ref:h,class:"j-input-rows-container"},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(m.value,(N,z)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:N._i+z,class:(0,n.normalizeClass)([e.isCompact?"j-space-compact":"j-space",{"j-space-wrap":e.isWrap}])},[e.showNum?((0,n.openBlock)(),(0,n.createElementBlock)("div",qm,(0,n.toDisplayString)(z+1),1)):(0,n.createCommentVNode)("",!0),e.showChar?((0,n.openBlock)(),(0,n.createElementBlock)("div",Xm,(0,n.toDisplayString)(g[z%26]),1)):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.columns,j=>((0,n.openBlock)(),(0,n.createBlock)(E,(0,n.mergeProps)({key:j.id,ref_for:!0},j,{row:N,style:k(j)}),null,16,["row","style"]))),128)),p.value?((0,n.openBlock)(),(0,n.createBlock)(_,{key:2,class:"j-input-rows-drag",icon:"mdi:drag"})):(0,n.createCommentVNode)("",!0),c.value&&(u.value||m.value.length>1)&&!f.value?((0,n.openBlock)(),(0,n.createBlock)(_,{key:3,icon:"mdi:delete-outline",class:"j-input-rows-delete",onClick:j=>y(z)},null,8,["onClick"])):(0,n.createCommentVNode)("",!0)],2))),128))],512),!f.value&&l.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,style:(0,n.normalizeStyle)({"text-align":d.value}),class:"j-input-rows-actions"},[l.value?((0,n.openBlock)(),(0,n.createBlock)(T,{key:0,type:"link",style:{"margin-right":"8px"},label:s.value,icon:"mdi:add",onClick:b},null,8,["label"])):(0,n.createCommentVNode)("",!0),e.actions&&e.actions.length>0?((0,n.openBlock)(),(0,n.createBlock)(V,{key:1,list:e.actions},null,8,["list"])):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0)])}}}),Qm=Zm,Cs=fe(Qm),ey={class:"j-input-layer"},ty=(0,n.defineComponent)({name:"JInputLayer",__name:"input-layer",props:{modelValue:{default:""},icon:{default:"mdi:library-edit-outline"},width:{default:800},height:{default:600},title:{},placeholder:{default:"请选择"},isMultiSelect:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},idKey:{},pidKey:{default:"value"},isTree:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},sidx:{},columns:{default:()=>[]},loadLayerData:{},renderVNode:{},getText:{},beforeOpen:{},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},mode:{default:"serve"},searchInputList:{default:()=>[]},onlyButton:{type:Boolean,default:!1},buttonLabel:{},buttonType:{},buttonShape:{},buttonGhost:{type:Boolean},buttonDanger:{type:Boolean},isSaveSelectData:{type:Boolean,default:!1},buttons:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:o}){const a=b=>!!(b==null||typeof b=="string"&&b.trim()===""||Array.isArray(b)&&b.length===0),r=e,i=o,l=(0,n.ref)(),s=(0,n.ref)(),d=(0,n.ref)(""),c=(0,n.computed)(()=>!!r.renderVNode&&!r.isMultiSelect),f=(0,n.computed)({get(){return r.modelValue},set(b){i("update:modelValue",b)}}),p=(0,n.computed)({get(){return a(f.value)?"":r.getText?r.getText(f.value)||d.value||f.value:d.value||f.value},set(b){b||h()}}),u=async()=>{r.readonly||r.beforeOpen&&await r.beforeOpen()===!1||l.value.open()},h=()=>{d.value="",f.value="",i("change",{value:"",data:void 0})},g=async({checked:b})=>{c.value&&b&&(await(0,n.nextTick)(),await m())},m=async()=>{if(!s.value)return;const b=s.value.getSelection();if(r.isMultiSelect){const y=[],C=[];b.forEach(S=>{const v=S[r.labelKey],x=S[r.valueKey];y.push(v!=null?String(v):""),x===0||x?C.push(String(x)):C.push("")}),d.value=y.join(","),f.value=C.join(","),i("change",{value:C.join(","),data:b})}else if(b.length>0){const y=b[0],C=y[r.labelKey],S=y[r.valueKey];d.value=C!=null?String(C):"";const v=S!=null?String(S):"";f.value=v,i("change",{value:v,data:y})}else d.value="",f.value="",i("change",{value:"",data:void 0});l.value.close()},w=()=>{s.value&&s.value.clearSelection&&s.value.clearSelection()};return t({getTablePanelRef:()=>s.value}),(b,y)=>{const C=(0,n.resolveComponent)("el-input");return(0,n.openBlock)(),(0,n.createElementBlock)("div",ey,[e.onlyButton?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(ra),{key:1,type:e.buttonType,size:e.size,label:e.buttonLabel,icon:e.icon,shape:e.buttonShape,ghost:e.buttonGhost,danger:e.buttonDanger,onClick:u},null,8,["type","size","label","icon","shape","ghost","danger"])):((0,n.openBlock)(),(0,n.createBlock)(C,{key:0,modelValue:p.value,"onUpdate:modelValue":y[0]||(y[0]=S=>p.value=S),placeholder:e.placeholder,readonly:!0,size:e.size,clearable:!e.readonly&&e.clearable,onClick:u,onClear:h},(0,n.createSlots)({_:2},[e.readonly?void 0:{name:"append",fn:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(ra),{icon:e.icon,onClick:u},null,8,["icon"])]),key:"0"}]),1032,["modelValue","placeholder","size","clearable"])),(0,n.createVNode)((0,n.unref)(wr),{ref_key:"layerRef",ref:l,title:e.title||e.placeholder,width:e.width,height:e.height,"has-btns":!c.value,"btn-text":"确定",onOk:m,onClosed:w},{default:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(Cr),{ref_key:"tableRef",ref:s,columns:e.columns,"row-key":e.valueKey,"is-tree":e.isTree,"is-page":e.isPage,sort:e.sidx,"is-multiple":e.isMultiSelect,"load-data":e.loadLayerData,"render-v-node":e.renderVNode,immediate:!0,onSelect:g},null,8,["columns","row-key","is-tree","is-page","sort","is-multiple","load-data","render-v-node"])]),_:1},8,["title","width","height","has-btns"])])}}}),ny=ty,xs=fe(ny),oy=(0,n.defineComponent)({name:"JLayerForm",__name:"layer-form",props:{icon:{type:String,default:"mdi:form-outline"},type:{type:String,default:"default"},size:{type:String,default:"default"},layerLabel:{type:String,default:"设置"},layerHeight:{type:Number,default:400},layerWidth:{type:Number,default:600},formConfig:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]}},setup(e){const t=e,o=gn(),{t:a}=Ye(),r=(0,n.computed)(()=>t.formConfig?.gutter||16),i=(0,n.computed)(()=>t.formConfig?.span||24),l=(0,n.computed)(()=>t.formConfig?.labelWidth||o.labelWidth?.value),s=(0,n.computed)(()=>t.formConfig?.labelPosition||o.labelPosition?.value||"right"),d=(0,n.computed)(()=>t.schema?.length===1&&(t.schema?.[0]?.type==="j-tabs"||t.schema?.[0]?.type==="j-layout"||t.schema?.[0]?.config?.isAutoWindow)),c=(0,n.ref)(!1),f=()=>{c.value=!0};return yr({...o,isAutoWindow:d,gutter:r,span:i,labelWidth:l}),(p,u)=>{const h=(0,n.resolveComponent)("j-button"),g=(0,n.resolveComponent)("j-form-item"),m=(0,n.resolveComponent)("el-row"),w=(0,n.resolveComponent)("el-form"),k=(0,n.resolveComponent)("j-dialog");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(h,(0,n.mergeProps)(p.$attrs,{type:e.type,size:e.size,icon:e.icon,onClick:f}),null,16,["type","size","icon"]),(0,n.createVNode)(k,{visible:c.value,"onUpdate:visible":u[1]||(u[1]=b=>c.value=b),title:(0,n.unref)(a)(e.layerLabel||"设置"),height:e.layerHeight||400,width:e.layerWidth||600,"has-btns":!1},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(w,{class:(0,n.normalizeClass)(["j-block","j-layer-form"]),"label-position":s.value,"label-width":l.value,size:e.formConfig?.size,onSubmit:u[0]||(u[0]=(0,n.withModifiers)(()=>{},["prevent"]))},{default:(0,n.withCtx)(()=>[d.value?((0,n.openBlock)(),(0,n.createBlock)(g,(0,n.normalizeProps)((0,n.mergeProps)({key:0},e.schema[0])),null,16)):((0,n.openBlock)(),(0,n.createBlock)(m,{key:1,gutter:r.value},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.schema,b=>((0,n.openBlock)(),(0,n.createBlock)(g,(0,n.mergeProps)({key:b.id,ref_for:!0},b),null,16))),128))]),_:1},8,["gutter"]))]),_:1},8,["label-position","label-width","size"])]),_:1},8,["visible","title","height","width"])])}}}),ay=oy,ks=fe(ay),ry=(0,n.defineComponent)({name:"JSwitch",inheritAttrs:!1,__name:"switch",props:{modelValue:{type:[Boolean,String,Number],default:!1},size:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeText:{},inactiveText:{},activeIcon:{},inactiveIcon:{},activeActionIcon:{},inactiveActionIcon:{},width:{default:40},inlinePrompt:{type:Boolean,default:!1},name:{},validateEvent:{type:Boolean,default:!0},beforeChange:{},id:{},tabindex:{},ariaLabel:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.computed)({get(){return o.modelValue},set(l){a("update:modelValue",l)}}),i=l=>{a("change",l)};return(0,n.onMounted)(()=>{o.autoFocus&&!o.readonly&&setTimeout(()=>{const l=r.value===o.activeValue?o.inactiveValue:o.activeValue;r.value=l,i(l)},100)}),(l,s)=>{const d=(0,n.resolveComponent)("el-switch");return(0,n.openBlock)(),(0,n.createBlock)(d,(0,n.mergeProps)(l.$attrs,{id:e.id,modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=c=>r.value=c),size:e.size,width:e.width,"inline-prompt":e.inlinePrompt,"active-icon":e.activeIcon,"inactive-icon":e.inactiveIcon,"active-action-icon":e.activeActionIcon,"inactive-action-icon":e.inactiveActionIcon,"active-text":e.activeText,"inactive-text":e.inactiveText,"active-value":e.activeValue,"inactive-value":e.inactiveValue,name:e.name,"validate-event":e.validateEvent,"before-change":e.beforeChange,tabindex:e.tabindex,"aria-label":e.ariaLabel,loading:e.loading,disabled:e.disabled||e.readonly,onChange:i}),(0,n.createSlots)({_:2},[l.$slots["active-action"]?{name:"active-action",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(l.$slots,"active-action")]),key:"0"}:void 0,l.$slots["inactive-action"]?{name:"inactive-action",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(l.$slots,"inactive-action")]),key:"1"}:void 0,l.$slots.active?{name:"active",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(l.$slots,"active")]),key:"2"}:void 0,l.$slots.inactive?{name:"inactive",fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(l.$slots,"inactive")]),key:"3"}:void 0]),1040,["id","modelValue","size","width","inline-prompt","active-icon","inactive-icon","active-action-icon","inactive-action-icon","active-text","inactive-text","active-value","inactive-value","name","validate-event","before-change","tabindex","aria-label","loading","disabled"])}}}),iy=ry,Ss=fe(iy),ly=(0,n.defineComponent)({name:"JTabs",__name:"tabs",props:{modelValue:{},type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},tabPosition:{default:"top"},stretch:{type:Boolean,default:!1},beforeLeave:{},isFill:{type:Boolean}},emits:["update:modelValue","tab-click","tab-change","tab-remove","tab-add","edit"],setup(e,{emit:t}){const o=t,a=c=>{o("update:modelValue",c)},r=(c,f)=>{o("tab-click",c,f)},i=c=>{o("tab-change",c)},l=c=>{o("tab-remove",c)},s=()=>{o("tab-add")},d=(c,f)=>{o("edit",c,f)};return(c,f)=>{const p=(0,n.resolveComponent)("el-tabs");return(0,n.openBlock)(),(0,n.createBlock)(p,(0,n.mergeProps)(c.$attrs,{class:{isFill:e.isFill},"model-value":e.modelValue,type:e.type,closable:e.closable,addable:e.addable,editable:e.editable,"tab-position":e.tabPosition,stretch:e.stretch,"before-leave":e.beforeLeave,"onUpdate:modelValue":a,onTabClick:r,onTabChange:i,onTabRemove:l,onTabAdd:s,onEdit:d}),{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(c.$slots,"default")]),_:3},16,["class","model-value","type","closable","addable","editable","tab-position","stretch","before-leave"])}}}),sy=ly,Es=fe(sy),cy=(0,n.defineComponent)({name:"JCollapse",__name:"collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=t,a=i=>{o("update:modelValue",i)},r=i=>{o("change",i)};return(i,l)=>{const s=(0,n.resolveComponent)("el-collapse");return(0,n.openBlock)(),(0,n.createBlock)(s,(0,n.mergeProps)(i.$attrs,{"model-value":e.modelValue,accordion:e.accordion,onChange:r,"onUpdate:modelValue":a}),{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(i.$slots,"default")]),_:3},16,["model-value","accordion"])}}}),dy=cy,_s=fe(dy),uy={class:"j-editor"},fy=(0,n.defineComponent)({name:"JEditor",__name:"editor",props:{value:{type:String,default:""},height:{type:[String,Number],default:300},options:{type:Object,default:()=>({})},placeholder:{type:String,default:void 0},readonly:{type:Boolean,default:!1},isUploadImg:{type:Boolean,default:!0},token:{type:String,default:""},apiUrl:{type:String,default:""}},emits:["update:value","change"],setup(e,{emit:t}){const o=e,a=t,r=(0,n.ref)(),i=(0,n.ref)(),l=(0,n.shallowRef)(),s=(0,n.computed)(()=>({height:typeof o.height=="number"?`${o.height}px`:o.height,overflowY:"hidden"}));let d=!1;const c=p=>{if(!p)return"";let u=p;return o.apiUrl&&o.token&&(u=u.replace(/{jcode_img_api}/g,`${o.apiUrl}/system/annexesfile/`).replace(/{jcode_img_token}/g,`token=${o.token}`)),u},f=p=>{if(!p)return"";let u=p;if(o.apiUrl){const h=`${o.apiUrl}/system/annexesfile/`;u=u.split(h).join("{jcode_img_api}"),o.token&&(u=u.split(`token=${o.token}`).join("{jcode_img_token}"))}return u};return(0,n.onMounted)(()=>{const p={placeholder:o.placeholder||"请输入内容...",readOnly:o.readonly,MENU_CONF:{},...o.options};p.onChange=h=>{if(d)return;const g=f(h.getHtml());a("update:value",g),a("change",{value:g})};const u=(0,Vi.createEditor)({selector:r.value,html:c(o.value),config:p,mode:"default"});l.value=u,(0,Vi.createToolbar)({editor:u,selector:i.value,mode:"default"})}),(0,n.watch)(()=>o.value,p=>{const u=l.value;if(u){const h=u.getHtml(),g=c(p);f(h)!==p&&(d=!0,u.setHtml(g),d=!1)}}),(0,n.watch)(()=>o.readonly,p=>{const u=l.value;u&&(p?u.disable():u.enable())}),(0,n.onBeforeUnmount)(()=>{const p=l.value;p?.destroy()}),(p,u)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",uy,[(0,n.createElementVNode)("div",{ref_key:"toolbarRef",ref:i,class:"j-editor-toolbar"},null,512),(0,n.createElementVNode)("div",{ref_key:"editorRef",ref:r,class:"j-editor-content",style:(0,n.normalizeStyle)(s.value)},null,4)]))}}),py=Ul(fy,[["__scopeId","data-v-d513e01b"]]),Bs=fe(py),hy={key:0,class:"j-map-loading"},gy=(0,n.defineComponent)({name:"JMap",__name:"map",props:{address:String,lng:Number,lat:Number,height:{type:String,default:"300px"},mapKey:{type:String,default:""}},emits:["update:address","update:lng","update:lat","change"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(!0),l=(0,n.ref)();let s=null,d=null,c=null,f=null;const p=async()=>{i.value=!0;try{s=await al(a.mapKey)}catch(k){console.error("Failed to load Baidu Map:",k),i.value=!1;return}if(d!=null){h(a.lng,a.lat),i.value=!1;return}if(!l.value)return;d=new s.Map(l.value,{enableMapClick:!1});const w=new s.Point(121.480248,31.236276);d.centerAndZoom(w,17),c=new s.Marker(w,{enableDragging:!0}),d.addOverlay(c),c.addEventListener("dragend",k=>{u(k.point)}),d.addControl(new s.NavigationControl({anchor:window.BMAP_ANCHOR_TOP_RIGHT,type:window.BMAP_NAVIGATION_CONTROL_SMALL})),f=new s.GeolocationControl({anchor:window.BMAP_ANCHOR_BOTTOM_LEFT}),f.addEventListener("locationSuccess",k=>{u(k.point)}),f.addEventListener("locationError",k=>{alert(k.message)}),d.addControl(f),d.addEventListener("click",k=>{u(k.point)}),d.enableScrollWheelZoom(!0),h(a.lng,a.lat),i.value=!1},u=w=>{new s.Geocoder().getLocation(w,k=>{c.setPosition(w),d.panTo(w),r("update:address",k.address),r("update:lng",w.lng),r("update:lat",w.lat),r("change",{value:{address:k.address,lng:w.lng,lat:w.lat}})})},h=(w,k)=>{if(w&&k&&s){const b=new s.Point(w,k);c&&c.setPosition(b),d&&d.panTo(b)}};let g=null;return t({setPoint:h,querySearchAsync:(w,k)=>{!d||!s||(g||(g=new s.LocalSearch(d,{onSearchComplete:b=>{const y=[];if(b){const C=b.getCurrentNumPois();for(let S=0;S<C;S++)y.push(b.getPoi(S))}k(y)}})),g.search(w))}}),(0,n.onMounted)(()=>{p()}),(w,k)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"j-map",style:(0,n.normalizeStyle)({height:e.height})},[i.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",hy,[(0,n.createVNode)(Hn,{icon:"mdi:loading",class:"is-loading",size:30})])):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",{ref_key:"mapRef",ref:l,class:"j-map-container"},null,512)],4))}}),my=gy,Rs=fe(my),yy=(0,n.defineComponent)({name:"JInputMap",__name:"input-map",props:{modelValue:{type:[String],default:null},placeholder:{type:String,default:"请选择"},readonly:Boolean,size:{type:String},clearable:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Ye(),i=(0,n.ref)(),l=(0,n.ref)(),s=(0,n.ref)(),d=(0,n.ref)(""),c=(0,n.ref)(0),f=(0,n.ref)(0),p=(0,n.ref)(""),u=(0,n.computed)(()=>{let C=o.modelValue||"";if(o.modelValue===null&&(C=(0,n.unref)(p)),xt(C))return{address:"",lng:0,lat:0};const S=C.split(",");return{address:S[0],lng:parseFloat(S[1]),lat:parseFloat(S[2])}}),h=(0,n.computed)({get(){return u.value.address},set(){p.value="",a("update:modelValue",void 0)}}),g=()=>{l.value.blur()},m=()=>{l.value.blur(),d.value=u.value.address,c.value=u.value.lng,f.value=u.value.lat,i.value.open("请选择地址"),setTimeout(()=>{s.value?.call("map","setPoint",null,c.value,f.value)},100)},w=(0,n.ref)([]),k=[{type:"j-layout",config:{class:["j-block"]},children:[{type:"div",slot:"top",config:{style:{padding:"8px"}},children:[{type:"el-autocomplete",config:{style:{width:"100%"},placeholder:r("请填写详细地址"),modelValue:d,value:d,fetchSuggestions:async(C,S)=>{S((0,n.unref)(w))},onInput:async C=>{d.value=C,s.value?.call("map","querySearchAsync",null,C,S=>{w.value=S.map(v=>({...v,value:`(${v.title}): ${v.address}`}))})},onSelect:C=>{d.value=`(${C.title})${C.address}`,c.value=C.point.lng,f.value=C.point.lat,s.value?.call("map","setPoint",null,C.point.lng,C.point.lat)}},children:[{slot:"option",config:{h:C=>(0,n.h)("div",{},[(0,n.h)("div",{style:{color:"var(--j-color-text)","font-size":"14px"}},C.title),(0,n.h)("div",{style:{color:"var(--color-text-secondary)","font-size":"12px","margin-bottom":"4px"}},C.address)])}}]}]},{type:"j-map",id:"map",config:{address:d,lng:c,lat:f,height:"100%",onChange:C=>{d.value=C.value.address,c.value=C.value.lng,f.value=C.value.lat}}}]}],b=()=>{!xt(d.value)&&!xt(c.value)&&!xt(f.value)?(p.value=`${d.value},${c.value},${f.value}`,a("update:modelValue",p.value),a("change",p.value)):(a("update:modelValue",void 0),a("change",void 0)),i.value.close()},y=()=>{};return(C,S)=>{const v=(0,n.resolveComponent)("j-button"),x=(0,n.resolveComponent)("el-input"),E=(0,n.resolveComponent)("j-page"),_=(0,n.resolveComponent)("j-layer");return(0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[(0,n.createVNode)(x,{modelValue:h.value,"onUpdate:modelValue":S[0]||(S[0]=T=>h.value=T),placeholder:e.placeholder?(0,n.unref)(r)(e.placeholder):void 0,readonly:e.readonly,size:e.size,clearable:e.readonly?!1:e.clearable,onFocus:g,ref_key:"inputRef",ref:l,class:"j-input-layer"},{append:(0,n.withCtx)(()=>[(0,n.createVNode)(v,{icon:"mdi:map-marker-outline",disabled:e.readonly,size:e.size,onClick:m},null,8,["disabled","size"])]),_:1},8,["modelValue","placeholder","readonly","size","clearable"]),(0,n.createElementVNode)("div",(0,n.normalizeProps)((0,n.guardReactiveProps)(C.$attrs)),null,16),(0,n.createVNode)(_,{ref_key:"layerRef",ref:i,width:900,height:500,"btn-text":"确认",destroyOnClose:!1,onOk:b,onClosed:y,style:{height:"0"}},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(E,{style:{padding:"0"},schema:k,ref_key:"indexRef",ref:s},null,512)]),_:1},512)],64)}}}),vy=yy,Ts=fe(vy);function Vs(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function oo(e){return e.originalEvent||e.srcEvent}function xr(e){Vs(e),Vs(oo(e))}function ao(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}var Ms=1500;function As(e,t,o){var a=this,r=o.get("dragging",!1);function i(l){if(!l.hover){var s=l.originalEvent,d=a._findTargetGfx(s),c=d&&e.get(d);d&&c&&(l.stopPropagation(),r.hover({element:c,gfx:d}),r.move(s))}}r&&t.on("drag.start",function(l){t.once("drag.move",Ms,function(s){i(s)})}),(function(){var l,s;t.on("element.hover",function(d){l=d.gfx,s=d.element}),t.on("element.hover",Ms,function(d){s&&t.fire("element.out",{element:s,gfx:l})}),t.on("element.out",function(){l=null,s=null})})(),this._findTargetGfx=function(l){var s,d;if(l instanceof MouseEvent)return s=ao(l),d=document.elementFromPoint(s.x,s.y),by(d)}}As.$inject=["elementRegistry","eventBus","injector"];function by(e){return(0,G.closest)(e,"svg, .djs-element",!0)}var wy={__init__:["hoverFix"],hoverFix:["type",As]};function Ns(){return/mac/i.test(navigator.platform)}function js(e,t){return(oo(e)||e).button===t}function mn(e){return js(e,0)}function Cy(e){return js(e,1)}function Ps(e){var t=oo(e)||e;return mn(e)?Ns()?t.metaKey:t.ctrlKey:!1}function kr(e){var t=oo(e)||e;return mn(e)&&t.shiftKey}function Ro(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function xy(e){return["M",e.x,e.y]}function Sr(e){return["L",e.x,e.y]}function ky(e,t,o){return["C",e.x,e.y,t.x,t.y,o.x,o.y]}function Sy(e,t){const o=e.length,a=[xy(e[0])];for(let r=1;r<o;r++){const i=e[r-1],l=e[r],s=e[r+1];if(!s||!t){a.push(Sr(l));continue}const d=Math.min(t,Er(l.x-i.x,l.y-i.y),Er(s.x-l.x,s.y-l.y));if(!d){a.push(Sr(l));continue}const c=ma(l,i,d),f=ma(l,i,d*.5),p=ma(l,s,d),u=ma(l,s,d*.5);a.push(Sr(c)),a.push(ky(f,u,p))}return a}function ma(e,t,o){const a=t.x-e.x,r=t.y-e.y,i=o/Er(a,r);return{x:e.x+a*i,y:e.y+r*i}}function Er(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function _r(e,t,o){(0,R.isNumber)(t)&&(o=t,t=null),t||(t={});const a=(0,P.create)("path",t);return(0,R.isNumber)(o)&&(a.dataset.cornerRadius=String(o)),Hs(a,e)}function Hs(e,t){return(0,P.attr)(e,{d:Ro(Sy(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function Ey(e){return!0}function ya(e){return mn(e)||Cy(e)}var zs=500;function Os(e,t,o){var a=this;function r(v,x,E){if(!s(v,x)){var _,T,V;E?T=t.getGraphics(E):(_=x.delegateTarget||x.target,_&&(T=_,E=t.get(T))),!(!T||!E)&&(V=e.fire(v,{element:E,gfx:T,originalEvent:x}),V===!1&&(x.stopPropagation(),x.preventDefault()))}}var i={};function l(v){return i[v]}function s(v,x){return!(c[v]||mn)(x)}var d={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":Ey,"element.mousedown":ya,"element.mouseup":ya,"element.click":ya,"element.dblclick":ya};function f(v,x,E){var _=d[v];if(!_)throw new Error("unmapped DOM event name <"+v+">");return r(_,x,E)}var p="svg, .djs-element";function u(v,x,E,_){var T=i[E]=function(V){r(E,V)};_&&(c[E]=_),T.$delegate=G.delegate.bind(v,p,x,T)}function h(v,x,E){var _=l(E);_&&G.delegate.unbind(v,x,_.$delegate)}function g(v){(0,R.forEach)(d,function(x,E){u(v,E,x)})}function m(v){(0,R.forEach)(d,function(x,E){h(v,E,x)})}e.on("canvas.destroy",function(v){m(v.svg)}),e.on("canvas.init",function(v){g(v.svg)}),e.on(["shape.added","connection.added"],function(v){var x=v.element,E=v.gfx;e.fire("interactionEvents.createHit",{element:x,gfx:E})}),e.on(["shape.changed","connection.changed"],zs,function(v){var x=v.element,E=v.gfx;e.fire("interactionEvents.updateHit",{element:x,gfx:E})}),e.on("interactionEvents.createHit",zs,function(v){var x=v.element,E=v.gfx;a.createDefaultHit(x,E)}),e.on("interactionEvents.updateHit",function(v){var x=v.element,E=v.gfx;a.updateDefaultHit(x,E)});var w=y("djs-hit djs-hit-stroke"),k=y("djs-hit djs-hit-click-stroke"),b={all:y("djs-hit djs-hit-all"),"click-stroke":k,stroke:w,"no-move":y("djs-hit djs-hit-no-move")};function y(v,x){return x=(0,R.assign)({stroke:"white",strokeWidth:15},x||{}),o.cls(v,["no-fill","no-border"],x)}function C(v,x){var E=b[x];if(!E)throw new Error("invalid hit type <"+x+">");return(0,P.attr)(v,E),v}function S(v,x){(0,P.append)(v,x)}this.removeHits=function(v){(0,R.forEach)((0,G.queryAll)(".djs-hit",v),P.remove)},this.createDefaultHit=function(v,x){var E=v.waypoints,_=v.isFrame,T;return E?this.createWaypointsHit(x,E):(T=_?"stroke":"all",this.createBoxHit(x,T,{width:v.width,height:v.height}))},this.createWaypointsHit=function(v,x){var E=_r(x);return C(E,"stroke"),S(v,E),E},this.createBoxHit=function(v,x,E){E=(0,R.assign)({x:0,y:0},E);var _=(0,P.create)("rect");return C(_,x),(0,P.attr)(_,E),S(v,_),_},this.updateDefaultHit=function(v,x){var E=(0,G.query)(".djs-hit",x);if(E)return v.waypoints?Hs(E,v.waypoints):(0,P.attr)(E,{width:v.width,height:v.height}),E},this.fire=r,this.triggerMouseEvent=f,this.mouseHandler=l,this.registerEvent=u,this.unregisterEvent=h}Os.$inject=["eventBus","elementRegistry","styles"];var Br={__init__:["interactionEvents"],interactionEvents:["type",Os]};function ro(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var o=this;e.on(["shape.remove","connection.remove"],function(a){var r=a.element;o.deselect(r)}),e.on(["diagram.clear","root.set"],function(a){o.select(null)})}ro.$inject=["eventBus","canvas"],ro.prototype.deselect=function(e){var t=this._selectedElements,o=t.indexOf(e);if(o!==-1){var a=t.slice();t.splice(o,1),this._eventBus.fire("selection.changed",{oldSelection:a,newSelection:t})}},ro.prototype.get=function(){return this._selectedElements},ro.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},ro.prototype.select=function(e,t){var o=this._selectedElements,a=o.slice();(0,R.isArray)(e)||(e=e?[e]:[]);var r=this._canvas,i=r.getRootElement();e=e.filter(function(l){return i===r.findRoot(l)}),t?(0,R.forEach)(e,function(l){o.indexOf(l)===-1&&o.push(l)}):this._selectedElements=o=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:a,newSelection:o})};var Ls="hover",Ds="selected";function Is(e,t){this._canvas=e;function o(r,i){e.addMarker(r,i)}function a(r,i){e.removeMarker(r,i)}t.on("element.hover",function(r){o(r.element,Ls)}),t.on("element.out",function(r){a(r.element,Ls)}),t.on("selection.changed",function(r){function i(c){a(c,Ds)}function l(c){o(c,Ds)}var s=r.oldSelection,d=r.newSelection;(0,R.forEach)(s,function(c){d.indexOf(c)===-1&&i(c)}),(0,R.forEach)(d,function(c){s.indexOf(c)===-1&&l(c)})})}Is.$inject=["canvas","eventBus"];function Fs(e,t,o,a){e.on("create.end",500,function(r){var i=r.context,l=i.canExecute,s=i.elements,d=(i.hints||{}).autoSelect;if(l){if(d===!1)return;(0,R.isArray)(d)?t.select(d):t.select(s.filter(_y))}}),e.on("connect.end",500,function(r){var i=r.context.connection;i&&t.select(i)}),e.on("shape.move.end",500,function(r){var i=r.previousSelection||[],l=a.get(r.context.shape.id);(0,R.find)(i,function(s){return l.id===s.id})||t.select(l)}),e.on("element.click",function(r){if(mn(r)){var i=r.element;i===o.getRootElement()&&(i=null);var l=t.isSelected(i),s=t.get().length>1,d=kr(r);if(l&&s)return d?t.deselect(i):t.select(i);l?t.deselect(i):t.select(i,d)}})}Fs.$inject=["eventBus","selection","canvas","elementRegistry"];function _y(e){return!e.hidden}var io={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Br],selection:["type",ro],selectionVisuals:["type",Is],selectionBehavior:["type",Fs]},By=/^djs-cursor-.*$/;function Rr(e){var t=(0,G.classes)(document.body);t.removeMatching(By),e&&t.add("djs-cursor-"+e)}function $s(){Rr(null)}var Ry=5e3;function Ws(e,t){t=t||"element.click";function o(){return!1}return e.once(t,Ry,o),function(){e.off(t,o)}}function Us(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function lo(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Js(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Ys(e,t){return e=(0,R.isArray)(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}var so=Math.round,Gs="djs-drag-active";function On(e){e.preventDefault()}function Ty(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function Vy(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Ks(e,t,o,a){var r={threshold:5,trapClick:!0},i;function l(y){var C=t.viewbox(),S=t._container.getBoundingClientRect();return{x:C.x+(y.x-S.left)/C.scale,y:C.y+(y.y-S.top)/C.scale}}function s(y,C){C=C||i;var S=e.createEvent((0,R.assign)({},C.payload,C.data,{isTouch:C.isTouch}));return e.fire("drag."+y,S)===!1?!1:e.fire(C.prefix+"."+y,S)}function d(y){var C=y.filter(function(S){return a.get(S.id)});C.length&&o.select(C)}function c(y,C){var S=i.payload,v=i.displacement,x=i.globalStart,E=ao(y),_=lo(E,x),T=i.localStart,V=l(E),N=lo(V,T);if(!i.active&&(C||Vy(_)>i.threshold)){if((0,R.assign)(S,{x:so(T.x+v.x),y:so(T.y+v.y),dx:0,dy:0},{originalEvent:y}),s("start")===!1)return w();i.active=!0,i.keepSelection||(S.previousSelection=o.get(),o.select(null)),i.cursor&&Rr(i.cursor),t.addMarker(t.getRootElement(),Gs)}xr(y),i.active&&((0,R.assign)(S,{x:so(V.x+v.x),y:so(V.y+v.y),dx:so(N.x),dy:so(N.y)},{originalEvent:y}),s("move"))}function f(y){var C,S=!0;i.active&&(y&&(i.payload.originalEvent=y,xr(y)),S=s("end")),S===!1&&s("rejected"),C=k(S!==!0),s("ended",C)}function p(y){Ys("Escape",y)&&(On(y),w())}function u(y){var C;i.active&&(C=Ws(e),setTimeout(C,400),On(y)),f(y)}function h(y){c(y)}function g(y){var C=i.payload;C.hoverGfx=y.gfx,C.hover=y.element,s("hover")}function m(y){s("out");var C=i.payload;C.hoverGfx=null,C.hover=null}function w(y){var C;if(i){var S=i.active;S&&s("cancel"),C=k(y),S&&s("canceled",C)}}function k(y){var C,S;s("cleanup"),$s(),i.trapClick?S=u:S=f,G.event.unbind(document,"mousemove",c),G.event.unbind(document,"dragstart",On),G.event.unbind(document,"selectstart",On),G.event.unbind(document,"mousedown",S,!0),G.event.unbind(document,"mouseup",S,!0),G.event.unbind(document,"keyup",p),G.event.unbind(document,"touchstart",h,!0),G.event.unbind(document,"touchcancel",w,!0),G.event.unbind(document,"touchmove",c,!0),G.event.unbind(document,"touchend",f,!0),e.off("element.hover",g),e.off("element.out",m),t.removeMarker(t.getRootElement(),Gs);var v=i.payload.previousSelection;return y!==!1&&v&&!o.get().length&&d(v),C=i,i=null,C}function b(y,C,S,v){i&&w(!1),typeof C=="string"&&(v=S,S=C,C=null),v=(0,R.assign)({},r,v||{});var x=v.data||{},E,_,T,V,N;v.trapClick?V=u:V=f,y?(E=oo(y)||y,_=ao(y),xr(y),E.type==="dragstart"&&On(E)):(E=null,_={x:0,y:0}),T=l(_),C||(C=T),N=Ty(E),i=(0,R.assign)({prefix:S,data:x,payload:{},globalStart:_,displacement:lo(C,T),localStart:T,isTouch:N},v),v.manual||(N?(G.event.bind(document,"touchstart",h,!0),G.event.bind(document,"touchcancel",w,!0),G.event.bind(document,"touchmove",c,!0),G.event.bind(document,"touchend",f,!0)):(G.event.bind(document,"mousemove",c),G.event.bind(document,"dragstart",On),G.event.bind(document,"selectstart",On),G.event.bind(document,"mousedown",V,!0),G.event.bind(document,"mouseup",V,!0)),G.event.bind(document,"keyup",p),e.on("element.hover",g),e.on("element.out",m)),s("init"),v.autoActivate&&c(y,!0)}e.on("diagram.destroy",w),this.init=b,this.move=c,this.hover=g,this.out=m,this.end=f,this.cancel=w,this.context=function(){return i},this.setOptions=function(y){(0,R.assign)(r,y)}}Ks.$inject=["eventBus","canvas","selection","elementRegistry"];var Ln={__depends__:[wy,io],dragging:["type",Ks]};function Tr(e){return e.childNodes[0]}function va(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}va.prototype.next=function(){return this._prefix+ ++this._counter};var My=new va("ps"),Ay=["marker-start","marker-mid","marker-end"],Ny=["circle","ellipse","line","path","polygon","polyline","path","rect"];function yn(e,t,o,a){this._elementRegistry=e,this._canvas=o,this._styles=a}yn.$inject=["elementRegistry","eventBus","canvas","styles"],yn.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},yn.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},yn.prototype.addDragger=function(e,t,o,a="djs-dragger"){o=o||this.getGfx(e);var r=(0,P.clone)(o),i=o.getBoundingClientRect();return this._cloneMarkers(Tr(r),a),(0,P.attr)(r,this._styles.cls(a,[],{x:i.top,y:i.left})),(0,P.append)(t,r),(0,P.attr)(r,"data-preview-support-element-id",e.id),r},yn.prototype.addFrame=function(e,t){var o=(0,P.create)("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return(0,P.append)(t,o),(0,P.attr)(o,"data-preview-support-element-id",e.id),o},yn.prototype._cloneMarkers=function(e,t="djs-dragger",o=e){var a=this;e.childNodes&&e.childNodes.forEach(r=>{a._cloneMarkers(r,t,o)}),zy(e)&&Ay.forEach(function(r){if((0,P.attr)(e,r)){var i=jy(e,r,a._canvas.getContainer());i&&a._cloneMarker(o,e,i,r,t)}})},yn.prototype._cloneMarker=function(e,t,o,a,r="djs-dragger"){var i=[o.id,r,My.next()].join("-"),l=(0,G.query)("marker#"+o.id,e);e=e||this._canvas._svg;var s=l||(0,P.clone)(o);s.id=i,(0,P.classes)(s).add(r);var d=(0,G.query)(":scope > defs",e);d||(d=(0,P.create)("defs"),(0,P.append)(e,d)),(0,P.append)(d,s),(0,P.attr)(t,a,Hy(s.id))};function jy(e,t,o){return(0,G.query)("marker#"+Py((0,P.attr)(e,t)),o||document)}function Py(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function Hy(e){return"url(#"+e+")"}function zy(e){return Ny.indexOf(e.nodeName)!==-1}var Vr={__init__:["previewSupport"],previewSupport:["type",yn]};function Mr(e){this._commandStack=e.get("commandStack",!1)}Mr.$inject=["injector"],Mr.prototype.allowed=function(e,t){var o=!0,a=this._commandStack;return a&&(o=a.canExecute(e,t)),o===void 0?!0:o};var co={__init__:["rules"],rules:["type",Mr]};function Oy(e){return(0,R.filter)(e,function(t){return!(0,R.find)(e,function(o){return o!==t&&qs(t,o)})})}function qs(e,t){if(t){if(e===t)return t;if(e.parent)return qs(e.parent,t)}}function Xs(e,t,o){var a=!o||e.indexOf(t)===-1;return a&&e.push(t),a}function Ar(e,t,o){o=o||0,(0,R.isArray)(e)||(e=[e]),(0,R.forEach)(e,function(a,r){var i=t(a,r,o);(0,R.isArray)(i)&&i.length&&Ar(i,t,o+1)})}function Ly(e,t,o){var a=[],r=[];return Ar(e,function(i,l,s){Xs(a,i,t);var d=i.children;if((o===-1||s<o)&&d&&Xs(r,d,t))return d}),a}function Dy(e,t){return Ly(e,!t,-1)}function Iy(e,t,o){(0,R.isUndefined)(t)&&(t=!0),(0,R.isObject)(t)&&(o=t,t=!0),o=o||{};var a=To(o.allShapes),r=To(o.allConnections),i=To(o.enclosedElements),l=To(o.enclosedConnections),s=To(o.topLevel,t&&(0,R.groupBy)(e,function(f){return f.id}));function d(f){s[f.source.id]&&s[f.target.id]&&(s[f.id]=[f]),a[f.source.id]&&a[f.target.id]&&(l[f.id]=i[f.id]=f),r[f.id]=f}function c(f){if(i[f.id]=f,f.waypoints)l[f.id]=r[f.id]=f;else return a[f.id]=f,(0,R.forEach)(f.incoming,d),(0,R.forEach)(f.outgoing,d),f.children}return Ar(e,c),{allShapes:a,allConnections:r,topLevel:s,enclosedConnections:l,enclosedElements:i}}function Yt(e,t){t=!!t,(0,R.isArray)(e)||(e=[e]);var o,a,r,i;return(0,R.forEach)(e,function(l){var s=l;l.waypoints&&!t&&(s=Yt(l.waypoints,!0));var d=s.x,c=s.y,f=s.height||0,p=s.width||0;(d<o||o===void 0)&&(o=d),(c<a||a===void 0)&&(a=c),(d+p>r||r===void 0)&&(r=d+p),(c+f>i||i===void 0)&&(i=c+f)}),{x:o,y:a,height:i-a,width:r-o}}function Zs(e,t){var o={};return(0,R.forEach)(e,function(a){var r=a;r.waypoints&&(r=Yt(r)),!(0,R.isNumber)(t.y)&&r.x>t.x&&(o[a.id]=a),!(0,R.isNumber)(t.x)&&r.y>t.y&&(o[a.id]=a),r.x>t.x&&r.y>t.y&&((0,R.isNumber)(t.width)&&(0,R.isNumber)(t.height)&&r.width+r.x<t.width+t.x&&r.height+r.y<t.height+t.y||!(0,R.isNumber)(t.width)||!(0,R.isNumber)(t.height))&&(o[a.id]=a)}),o}function Fy(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function $y(e){return!!(e&&e.isFrame)}function To(e,t){return(0,R.assign)({},e||{},t||{})}function _t(e){return(0,R.isObject)(e)&&(0,R.has)(e,"waypoints")}function uo(e){return(0,R.isObject)(e)&&(0,R.has)(e,"labelTarget")}var Wy="drop-ok",Qs="drop-not-ok",ec="attach-ok",tc="new-parent",nc="create",Uy=2e3;function oc(e,t,o,a,r){function i(d,c,f,p,u){if(!c)return!1;d=(0,R.filter)(d,function(b){var y=b.labelTarget;return!b.parent&&!(uo(b)&&d.indexOf(y)!==-1)});var h=(0,R.find)(d,function(b){return!_t(b)}),g=!1,m=!1,w=!1;rc(d)&&(g=r.allowed("shape.attach",{position:f,shape:h,target:c})),g||(rc(d)?w=r.allowed("shape.create",{position:f,shape:h,source:p,target:c}):w=r.allowed("elements.create",{elements:d,position:f,target:c}));var k=u.connectionTarget;return w||g?(h&&p&&(m=r.allowed("connection.create",{source:k===p?h:p,target:k===p?p:h,hints:{targetParent:c,targetAttach:g}})),{attach:g,connect:m}):w===null||g===null?null:!1}function l(d,c){[ec,Wy,Qs,tc].forEach(function(f){f===c?e.addMarker(d,f):e.removeMarker(d,f)})}o.on(["create.move","create.hover"],function(d){var c=d.context,f=c.elements,p=d.hover,u=c.source,h=c.hints||{};if(!p){c.canExecute=!1,c.target=null;return}ac(d);var g={x:d.x,y:d.y},m=c.canExecute=p&&i(f,p,g,u,h);p&&m!==null&&(c.target=p,m&&m.attach?l(p,ec):l(p,m?tc:Qs))}),o.on(["create.end","create.out","create.cleanup"],function(d){var c=d.hover;c&&l(c,null)}),o.on("create.end",function(d){var c=d.context,f=c.source,p=c.shape,u=c.elements,h=c.target,g=c.canExecute,m=g&&g.attach,w=g&&g.connect,k=c.hints||{};if(g===!1||!h)return!1;ac(d);var b={x:d.x,y:d.y};w?p=a.appendShape(f,p,b,h,{attach:m,connection:w===!0?{}:w,connectionTarget:k.connectionTarget}):(u=a.createElements(u,b,h,(0,R.assign)({},k,{attach:m})),p=(0,R.find)(u,function(y){return!_t(y)})),(0,R.assign)(c,{elements:u,shape:p}),(0,R.assign)(d,{elements:u,shape:p})});function s(){var d=t.context();d&&d.prefix===nc&&t.cancel()}o.on("create.init",function(){o.on("elements.changed",s),o.once(["create.cancel","create.end"],Uy,function(){o.off("elements.changed",s)})}),this.start=function(d,c,f){(0,R.isArray)(c)||(c=[c]);var p=(0,R.find)(c,function(h){return!_t(h)});if(p){f=(0,R.assign)({elements:c,hints:{},shape:p},f||{}),(0,R.forEach)(c,function(h){(0,R.isNumber)(h.x)||(h.x=0),(0,R.isNumber)(h.y)||(h.y=0)});var u=Yt((0,R.filter)(c,function(h){return!h.hidden}));(0,R.forEach)(c,function(h){_t(h)&&(h.waypoints=(0,R.map)(h.waypoints,function(g){return{x:g.x-u.x-u.width/2,y:g.y-u.y-u.height/2}})),(0,R.assign)(h,{x:h.x-u.x-u.width/2,y:h.y-u.y-u.height/2})}),t.init(d,nc,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:c,context:f}})}}}oc.$inject=["canvas","dragging","eventBus","modeling","rules"];function ac(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function rc(e){return e&&e.length===1&&!_t(e[0])}function Jy(e,t,o,a,r){var i=(0,P.createTransform)();i.setTranslate(t,o);var l=(0,P.createTransform)();l.setRotate(a||0,0,0);var s=(0,P.createTransform)();s.setScale(r||1,r||1),(0,P.transform)(e,[i,l,s])}function Gt(e,t,o){var a=(0,P.createTransform)();a.setTranslate(t,o),(0,P.transform)(e,a)}function Yy(e,t){var o=(0,P.createTransform)();o.setRotate(t,0,0),(0,P.transform)(e,o)}var Gy=750;function ic(e,t,o,a,r){function i(l){var s=(0,P.create)("g");(0,P.attr)(s,r.cls("djs-drag-group",["no-events"]));var d=(0,P.create)("g");return l.forEach(function(c){var f;c.hidden||(c.waypoints?(f=o._createContainer("connection",d),o.drawConnection(Tr(f),c)):(f=o._createContainer("shape",d),o.drawShape(Tr(f),c),Gt(f,c.x,c.y)),a.addDragger(c,s,f))}),s}t.on("create.move",Gy,function(l){var s=l.hover,d=l.context,c=d.elements,f=d.dragGroup;f||(f=d.dragGroup=i(c));var p;s?(f.parentNode||(p=e.getActiveLayer(),(0,P.append)(p,f)),Gt(f,l.x,l.y)):(0,P.remove)(f)}),t.on("create.cleanup",function(l){var s=l.context.dragGroup;s&&(0,P.remove)(s)})}ic.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var lc={__depends__:[Ln,Vr,co,io],__init__:["create","createPreview"],create:["type",oc],createPreview:["type",ic]};function Vo(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Nr(e,t,o,a){if(typeof a>"u"&&(a=5),!e||!t||!o)return!1;var r=(t.x-e.x)*(o.y-e.y)-(t.y-e.y)*(o.x-e.x),i=Vo(e,t);return Math.abs(r/i)<=a}var Ky=2;function vn(e,t){var o=Array.from(arguments).flat();for(const[a,r]of Object.entries({x:"v",y:"h"}))if(qy(a,o))return r;return!1}function qy(e,t){const o=t[0];return(0,R.every)(t,function(a){return Math.abs(o[e]-a[e])<=Ky})}function sc(e,t,o){return o=o||0,e.x>t.x-o&&e.y>t.y-o&&e.x<t.x+t.width+o&&e.y<t.y+t.height+o}function jr(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var Xy=/,?([a-z]),?/gi,cc=parseFloat,at=Math,bn=at.PI,Kt=at.min,qt=at.max,dc=at.pow,wn=at.abs,Zy=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,Qy=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,uc=Array.isArray||function(e){return e instanceof Array};function ev(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tv(e,t){for(var o=0,a=e.length;o<a;o++)if(e[o]===t)return e.push(e.splice(o,1)[0])}function nv(e){function t(){var o=Array.prototype.slice.call(arguments,0).join("␀"),a=t.cache=t.cache||{},r=t.count=t.count||[];return ev(a,o)?(tv(r,o),a[o]):(r.length>=1e3&&delete a[r.shift()],r.push(o),a[o]=e(...arguments),a[o])}return t}function ov(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return String(e).replace(Zy,function(a,r,i){var l=[],s=r.toLowerCase();for(i.replace(Qy,function(d,c){c&&l.push(+c)}),s=="m"&&l.length>2&&(o.push([r,...l.splice(0,2)]),s="l",r=r=="m"?"l":"L");l.length>=t[s]&&(o.push([r,...l.splice(0,t[s])]),!!t[s]););}),o.toString=Hr,o}function av(e){for(var t=0,o=e.length;t<o;t++){var a=e[t][0];if(typeof a=="string"&&a!==a.toUpperCase())return!1}return!0}function rv(e){for(var t=0,o=e.length;t<o;t++){var a=e[t][0];if(a!=="M"&&a!=="C")return!1}return!0}function Pr(e,t,o,a){return arguments.length===1&&(t=e.y,o=e.width,a=e.height,e=e.x),{x:e,y:t,width:o,height:a,x2:e+o,y2:t+a}}function Hr(){return this.join(",").replace(Xy,"$1")}function iv(e){for(var t=new Array(e.length),o=0,a=e.length;o<a;o++)for(var r=e[o],i=t[o]=new Array(r.length),l=0,s=r.length;l<s;l++)i[l]=r[l];return t.toString=Hr,t}function fc(e,t,o,a,r,i,l,s,d){var c=1-d,f=dc(c,3),p=dc(c,2),u=d*d*d,h=f*e+p*3*d*o+c*3*d*d*r+u*l,g=f*t+p*3*d*a+c*3*d*d*i+u*s;return{x:ba(h),y:ba(g)}}function pc(e){var t=fv(...e);return Pr(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function Cn(e,t,o){return t>=e.x&&t<=e.x+e.width&&o>=e.y&&o<=e.y+e.height}function lv(e,t){return e=Pr(e),t=Pr(t),Cn(t,e.x,e.y)||Cn(t,e.x2,e.y)||Cn(t,e.x,e.y2)||Cn(t,e.x2,e.y2)||Cn(e,t.x,t.y)||Cn(e,t.x2,t.y)||Cn(e,t.x,t.y2)||Cn(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function hc(e,t,o,a,r){return e*(e*(-3*t+9*o-9*a+3*r)+6*t-12*o+6*a)-3*t+3*o}function gc(e,t,o,a,r,i,l,s,d){d==null&&(d=1),d=d>1?1:d<0?0:d;for(var c=d/2,f=12,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,g=0;g<f;g++){var m=c*p[g]+c,w=hc(m,e,o,r,l),k=hc(m,t,a,i,s),b=w*w+k*k;h+=u[g]*at.sqrt(b)}return c*h}function sv(e,t,o,a,r,i,l,s){if(!(qt(e,o)<Kt(r,l)||Kt(e,o)>qt(r,l)||qt(t,a)<Kt(i,s)||Kt(t,a)>qt(i,s))){var d=(e*a-t*o)*(r-l)-(e-o)*(r*s-i*l),c=(e*a-t*o)*(i-s)-(t-a)*(r*s-i*l),f=(e-o)*(i-s)-(t-a)*(r-l);if(f){var p=ba(d/f),u=ba(c/f),h=+p.toFixed(2),g=+u.toFixed(2);if(!(h<+Kt(e,o).toFixed(2)||h>+qt(e,o).toFixed(2)||h<+Kt(r,l).toFixed(2)||h>+qt(r,l).toFixed(2)||g<+Kt(t,a).toFixed(2)||g>+qt(t,a).toFixed(2)||g<+Kt(i,s).toFixed(2)||g>+qt(i,s).toFixed(2)))return{x:p,y:u}}}}function ba(e){return Math.round(e*1e11)/1e11}function cv(e,t,o){if(!lv(pc(e),pc(t)))return o?0:[];var a=gc(...e),r=gc(...t),i=yc(e)?1:~~(a/5)||1,l=yc(t)?1:~~(r/5)||1,s=new Array(i+1),d=new Array(l+1),c={},f=o?0:[],p,u;for(p=0;p<i+1;p++){var h=fc(...e,p/i);s[p]={x:h.x,y:h.y,t:p/i}}for(p=0;p<l+1;p++)h=fc(...t,p/l),d[p]={x:h.x,y:h.y,t:p/l};for(p=0;p<i;p++)for(u=0;u<l;u++){var g=s[p],m=s[p+1],w=d[u],k=d[u+1],b=wn(m.x-g.x)<.01?"y":"x",y=wn(k.x-w.x)<.01?"y":"x",C=sv(g.x,g.y,m.x,m.y,w.x,w.y,k.x,k.y),S;if(C){if(S=C.x.toFixed(9)+"#"+C.y.toFixed(9),c[S])continue;c[S]=!0;var v=g.t+wn((C[b]-g[b])/(m[b]-g[b]))*(m.t-g.t),x=w.t+wn((C[y]-w[y])/(k[y]-w[y]))*(k.t-w.t);v>=0&&v<=1&&x>=0&&x<=1&&(o?f++:f.push({x:C.x,y:C.y,t1:v,t2:x}))}}return f}function mc(e,t,o){e=wc(e),t=wc(t);for(var a,r,i,l,s,d,c,f,p,u,h=o?0:[],g=0,m=e.length;g<m;g++){var w=e[g];if(w[0]=="M")a=s=w[1],r=d=w[2];else{w[0]=="C"?(p=[a,r,...w.slice(1)],a=p[6],r=p[7]):(p=[a,r,a,r,s,d,s,d],a=s,r=d);for(var k=0,b=t.length;k<b;k++){var y=t[k];if(y[0]=="M")i=c=y[1],l=f=y[2];else{y[0]=="C"?(u=[i,l,...y.slice(1)],i=u[6],l=u[7]):(u=[i,l,i,l,c,f,c,f],i=c,l=f);var C=cv(p,u,o);if(o)h+=C;else{for(var S=0,v=C.length;S<v;S++)C[S].segment1=g,C[S].segment2=k,C[S].bez1=p,C[S].bez2=u;h=h.concat(C)}}}}}return h}function dv(e){return uc(e)&&uc(e[0])}function uv(e){if(av(e))return e;var t=new Array(e.length),o=0,a=0,r=0,i=0,l=0,s;e[0][0]=="M"&&(o=+e[0][1],a=+e[0][2],r=o,i=a,l++,t[0]=["M",o,a]);for(var d,c,f=l,p=e.length;f<p;f++){if(c=e[f],s=c[0],t[f]=d=new Array(c.length),s!=s.toUpperCase())switch(d[0]=s.toUpperCase(),d[0]){case"A":d[1]=c[1],d[2]=c[2],d[3]=c[3],d[4]=c[4],d[5]=c[5],d[6]=+c[6]+o,d[7]=+c[7]+a;break;case"V":d[1]=+c[1]+a;break;case"H":d[1]=+c[1]+o;break;case"M":r=+c[1]+o,i=+c[2]+a;default:for(var u=1,h=c.length;u<h;u++)d[u]=+c[u]+(u%2?o:a)}else for(var g=0,m=c.length;g<m;g++)d[g]=c[g];switch(s=s.toUpperCase(),d[0]){case"Z":o=+r,a=+i;break;case"H":o=d[1];break;case"V":a=d[1];break;case"M":r=d[d.length-2],i=d[d.length-1];default:o=d[d.length-2],a=d[d.length-1]}}return t.toString=Hr,t}function yc(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function wa(e,t,o,a){return[e,t,o,a,o,a]}function vc(e,t,o,a,r,i){var l=.3333333333333333,s=2/3;return[l*e+s*o,l*t+s*a,l*r+s*o,l*i+s*a,r,i]}function bc(e,t,o,a,r,i,l,s,d,c){var f=bn*120/180,p=bn/180*(+r||0),u=[],h,g=nv(function(ce,Be,Te){return{x:ce*at.cos(Te)-Be*at.sin(Te),y:ce*at.sin(Te)+Be*at.cos(Te)}});if(c)x=c[0],E=c[1],S=c[2],v=c[3];else{h=g(e,t,-p),e=h.x,t=h.y,h=g(s,d,-p),s=h.x,d=h.y;var m=(e-s)/2,w=(t-d)/2,k=m*m/(o*o)+w*w/(a*a);k>1&&(k=at.sqrt(k),o=k*o,a=k*a);var b=o*o,y=a*a,C=(i==l?-1:1)*at.sqrt(wn((b*y-b*w*w-y*m*m)/(b*w*w+y*m*m))),S=C*o*w/a+(e+s)/2,v=C*-a*m/o+(t+d)/2,x=at.asin(((t-v)/a).toFixed(9)),E=at.asin(((d-v)/a).toFixed(9));x=e<S?bn-x:x,E=s<S?bn-E:E,x<0&&(x=bn*2+x),E<0&&(E=bn*2+E),l&&x>E&&(x=x-bn*2),!l&&E>x&&(E=E-bn*2)}var _=E-x;if(wn(_)>f){var T=E,V=s,N=d;E=x+f*(l&&E>x?1:-1),s=S+o*at.cos(E),d=v+a*at.sin(E),u=bc(s,d,o,a,r,0,l,V,N,[E,T,S,v])}_=E-x;var z=at.cos(x),j=at.sin(x),A=at.cos(E),B=at.sin(E),L=at.tan(_/4),U=4/3*o*L,te=4/3*a*L,se=[e,t],I=[e+U*j,t-te*z],$=[s+U*B,d-te*A],Y=[s,d];if(I[0]=2*se[0]-I[0],I[1]=2*se[1]-I[1],c)return[I,$,Y].concat(u);u=[I,$,Y].concat(u).join().split(",");for(var M=[],oe=0,me=u.length;oe<me;oe++)M[oe]=oe%2?g(u[oe-1],u[oe],p).y:g(u[oe],u[oe+1],p).x;return M}function fv(e,t,o,a,r,i,l,s){for(var d=[],c=[[],[]],f,p,u,h,g,m,w,k,b=0;b<2;++b){if(b==0?(p=6*e-12*o+6*r,f=-3*e+9*o-9*r+3*l,u=3*o-3*e):(p=6*t-12*a+6*i,f=-3*t+9*a-9*i+3*s,u=3*a-3*t),wn(f)<1e-12){if(wn(p)<1e-12)continue;h=-u/p,0<h&&h<1&&d.push(h);continue}w=p*p-4*u*f,k=at.sqrt(w),!(w<0)&&(g=(-p+k)/(2*f),0<g&&g<1&&d.push(g),m=(-p-k)/(2*f),0<m&&m<1&&d.push(m))}for(var y=d.length,C=y,S;y--;)h=d[y],S=1-h,c[0][y]=S*S*S*e+3*S*S*h*o+3*S*h*h*r+h*h*h*l,c[1][y]=S*S*S*t+3*S*S*h*a+3*S*h*h*i+h*h*h*s;return c[0][C]=e,c[1][C]=t,c[0][C+1]=l,c[1][C+1]=s,c[0].length=c[1].length=C+2,{x0:Kt(...c[0]),y0:Kt(...c[1]),x1:qt(...c[0]),y1:qt(...c[1])}}function wc(e){if(dv(e)||(e=ov(e)),rv(e))return e;for(var t=iv(uv(e)),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a=function(u,h,g){var m,w;if(!u)return["C",h.x,h.y,h.x,h.y,h.x,h.y];switch(!(u[0]in{T:1,Q:1})&&(h.qx=h.qy=null),u[0]){case"M":h.X=u[1],h.Y=u[2];break;case"A":u=["C",...bc(h.x,h.y,...u.slice(1))];break;case"S":g=="C"||g=="S"?(m=h.x*2-h.bx,w=h.y*2-h.by):(m=h.x,w=h.y),u=["C",m,w,...u.slice(1)];break;case"T":g=="Q"||g=="T"?(h.qx=h.x*2-h.qx,h.qy=h.y*2-h.qy):(h.qx=h.x,h.qy=h.y),u=["C",...vc(h.x,h.y,h.qx,h.qy,u[1],u[2])];break;case"Q":h.qx=u[1],h.qy=u[2],u=["C",...vc(h.x,h.y,u[1],u[2],u[3],u[4])];break;case"L":u=["C",...wa(h.x,h.y,u[1],u[2])];break;case"H":u=["C",...wa(h.x,h.y,u[1],h.y)];break;case"V":u=["C",...wa(h.x,h.y,h.x,u[1])];break;case"Z":u=["C",...wa(h.x,h.y,h.X,h.Y)];break}return u},r=function(u,h){if(u[h].length>7){u[h].shift();for(var g=u[h];g.length;)i[h]="A",u.splice(h++,0,["C",...g.splice(0,6)]);u.splice(h,1),c=t.length}},i=[],l="",s="",d=0,c=t.length;d<c;d++){t[d]&&(l=t[d][0]),l!="C"&&(i[d]=l,d&&(s=i[d-1])),t[d]=a(t[d],o,s),i[d]!="A"&&l=="C"&&(i[d]="C"),r(t,d);var f=t[d],p=f.length;o.x=f[p-2],o.y=f[p-1],o.bx=cc(f[p-4])||o.x,o.by=cc(f[p-3])||o.y}return t}function pv(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Mo(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function De(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function Cc(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function hv(e){return Mo({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function gv(e){for(var t=e.waypoints,o=t.reduce(function(s,d,c){var f=t[c-1];if(f){var p=s[s.length-1],u=p&&p.endLength||0,h=vv(f,d);s.push({start:f,end:d,startLength:u,endLength:u+h,length:h})}return s},[]),a=o.reduce(function(s,d){return s+d.length},0)/2,r=0,i=o[r];i.endLength<a;)i=o[++r];var l=(a-i.startLength)/i.length;return{x:i.start.x+(i.end.x-i.start.x)*l,y:i.start.y+(i.end.y-i.start.y)*l}}function tt(e){return _t(e)?gv(e):hv(e)}function xn(e,t,o){o=o||0,(0,R.isObject)(o)||(o={x:o,y:o});var a=De(e),r=De(t),i=a.bottom+o.y<=r.top,l=a.left-o.x>=r.right,s=a.top-o.y>=r.bottom,d=a.right+o.x<=r.left,c=i?"top":s?"bottom":null,f=d?"left":l?"right":null;return f&&c?c+"-"+f:f||c||"intersect"}function zr(e,t,o){var a=mv(e,t);return a.length===1||a.length===2&&Vo(a[0],a[1])<1?Mo(a[0]):a.length>1?(a=(0,R.sortBy)(a,function(r){var i=Math.floor(r.t2*100)||1;return i=100-i,i=(i<10?"0":"")+i,r.segment2+"#"+i}),Mo(a[o?0:a.length-1])):null}function mv(e,t){return mc(e,t)}function yv(e){e=e.slice();for(var t=0,o,a,r;e[t];)o=e[t],a=e[t-1],r=e[t+1],Vo(o,r)===0||Nr(a,r,o)?e.splice(t,1):t++;return e}function vv(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xc(e,t,o,a){function r(l,s){return a.allowed("connection.create",{source:l,target:s})}function i(l,s){return r(s,l)}e.on("connect.hover",function(l){var s=l.context,d=s.start,c=l.hover,f;if(s.hover=c,f=s.canExecute=r(d,c),!(0,R.isNil)(f)){if(f!==!1){s.source=d,s.target=c;return}f=s.canExecute=i(d,c),!(0,R.isNil)(f)&&f!==!1&&(s.source=c,s.target=d)}}),e.on(["connect.out","connect.cleanup"],function(l){var s=l.context;s.hover=null,s.source=null,s.target=null,s.canExecute=!1}),e.on("connect.end",function(l){var s=l.context,d=s.canExecute,c=s.connectionStart,f={x:l.x,y:l.y},p=s.source,u=s.target;if(!d)return!1;var h=null,g={connectionStart:Or(s)?f:c,connectionEnd:Or(s)?c:f};(0,R.isObject)(d)&&(h=d),s.connection=o.connect(p,u,h,g)}),this.start=function(l,s,d,c){(0,R.isObject)(d)||(c=d,d=tt(s)),t.init(l,"connect",{autoActivate:c,data:{shape:s,context:{start:s,connectionStart:d}}})}}xc.$inject=["eventBus","dragging","modeling","rules"];function Or(e){var t=e.hover,o=e.source,a=e.target;return t&&o&&t===o&&o!==a}var bv=1100,wv=900,kc="connect-ok",Sc="connect-not-ok";function Ec(e,t,o){var a=e.get("connectionPreview",!1);a&&t.on("connect.move",function(r){var i=r.context,l=i.canExecute,s=i.hover,d=i.source,c=i.start,f=i.startPosition,p=i.target,u=i.connectionStart||f,h=i.connectionEnd||{x:r.x,y:r.y},g=u,m=h;Or(i)&&(g=h,m=u),a.drawPreview(i,l,{source:d||c,target:p||s,connectionStart:g,connectionEnd:m})}),t.on("connect.hover",wv,function(r){var i=r.context,l=r.hover,s=i.canExecute;s!==null&&o.addMarker(l,s?kc:Sc)}),t.on(["connect.out","connect.cleanup"],bv,function(r){var i=r.hover;i&&(o.removeMarker(i,kc),o.removeMarker(i,Sc))}),a&&t.on("connect.cleanup",function(r){a.cleanUp(r.context)})}Ec.$inject=["injector","eventBus","canvas"];var Lr={__depends__:[io,co,Ln],__init__:["connectPreview"],connect:["type",xc],connectPreview:["type",Ec]},Cv=15;function _c(e,t){var o;function a(s){return l(s.originalEvent)}e.on("canvas.focus.changed",function(s){s.focused?e.on("element.mousedown",500,a):e.off("element.mousedown",a)});function r(s){var d=o.start,c=o.button,f=ao(s),p=lo(f,d);!o.dragging&&xv(p)>Cv&&(o.dragging=!0,c===0&&Ws(e),Rr("grab")),o.dragging&&(p=lo(f,o.last||o.start),t.scroll({dx:p.x,dy:p.y}),o.last=f),s.preventDefault()}function i(s){G.event.unbind(document,"mousemove",r),G.event.unbind(document,"mouseup",i),o=null,$s()}function l(s){if(!(0,G.closest)(s.target,".djs-draggable")){var d=s.button;if(!(d>=2||s.ctrlKey||s.shiftKey||s.altKey))return o={button:d,start:ao(s)},G.event.bind(document,"mousemove",r),G.event.bind(document,"mouseup",i),!0}}this.isActive=function(){return!!o}}_c.$inject=["eventBus","canvas"];function xv(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var Bc={__init__:["moveCanvas"],moveCanvas:["type",_c]};function Dr(e){return Math.log(e)/Math.log(10)}function Rc(e,t){var o=Dr(e.min),a=Dr(e.max);return(Math.abs(o)+Math.abs(a))/t}function kv(e,t){return Math.max(e.min,Math.min(e.max,t))}var Sv=Math.sign||function(e){return e>=0?1:-1},Ir={min:.2,max:4},Tc=10,Ev=.1,_v=.75;function Xt(e,t,o){e=e||{},this._enabled=!1,this._canvas=o,this._container=o._container,this._handleWheel=(0,R.bind)(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||_v;var a=this;t.on("canvas.mouseover",function(){a._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){a._init(!1)})}Xt.$inject=["config.zoomScroll","eventBus","canvas"],Xt.prototype.scroll=function(t){this._canvas.scroll(t)},Xt.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Xt.prototype.zoom=function(t,o){var a=Rc(Ir,Tc*2);this._totalDelta+=t,Math.abs(this._totalDelta)>Ev&&(this._zoom(t,o,a),this._totalDelta=0)},Xt.prototype._handleWheel=function(t){if(this._enabled){var o=this._container;t.preventDefault();var a=t.ctrlKey||Ns()&&t.metaKey,r=t.shiftKey,i=-1*this._scale,l;if(a?i*=t.deltaMode===0?.02:.32:i*=t.deltaMode===0?1:16,a){var s=o.getBoundingClientRect(),d={x:t.clientX-s.left,y:t.clientY-s.top};l=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Sv(t.deltaY)*i,this.zoom(l,d)}else r?l={dx:i*t.deltaY,dy:0}:l={dx:i*t.deltaX,dy:i*t.deltaY},this.scroll(l)}},Xt.prototype.stepZoom=function(t,o){var a=Rc(Ir,Tc);this._zoom(t,o,a)},Xt.prototype._zoom=function(e,t,o){var a=this._canvas,r=e>0?1:-1,i=Dr(a.zoom()),l=Math.round(i/o)*o;l+=o*r;var s=Math.pow(10,l);a.zoom(kv(Ir,s),t)},Xt.prototype.toggle=function(t){var o=this._container,a=this._handleWheel,r=this._enabled;return typeof t>"u"&&(t=!r),r!==t&&G.event[t?"bind":"unbind"](o,"wheel",a,!1),this._enabled=t,t},Xt.prototype._init=function(e){this.toggle(e)};var Vc={__init__:["zoomScroll"],zoomScroll:["type",Xt]};function Ke(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ke.$inject=["eventBus","injector"],Ke.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const o={command:e,context:t};this._pushAction(o),this._internalExecute(o),this._popAction()},Ke.prototype.canExecute=function(e,t){const o={command:e,context:t},a=this._getHandler(e);let r=this._fire(e,"canExecute",o);if(r===void 0){if(!a)return!1;a.canExecute&&(r=a.canExecute(t))}return r},Ke.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Ke.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ke.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ke.prototype.register=function(e,t){this._setHandler(e,t)},Ke.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const o=this._injector.instantiate(t);this.register(e,o)},Ke.prototype.canUndo=function(){return!!this._getUndoAction()},Ke.prototype.canRedo=function(){return!!this._getRedoAction()},Ke.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ke.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ke.prototype._internalUndo=function(e){const t=e.command,o=e.context,a=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),a.revert&&this._markDirty(a.revert(o)),this._revertedAction(e),this._fire(t,"reverted",e)})},Ke.prototype._fire=function(e,t,o){arguments.length<3&&(o=t,t=null);const a=t?[e+"."+t,t]:[e];let r;o=this._eventBus.createEvent(o);for(const i of a)if(r=this._eventBus.fire("commandStack."+i,o),o.cancelBubble)break;return r},Ke.prototype._createId=function(){return this._uid++},Ke.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ke.prototype._internalExecute=function(e,t){const o=e.command,a=e.context,r=this._getHandler(o);if(!r)throw new Error("no command handler registered for <"+o+">");this._pushAction(e),t||(this._fire(o,"preExecute",e),r.preExecute&&r.preExecute(a),this._fire(o,"preExecuted",e)),this._atomicDo(()=>{this._fire(o,"execute",e),r.execute&&this._markDirty(r.execute(a)),this._executedAction(e,t),this._fire(o,"executed",e)}),t||(this._fire(o,"postExecute",e),r.postExecute&&r.postExecute(a),this._fire(o,"postExecuted",e)),this._popAction()},Ke.prototype._pushAction=function(e){const t=this._currentExecution,o=t.actions,a=o[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=a&&a.id||this._createId()),o.push(e)},Ke.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,o=e.actions,a=e.dirty;o.pop(),o.length||(this._eventBus.fire("elements.changed",{elements:(0,R.uniqueBy)("id",a.reverse())}),a.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ke.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=(0,R.isArray)(e)?e:[e],t.dirty=t.dirty.concat(e))},Ke.prototype._executedAction=function(e,t){const o=++this._stackIdx;t||this._stack.splice(o,this._stack.length,e)},Ke.prototype._revertedAction=function(e){this._stackIdx--},Ke.prototype._getHandler=function(e){return this._handlerMap[e]},Ke.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var Bv={commandStack:["type",Ke]};function Dn(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function Ca(e,t){if(!e||!t)return-1;var o=e.indexOf(t);return o!==-1&&e.splice(o,1),o}function kn(e,t,o){if(!(!e||!t)){typeof o!="number"&&(o=-1);var a=e.indexOf(t);if(a!==-1){if(a===o)return;if(o!==-1)e.splice(a,1);else return}o!==-1?e.splice(o,0,t):e.push(t)}}function Fr(e,t){return!e||!t?-1:e.indexOf(t)}function fo(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var o;o=e[0];)t(o);return e}}var Rv=1e3;function bt(e){this._eventBus=e}bt.$inject=["eventBus"];function Tv(e,t){return function(o){return e.call(t||null,o.context,o.command,o)}}bt.prototype.on=function(e,t,o,a,r,i){if(((0,R.isFunction)(t)||(0,R.isNumber)(t))&&(i=r,r=a,a=o,o=t,t=null),(0,R.isFunction)(o)&&(i=r,r=a,a=o,o=Rv),(0,R.isObject)(r)&&(i=r,r=!1),!(0,R.isFunction)(a))throw new Error("handlerFn must be a function");(0,R.isArray)(e)||(e=[e]);var l=this._eventBus;(0,R.forEach)(e,function(s){var d=["commandStack",s,t].filter(function(c){return c}).join(".");l.on(d,o,r?Tv(a,i):a,i)})},bt.prototype.canExecute=sn("canExecute"),bt.prototype.preExecute=sn("preExecute"),bt.prototype.preExecuted=sn("preExecuted"),bt.prototype.execute=sn("execute"),bt.prototype.executed=sn("executed"),bt.prototype.postExecute=sn("postExecute"),bt.prototype.postExecuted=sn("postExecuted"),bt.prototype.revert=sn("revert"),bt.prototype.reverted=sn("reverted");function sn(e){return function(o,a,r,i,l){((0,R.isFunction)(o)||(0,R.isNumber)(o))&&(l=i,i=r,r=a,a=o,o=null),this.on(o,e,a,r,i,l)}}var Vv=250,Mc=1400;function $r(e,t,o){bt.call(this,t);var a=e.get("movePreview",!1);t.on("shape.move.start",Mc,function(r){var i=r.context,l=i.shapes,s=i.validatedShapes;i.shapes=Ac(l),i.validatedShapes=Ac(s)}),a&&t.on("shape.move.start",Vv,function(r){var i=r.context,l=i.shapes,s=[];(0,R.forEach)(l,function(d){(0,R.forEach)(d.labels,function(c){!c.hidden&&i.shapes.indexOf(c)===-1&&s.push(c),d.labelTarget&&s.push(d)})}),(0,R.forEach)(s,function(d){a.makeDraggable(i,d,!0)})}),this.preExecuted("elements.move",Mc,function(r){var i=r.context.closure,l=i.enclosedElements,s=[];(0,R.forEach)(l,function(d){(0,R.forEach)(d.labels,function(c){l[c.id]||s.push(c)})}),i.addAll(s)}),this.preExecute(["connection.delete","shape.delete"],function(r){var i=r.context;fo((i.connection||i.shape).labels,function(l){o.removeShape(l,{nested:!0})})}),this.execute("shape.delete",function(r){var i=r.context,l=i.shape,s=l.labelTarget;s&&(i.labelTargetIndex=Fr(s.labels,l),i.labelTarget=s,l.labelTarget=null)}),this.revert("shape.delete",function(r){var i=r.context,l=i.shape,s=i.labelTarget,d=i.labelTargetIndex;s&&(kn(s.labels,l,d),l.labelTarget=s)})}Dn($r,bt),$r.$inject=["injector","eventBus","modeling"];function Ac(e){return(0,R.filter)(e,function(t){return e.indexOf(t.labelTarget)===-1})}var Mv={__init__:["labelSupport"],labelSupport:["type",$r]};function Nc(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function jc(e,t){if(t){let o=e;return Object.keys(t).forEach(a=>{o=o.replace(new RegExp(`{${a}}`,"g"),t[a])}),o}return e}function Av(e,t,o,a){var r=o.inverse;return Object.defineProperty(e,"remove",{value:function(i){var l=this.indexOf(i);return l!==-1&&(this.splice(l,1),t.unset(i,r,a)),i}}),Object.defineProperty(e,"contains",{value:function(i){return this.indexOf(i)!==-1}}),Object.defineProperty(e,"add",{value:function(i,l){var s=this.indexOf(i);if(typeof l>"u"){if(s!==-1)return;l=this.length}s!==-1&&this.splice(s,1),this.splice(l,0,i),s===-1&&t.set(i,r,a)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function Nv(e){return e.__refs_collection===!0}function jv(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function Pc(e,t,o){var a=Av(o[t.name]||[],e,t,o);Object.defineProperty(o,t.name,{enumerable:t.enumerable,value:a}),a.length&&a.forEach(function(r){e.set(r,t.inverse,o)})}function Pv(e,t,o){var a=t.inverse,r=o[t.name];Object.defineProperty(o,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return r},set:function(i){if(i!==r){var l=r;r=null,l&&e.unset(l,a,o),r=i,e.set(r,a,o)}}})}function Pt(e,t){if(!(this instanceof Pt))return new Pt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Pt.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Pc(this,t,e):Pv(this,t,e)},Pt.prototype.ensureRefsCollection=function(e,t){var o=e[t.name];return Nv(o)||Pc(this,t,e),o},Pt.prototype.ensureBound=function(e,t){jv(e,t)||this.bind(e,t)},Pt.prototype.unset=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(o):e[t.name]=void 0)},Pt.prototype.set=function(e,t,o){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(o):e[t.name]=o)};var Wr=new Pt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Hc=new Pt({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zc=new Pt({name:"attachers",collection:!0},{name:"host"}),Oc=new Pt({name:"outgoing",collection:!0},{name:"source"}),Lc=new Pt({name:"incoming",collection:!0},{name:"target"});function po(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,o=this.labels;!e&&t?o.remove(t):o.add(e,0)}}),Wr.bind(this,"parent"),Hc.bind(this,"labels"),Oc.bind(this,"outgoing"),Lc.bind(this,"incoming")}function Ao(){po.call(this),Wr.bind(this,"children"),zc.bind(this,"host"),zc.bind(this,"attachers")}Dn(Ao,po);function Dc(){po.call(this),Wr.bind(this,"children")}Dn(Dc,Ao);function Ic(){Ao.call(this),Hc.bind(this,"labelTarget")}Dn(Ic,Ao);function Fc(){po.call(this),Oc.bind(this,"source"),Lc.bind(this,"target")}Dn(Fc,po);var Hv={connection:Fc,shape:Ao,label:Ic,root:Dc};function zv(e,t){var o=Hv[e];if(!o)throw new Error("unknown type: <"+e+">");return(0,R.assign)(new o,t)}function Ov(e){return e instanceof po}function Sn(){this._uid=12}Sn.prototype.createRoot=function(e){return this.create("root",e)},Sn.prototype.createLabel=function(e){return this.create("label",e)},Sn.prototype.createShape=function(e){return this.create("shape",e)},Sn.prototype.createConnection=function(e){return this.create("connection",e)},Sn.prototype.create=function(e,t){return t=(0,R.assign)({},t||{}),t.id||(t.id=e+"_"+this._uid++),zv(e,t)};var Lv={width:90,height:20};function In(){Sn.call(this),this._translate=jc}(0,rn.default)(In,Sn),In.$inject=[],In.prototype.baseCreate=Sn.prototype.create,In.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,Ge({type:"label"},Lv,t)):this.createFlowElement(e,t)},In.prototype.createFlowElement=function(e,t){if(t==null||t===void 0||t==="")return this.baseCreate(e,t);t.businessObject=t.businessObject||{id:Nc()},e==="connection"&&(t.type="myline");const{businessObject:o}=t;o.type=t.type;const a=this._getDefaultSize(o.type);return t=Ge({businessObject:o,id:o.id},a,t),this.baseCreate(e,t)},In.prototype._getDefaultSize=function(e){let t={width:100,height:80};switch(e){case"startEvent":case"endEvent":case"myEvent":t={width:36,height:36};break;case"gatewayAnd":case"gatewayXor":case"gatewayInclusive":t={width:50,height:50};break;case"subprocess":case"userTask":case"scriptTask":t={width:100,height:80};break}return t};function xa(e,t){this._modeling=e,this._canvas=t}xa.$inject=["modeling","canvas"],xa.prototype.preExecute=function(e){var t=this._modeling,o=e.elements,a=e.alignment;(0,R.forEach)(o,function(r){var i={x:0,y:0};(0,R.isDefined)(a.left)?i.x=a.left-r.x:(0,R.isDefined)(a.right)?i.x=a.right-r.width-r.x:(0,R.isDefined)(a.center)?i.x=a.center-Math.round(r.width/2)-r.x:(0,R.isDefined)(a.top)?i.y=a.top-r.y:(0,R.isDefined)(a.bottom)?i.y=a.bottom-r.height-r.y:(0,R.isDefined)(a.middle)&&(i.y=a.middle-Math.round(r.height/2)-r.y),t.moveElements([r],i,r.parent)})},xa.prototype.postExecute=function(e){};function ka(e){this._modeling=e}ka.$inject=["modeling"],ka.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var o=e.target||t.parent,a=e.shape,r=e.hints||{};a=e.shape=this._modeling.createShape(a,e.position,o,{attach:r.attach}),e.shape=a},ka.prototype.postExecute=function(e){var t=e.hints||{};Dv(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function Dv(e,t){return(0,R.some)(e.outgoing,function(o){return o.target===t})}function Sa(e,t){this._canvas=e,this._layouter=t}Sa.$inject=["canvas","layouter"],Sa.prototype.execute=function(e){var t=e.connection,o=e.source,a=e.target,r=e.parent,i=e.parentIndex,l=e.hints;if(!o||!a)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=o,t.target=a,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,l)),this._canvas.addConnection(t,r,i),t},Sa.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Ea=Math.round;function Ur(e){this._modeling=e}Ur.$inject=["modeling"],Ur.prototype.preExecute=function(e){var t=e.elements,o=e.parent,a=e.parentIndex,r=e.position,i=e.hints,l=this._modeling;(0,R.forEach)(t,function(f){(0,R.isNumber)(f.x)||(f.x=0),(0,R.isNumber)(f.y)||(f.y=0)});var s=Yt((0,R.filter)(t,function(f){return!f.hidden}));(0,R.forEach)(t,function(f){_t(f)&&(f.waypoints=(0,R.map)(f.waypoints,function(p){return{x:Ea(p.x-s.x-s.width/2+r.x),y:Ea(p.y-s.y-s.height/2+r.y)}})),(0,R.assign)(f,{x:Ea(f.x-s.x-s.width/2+r.x),y:Ea(f.y-s.y-s.height/2+r.y)})});var d=Oy(t),c={};(0,R.forEach)(t,function(f){if(_t(f)){c[f.id]=(0,R.isNumber)(a)?l.createConnection(c[f.source.id],c[f.target.id],a,f,f.parent||o,i):l.createConnection(c[f.source.id],c[f.target.id],f,f.parent||o,i);return}var p=(0,R.assign)({},i);d.indexOf(f)===-1&&(p.autoResize=!1),uo(f)&&(p=(0,R.omit)(p,["attach"])),c[f.id]=(0,R.isNumber)(a)?l.createShape(f,(0,R.pick)(f,["x","y","width","height"]),f.parent||o,a,p):l.createShape(f,(0,R.pick)(f,["x","y","width","height"]),f.parent||o,p)}),e.elements=(0,R.values)(c)};var $c=Math.round;function En(e){this._canvas=e}En.$inject=["canvas"],En.prototype.execute=function(e){var t=e.shape,o=e.position,a=e.parent,r=e.parentIndex;if(!a)throw new Error("parent required");if(!o)throw new Error("position required");return o.width!==void 0?(0,R.assign)(t,o):(0,R.assign)(t,{x:o.x-$c(t.width/2),y:o.y-$c(t.height/2)}),this._canvas.addShape(t,a,r),t},En.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function No(e){En.call(this,e)}Dn(No,En),No.$inject=["canvas"];var Iv=En.prototype.execute;No.prototype.execute=function(e){var t=e.shape;return $v(t),t.labelTarget=e.labelTarget,Iv.call(this,e)};var Fv=En.prototype.revert;No.prototype.revert=function(e){return e.shape.labelTarget=null,Fv.call(this,e)};function $v(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function jo(e,t){this._canvas=e,this._modeling=t}jo.$inject=["canvas","modeling"],jo.prototype.preExecute=function(e){var t=this._modeling,o=e.connection;fo(o.incoming,function(a){t.removeConnection(a,{nested:!0})}),fo(o.outgoing,function(a){t.removeConnection(a,{nested:!0})})},jo.prototype.execute=function(e){var t=e.connection,o=t.parent;return e.parent=o,e.parentIndex=Fr(o.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},jo.prototype.revert=function(e){var t=e.connection,o=e.parent,a=e.parentIndex;return t.source=e.source,t.target=e.target,kn(o.children,t,a),this._canvas.addConnection(t,o),t};function Jr(e,t){this._modeling=e,this._elementRegistry=t}Jr.$inject=["modeling","elementRegistry"],Jr.prototype.postExecute=function(e){var t=this._modeling,o=this._elementRegistry,a=e.elements;(0,R.forEach)(a,function(r){o.get(r.id)&&(r.waypoints?t.removeConnection(r):t.removeShape(r))})};function Po(e,t){this._canvas=e,this._modeling=t}Po.$inject=["canvas","modeling"],Po.prototype.preExecute=function(e){var t=this._modeling,o=e.shape;fo(o.incoming,function(a){t.removeConnection(a,{nested:!0})}),fo(o.outgoing,function(a){t.removeConnection(a,{nested:!0})}),fo(o.children,function(a){_t(a)?t.removeConnection(a,{nested:!0}):t.removeShape(a,{nested:!0})})},Po.prototype.execute=function(e){var t=this._canvas,o=e.shape,a=o.parent;return e.oldParent=a,e.oldParentIndex=Fr(a.children,o),t.removeShape(o),o},Po.prototype.revert=function(e){var t=this._canvas,o=e.shape,a=e.oldParent,r=e.oldParentIndex;return kn(a.children,o,r),t.addShape(o,a),o};function _a(e){this._modeling=e}_a.$inject=["modeling"];var Wc={x:"y",y:"x"};_a.prototype.preExecute=function(e){var t=this._modeling,o=e.groups,a=e.axis,r=e.dimension;function i(w,k){w.range.min=Math.min(k[a],w.range.min),w.range.max=Math.max(k[a]+k[r],w.range.max)}function l(w){return w[a]+w[r]/2}function s(w){return w.length-1}function d(w){return w.max-w.min}function c(w,k){var b={y:0};b[a]=w-l(k),b[a]&&(b[Wc[a]]=0,t.moveElements([k],b,k.parent))}var f=o[0],p=s(o),u=o[p],h,g,m=0;(0,R.forEach)(o,function(w,k){var b,y,C;if(w.elements.length<2){k&&k!==o.length-1&&(i(w,w.elements[0]),m+=d(w.range));return}b=(0,R.sortBy)(w.elements,a),y=b[0],k===p&&(y=b[s(b)]),C=l(y),w.range=null,(0,R.forEach)(b,function(S){if(c(C,S),w.range===null){w.range={min:S[a],max:S[a]+S[r]};return}i(w,S)}),k&&k!==o.length-1&&(m+=d(w.range))}),g=Math.abs(u.range.min-f.range.max),h=Math.round((g-m)/(o.length-1)),!(h<o.length-1)&&(0,R.forEach)(o,function(w,k){var b={},y;w===f||w===u||(y=o[k-1],w.range.max=0,(0,R.forEach)(w.elements,function(C,S){b[Wc[a]]=0,b[a]=y.range.max-C[a]+h,w.range.min!==C[a]&&(b[a]+=C[a]-w.range.min),b[a]&&t.moveElements([C],b,C.parent),w.range.max=Math.max(C[a]+C[r],S?w.range.max:0)}))})},_a.prototype.postExecute=function(e){};function Ba(e,t){this._layouter=e,this._canvas=t}Ba.$inject=["layouter","canvas"],Ba.prototype.execute=function(e){var t=e.connection,o=t.waypoints;return(0,R.assign)(e,{oldWaypoints:o}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Ba.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Yr(){}Yr.prototype.execute=function(e){var t=e.connection,o=e.delta,a=e.newParent||t.parent,r=e.newParentIndex,i=t.parent;return e.oldParent=i,e.oldParentIndex=Ca(i.children,t),kn(a.children,t,r),t.parent=a,(0,R.forEach)(t.waypoints,function(l){l.x+=o.x,l.y+=o.y,l.original&&(l.original.x+=o.x,l.original.y+=o.y)}),t},Yr.prototype.revert=function(e){var t=e.connection,o=t.parent,a=e.oldParent,r=e.oldParentIndex,i=e.delta;return Ca(o.children,t),kn(a.children,t,r),t.parent=a,(0,R.forEach)(t.waypoints,function(l){l.x-=i.x,l.y-=i.y,l.original&&(l.original.x-=i.x,l.original.y-=i.y)}),t};function Ra(e,t,o){var a=Us(t),r=Us(o),i=lo(e,a),l={x:i.x*(o.width/t.width),y:i.y*(o.height/t.height)};return Mo({x:r.x+l.x,y:r.y+l.y})}function Gr(e,t,o){var a=Ta(e),r=Jc(a,t),i=a[0];return r.length?r[r.length-1]:Ra(i.original||i,o,t)}function Kr(e,t,o){var a=Ta(e),r=Jc(a,t),i=a[a.length-1];return r.length?r[0]:Ra(i.original||i,o,t)}function qr(e,t,o){var a=Ta(e),r=Uc(t,o),i=a[0];return Ra(i.original||i,r,t)}function Xr(e,t,o){var a=Ta(e),r=Uc(t,o),i=a[a.length-1];return Ra(i.original||i,r,t)}function Uc(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Ta(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Jc(e,t){return(0,R.filter)((0,R.map)(e,Uv),function(o){return Wv(o,t)})}function Wv(e,t){return xn(t,e,1)==="intersect"}function Uv(e){return e.original||e}function Zr(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Zr.prototype.add=function(e,t){return this.addAll([e],t)},Zr.prototype.addAll=function(e,t){var o=Iy(e,!!t,this);return(0,R.assign)(this,o),this};function Ho(e){this._modeling=e}Ho.prototype.moveRecursive=function(e,t,o){return e?this.moveClosure(this.getClosure(e),t,o):[]},Ho.prototype.moveClosure=function(e,t,o,a,r){var i=this._modeling,l=e.allShapes,s=e.allConnections,d=e.enclosedConnections,c=e.topLevel,f=!1;r&&r.parent===o&&(f=!0),(0,R.forEach)(l,function(p){i.moveShape(p,t,c[p.id]&&!f&&o,{recurse:!1,layout:!1})}),(0,R.forEach)(s,function(p){var u=!!l[p.source.id],h=!!l[p.target.id];d[p.id]&&u&&h?i.moveConnection(p,t,c[p.id]&&!f&&o):i.layoutConnection(p,{connectionStart:u&&qr(p,p.source,t),connectionEnd:h&&Xr(p,p.target,t)})})},Ho.prototype.getClosure=function(e){return new Zr().addAll(e,!0)};function Va(e){this._helper=new Ho(e)}Va.$inject=["modeling"],Va.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Va.prototype.postExecute=function(e){var t=e.hints,o;t&&t.primaryShape&&(o=t.primaryShape,t.oldParent=o.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,o)};function Fn(e){this._modeling=e,this._helper=new Ho(e)}Fn.$inject=["modeling"],Fn.prototype.execute=function(e){var t=e.shape,o=e.delta,a=e.newParent||t.parent,r=e.newParentIndex,i=t.parent;return e.oldBounds=(0,R.pick)(t,["x","y","width","height"]),e.oldParent=i,e.oldParentIndex=Ca(i.children,t),kn(a.children,t,r),(0,R.assign)(t,{parent:a,x:t.x+o.x,y:t.y+o.y}),t},Fn.prototype.postExecute=function(e){var t=e.shape,o=e.delta,a=e.hints,r=this._modeling;a.layout!==!1&&((0,R.forEach)(t.incoming,function(i){r.layoutConnection(i,{connectionEnd:Xr(i,t,o)})}),(0,R.forEach)(t.outgoing,function(i){r.layoutConnection(i,{connectionStart:qr(i,t,o)})})),a.recurse!==!1&&this.moveChildren(e)},Fn.prototype.revert=function(e){var t=e.shape,o=e.oldParent,a=e.oldParentIndex,r=e.delta;return kn(o.children,t,a),(0,R.assign)(t,{parent:o,x:t.x-r.x,y:t.y-r.y}),t},Fn.prototype.moveChildren=function(e){var t=e.delta,o=e.shape;this._helper.moveRecursive(o.children,t,null)},Fn.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function zo(e){this._modeling=e}zo.$inject=["modeling"],zo.prototype.execute=function(e){var t=e.newSource,o=e.newTarget,a=e.connection,r=e.dockingOrPoints;if(!t&&!o)throw new Error("newSource or newTarget required");return(0,R.isArray)(r)&&(e.oldWaypoints=a.waypoints,a.waypoints=r),t&&(e.oldSource=a.source,a.source=t),o&&(e.oldTarget=a.target,a.target=o),a},zo.prototype.postExecute=function(e){var t=e.connection,o=e.newSource,a=e.newTarget,r=e.dockingOrPoints,i=e.hints||{},l={};i.connectionStart&&(l.connectionStart=i.connectionStart),i.connectionEnd&&(l.connectionEnd=i.connectionEnd),i.layoutConnection!==!1&&(o&&(!a||i.docking==="source")&&(l.connectionStart=l.connectionStart||Yc((0,R.isArray)(r)?r[0]:r)),a&&(!o||i.docking==="target")&&(l.connectionEnd=l.connectionEnd||Yc((0,R.isArray)(r)?r[r.length-1]:r)),i.newWaypoints&&(l.waypoints=i.newWaypoints),this._modeling.layoutConnection(t,l))},zo.prototype.revert=function(e){var t=e.oldSource,o=e.oldTarget,a=e.oldWaypoints,r=e.connection;return t&&(r.source=t),o&&(r.target=o),a&&(r.waypoints=a),r};function Yc(e){return e.original||e}function cn(e,t){this._modeling=e,this._rules=t}cn.$inject=["modeling","rules"],cn.prototype.preExecute=function(e){var t=this,o=this._modeling,a=this._rules,r=e.oldShape,i=e.newData,l=e.hints||{},s;function d(g,m,w){return a.allowed("connection.reconnect",{connection:w,source:g,target:m})}var c={x:i.x,y:i.y},f={x:r.x,y:r.y,width:r.width,height:r.height};s=e.newShape=e.newShape||t.createShape(i,c,r.parent,l),r.host&&o.updateAttachment(s,r.host);var p;l.moveChildren!==!1&&(p=r.children.slice(),o.moveElements(p,{x:0,y:0},s,l));var u=r.incoming.slice(),h=r.outgoing.slice();(0,R.forEach)(u,function(g){var m=g.source;d(m,s,g)&&t.reconnectEnd(g,s,Kr(g,s,f),l)}),(0,R.forEach)(h,function(g){var m=g.target;d(s,m,g)&&t.reconnectStart(g,s,Gr(g,s,f),l)})},cn.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},cn.prototype.execute=function(e){},cn.prototype.revert=function(e){},cn.prototype.createShape=function(e,t,o,a){return this._modeling.createShape(e,t,o,a)},cn.prototype.reconnectStart=function(e,t,o,a){this._modeling.reconnectStart(e,t,o,a)},cn.prototype.reconnectEnd=function(e,t,o,a){this._modeling.reconnectEnd(e,t,o,a)};function Oo(e){this._modeling=e}Oo.$inject=["modeling"],Oo.prototype.execute=function(e){var t=e.shape,o=e.newBounds,a=e.minBounds;if(o.x===void 0||o.y===void 0||o.width===void 0||o.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(a&&(o.width<a.width||o.height<a.height))throw new Error("width and height cannot be less than minimum height and width");if(!a&&o.width<10||o.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},(0,R.assign)(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t},Oo.prototype.postExecute=function(e){var t=this._modeling,o=e.shape,a=e.oldBounds;(e.hints||{}).layout!==!1&&((0,R.forEach)(o.incoming,function(r){t.layoutConnection(r,{connectionEnd:Kr(r,o,a)})}),(0,R.forEach)(o.outgoing,function(r){t.layoutConnection(r,{connectionStart:Gr(r,o,a)})}))},Oo.prototype.revert=function(e){var t=e.shape,o=e.oldBounds;return(0,R.assign)(t,{width:o.width,height:o.height,x:o.x,y:o.y}),t};function Jv(e,t){var o=[];return(0,R.forEach)(e.concat(t),function(a){var r=a.incoming,i=a.outgoing;(0,R.forEach)(r.concat(i),function(l){var s=l.source,d=l.target;(Lo(e,s)||Lo(e,d)||Lo(t,s)||Lo(t,d))&&(Lo(o,l)||o.push(l))})}),o}function Lo(e,t){return e.indexOf(t)!==-1}function Yv(e,t,o){var a=e.x,r=e.y,i=e.width,l=e.height,s=o.x,d=o.y;switch(t){case"n":return{x:a,y:r+d,width:i,height:l-d};case"s":return{x:a,y:r,width:i,height:l+d};case"w":return{x:a+s,y:r,width:i-s,height:l};case"e":return{x:a,y:r,width:i+s,height:l};default:throw new Error("unknown direction: "+t)}}function _n(e){this._modeling=e}_n.$inject=["modeling"],_n.prototype.preExecute=function(e){var t=e.delta,o=e.direction,a=e.movingShapes,r=e.resizingShapes,i=e.start,l={};this.moveShapes(a,t),(0,R.forEach)(r,function(s){l[s.id]=Kv(s)}),this.resizeShapes(r,t,o),this.updateConnectionWaypoints(Jv(a,r),t,o,i,a,r,l)},_n.prototype.execute=function(){},_n.prototype.revert=function(){},_n.prototype.moveShapes=function(e,t){var o=this;(0,R.forEach)(e,function(a){o._modeling.moveShape(a,t,null,{autoResize:!1,layout:!1,recurse:!1})})},_n.prototype.resizeShapes=function(e,t,o){var a=this;(0,R.forEach)(e,function(r){var i=Yv(r,o,t);a._modeling.resizeShape(r,i,null,{attachSupport:!1,autoResize:!1,layout:!1})})},_n.prototype.updateConnectionWaypoints=function(e,t,o,a,r,i,l){var s=this,d=r.concat(i);(0,R.forEach)(e,function(c){var f=c.source,p=c.target,u=Gv(c),h=Kc(o),g={};Bn(d,f)&&Bn(d,p)?(u=(0,R.map)(u,function(m){return qc(m,a,o)&&(m[h]=m[h]+t[h]),m.original&&qc(m.original,a,o)&&(m.original[h]=m.original[h]+t[h]),m}),s._modeling.updateWaypoints(c,u,{labelBehavior:!1})):(Bn(d,f)||Bn(d,p))&&(Bn(r,f)?g.connectionStart=qr(c,f,t):Bn(r,p)?g.connectionEnd=Xr(c,p,t):Bn(i,f)?g.connectionStart=Gr(c,f,l[f.id]):Bn(i,p)&&(g.connectionEnd=Kr(c,p,l[p.id])),s._modeling.layoutConnection(c,g))})};function Gc(e){return(0,R.assign)({},e)}function Gv(e){return(0,R.map)(e.waypoints,function(t){return t=Gc(t),t.original&&(t.original=Gc(t.original)),t})}function Kc(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function qc(e,t,o){var a=Kc(o);if(/e|s/.test(o))return e[a]>t;if(/n|w/.test(o))return e[a]<t}function Bn(e,t){return e.indexOf(t)!==-1}function Kv(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function Ma(e){this._modeling=e}Ma.$inject=["modeling"],Ma.prototype.execute=function(e){var t=e.shape,o=t.children;e.oldChildrenVisibility=Xc(o),t.collapsed=!t.collapsed;var a=Zc(o,t.collapsed);return[t].concat(a)},Ma.prototype.revert=function(e){var t=e.shape,o=e.oldChildrenVisibility,a=t.children,r=Qc(a,o);return t.collapsed=!t.collapsed,[t].concat(r)};function Xc(e){var t={};return(0,R.forEach)(e,function(o){t[o.id]=o.hidden,o.children&&(t=(0,R.assign)({},t,Xc(o.children)))}),t}function Zc(e,t){var o=[];return(0,R.forEach)(e,function(a){a.hidden=t,o=o.concat(a),a.children&&(o=o.concat(Zc(a.children,a.collapsed||t)))}),o}function Qc(e,t){var o=[];return(0,R.forEach)(e,function(a){a.hidden=t[a.id],o=o.concat(a),a.children&&(o=o.concat(Qc(a.children,t)))}),o}function Aa(e){this._modeling=e}Aa.$inject=["modeling"],Aa.prototype.execute=function(e){var t=e.shape,o=e.newHost,a=t.host;return e.oldHost=a,e.attacherIdx=ed(a,t),td(o,t),t.host=o,t},Aa.prototype.revert=function(e){var t=e.shape,o=e.newHost,a=e.oldHost,r=e.attacherIdx;return t.host=a,ed(o,t),td(a,t,r),t};function ed(e,t){return Ca(e&&e.attachers,t)}function td(e,t,o){if(e){var a=e.attachers;a||(e.attachers=a=[]),kn(a,t,o)}}function Qr(){}Qr.prototype.execute=function(e){var t=e.connection,o=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=o,t},Qr.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Oe(e,t,o){this._eventBus=e,this._elementFactory=t,this._commandStack=o;var a=this;e.on("diagram.init",function(){a.registerHandlers(o)})}Oe.$inject=["eventBus","elementFactory","commandStack"],Oe.prototype.getHandlers=function(){return{"shape.append":ka,"shape.create":En,"shape.delete":Po,"shape.move":Fn,"shape.resize":Oo,"shape.replace":cn,"shape.toggleCollapse":Ma,spaceTool:_n,"label.create":No,"connection.create":Sa,"connection.delete":jo,"connection.move":Yr,"connection.layout":Ba,"connection.updateWaypoints":Qr,"connection.reconnect":zo,"elements.create":Ur,"elements.move":Va,"elements.delete":Jr,"elements.distribute":_a,"elements.align":xa,"element.updateAttachment":Aa}},Oe.prototype.registerHandlers=function(e){(0,R.forEach)(this.getHandlers(),function(t,o){e.registerHandler(o,t)})},Oe.prototype.moveShape=function(e,t,o,a,r){typeof a=="object"&&(r=a,a=null);var i={shape:e,delta:t,newParent:o,newParentIndex:a,hints:r||{}};this._commandStack.execute("shape.move",i)},Oe.prototype.updateAttachment=function(e,t){var o={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",o)},Oe.prototype.moveElements=function(e,t,o,a){a=a||{};var r=a.attach,i=o,l;r===!0?(l=o,i=o.parent):r===!1&&(l=null);var s={shapes:e,delta:t,newParent:i,newHost:l,hints:a};this._commandStack.execute("elements.move",s)},Oe.prototype.moveConnection=function(e,t,o,a,r){typeof a=="object"&&(r=a,a=void 0);var i={connection:e,delta:t,newParent:o,newParentIndex:a,hints:r||{}};this._commandStack.execute("connection.move",i)},Oe.prototype.layoutConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",o)},Oe.prototype.createConnection=function(e,t,o,a,r,i){typeof o=="object"&&(i=r,r=a,a=o,o=void 0),a=this._create("connection",a);var l={source:e,target:t,parent:r,parentIndex:o,connection:a,hints:i};return this._commandStack.execute("connection.create",l),l.connection},Oe.prototype.createShape=function(e,t,o,a,r){typeof a!="number"&&(r=a,a=void 0),r=r||{};var i=r.attach,l,s;e=this._create("shape",e),i?(l=o.parent,s=o):l=o;var d={position:t,shape:e,parent:l,parentIndex:a,host:s,hints:r};return this._commandStack.execute("shape.create",d),d.shape},Oe.prototype.createElements=function(e,t,o,a,r){(0,R.isArray)(e)||(e=[e]),typeof a!="number"&&(r=a,a=void 0),r=r||{};var i={position:t,elements:e,parent:o,parentIndex:a,hints:r};return this._commandStack.execute("elements.create",i),i.elements},Oe.prototype.createLabel=function(e,t,o,a){o=this._create("label",o);var r={labelTarget:e,position:t,parent:a||e.parent,shape:o};return this._commandStack.execute("label.create",r),r.shape},Oe.prototype.appendShape=function(e,t,o,a,r){r=r||{},t=this._create("shape",t);var i={source:e,position:o,target:a,shape:t,connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",i),i.shape},Oe.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Oe.prototype.distributeElements=function(e,t,o){var a={groups:e,axis:t,dimension:o};this._commandStack.execute("elements.distribute",a)},Oe.prototype.removeShape=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",o)},Oe.prototype.removeConnection=function(e,t){var o={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",o)},Oe.prototype.replaceShape=function(e,t,o){var a={oldShape:e,newData:t,hints:o||{}};return this._commandStack.execute("shape.replace",a),a.newShape},Oe.prototype.alignElements=function(e,t){var o={elements:e,alignment:t};this._commandStack.execute("elements.align",o)},Oe.prototype.resizeShape=function(e,t,o,a){var r={shape:e,newBounds:t,minBounds:o,hints:a};this._commandStack.execute("shape.resize",r)},Oe.prototype.createSpace=function(e,t,o,a,r){var i={delta:o,direction:a,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",i)},Oe.prototype.updateWaypoints=function(e,t,o){var a={connection:e,newWaypoints:t,hints:o||{}};this._commandStack.execute("connection.updateWaypoints",a)},Oe.prototype.reconnect=function(e,t,o,a,r){var i={connection:e,newSource:t,newTarget:o,dockingOrPoints:a,hints:r||{}};this._commandStack.execute("connection.reconnect",i)},Oe.prototype.reconnectStart=function(e,t,o,a){a||(a={}),this.reconnect(e,t,e.target,o,(0,R.assign)(a,{docking:"source"}))},Oe.prototype.reconnectEnd=function(e,t,o,a){a||(a={}),this.reconnect(e,e.source,t,o,(0,R.assign)(a,{docking:"target"}))},Oe.prototype.connect=function(e,t,o,a){return this.createConnection(e,t,o||{},e.parent,a)},Oe.prototype._create=function(e,t){return Ov(t)?t:this._elementFactory.create(e,t)},Oe.prototype.toggleCollapse=function(e,t){var o={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",o)};function nd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function ei(e,t){if(!e||!t||!Array.isArray(t))return!1;const o=e.type||e.businessObject&&e.businessObject.type;return t.includes(o)}function qv(e,t){Array.isArray(e)&&e.forEach(t)}function Na(e){const t=e.businessObject;if(t)return t.name||""}function Xv(e,t){const o=e.businessObject;return o.name=t,e}var Zv={width:90,height:20},bx=15;function ti(e){return["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(e.type)}function od(e){return Do(e.label)}function Qv(e){const t=e.length/2-1,o=e[Math.floor(t)],a=e[Math.ceil(t+.01)],r=eb(e),i=Math.atan((a.y-o.y)/(a.x-o.x));let{x:l,y:s}=r;return Math.abs(i)<Math.PI/2?s-=15:l+=15,{x:l,y:s}}function eb(e){const t=e.length/2-1,o=e[Math.floor(t)],a=e[Math.ceil(t+.01)];return{x:o.x+(a.x-o.x)/2,y:o.y+(a.y-o.y)/2}}function ad(e){return e.waypoints?Qv(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+Zv.height/2}}function Do(e){return e&&!!e.labelTarget}var tb={width:0,height:0};function rd(e,t){function o(s,d){const c=s.label||s,f=s.labelTarget||s;return Xv(c,d,f!==c),[c,f]}function a(s){const{element:d,newLabel:c}=s,{businessObject:f}=d;if(!Do(d)&&ti(d)&&!od(d)&&!id(c)){let u=ad(d);u={x:u.x,y:u.y+7},e.createLabel(d,u,{id:f.id+"_label",businessObject:f})}}function r(s){return s.oldLabel=Na(s.element),o(s.element,s.newLabel)}function i(s){return o(s.element,s.oldLabel)}function l(s){const{element:d,newLabel:c}=s,f=d.label||d,p=s.hints||{};let{newBounds:u}=s;if(!Do(f))return;if(Do(f)&&id(c)){p.removeShape!==!1&&e.removeShape(f,{unsetLabel:!1});return}const h=Na(f);typeof u>"u"&&(u=t.getExternalLabelBounds(f,h)),u&&e.resizeShape(f,u,tb)}this.preExecute=a,this.execute=r,this.revert=i,this.postExecute=l}rd.$inject=["modeling","textRenderer"];function id(e){return!e||!e.trim()}function Io(e,t,o){Oe.call(this,e,t,o)}(0,rn.default)(Io,Oe),Io.$inject=["eventBus","elementFactory","commandStack"],Io.prototype.getHandlers=function(){const e=Oe.prototype.getHandlers.call(this);return e["element.updateLabel"]=rd,e},Io.prototype.updateLabel=function(e,t,o,a){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:o,hints:a||{}})};function ni(e,t){bt.call(this,e);function o(a){const{context:r}=a,i=r.hints||{};let l;!r.cropped&&i.createElementsBehavior!==!1&&(l=r.connection,l.waypoints=t.getCroppedWaypoints(l),r.cropped=!0)}this.executed(["connection.layout","connection.create"],o)}(0,rn.default)(ni,bt),ni.$inject=["eventBus","connectionDocking"];function ld(){}ld.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||tt(t.source||e.source),t.connectionEnd||tt(t.target||e.target)]};var ja=20,nb=5,Pa=Math.round,sd=20,ob={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function ab(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function rb(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function cd(e,t,o){var a=xn(t,e,nb),r=o.split(":")[0],i=Pa((t.x-e.x)/2+e.x),l=Pa((t.y-e.y)/2+e.y),s,d,c=rb(r,a),f=/h|r|l/.test(r),p=!1,u=!1;return c?(s=f?{x:i,y:e.y}:{x:e.x,y:l},d=f?"h:h":"v:v"):(p=ab(a,r),d=f?"h:v":"v:h",p?f?(u=l===e.y,s={x:e.x+ja*(/l/.test(r)?-1:1),y:u?l+ja:l}):(u=i===e.x,s={x:u?i+ja:i,y:e.y+ja*(/t/.test(r)?-1:1)}):s={x:i,y:l}),{waypoints:oi(e,s,d).concat(s),directions:d,turnNextDirections:u}}function ib(e,t,o){return cd(e,t,o)}function lb(e,t,o){var a=cd(t,e,dd(o));return{waypoints:a.waypoints.slice().reverse(),directions:dd(a.directions),turnNextDirections:a.turnNextDirections}}function sb(e,t){var o=e.directions.split(":")[1],a=t.directions.split(":")[0];e.turnNextDirections&&(o=o=="h"?"v":"h"),t.turnNextDirections&&(a=a=="h"?"v":"h");var r=o+":"+a;return{waypoints:oi(e.waypoints[e.waypoints.length-1],t.waypoints[0],r),directions:r}}function dd(e){return e.split(":").reverse().join(":")}function cb(e,t,o){var a=Pa((t.x-e.x)/2+e.x),r=Pa((t.y-e.y)/2+e.y);if(o==="h:v")return[{x:t.x,y:e.y}];if(o==="v:h")return[{x:e.x,y:t.y}];if(o==="h:h")return[{x:a,y:e.y},{x:a,y:t.y}];if(o==="v:v")return[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function oi(e,t,o){if(o=o||"h:h",!vb(o))throw new Error("unknown directions: <"+o+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(fd(o)){var a=ib(e,t,o),r=lb(e,t,o),i=sb(a,r);return[].concat(a.waypoints,i.waypoints,r.waypoints)}return cb(e,t,o)}function db(e,t,o){var a=oi(e,t,o);return a.unshift(e),a.push(t),hd(a)}function ub(e,t,o,a,r){var i=(0,R.without)(r&&r.preferredLayouts||[],"straight")[0]||"h:h",l=xn(e,t,ob[i]||0),s=yb(l,i);o=o||tt(e),a=a||tt(t);var d=s.split(":");return db(pd(o,e,d[0],bb(l)),pd(a,t,d[1],l),s)}function fb(e,t,o,a,r,i){(0,R.isArray)(o)&&(r=o,i=a,o=tt(e),a=tt(t)),i=(0,R.assign)({preferredLayouts:[]},i),r=r||[];var l=i.preferredLayouts.indexOf("straight")!==-1&&hb(e,t,o,a,i);return l||(l=i.connectionEnd&&mb(t,e,a,r),l)||(l=i.connectionStart&&gb(e,t,o,r),l)?l:!i.connectionStart&&!i.connectionEnd&&r&&r.length?r:ub(e,t,o,a,i)}function pb(e,t,o){return e>=t&&e<=o}function ud(e,t,o){return pb(t[e],o[e],o[e]+o[{x:"width",y:"height"}[e]])}function hb(e,t,o,a,r){var i={},l,s=xn(e,t);return/^(top|bottom|left|right)$/.test(s)?(/top|bottom/.test(s)&&(l="x"),/left|right/.test(s)&&(l="y"),r.preserveDocking==="target"?ud(l,a,e)?(i[l]=a[l],[{x:i.x!==void 0?i.x:o.x,y:i.y!==void 0?i.y:o.y,original:{x:i.x!==void 0?i.x:o.x,y:i.y!==void 0?i.y:o.y}},{x:a.x,y:a.y}]):null:ud(l,o,t)?(i[l]=o[l],[{x:o.x,y:o.y},{x:i.x!==void 0?i.x:a.x,y:i.y!==void 0?i.y:a.y,original:{x:i.x!==void 0?i.x:a.x,y:i.y!==void 0?i.y:a.y}}]):null):null}function gb(e,t,o,a){return ai(e,t,o,a)}function mb(e,t,o,a){var r=a.slice().reverse();return r=ai(e,t,o,r),r?r.reverse():null}function ai(e,t,o,a){function r(f){return f.length<3?!0:f.length>4?!1:!!(0,R.find)(f,function(p,u){var h=f[u-1];return h&&Vo(p,h)<3})}function i(f,p,u){switch(vn(p,f)){case"v":return{x:u.x,y:f.y};case"h":return{x:f.x,y:u.y}}return{x:f.x,y:f.y}}function l(f,p,u){var h;for(h=f.length-2;h!==0;h--)if(sc(f[h],p,sd)||sc(f[h],u,sd))return f.slice(h);return f}if(r(a))return null;var s=a[0],d=a.slice(),c;return d[0]=o,d[1]=i(d[1],s,o),c=l(d,e,t),c!==d&&(d=ai(e,t,o,c)),d&&vn(d)?null:d}function yb(e,t){if(fd(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function vb(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function fd(e){return e&&/t|r|b|l/.test(e)}function bb(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function pd(e,t,o,a){if(o==="h"&&(o=/left/.test(a)?"l":"r"),o==="v"&&(o=/top/.test(a)?"t":"b"),o==="t")return{original:e,x:e.x,y:t.y};if(o==="r")return{original:e,x:t.x+t.width,y:e.y};if(o==="b")return{original:e,x:e.x,y:t.y+t.height};if(o==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+o+">")}function hd(e){return e.reduce(function(t,o,a){var r=t[t.length-1],i=e[a+1];return Nr(r,i,o,0)||t.push(o),t},[])}function ri(){}(0,rn.default)(ri,ld);var $n=(e,t)=>e.type===t;ri.prototype.layoutConnection=function(e,t){t||(t={});const o=t.source||e.source,a=t.target||e.target,r=t.waypoints||e.waypoints;let{connectionStart:i,connectionEnd:l}=t,s,d;return l===void 0&&(i=Ha(r&&r[0],o),l=Ha(r&&r[r.length-1],a)),i||(i=Ha(r&&r[0],o)),l||(l=Ha(r&&r[r.length-1],a)),$n(e,"myline")&&(o===a?s={preferredLayouts:wb(o,e)}:$n(o,"gatewayAnd")||$n(o,"gatewayXor")||$n(o,"gatewayInclusive")?s={preferredLayouts:["v:h"]}:$n(a,"gatewayAnd")||$n(a,"gatewayXor")||$n(a,"gatewayInclusive")?s={preferredLayouts:["h:v"]}:s={preferredLayouts:["h:h"]}),s&&(s=Ge(s,t),d=hd(fb(o,a,i,l,r,s))),d||[i,l]};function Ha(e,t){return e?e.original||e:tt(t)}function wb(e,t){const{waypoints:o}=t,a=o&&o.length&&xn(o[0],e);return a==="top"?["t:r"]:a==="right"?["r:b"]:a==="left"?["l:t"]:["b:l"]}function gd(e){return(0,R.assign)({original:e.point.original||e.point},e.actual)}function Rn(e,t){this._elementRegistry=e,this._graphicsFactory=t}Rn.$inject=["elementRegistry","graphicsFactory"],Rn.prototype.getCroppedWaypoints=function(e,t,o){t=t||e.source,o=o||e.target;var a=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,o),i=e.waypoints.slice(a.idx+1,r.idx);return i.unshift(gd(a)),i.push(gd(r)),i},Rn.prototype.getDockingPoint=function(e,t,o){var a=e.waypoints,r=o?0:a.length-1,i=a[r];return{point:i,actual:this._getIntersection(t,e,o)||i,idx:r}},Rn.prototype._getIntersection=function(e,t,o){return zr(this._getShapePath(e),this._getConnectionPath(t),o)},Rn.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Rn.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Rn.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var md={__depends__:[Bv,Mv,io],__init__:["modeling","elementUpdater"],modeling:["type",Io],layouter:["type",ri],elementUpdater:["type",ni],elementFactory:["type",In],connectionDocking:["type",Rn]},Cb=1e3;function Wn(e,t){var o=this;t=t||Cb,e.on(["render.shape","render.connection"],t,function(a,r){var i=a.type,l=r.element,s=r.gfx,d=r.attrs;if(o.canRender(l))return i==="render.shape"?o.drawShape(s,l,d):o.drawConnection(s,l,d)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(a,r){if(o.canRender(r))return a.type==="render.getShapePath"?o.getShapePath(r):o.getConnectionPath(r)})}Wn.prototype.canRender=function(e){},Wn.prototype.drawShape=function(e,t){},Wn.prototype.drawConnection=function(e,t){},Wn.prototype.getShapePath=function(e){},Wn.prototype.getConnectionPath=function(e){};function xb(e){return e.businessObject}function za(e,t){return e.businessObject.strokeWidth||t||1}function Dt(e,t){return e.businessObject.fillColor||t||"var(--j-color-bg-container)"}function nt(e,t){return e.businessObject.strokeColor||t||"var(--j-color-text)"}function kb(e){const t=e.x+e.width/2,o=e.y+e.height/2,a=e.width/2;return Ro([["M",t,o],["m",0,-a],["a",a,a,0,1,1,0,2*a],["a",a,a,0,1,1,0,-2*a],["z"]])}function Sb(e,t){const{x:o,y:a,width:r,height:i}=e;return Ro([["M",o+t,a],["l",r-t*2,0],["a",t,t,0,0,1,t,t],["l",0,i-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-r,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-i],["a",t,t,0,0,1,t,-t],["z"]])}function Eb(e){const{x:t,y:o,width:a,height:r}=e,i=a/2,l=r/2;return Ro([["M",t+i,o],["l",i,l],["l",-i,l],["l",-i,-l],["z"]])}function _b(e){const{x:t,y:o,width:a,height:r}=e;return Ro([["M",t,o],["l",a,0],["l",0,r],["l",-a,0],["z"]])}var ii=10,li=.95,Tn=(e,t)=>e.type===t;function Un(e,t,o,a,r,i,l){Wn.call(this,e,l);const s="var(--j-color-bg-container)",d="var(--j-color-text)",c={};Object.keys(i.palette).forEach(A=>{const B=i.palette[A];c[B.type]=B.options});const{computeStyle:f}=t;function p(A){return j[A]}function u(A){return t.computeStyle(A,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2})}function h(A){return t.computeStyle(A,{strokeLinecap:"round",strokeLinejoin:"round",stroke:d,strokeWidth:2,fill:"white"})}function g(A,B,L,U){L=u(L);const te=_r(B,L,U);return(0,P.append)(A,te),te}function m(A,B,L){return g(A,B,L,5)}function w(A,B,L,U,te){nd(U)&&(te=U,U=0),U=U||0,te=f(te,{stroke:d,strokeWidth:2,fill:s}),te.fill==="none"&&delete te.fillOpacity;const se=B/2,I=L/2,$=(0,P.create)("circle");return(0,P.attr)($,{cx:se,cy:I,r:Math.round((B+L)/4-U)}),(0,P.attr)($,te),(0,P.append)(A,$),$}function k(A,B,L,U,te,se){nd(te)&&(se=te,te=0),te=te||0,se=f(se,{stroke:d,strokeWidth:2,fill:s});const I=(0,P.create)("rect");return(0,P.attr)(I,{x:te,y:te,width:B-te*2,height:L-te*2,rx:U,ry:U}),(0,P.attr)(I,se),(0,P.append)(A,I),I}function b(A,B,L){L=f(L,["no-fill"],{strokeWidth:2,stroke:d});const U=(0,P.create)("path");return(0,P.attr)(U,{d:B}),(0,P.attr)(U,L),(0,P.append)(A,U),U}function y(A,B,L,U){const te=B/2,se=L/2,I=[{x:te,y:0},{x:B,y:se},{x:te,y:L},{x:0,y:se}].map(Y=>Y.x+","+Y.y).join(" ");U=f(U,{stroke:d,strokeWidth:2,fill:s});const $=(0,P.create)("polygon");return(0,P.attr)($,{points:I}),(0,P.attr)($,U),(0,P.append)(A,$),$}function C(A,B,L,U){return b(B,L,Ge({"data-marker":A},U))}function S(A,B,L){L=Ge({size:{width:100}},L);const U=r.createText(B||"",L);return(0,P.classes)(U).add("djs-label"),(0,P.append)(A,U),U}function v(A,B,L){return S(A,xb(B).name,{box:B,align:L,padding:5,style:{fill:nt(B,d)}})}function x(A,B){const L={width:90,height:30,x:B.width/2+B.x,y:B.height/2+B.y};return S(A,Na(B),{box:L,fitBox:!0,style:Ge({},r.getExternalStyle(),{fill:nt(B,d)})})}function E(A,B,L){const U=L&&L.indexOf("SubProcessMarker")!==-1;let te;U?te={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:te={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},qv(L,se=>{p(se)(A,B,te)})}function _(A){return A.replace(/[^0-9a-zA-z]+/g,"_")}function T(A,B){const{ref:L={x:0,y:0},scale:U=1,element:te,parentGfx:se=a._svg}=B,I=(0,P.create)("marker",{id:A,viewBox:"0 0 20 20",refX:L.x,refY:L.y,markerWidth:20*U,markerHeight:20*U,orient:"auto"});(0,P.append)(I,te);let $=(0,G.query)(":scope > defs",se);$||($=(0,P.create)("defs"),(0,P.append)(se,$)),(0,P.append)($,I)}function V(A,B,L,U){const te=B+"-"+_(L)+"-"+_(U)+"-"+Nc();return N(A,te,B,L,U),"url(#"+te+")"}function N(A,B,L,U,te){L==="sequenceflow-end"&&T(B,{element:(0,P.create)("path",{d:"M 1 5 L 11 10 L 1 15 Z",...h({fill:te,stroke:te,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:A}),L==="messageflow-start"&&T(B,{element:(0,P.create)("circle",{cx:6,cy:6,r:3.5,...h({fill:U,stroke:te,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:A}),L==="messageflow-end"&&T(B,{element:(0,P.create)("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...h({fill:U,stroke:te,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:A}),L==="association-start"&&T(B,{element:(0,P.create)("path",{d:"M 11 5 L 1 10 L 11 15",...u({fill:"none",stroke:te,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:A}),L==="association-end"&&T(B,{element:(0,P.create)("path",{d:"M 1 5 L 11 10 L 1 15",...u({fill:"none",stroke:te,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:A}),L==="conditional-flow-marker"&&T(B,{element:(0,P.create)("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...h({fill:U,stroke:te})}),ref:{x:-1,y:10},scale:.5,parentGfx:A}),L==="conditional-default-flow-marker"&&T(B,{element:(0,P.create)("path",{d:"M 6 4 L 10 16",...h({stroke:te,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:A})}function z(A,B,L,U){const te=c[B.type]?.icon||B.icon;te&&b(A,o.getScaledPath(te,{abspos:{x:L,y:U}}),{strokeWidth:0,fill:nt(B,c[B.type]?.iconFill||B.iconFill)})}const j={event(A,B,L){return"fillOpacity"in L||(L.fillOpacity=li),w(A,B.width,B.height,L)},startEvent(A,B){const L={fill:Dt(B,c.startEvent?.fill||B.fill),stroke:nt(B,c.startEvent?.stroke||B.stroke),strokeWidth:za(B,c.startEvent?.strokeWidth||B.strokeWidth)},U=p("event")(A,B,L);return z(A,B,18,18),U},endEvent(A,B){const L=p("event")(A,B,{strokeWidth:za(B,c.endEvent?.strokeWidth||B.strokeWidth||4),fill:Dt(B,c.endEvent?.fill||B.fill),stroke:nt(B,c.endEvent?.stroke||B.stroke)});return z(A,B,18,18),L},gateway(A,B){const L={fillOpacity:li,strokeWidth:za(B,c[B.type]?.strokeWidth||B.strokeWidth||4),fill:Dt(B,c[B.type]?.fill||B.fill),stroke:nt(B,c[B.type]?.stroke||B.stroke)};return y(A,B.width,B.height,L)},gatewayAnd(A,B){const L=p("gateway")(A,B);return b(A,o.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:c[B.type]?.width||B.width,containerHeight:c[B.type]?.height||B.height,position:{mx:.47,my:.29}}),{strokeWidth:1,fill:nt(B,c[B.type]?.iconFill||B.iconFill),stroke:nt(B,c[B.type]?.iconFill||B.iconFill)}),L},gatewayXor(A,B){const L=p("gateway")(A,B);return b(A,o.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:B.width,containerHeight:B.height,position:{mx:.32,my:.3}}),{strokeWidth:1,fill:nt(B,c[B.type]?.iconFill||B.iconFill),stroke:nt(B,c[B.type]?.iconFill||B.iconFill)}),L},gatewayInclusive(A,B){const L=p("gateway")(A,B);return w(A,B.width,B.height,B.height*.24,{strokeWidth:2.5,fill:nt(B,s),stroke:nt(B,c[B.type]?.iconFill||B.iconFill)}),L},activity(A,B,L){return L=L||{},"fillOpacity"in L||(L.fillOpacity=li),k(A,B.width,B.height,ii,L)},task(A,B){const L={fill:Dt(B,s),stroke:nt(B,d)},U=p("activity")(A,B,L);return v(A,B,"center-middle"),E(A,B),U},userTask(A,B){const L=p("task")(A,B),U=15,te=12;return b(A,o.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:U,y:te}}),{strokeWidth:.5,fill:Dt(B,s),stroke:nt(B,d)}),b(A,o.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:U,y:te}}),{strokeWidth:.5,fill:Dt(B,s),stroke:nt(B,d)}),b(A,o.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:U,y:te}}),{strokeWidth:.5,fill:nt(B,d),stroke:nt(B,d)}),L},scriptTask(A,B){const L=p("task")(A,B);return b(A,o.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:nt(B,d)}),L},SubProcessMarker(A,B){Gt(k(A,14,14,0,{strokeWidth:1,fill:Dt(B,s),stroke:nt(B,d)}),B.width/2-7.5,B.height-20),C("sub-process",A,o.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:B.width,containerHeight:B.height,position:{mx:(B.width/2-7.5)/B.width,my:(B.height-20)/B.height}}),{fill:Dt(B,s),stroke:nt(B,d)})},subprocess(A,B,L){L=Ge({fill:Dt(B,s),stroke:nt(B,d)},L);const U=p("activity")(A,B,L);return v(A,B,"center-middle"),E(A,B,["SubProcessMarker"]),U},label(A,B){return x(A,B)},myline(A,B){const L=Dt(B,i.lineStroke||s),U=nt(B,i.lineStroke||d);return m(A,B.waypoints,{markerEnd:V(A,"sequenceflow-end",L,U),stroke:U})},default(A,B){const L={strokeWidth:za(B,c[B.type]?.strokeWidth||B.strokeWidth||1),fill:Dt(B,c[B.type]?.fill||B.fill),stroke:nt(B,c[B.type]?.stroke||B.stroke)},U=k(A,B.width,B.height,B.radius||ii,L);return v(A,B,"center-middle"),E(A,B),z(A,B,B.iconX,B.iconY),U}};this.handlers=j,this._drawPath=b}(0,rn.default)(Un,Wn),Un.$inject=["eventBus","styles","pathMap","canvas","textRenderer","myOptions"],Un.prototype.canRender=function(){return!0},Un.prototype.drawShape=function(e,t){const{type:o}=t;return(this.handlers[o]||this.handlers.default)(e,t)},Un.prototype.drawConnection=function(e,t){const{type:o}=t,a=this.handlers[o];return a(e,t)},Un.prototype.getShapePath=function(e){return Tn(e,"startEvent")||Tn(e,"endEvent")?kb(e):Tn(e,"userTask")||Tn(e,"scriptTask")||Tn(e,"subprocess")?Sb(e,ii):Tn(e,"gatewayAnd")||Tn(e,"gatewayXor")||Tn(e,"gatewayInclusive")?Eb(e):_b(e)};var Bb=0,Rb={width:150,height:50};function Tb(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function Vb(e){return(0,R.isObject)(e)?(0,R.assign)({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var si=null;function Mb(){return si||(si=document.createElement("canvas").getContext("2d")),si}function Ab(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(yd(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function yd(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function Nb(e,t){var o=Mb();if(!o)return{width:0,height:0};o.font=Ab(t),"letterSpacing"in o&&(o.letterSpacing=yd(t.letterSpacing)||"0px");var a=e==="",r=a?"dummy":e.replace(/\s+$/,""),i=o.measureText(r);return{width:a?0:i.width,height:"fontBoundingBoxAscent"in i?i.fontBoundingBoxAscent+i.fontBoundingBoxDescent:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent}}function jb(e,t,o){for(var a=e.shift(),r=a,i;;){if(i=Nb(r,o),i.width=r?i.width:0,r===" "||r===""||i.width<Math.round(t)||r.length<2)return Pb(e,r,a,i);r=zb(r,i.width,t)}}function Pb(e,t,o,a){if(t.length<o.length){var r=o.slice(t.length).trim();e.unshift(r)}return{width:a.width,height:a.height,text:t}}var vd="";function Hb(e,t){var o=e.split(/(\s|-|\u00AD)/g),a,r=[],i=0;if(o.length>1)for(;a=o.shift();)if(a.length+i<t)r.push(a),i+=a.length;else{(a==="-"||a===vd)&&r.pop();break}var l=r[r.length-1];return l&&l===vd&&(r[r.length-1]="-"),r.join("")}function zb(e,t,o){var a=Math.max(e.length*(o/t),1),r=Hb(e,a);return r||(r=e.slice(0,Math.max(Math.round(a-1),1))),r}function Oa(e){this._config=(0,R.assign)({},{size:Rb,padding:Bb,style:{},align:"center-top"},e||{})}Oa.prototype.createText=function(e,t){return this.layoutText(e,t).element},Oa.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Oa.prototype.layoutText=function(e,t){for(var o=(0,R.assign)({},this._config.size,t.box),a=(0,R.assign)({},this._config.style,t.style),r=Tb(t.align||this._config.align),i=Vb(t.padding!==void 0?t.padding:this._config.padding),l=t.fitBox||!1,s=Ob(a),d=e.split(/\u00AD?\r?\n/),c=[],f=o.width-i.left-i.right;d.length;)c.push(jb(d,f,a));r.vertical==="middle"&&(i.top=i.bottom=0);var p=(0,R.reduce)(c,function(m,w,k){return m+(s||w.height)},0)+i.top+i.bottom,u=(0,R.reduce)(c,function(m,w,k){return w.width>m?w.width:m},0),h=i.top;r.vertical==="middle"&&(h+=(o.height-p)/2),h-=(s||c[0].height)/4;var g=(0,P.create)("text");return(0,P.attr)(g,a),(0,R.forEach)(c,function(m){var w;switch(h+=s||m.height,r.horizontal){case"left":w=i.left;break;case"right":w=(l?u:f)-i.right-m.width;break;default:w=Math.max(((l?u:f)-m.width)/2+i.left,0)}var k=(0,P.create)("tspan");(0,P.attr)(k,{x:w,y:h}),k.textContent=m.text,(0,P.append)(g,k)}),{dimensions:{width:u,height:p},element:g}};function Ob(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var Lb=12,Db=1.2,Ib=30;function bd(e){const t=Ge({fontFamily:"Arial, sans-serif",fontSize:Lb,fontWeight:"normal",lineHeight:Db},e&&e.defaultStyle||{}),o=Ge({},t,{fontSize:parseInt(t.fontSize,10)-1},e&&e.externalStyle||{}),a=new Oa({style:t});this.getExternalLabelBounds=function(r,i){const l=a.getDimensions(i,{box:{width:90,height:30,x:r.width/2+r.x,y:r.height/2+r.y},style:o});return{x:Math.round(r.x+r.width/2-l.width/2),y:Math.round(r.y),width:Math.ceil(l.width),height:Math.ceil(l.height)}},this.getTextAnnotationBounds=function(r,i){const l=a.getDimensions(i,{box:r,style:t,align:"left-top",padding:5});return{x:r.x,y:r.y,width:r.width,height:Math.max(Ib,Math.round(l.height))}},this.createText=function(r,i){return a.createText(r,i||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return o}}bd.$inject=["config.textRenderer"];function Fb(){this.pathMap={GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,o){let a,r;o.abspos?(a=o.abspos.x,r=o.abspos.y):(a=o.containerWidth*o.position.mx,r=o.containerHeight*o.position.my);let i={};typeof t=="object"?(i=t,i.d.indexOf("{mx},{my}")===-1&&(i.d="m {mx},{my}"+i.d),i.width&&(a-=i.width/2),i.height&&(r-=i.height/2)):i=this.pathMap[t];const l={};if(o.position){const s=o.containerHeight/i.height*o.yScaleFactor,d=o.containerWidth/i.width*o.xScaleFactor;for(let c=0;c<i.heightElements.length;c++)l["y"+c]=i.heightElements[c]*s;for(let c=0;c<i.widthElements.length;c++)l["x"+c]=i.widthElements[c]*d}return Jb(i.d,{mx:a,my:r,e:l})}}var $b=/\{([^}]+)\}/g,Wb=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function Ub(e,t,o){let a=o;return t.replace(Wb,(r,i,l,s,d)=>{i=i||s,a&&(i in a&&(a=a[i]),typeof a=="function"&&d&&(a=a()))}),a=(a==null||a===o?e:a)+"",a}function Jb(e,t){return String(e).replace($b,(o,a)=>Ub(o,a,t))}var wd={__init__:["myRenderer"],myRenderer:["type",Un],textRenderer:["type",bd],pathMap:["type",Fb]};function Cd(e,t){return Ge({id:e.id,type:e.type,businessObject:e},t)}function Yb(e,t,o){const a=e.waypoint;return!a||a.length<2?[tt(t),tt(o)]:a.map(r=>({x:r.x,y:r.y}))}function Vn(e,t,o,a,r,i){this._eventBus=e,this._canvas=o,this._elementFactory=a,this._elementRegistry=r,this._translate=jc,this._textRenderer=i,this._modeling=t}Vn.$inject=["eventBus","modeling","canvas","elementFactory","elementRegistry","textRenderer"],Vn.prototype.add=function(e){let t;const{label:o}=e;if(o&&(o.id=e.id,o.name=e.name,delete e.label),e.type==="myline"){const a=this._getSource(e),r=this._getTarget(e);t=this._elementFactory.createConnection(Cd(e,{source:a,target:r,waypoints:Yb(e,a,r)})),this._canvas.addConnection(t)}else{const a=this._elementFactory._getDefaultSize(e.type);t=this._elementFactory.createShape(Cd(e,{x:Math.round(e.x),y:Math.round(e.y),width:a.width,height:a.height,isFrame:!1})),this._canvas.addShape(t)}return o&&t&&this.addLabel(o,t),t},Vn.prototype.addLabel=function(e,t){const o=this._elementFactory.createLabel({id:e.id+"_label",labelTarget:t,type:"label",x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),businessObject:e});return this._canvas.addShape(o,t.parent)},Vn.prototype.update=function(e,t){const o=this._elementRegistry.get(e);o.businessObject=Ge(o.businessObject,t),t.type==="myline"?(this._canvas.removeConnection(o),this._canvas.addConnection(o,o.parent)):(this._canvas.removeShape(o),this._canvas.addShape(o,o.parent));const a=this._elementRegistry.get(e+"_label");if(a)a.businessObject=o.businessObject,this._canvas.removeShape(a),this._canvas.addShape(a,o.parent);else{const{name:r}=t;if(r&&["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(t.type)){const i={x:t.x+12,y:t.y+42,width:10,height:10,name:r,id:e},l=this._textRenderer.getExternalLabelBounds(i,t.name);this._modeling.resizeShape(i,l,{width:0,height:0}),o&&this.addLabel(i,o)}}},Vn.prototype._getSource=function(e){return this._getElement(e.from)},Vn.prototype._getTarget=function(e){return this._getElement(e.to)},Vn.prototype._getElement=function(e){return this._elementRegistry.get(e)};var xd={myImporter:["type",Vn]},kd=e=>{const t=[];return e.forEach(o=>{if(o.type!==void 0){const a=o.businessObject;if(o.type==="myline")o.source&&o.target&&(a.from=o.source.id,a.to=o.target.id,a.waypoint=o.waypoints.map(r=>({x:r.x,y:r.y})),t.push(a));else if(o.type!=="label")a.x=o.x,a.y=o.y,t.push(a);else{const r=t.find(i=>i.id===a.id);r&&(r.name=a.name||"",r.label={x:o.x,y:o.y,height:o.height,width:o.width})}}}),t},Sd=(e,t)=>{const o=t.get("myImporter"),a=e.filter(i=>i.type!=="myline"),r=e.filter(i=>i.type==="myline");a.forEach(i=>{o.add(i)}),r.forEach(i=>{o.add(i)})},Gb=(0,n.defineComponent)({name:"JWorkflowViewer",__name:"workflow-viewer",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let s,d=1;const c=()=>{d=1,s.get("canvas").zoom("fit-viewport")},f=()=>{const v=s.get("eventBus");v.on("element.dblclick",x=>{r("elementDblclick",x.element.businessObject)}),v.on("element.click",x=>{r("elementClick",x.element.businessObject)})},p=function(){return{palette:a.paletteOptions||l,lineStroke:a.lineStroke}},u=()=>{let v={__init__:["myOptions"],myOptions:["type",p]};s=new oa.default({canvas:{container:i.value},modules:[Lr,lc,md,Bc,Vc,v,wd,xd]});const x=s.get("canvas"),E=s.get("elementFactory");c();const _=E.createRoot();x.setRootElement(_),f()};(0,n.onMounted)(()=>{u()});const h=v=>{const x=v==null?1:d+v;s.get("canvas").zoom(x),d=x},g=()=>(s.get("canvas").zoom(1),kd(s.get("elementRegistry").getAll())),m=v=>{s.clear(),c(),Sd(v,s)},w=v=>{s.get("myImporter").update(v.id,v)};return t({reset:()=>{c()},zoom:v=>{h(v)},getData:()=>g(),setData:v=>{m(v)},updateElemet:v=>{w(v)}}),(v,x)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"containerRef",ref:i,class:"j-work-flow"},null,512))}}),Kb=Gb;function ci(e){return e&&e[e.length-1]}function Ed(e){return e.y}function _d(e){return e.x}var qb={left:_d,center:_d,right:function(e){return e.x+e.width},top:Ed,middle:Ed,bottom:function(e){return e.y+e.height}};function ho(e,t){this._modeling=e,this._rules=t}ho.$inject=["modeling","rules"],ho.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],o="x",a="width";return t.indexOf(e)!==-1&&(o="y",a="height"),{axis:o,dimension:a}},ho.prototype._isType=function(e,t){return t.indexOf(e)!==-1},ho.prototype._alignmentPosition=function(e,t){var o=this._getOrientationDetails(e),a=o.axis,r=o.dimension,i={},l={},s=!1,d,c,f;function p(u,h){return Math.round((u[a]+h[a]+h[r])/2)}if(this._isType(e,["left","top"]))i[e]=t[0][a];else if(this._isType(e,["right","bottom"]))f=ci(t),i[e]=f[a]+f[r];else if(this._isType(e,["center","middle"])){if((0,R.forEach)(t,function(u){var h=u[a]+Math.round(u[r]/2);l[h]?l[h].elements.push(u):l[h]={elements:[u],center:h}}),d=(0,R.sortBy)(l,function(u){return u.elements.length>1&&(s=!0),u.elements.length}),s)return i[e]=ci(d).center,i;c=t[0],t=(0,R.sortBy)(t,function(u){return u[a]+u[r]}),f=ci(t),i[e]=p(c,f)}return i},ho.prototype.trigger=function(e,t){var o=this._modeling,a,r=(0,R.filter)(e,function(d){return!(d.waypoints||d.host||d.labelTarget)});if(a=this._rules.allowed("elements.align",{elements:r}),(0,R.isArray)(a)&&(r=a),!(r.length<2||!a)){var i=qb[t],l=(0,R.sortBy)(r,i),s=this._alignmentPosition(t,l);o.alignElements(l,s)}};var Xb={__init__:["alignElements"],alignElements:["type",ho]},La=Math.round,Zb=Math.max;function Qb(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function ew(e){var t=[];return e.forEach(function(o,a){t.push([a===0?"M":"L",o.x,o.y])}),t}var Bd=10;function tw(e,t){var o,a;for(o=0;a=e[o];o++)if(Vo(a,t)<=Bd)return{point:e[o],bendpoint:!0,index:o};return null}function nw(e,t){var o=mc(Qb(t,Bd),ew(e)),a=o[0],r=o[o.length-1],i;return a?a!==r?a.segment2!==r.segment2?(i=Zb(a.segment2,r.segment2)-1,{point:e[i],bendpoint:!0,index:i}):{point:{x:La(a.x+r.x)/2,y:La(a.y+r.y)/2},index:a.segment2}:{point:{x:La(a.x),y:La(a.y)},index:a.segment2}:null}function ow(e,t){return tw(e,t)||nw(e,t)}function aw(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function rw(e,t,o){var a=[{n:e[0]-o[0],lambda:t[0]},{n:e[1]-o[1],lambda:t[1]}],r=a[0].n*t[0]+a[1].n*t[1],i=a[0].lambda*t[0]+a[1].lambda*t[1];return-r/i}function Rd(e,t){var o=t[0],a=t[1],r={x:a.x-o.x,y:a.y-o.y},i=rw([o.x,o.y],[r.x,r.y],[e.x,e.y]);return{x:o.x+i*r.x,y:o.y+i*r.y}}function iw(e,t){var o=Rd(e,t);return aw({x:o.x-e.x,y:o.y-e.y})}var Td="djs-bendpoint",Vd="djs-segment-dragger";function lw(e,t){var o=ao(t),a=e._container.getBoundingClientRect(),r={x:a.left,y:a.top},i=e.viewbox();return{x:i.x+(o.x-r.x)/i.scale,y:i.y+(o.y-r.y)/i.scale}}function di(e,t,o){return ow(t,lw(e,o))}function ui(e,t){var o=(0,P.create)("g");(0,P.classes)(o).add(Td),(0,P.append)(e,o);var a=(0,P.create)("circle");(0,P.attr)(a,{cx:0,cy:0,r:4}),(0,P.classes)(a).add("djs-visual"),(0,P.append)(o,a);var r=(0,P.create)("circle");return(0,P.attr)(r,{cx:0,cy:0,r:10}),(0,P.classes)(r).add("djs-hit"),(0,P.append)(o,r),t&&(0,P.classes)(o).add(t),o}function sw(e,t,o,a){var r=(0,P.create)("g");(0,P.append)(e,r);var i=18,l=6,s=11,d=dw(t,o,a),c=l+s,f=(0,P.create)("rect");(0,P.attr)(f,{x:-i/2,y:-l/2,width:i,height:l}),(0,P.classes)(f).add("djs-visual"),(0,P.append)(r,f);var p=(0,P.create)("rect");return(0,P.attr)(p,{x:-d/2,y:-c/2,width:d,height:c}),(0,P.classes)(p).add("djs-hit"),(0,P.append)(r,p),Yy(r,a==="v"?90:0,0,0),r}function Md(e,t,o){var a=(0,P.create)("g"),r=jr(t,o),i=vn(t,o);return(0,P.append)(e,a),sw(a,t,o,i),(0,P.classes)(a).add(Vd),(0,P.classes)(a).add(i==="h"?"horizontal":"vertical"),Gt(a,r.x,r.y),a}function fi(e){return Math.abs(Math.round(e*2/3))}function cw(e,t){return Rd(e,uw(e,t))}function dw(e,t,o){var a=t.x-e.x,r=t.y-e.y;return fi(o==="h"?a:r)}function uw(e,t){for(var o=t.waypoints,a=1/0,r,i=0;i<o.length-1;i++){var l=o[i],s=o[i+1],d=iw(e,[l,s]);d<a&&(a=d,r=i)}return[o[r],o[r+1]]}function pi(e){return CSS.escape(e)}function Ad(e,t,o,a,r){function i(y,C,S){var v=y.index,x=y.point,E,_,T,V,N,z;return v<=0||y.bendpoint?!1:(E=C[v-1],_=C[v],T=jr(E,_),V=vn(E,_),N=Math.abs(x.x-T.x),z=Math.abs(x.y-T.y),V&&N<=S&&z<=S)}function l(y,C){var S=y.waypoints,v,x,E,_;return C.index<=0||C.bendpoint||(v={start:S[C.index-1],end:S[C.index]},x=vn(v.start,v.end),!x)?null:(x==="h"?E=v.end.x-v.start.x:E=v.end.y-v.start.y,_=fi(E)/2,_)}function s(y,C){var S=C.waypoints,v=di(t,S,y),x;if(v)return x=l(C,v),i(v,S,x)?r.start(y,C,v.index):a.start(y,C,v.index,!v.bendpoint),!0}function d(y,C,S){G.event.bind(y,C,function(v){o.triggerMouseEvent(C,v,S),v.stopPropagation()})}function c(y,C){var S=t.getLayer("overlays"),v=(0,G.query)('.djs-bendpoints[data-element-id="'+pi(y.id)+'"]',S);return!v&&C&&(v=(0,P.create)("g"),(0,P.attr)(v,{"data-element-id":y.id}),(0,P.classes)(v).add("djs-bendpoints"),(0,P.append)(S,v),d(v,"mousedown",y),d(v,"click",y),d(v,"dblclick",y)),v}function f(y,C){return(0,G.query)('.djs-segment-dragger[data-segment-idx="'+y+'"]',C)}function p(y,C){C.waypoints.forEach(function(S,v){var x=ui(y);(0,P.append)(y,x),Gt(x,S.x,S.y)}),ui(y,"floating")}function u(y,C){for(var S=C.waypoints,v,x,E,_=1;_<S.length;_++)v=S[_-1],x=S[_],vn(v,x)&&(E=Md(y,v,x),(0,P.attr)(E,{"data-segment-idx":_}),d(E,"mousemove",C))}function h(y){(0,R.forEach)((0,G.queryAll)("."+Td,y),function(C){(0,P.remove)(C)})}function g(y){(0,R.forEach)((0,G.queryAll)("."+Vd,y),function(C){(0,P.remove)(C)})}function m(y){var C=c(y);return C||(C=c(y,!0),p(C,y),u(C,y)),C}function w(y){var C=c(y);C&&(g(C),h(C),u(C,y),p(C,y))}function k(y,C){var S=(0,G.query)(".floating",y),v=C.point;S&&Gt(S,v.x,v.y)}function b(y,C,S){var v=f(C.index,y),x=S[C.index-1],E=S[C.index],_=C.point,T=jr(x,E),V=vn(x,E),N,z;v&&(N=fw(v),z={x:_.x-T.x,y:_.y-T.y},V==="v"&&(z={x:z.y,y:z.x}),Gt(N,z.x,z.y))}e.on("connection.changed",function(y){w(y.element)}),e.on("connection.remove",function(y){var C=c(y.element);C&&(0,P.remove)(C)}),e.on("element.marker.update",function(y){var C=y.element,S;C.waypoints&&(S=m(C),y.add?(0,P.classes)(S).add(y.marker):(0,P.classes)(S).remove(y.marker))}),e.on("element.mousemove",function(y){var C=y.element,S=C.waypoints,v,x;if(S){if(v=c(C,!0),x=di(t,S,y.originalEvent),!x)return;k(v,x),x.bendpoint||b(v,x,S)}}),e.on("element.mousedown",function(y){if(mn(y)){var C=y.originalEvent,S=y.element;if(S.waypoints)return s(C,S)}}),e.on("selection.changed",function(y){var C=y.newSelection[0];C&&C.waypoints&&m(C)}),e.on("element.hover",function(y){var C=y.element;C.waypoints&&(m(C),o.registerEvent(y.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(y){o.unregisterEvent(y.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(y){var C=y.element,S=y.newId;if(C.waypoints){var v=c(C);v&&(0,P.attr)(v,{"data-element-id":S})}}),this.addHandles=m,this.updateHandles=w,this.getBendpointsContainer=c,this.getSegmentDragger=f}Ad.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function fw(e){return(0,G.query)(".djs-visual",e)}var Nd=Math.round,Jn="reconnectStart",Yn="reconnectEnd",Fo="updateWaypoints";function hi(e,t,o,a,r,i){this._injector=e,this.start=function(l,s,d,c){var f=o.getGraphics(s),p=s.source,u=s.target,h=s.waypoints,g;!c&&d===0?g=Jn:!c&&d===h.length-1?g=Yn:g=Fo;var m=g===Fo?"connection.updateWaypoints":"connection.reconnect",w=r.allowed(m,{connection:s,source:p,target:u});w===!1&&(w=r.allowed(m,{connection:s,source:u,target:p})),w!==!1&&a.init(l,"bendpoint.move",{data:{connection:s,connectionGfx:f,context:{allowed:w,bendpointIndex:d,connection:s,source:p,target:u,insert:c,type:g}}})},t.on("bendpoint.move.hover",function(l){var s=l.context,d=s.connection,c=d.source,f=d.target,p=l.hover,u=s.type;s.hover=p;var h;if(p){var g=u===Fo?"connection.updateWaypoints":"connection.reconnect";if(h=s.allowed=r.allowed(g,{connection:d,source:u===Jn?p:c,target:u===Yn?p:f}),h){s.source=u===Jn?p:c,s.target=u===Yn?p:f;return}h===!1&&(h=s.allowed=r.allowed(g,{connection:d,source:u===Yn?p:f,target:u===Jn?p:c})),h&&(s.source=u===Yn?p:f,s.target=u===Jn?p:c)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(l){var s=l.context,d=s.type;s.hover=null,s.source=null,s.target=null,d!==Fo&&(s.allowed=!1)}),t.on("bendpoint.move.end",function(l){var s=l.context,d=s.allowed,c=s.bendpointIndex,f=s.connection,p=s.insert,u=f.waypoints.slice(),h=s.source,g=s.target,m=s.type,w=s.hints||{},k={x:Nd(l.x),y:Nd(l.y)};if(!d)return!1;m===Fo?(p?u.splice(c,0,k):u[c]=k,w.bendpointMove={insert:p,bendpointIndex:c},u=this.cropWaypoints(f,u),i.updateWaypoints(f,yv(u),w)):(m===Jn?(w.docking="source",Da(s)&&(w.docking="target",w.newWaypoints=u.reverse())):m===Yn&&(w.docking="target",Da(s)&&(w.docking="source",w.newWaypoints=u.reverse())),i.reconnect(f,h,g,k,w))},this)}hi.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],hi.prototype.cropWaypoints=function(e,t){var o=this._injector.get("connectionDocking",!1);if(!o)return t;var a=e.waypoints;return e.waypoints=t,e.waypoints=o.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=a,t};function Da(e){var t=e.hover,o=e.source,a=e.target,r=e.type;if(r===Jn)return t&&a&&t===a&&o!==a;if(r===Yn)return t&&o&&t===o&&o!==a}var pw="reconnectStart",hw="reconnectEnd",jd="updateWaypoints",$o="connect-ok",Ia="connect-not-ok",Pd="connect-hover",Hd="djs-updating",zd="djs-dragging",Od=1100;function Ld(e,t,o,a){this._injector=t;var r=t.get("connectionPreview",!1);o.on("bendpoint.move.start",function(i){var l=i.context,s=l.bendpointIndex,d=l.connection,c=l.insert,f=d.waypoints,p=f.slice();l.waypoints=f,c&&p.splice(s,0,{x:i.x,y:i.y}),d.waypoints=p,(0,P.classes)(l.draggerGfx=ui(a.getLayer("overlays"))).add("djs-dragging"),a.addMarker(d,zd),a.addMarker(d,Hd)}),o.on("bendpoint.move.hover",function(i){var l=i.context,s=l.allowed,d=l.hover,c=l.type;if(d){if(a.addMarker(d,Pd),c===jd)return;s?(a.removeMarker(d,Ia),a.addMarker(d,$o)):s===!1&&(a.removeMarker(d,$o),a.addMarker(d,Ia))}}),o.on(["bendpoint.move.out","bendpoint.move.cleanup"],Od,function(i){var l=i.context,s=l.hover,d=l.target;s&&(a.removeMarker(s,Pd),a.removeMarker(s,d?$o:Ia))}),o.on("bendpoint.move.move",function(i){var l=i.context,s=l.allowed,d=l.bendpointIndex,c=l.draggerGfx,f=l.hover,p=l.type,u=l.connection,h=u.source,g=u.target,m=u.waypoints.slice(),w={x:i.x,y:i.y},k=l.hints||{},b={};r&&(k.connectionStart&&(b.connectionStart=k.connectionStart),k.connectionEnd&&(b.connectionEnd=k.connectionEnd),p===pw?Da(l)?(b.connectionEnd=b.connectionEnd||w,b.source=g,b.target=f||h,m=m.reverse()):(b.connectionStart=b.connectionStart||w,b.source=f||h,b.target=g):p===hw?Da(l)?(b.connectionStart=b.connectionStart||w,b.source=f||g,b.target=h,m=m.reverse()):(b.connectionEnd=b.connectionEnd||w,b.source=h,b.target=f||g):(b.noCropping=!0,b.noLayout=!0,m[d]=w),p===jd&&(m=e.cropWaypoints(u,m)),b.waypoints=m,r.drawPreview(l,s,b)),Gt(c,i.x,i.y)},this),o.on(["bendpoint.move.end","bendpoint.move.cancel"],Od,function(i){var l=i.context,s=l.connection,d=l.draggerGfx,c=l.hover,f=l.target;s.waypoints=l.waypoints,(0,P.remove)(d),a.removeMarker(s,Hd),a.removeMarker(s,zd),c&&(a.removeMarker(c,$o),a.removeMarker(c,f?$o:Ia)),r&&r.cleanUp(l)})}Ld.$inject=["bendpointMove","injector","eventBus","canvas"];var Dd="connect-hover",Id="djs-updating";function Fd(e,t,o){return gi(e,t,e[t]+o)}function gi(e,t,o){return{x:t==="x"?o:e.x,y:t==="y"?o:e.y}}function gw(e,t,o,a){var r=Math.max(t[a],o[a]),i=Math.min(t[a],o[a]),l=20;return gi(t,a,Math.min(Math.max(i+l,e[a]),r-l))}function $d(e){return e==="x"?"y":"x"}function Wd(e,t,o){var a,r;return e.original?e.original:(a=tt(t),r=$d(o),gi(e,r,a[r]))}function Ud(e,t,o,a,r,i){var l=e.get("connectionDocking",!1);this.start=function(p,u,h){var g,m=o.getGraphics(u),w=h-1,k=h,b=u.waypoints,y=b[w],C=b[k],S=di(o,b,p),v=vn(y,C),x,E;v&&(x=v==="v"?"x":"y",w===0&&(y=Wd(y,u.source,x)),k===b.length-1&&(C=Wd(C,u.target,x)),S?E=S.point:E={x:(y.x+C.x)/2,y:(y.y+C.y)/2},g={connection:u,segmentStartIndex:w,segmentEndIndex:k,segmentStart:y,segmentEnd:C,axis:x,dragPosition:E},a.init(p,E,"connectionSegment.move",{cursor:x==="x"?"resize-ew":"resize-ns",data:{connection:u,connectionGfx:m,context:g}}))};function s(p,u){if(!l)return u;var h=p.waypoints,g;return p.waypoints=u,g=l.getCroppedWaypoints(p),p.waypoints=h,g}function d(p){r.update("connection",p.connection,p.connectionGfx)}function c(p,u,h){var g=p.newWaypoints,m=g[p.segmentStartIndex+u],w=g[p.segmentEndIndex+u],k=gw(h,m,w,$d(p.axis));Gt(p.draggerGfx,k.x,k.y)}function f(p,u){var h=0;return{waypoints:p.filter(function(g,m){return Nr(p[m-1],p[m+1],g)?(h=m<=u?h-1:h,!1):!0}),segmentOffset:h}}t.on("connectionSegment.move.start",function(p){var u=p.context,h=p.connection,g=o.getLayer("overlays");u.originalWaypoints=h.waypoints.slice(),u.draggerGfx=Md(g,u.segmentStart,u.segmentEnd),(0,P.classes)(u.draggerGfx).add("djs-dragging"),o.addMarker(h,Id)}),t.on("connectionSegment.move.move",function(p){var u=p.context,h=u.connection,g=u.segmentStartIndex,m=u.segmentEndIndex,w=u.segmentStart,k=u.segmentEnd,b=u.axis,y=u.originalWaypoints.slice(),C=Fd(w,b,p["d"+b]),S=Fd(k,b,p["d"+b]),v=y.length,x=0;y[g]=C,y[m]=S;var E,_;g<2&&(E=xn(h.source,C),g===1?E==="intersect"&&(y.shift(),y[0]=C,x--):E!=="intersect"&&(y.unshift(w),x++)),m>v-3&&(_=xn(h.target,S),m===v-2?_==="intersect"&&(y.pop(),y[y.length-1]=S):_!=="intersect"&&y.push(k)),u.newWaypoints=h.waypoints=s(h,y),c(u,x,p),u.newSegmentStartIndex=g+x,d(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,o.addMarker(p.hover,Dd)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var u=p.context.hover;u&&o.removeMarker(u,Dd)}),t.on("connectionSegment.move.cleanup",function(p){var u=p.context,h=u.connection;u.draggerGfx&&(0,P.remove)(u.draggerGfx),o.removeMarker(h,Id)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var u=p.context,h=u.connection;h.waypoints=u.originalWaypoints,d(p)}),t.on("connectionSegment.move.end",function(p){var u=p.context,h=u.connection,g=u.newWaypoints,m=u.newSegmentStartIndex;g=g.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var w=f(g,m),k=w.waypoints,b=s(h,k),y=w.segmentOffset,C={segmentMove:{segmentStartIndex:u.segmentStartIndex,newSegmentStartIndex:m+y}};i.updateWaypoints(h,b,C)})}Ud.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var mw=Math.abs,Jd=Math.round;function yw(e,t,o){o=o===void 0?10:o;var a,r;for(a=0;a<t.length;a++)if(r=t[a],mw(r-e)<=o)return r}function vw(e){return{x:e.x,y:e.y}}function bw(e){return{x:e.x+e.width,y:e.y+e.height}}function go(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Jd(e.x+e.width/2),y:Jd(e.y+e.height/2)}}function Fa(e,t){var o=e.snapped;return o?typeof t=="string"?o[t]:o.x&&o.y:!1}function dn(e,t,o){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof o!="number"&&o!==!1)throw new Error("value must be Number or false");var a,r=e[t],i=e.snapped=e.snapped||{};return o===!1?i[t]=!1:(i[t]=!0,a=o-r,e[t]+=a,e["d"+t]+=a),r}function Yd(e){return e.children||[]}var ww=Math.abs,Gd=Math.round,mi=10;function Kd(e){function t(i,l){if((0,R.isArray)(i)){for(var s=i.length;s--;)if(ww(i[s]-l)<=mi)return i[s]}else{i=+i;var d=l%i;if(d<mi)return l-d;if(d>i-mi)return l-d+i}return l}function o(i,l){if(i.waypoints)return cw(l,i);if(i.width)return{x:Gd(i.width/2+i.x),y:Gd(i.height/2+i.y)}}function a(i){var l=i.context,s=l.snapPoints,d=l.connection,c=d.waypoints,f=l.segmentStart,p=l.segmentStartIndex,u=l.segmentEnd,h=l.segmentEndIndex,g=l.axis;if(s)return s;var m=[c[p-1],f,u,c[h+1]];return p<2&&m.unshift(o(d.source,i)),h>c.length-3&&m.unshift(o(d.target,i)),l.snapPoints=s={horizontal:[],vertical:[]},(0,R.forEach)(m,function(w){w&&(w=w.original||w,g==="y"&&s.horizontal.push(w.y),g==="x"&&s.vertical.push(w.x))}),s}e.on("connectionSegment.move.move",1500,function(i){var l=a(i),s=i.x,d=i.y,c,f;if(l){c=t(l.vertical,s),f=t(l.horizontal,d);var p=s-c,u=d-f;(0,R.assign)(i,{dx:i.dx-p,dy:i.dy-u,x:c,y:f}),(p||l.vertical.indexOf(s)!==-1)&&dn(i,"x",c),(u||l.horizontal.indexOf(d)!==-1)&&dn(i,"y",f)}});function r(i){var l=i.snapPoints,s=i.connection.waypoints,d=i.bendpointIndex;if(l)return l;var c=[s[d-1],s[d+1]];return i.snapPoints=l={horizontal:[],vertical:[]},(0,R.forEach)(c,function(f){f&&(f=f.original||f,l.horizontal.push(f.y),l.vertical.push(f.x))}),l}e.on(["connect.hover","connect.move","connect.end"],1500,function(i){var l=i.context.hover,s=l&&o(l,i);!_t(l)||!s||!s.x||!s.y||(dn(i,"x",s.x),dn(i,"y",s.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var l=i.context,s=r(l),d=l.hover,c=d&&o(d,i),f=i.x,p=i.y,u,h;if(s){u=t(c?s.vertical.concat([c.x]):s.vertical,f),h=t(c?s.horizontal.concat([c.y]):s.horizontal,p);var g=f-u,m=p-h;(0,R.assign)(i,{dx:i.dx-g,dy:i.dy-m,x:i.x-g,y:i.y-m}),(g||s.vertical.indexOf(f)!==-1)&&dn(i,"x",u),(m||s.horizontal.indexOf(p)!==-1)&&dn(i,"y",h)}})}Kd.$inject=["eventBus"];var Cw={__depends__:[Ln,co],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",Ad],bendpointMove:["type",hi],bendpointMovePreview:["type",Ld],connectionSegmentMove:["type",Ud],bendpointSnapping:["type",Kd]},xw="djs-dragger";function un(e,t,o,a){this._canvas=t,this._graphicsFactory=o,this._elementFactory=a,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}un.$inject=["injector","canvas","graphicsFactory","elementFactory"],un.prototype.drawPreview=function(e,t,o){o=o||{};var a=e.connectionPreviewGfx,r=e.getConnection,i=o.source,l=o.target,s=o.waypoints,d=o.connectionStart,c=o.connectionEnd,f=o.noLayout,p=o.noCropping,u=o.noNoop,h,g=this;if(a||(a=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),(0,P.clear)(a),r||(r=e.getConnection=kw(function(m,w,k){return g.getConnection(m,w,k)})),t&&(h=r(t,i,l)),!h){!u&&this.drawNoopPreview(a,o);return}h.waypoints=s||[],this._layouter&&!f&&(h.waypoints=this._layouter.layoutConnection(h,{source:i,target:l,connectionStart:d,connectionEnd:c,waypoints:o.waypoints||h.waypoints})),(!h.waypoints||!h.waypoints.length)&&(h.waypoints=[i?tt(i):d,l?tt(l):c]),this._connectionDocking&&(i||l)&&!p&&(h.waypoints=this._connectionDocking.getCroppedWaypoints(h,i,l)),this._graphicsFactory.drawConnection(a,h,{stroke:"var(--element-dragger-color)"})},un.prototype.drawNoopPreview=function(e,t){var o=t.source,a=t.target,r=t.connectionStart||tt(o),i=t.connectionEnd||tt(a),l=this.cropWaypoints(r,i,o,a);(0,P.append)(e,this.createNoopConnection(l[0],l[1]))},un.prototype.cropWaypoints=function(e,t,o,a){var r=this._graphicsFactory,i=o&&r.getShapePath(o),l=a&&r.getShapePath(a),s=r.getConnectionPath({waypoints:[e,t]});return e=o&&zr(i,s,!0)||e,t=a&&zr(l,s,!1)||t,[e,t]},un.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&(0,P.remove)(e.connectionPreviewGfx)},un.prototype.getConnection=function(e){var t=Sw(e);return this._elementFactory.createConnection(t)},un.prototype.createConnectionPreviewGfx=function(){var e=(0,P.create)("g");return(0,P.attr)(e,{pointerEvents:"none"}),(0,P.classes)(e).add(xw),(0,P.append)(this._canvas.getActiveLayer(),e),e},un.prototype.createNoopConnection=function(e,t){return _r([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function kw(e){var t={};return function(o){var a=JSON.stringify(o),r=t[a];return r||(r=t[a]=e.apply(null,arguments)),r}}function Sw(e){return(0,R.isObject)(e)?e:{}}var Ew={__init__:["connectionPreview"],connectionPreview:["type",un]},_w=new va("ov"),Bw=500;function ht(e,t,o,a){this._eventBus=t,this._canvas=o,this._elementRegistry=a,this._ids=_w,this._overlayDefaults=(0,R.assign)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=Rw(o.getContainer()),this._init()}ht.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ht.prototype.get=function(e){if((0,R.isString)(e)&&(e={id:e}),(0,R.isString)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?(0,R.filter)(t.overlays,(0,R.matchPattern)({type:e.type})):t.overlays.slice():[]}else return e.type?(0,R.filter)(this._overlays,(0,R.matchPattern)({type:e.type})):e.id?this._overlays[e.id]:null},ht.prototype.add=function(e,t,o){if((0,R.isObject)(t)&&(o=t,t=null),e.id||(e=this._elementRegistry.get(e)),!o.position)throw new Error("must specifiy overlay position");if(!o.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var a=this._ids.next();return o=(0,R.assign)({},this._overlayDefaults,o,{id:a,type:t,element:e,html:o.html}),this._addOverlay(o),a},ht.prototype.remove=function(e){var t=this.get(e)||[];(0,R.isArray)(t)||(t=[t]);var o=this;(0,R.forEach)(t,function(a){var r=o._getOverlayContainer(a.element,!0);if(a&&((0,G.remove)(a.html),(0,G.remove)(a.htmlContainer),delete a.htmlContainer,delete a.element,delete o._overlays[a.id]),r){var i=r.overlays.indexOf(a);i!==-1&&r.overlays.splice(i,1)}})},ht.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},ht.prototype.show=function(){$a(this._overlayRoot)},ht.prototype.hide=function(){$a(this._overlayRoot,!1)},ht.prototype.clear=function(){this._overlays={},this._overlayContainers=[],(0,G.clear)(this._overlayRoot)},ht.prototype._updateOverlayContainer=function(e){var t=e.element,o=e.html,a=t.x,r=t.y;if(t.waypoints){var i=Yt(t);a=i.x,r=i.y}qd(o,a,r),(0,G.attr)(e.html,"data-container-id",t.id)},ht.prototype._updateOverlay=function(e){var t=e.position,o=e.htmlContainer,a=e.element,r=t.left,i=t.top;if(t.right!==void 0){var l;a.waypoints?l=Yt(a).width:l=a.width,r=t.right*-1+l}if(t.bottom!==void 0){var s;a.waypoints?s=Yt(a).height:s=a.height,i=t.bottom*-1+s}qd(o,r||0,i||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ht.prototype._createOverlayContainer=function(e){var t=(0,G.domify)('<div class="djs-overlays" />');(0,G.assignStyle)(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var o={html:t,element:e,overlays:[]};return this._updateOverlayContainer(o),this._overlayContainers.push(o),o},ht.prototype._updateRoot=function(e){var t=e.scale||1,o="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Xd(this._overlayRoot,o)},ht.prototype._getOverlayContainer=function(e,t){var o=(0,R.find)(this._overlayContainers,function(a){return a.element===e});return!o&&!t?this._createOverlayContainer(e):o},ht.prototype._addOverlay=function(e){var t=e.id,o=e.element,a=e.html,r,i;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),(0,R.isString)(a)&&(a=(0,G.domify)(a)),i=this._getOverlayContainer(o),r=(0,G.domify)('<div class="djs-overlay" data-overlay-id="'+t+'">'),(0,G.assignStyle)(r,{position:"absolute"}),r.appendChild(a),e.type&&(0,G.classes)(r).add("djs-overlay-"+e.type);var l=this._canvas.findRoot(o),s=this._canvas.getRootElement();$a(r,l===s),e.htmlContainer=r,i.overlays.push(e),i.html.appendChild(r),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ht.prototype._updateOverlayVisibilty=function(e,t){var o=e.show,a=this._canvas.findRoot(e.element),r=o&&o.minZoom,i=o&&o.maxZoom,l=e.htmlContainer,s=this._canvas.getRootElement(),d=!0;(a!==s||o&&((0,R.isDefined)(r)&&r>t.scale||(0,R.isDefined)(i)&&i<t.scale))&&(d=!1),$a(l,d),this._updateOverlayScale(e,t)},ht.prototype._updateOverlayScale=function(e,t){var o=e.scale,a,r,i=e.htmlContainer,l,s="";o!==!0&&(o===!1?(a=1,r=1):(a=o.min,r=o.max),(0,R.isDefined)(a)&&t.scale<a&&(l=(1/t.scale||1)*a),(0,R.isDefined)(r)&&t.scale>r&&(l=(1/t.scale||1)*r)),(0,R.isDefined)(l)&&(s="scale("+l+","+l+")"),Xd(i,s)},ht.prototype._updateOverlaysVisibilty=function(e){var t=this;(0,R.forEach)(this._overlays,function(o){t._updateOverlayVisibilty(o,e)})},ht.prototype._init=function(){var e=this._eventBus,t=this;function o(a){t._updateRoot(a),t._updateOverlaysVisibilty(a),t.show()}e.on("canvas.viewbox.changing",function(a){t.hide()}),e.on("canvas.viewbox.changed",function(a){o(a.viewbox)}),e.on(["shape.remove","connection.remove"],function(a){var r=a.element;(0,R.forEach)(t.get({element:r}),function(s){t.remove(s.id)});var i=t._getOverlayContainer(r);if(i){(0,G.remove)(i.html);var l=t._overlayContainers.indexOf(i);l!==-1&&t._overlayContainers.splice(l,1)}}),e.on("element.changed",Bw,function(a){var r=a.element,i=t._getOverlayContainer(r,!0);i&&((0,R.forEach)(i.overlays,function(l){t._updateOverlay(l)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(a){var r=t._getOverlayContainer(a.element,!0);r&&(0,G.classes)(r.html)[a.add?"add":"remove"](a.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function Rw(e){var t=(0,G.domify)('<div class="djs-overlay-container" />');return(0,G.assignStyle)(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function qd(e,t,o){(0,G.assignStyle)(e,{left:t+"px",top:o+"px"})}function $a(e,t){e.style.display=t===!1?"none":""}function Xd(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(o){e.style[o+"transform"]=t})}var Tw={__init__:["overlays"],overlays:["type",ht]},Vw=new va;function mo(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}mo.$inject=["eventBus"],mo.prototype.schedule=function(e,t=Vw.next()){this.cancel(t);const o=this._schedule(e,t);return this._scheduled[t]=o,o.promise},mo.prototype._schedule=function(e,t){const o=Mw();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{o.resolve(e())}catch(a){o.reject(a)}}catch(a){console.error("Scheduler#_schedule execution failed",a)}}),promise:o.promise}},mo.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},mo.prototype._cancel=function(e){clearTimeout(e.executionId)};function Mw(){const e={};return e.promise=new Promise((t,o)=>{e.resolve=t,e.reject=o}),e}var Aw={scheduler:["type",mo]},Nw="djs-element-hidden",Wa=".entry",jw=1e3,Zd=8,Pw=300;function rt(e,t,o,a){this._canvas=e,this._elementRegistry=t,this._eventBus=o,this._scheduler=a,this._current=null,this._init()}rt.$inject=["canvas","elementRegistry","eventBus","scheduler"],rt.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var o=t.newSelection,a=o.length?o.length===1?o[0]:o:null;a?e.open(a,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var o=t.elements,a=e._current;if(a){var r=a.target,i=(0,R.isArray)(r)?r:[r];if(i.filter(function(s){return o.includes(s)}).length){e.close();var l=i.filter(function(s){return e._elementRegistry.get(s.id)});l.length&&e._updateAndOpen(l.length>1?l:l[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var o=t.element,a=e._current;((0,R.isArray)(a.target)?a.target:[a.target]).includes(o)&&e._updateVisibility()}}),this._container=this._createContainer()},rt.prototype._createContainer=function(){var e=(0,G.domify)('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},rt.prototype.registerProvider=function(e,t){t||(t=e,e=jw),this._eventBus.on("contextPad.getProviders",e,function(o){o.providers.push(t)})},rt.prototype.getEntries=function(e){var t=this._getProviders(),o=(0,R.isArray)(e)?"getMultiElementContextPadEntries":"getContextPadEntries",a={};return(0,R.forEach)(t,function(r){if((0,R.isFunction)(r[o])){var i=r[o](e);(0,R.isFunction)(i)?a=i(a):(0,R.forEach)(i,function(l,s){a[s]=l})}}),a},rt.prototype.trigger=function(e,t,o){var a=this,r,i,l=t.delegateTarget||t.target;if(!l)return t.preventDefault();if(r=(0,G.attr)(l,"data-action"),i=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){a._mouseout=a.triggerEntry(r,"hover",i,o)},Pw);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(r,e,i,o)},rt.prototype.triggerEntry=function(e,t,o,a){if(this.isShown()){var r=this._current.target,i=this._current.entries[e];if(i){var l=i.action;if(this._eventBus.fire("contextPad.trigger",{entry:i,event:o})!==!1){if((0,R.isFunction)(l)){if(t==="click")return l(o,r,a)}else if(l[t])return l[t](o,r,a);o.preventDefault()}}}},rt.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},rt.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},rt.prototype._updateAndOpen=function(e){var t=this.getEntries(e),o=this._createHtml(e),a;(0,R.forEach)(t,function(r,i){var l=r.group||"default",s=(0,G.domify)(r.html||'<div class="entry" draggable="true"></div>'),d;(0,G.attr)(s,"data-action",i),d=(0,G.query)("[data-group="+pi(l)+"]",o),d||(d=(0,G.domify)('<div class="group"></div>'),(0,G.attr)(d,"data-group",l),o.appendChild(d)),d.appendChild(s),r.className&&Hw(s,r.className),r.title&&(0,G.attr)(s,"title",r.title),r.imageUrl&&(a=(0,G.domify)("<img>"),(0,G.attr)(a,"src",r.imageUrl),a.style.width="100%",a.style.height="100%",s.appendChild(a))}),(0,G.classes)(o).add("open"),this._current={entries:t,html:o,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},rt.prototype._createHtml=function(e){var t=this,o=(0,G.domify)('<div class="djs-context-pad"></div>');return G.delegate.bind(o,Wa,"click",function(a){t.trigger("click",a)}),G.delegate.bind(o,Wa,"dragstart",function(a){t.trigger("dragstart",a)}),G.delegate.bind(o,Wa,"mouseover",function(a){t.trigger("mouseover",a)}),G.delegate.bind(o,Wa,"mouseout",function(a){t.trigger("mouseout",a)}),G.event.bind(o,"mousedown",function(a){a.stopPropagation()}),this._container.appendChild(o),this._eventBus.fire("contextPad.create",{target:e,pad:o}),o},rt.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&Ow(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},rt.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},rt.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var o=t.target;return(0,R.isArray)(e)!==(0,R.isArray)(o)?!1:(0,R.isArray)(e)?e.length===o.length&&(0,R.every)(e,function(a){return o.includes(a)}):o===e},rt.prototype.isShown=function(){return this.isOpen()&&(0,G.classes)(this._current.html).has("open")},rt.prototype.show=function(){this.isOpen()&&((0,G.classes)(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},rt.prototype.hide=function(){this.isOpen()&&((0,G.classes)(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},rt.prototype._getPosition=function(e){if(!(0,R.isArray)(e)&&_t(e)){var t=this._canvas.viewbox(),o=zw(e),a=o.x*t.scale-t.x*t.scale,r=o.y*t.scale-t.y*t.scale;return{left:a+Zd*this._canvas.zoom(),top:r}}var i=this._canvas.getContainer().getBoundingClientRect(),l=this._getTargetBounds(e);return{left:l.right-i.left+Zd*this._canvas.zoom(),top:l.top-i.top}},rt.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,o=this._getPosition(this._current.target);"x"in o&&"y"in o?(t.style.left=o.x+"px",t.style.top=o.y+"px"):["top","right","bottom","left"].forEach(function(a){a in o&&(t.style[a]=o[a]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},rt.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,o=this._current.target;((0,R.isArray)(o)?o:[o]).some(function(a){return t._canvas.hasMarker(a,Nw)})?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},rt.prototype._getTargetBounds=function(e){var t=this;return((0,R.isArray)(e)?e:[e]).map(function(o){return t._canvas.getGraphics(o)}).reduce(function(o,a){const r=a.getBoundingClientRect();return o.top=Math.min(o.top,r.top),o.right=Math.max(o.right,r.right),o.bottom=Math.max(o.bottom,r.bottom),o.left=Math.min(o.left,r.left),o.x=o.left,o.y=o.top,o.width=o.right-o.left,o.height=o.bottom-o.top,o},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function Hw(e,t){var o=(0,G.classes)(e);t=(0,R.isArray)(t)?t:t.split(/\s+/g),t.forEach(function(a){o.add(a)})}function zw(e){return e.waypoints[e.waypoints.length-1]}function Ow(e,t){return e=(0,R.isArray)(e)?e:[e],t=(0,R.isArray)(t)?t:[t],e.length===t.length&&(0,R.every)(e,function(o){return t.includes(o)})}var Lw={__depends__:[Br,Aw,Tw],contextPad:["type",rt]},Dw=250;function Gn(e){this._eventBus=e,this._tools=[],this._active=null}Gn.$inject=["eventBus"],Gn.prototype.registerTool=function(e,t){var o=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);o.push(e),this.bindEvents(e,t)},Gn.prototype.isActive=function(e){return e&&this._active===e},Gn.prototype.length=function(e){return this._tools.length},Gn.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Gn.prototype.bindEvents=function(e,t){var o=this._eventBus,a=[];o.on(t.tool+".init",function(r){if(!r.context.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),(0,R.forEach)(t,function(r){a.push(r+".ended"),a.push(r+".canceled")}),o.on(a,Dw,function(r){this._active&&(Iw(r)||this.setActive(null))},this)};function Iw(e){var t=e.originalEvent&&e.originalEvent.target;return t&&(0,G.closest)(t,'.group[data-group="tools"]')}var yi={__depends__:[Ln],__init__:["toolManager"],toolManager:["type",Gn]};function vi(e){var t=this;this._lastMoveEvent=null;function o(a){t._lastMoveEvent=a}e.on("canvas.init",function(a){(t._svg=a.svg).addEventListener("mousemove",o)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",o)})}vi.$inject=["eventBus"],vi.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||Fw(0,0)};function Fw(e,t){var o=document.createEvent("MouseEvent"),a=e,r=t,i=e,l=t;return o.initMouseEvent&&o.initMouseEvent("mousemove",!0,!0,window,0,a,r,i,l,!1,!1,!1,!1,0,null),o}var bi={__init__:["mouse"],mouse:["type",vi]},wi=1500,Qd="grab";function yo(e,t,o,a,r,i){this._dragging=o,this._mouse=i;var l=this,s=a.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",wi,function(d){if(Ps(d))return l.activateMove(d.originalEvent,!0),!1}),s&&s.addListener(wi,function(d){if(!(!eu(d.keyEvent)||l.isActive())){var c=l._mouse.getLastMoveEvent();l.activateMove(c,!!c)}},"keyboard.keydown"),s&&s.addListener(wi,function(d){!eu(d.keyEvent)||!l.isActive()||l.toggle()},"keyboard.keyup"),e.on("hand.end",function(d){var c=d.originalEvent.target;if(!d.hover&&!(c instanceof SVGElement))return!1;e.once("hand.ended",function(){l.activateMove(d.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(d){var c=t.viewbox().scale;t.scroll({dx:d.dx*c,dy:d.dy*c})}),e.on("hand.move.end",function(d){var c=d.context.reactivate;return!Ps(d)&&c&&e.once("hand.move.ended",function(f){l.activateHand(f.originalEvent,!0,!0)}),!1})}yo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],yo.prototype.activateMove=function(e,t,o){typeof t=="object"&&(o=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Qd,data:{context:o||{}}})},yo.prototype.activateHand=function(e,t,o){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Qd,data:{context:{reactivate:o}}})},yo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},yo.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function eu(e){return Ys("Space",e)}var $w={__depends__:[yi,bi],__init__:["handTool"],handTool:["type",yo]},tu="crosshair",nu="selected",Ww="djs-dragging-active-lasso";function Mn(e,t,o,a,r,i,l){this._selection=r,this._dragging=o,this._mouse=l;var s=this,d={create:function(p){var u=t.getActiveLayer(),h=p.frame=(0,P.create)("rect");(0,P.attr)(h,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),(0,P.append)(u,h),c(!0),this.update(p)},update:function(p){var u=p.frame,h=p.bbox;u&&h&&(0,P.attr)(u,{x:h.x,y:h.y,width:h.width,height:h.height});var g=p.marked,m=p.lastMarked;if(g&&m){for(const w of m)g.has(w)||t.removeMarker(w,nu);for(const w of g)m.has(w)||t.addMarker(w,nu)}},remove:function(p){this.update(p),p.frame&&(0,P.remove)(p.frame),c(!1)}};function c(p){(0,P.classes)(t.getContainer()).toggle(Ww,p)}function f(p){var u=a.getAll();return new Set((0,R.values)(Zs(u,p)))}i.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(p){var u=p.originalEvent.target;!p.hover&&!(u instanceof SVGElement)||e.once("lasso.selection.ended",function(){s.activateLasso(p.originalEvent,!0)})}),e.on("lasso.end",0,function(p){var u=p.context;s._select(Array.from(u.marked))}),e.on("lasso.start",function(p){var u=p.context;u.bbox=ou(p),u.add=kr(p),u.lastMarked=new Set(r.get()),u.add?u.marked=u.lastMarked:u.marked=new Set,u.initialMarked=u.marked,d.create(u)}),e.on("lasso.move",function(p){var u=p.context,h=f(u.bbox=ou(p)),g=u.initialMarked.union(h);u.lastMarked=u.marked,u.marked=g,d.update(u)}),e.on("lasso.cleanup",function(p){var u=p.context;u.lastMarked=u.marked,u.marked=new Set(r.get()),d.remove(p.context)}),e.on("element.mousedown",1500,function(p){if(kr(p))return s.activateLasso(p.originalEvent),!0})}Mn.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Mn.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:tu,data:{context:{}},keepSelection:!0})},Mn.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:tu,data:{context:{}},keepSelection:!0})},Mn.prototype._select=function(e){this._selection.select(e)},Mn.prototype.select=function(e,t,o=[]){var a=(0,R.values)(Zs(e,t));this._select([...o,...a])},Mn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Mn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function ou(e){var t={x:e.x-e.dx,y:e.y-e.dy},o={x:e.x,y:e.y},a;return t.x<=o.x&&t.y<o.y||t.x<o.x&&t.y<=o.y?a={x:t.x,y:t.y,width:o.x-t.x,height:o.y-t.y}:t.x>=o.x&&t.y<o.y||t.x>o.x&&t.y<=o.y?a={x:o.x,y:t.y,width:t.x-o.x,height:o.y-t.y}:t.x<=o.x&&t.y>o.y||t.x<o.x&&t.y>=o.y?a={x:t.x,y:o.y,width:o.x-t.x,height:t.y-o.y}:t.x>=o.x&&t.y>o.y||t.x>o.x&&t.y>=o.y?a={x:o.x,y:o.y,width:t.x-o.x,height:t.y-o.y}:a={x:o.x,y:o.y,width:0,height:0},a}var Uw={__depends__:[yi,bi],__init__:["lassoTool"],lassoTool:["type",Mn]},au="connect-ok",ru="connect-not-ok";function vo(e,t,o,a,r,i,l){var s=this;this._dragging=t,this._rules=i,this._mouse=l,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(d){var c=d.context,f=d.hover,p=c.canStartConnect=s.canStartConnect(f);p!==null&&(c.startTarget=f,a.addMarker(f,p?au:ru))}),e.on(["global-connect.out","global-connect.cleanup"],function(d){var c=d.context.startTarget,f=d.context.canStartConnect;c&&a.removeMarker(c,f?au:ru)}),e.on(["global-connect.ended"],function(d){var c=d.context.startTarget,f={x:d.x,y:d.y};if(s.canStartConnect(c))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),o.start(null,c,f)}),!1})}vo.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],vo.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},vo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},vo.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},vo.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var Jw={__depends__:[Lr,co,Ln,yi,bi],globalConnect:["type",vo]},Yw=500,Gw=1e3;function Kn(e,t){this._eventBus=e,this.offset=5;var o=t.cls("djs-outline",["no-fill"]),a=this;function r(i){var l=(0,P.create)("rect");return(0,P.attr)(l,(0,R.assign)({x:0,y:0,rx:4,width:100,height:100},o)),l}e.on(["shape.added","shape.changed"],Yw,function(i){var l=i.element,s=i.gfx,d=(0,G.query)(".djs-outline",s);d||(d=a.getOutline(l)||r(s),(0,P.append)(s,d)),a.updateShapeOutline(d,l)}),e.on(["connection.added","connection.changed"],function(i){var l=i.element,s=i.gfx,d=(0,G.query)(".djs-outline",s);d||(d=r(s),(0,P.append)(s,d)),a.updateConnectionOutline(d,l)})}Kn.prototype.updateShapeOutline=function(e,t){var o=!1,a=this._getProviders();a.length&&(0,R.forEach)(a,function(r){o=o||r.updateOutline(t,e)}),o||(0,P.attr)(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},Kn.prototype.updateConnectionOutline=function(e,t){var o=Yt(t);(0,P.attr)(e,{x:o.x-this.offset,y:o.y-this.offset,width:o.width+this.offset*2,height:o.height+this.offset*2})},Kn.prototype.registerProvider=function(e,t){t||(t=e,e=Gw),this._eventBus.on("outline.getProviders",e,function(o){o.providers.push(t)})},Kn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Kn.prototype.getOutline=function(e){var t;return(0,R.forEach)(this._getProviders(),function(o){(0,R.isFunction)(o.getOutline)&&(t=t||o.getOutline(e))}),t},Kn.$inject=["eventBus","styles","elementRegistry"];var Ua=6;function Ci(e,t,o){this._canvas=t;var a=this;e.on("element.changed",function(r){o.isSelected(r.element)&&a._updateMultiSelectionOutline(o.get())}),e.on("selection.changed",function(r){var i=r.newSelection;a._updateMultiSelectionOutline(i)})}Ci.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");(0,P.clear)(t);var o=e.length>1;if((0,P.classes)(this._canvas.getContainer())[o?"add":"remove"]("djs-multi-select"),!!o){var a=Kw(Yt(e)),r=(0,P.create)("rect");(0,P.attr)(r,(0,R.assign)({rx:3},a)),(0,P.classes)(r).add("djs-selection-outline"),(0,P.append)(t,r)}},Ci.$inject=["eventBus","canvas","selection"];function Kw(e){return{x:e.x-Ua,y:e.y-Ua,width:e.width+Ua*2,height:e.height+Ua*2}}var iu={__depends__:[io],__init__:["outline","multiSelectionOutline"],outline:["type",Kn],multiSelectionOutline:["type",Ci]},qw=500,Xw=1250,Zw=1500,Ja=Math.round;function Qw(e){return{x:e.x+Ja(e.width/2),y:e.y+Ja(e.height/2)}}function lu(e,t,o,a,r){function i(s,d,c,f){return r.allowed("elements.move",{shapes:s,delta:d,position:c,target:f})}e.on("shape.move.start",Zw,function(s){var d=s.context,c=s.shape,f=a.get().slice();f.indexOf(c)===-1&&(f=[c]),f=eC(f),(0,R.assign)(d,{shapes:f,validatedShapes:f,shape:c})}),e.on("shape.move.start",Xw,function(s){var d=s.context,c=d.validatedShapes;if(!(d.canExecute=i(c)))return!1}),e.on("shape.move.move",qw,function(s){var d=s.context,c=d.validatedShapes,f=s.hover,p={x:s.dx,y:s.dy},u=i(c,p,{x:s.x,y:s.y},f);if(d.delta=p,d.canExecute=u,u===null){d.target=null;return}d.target=f}),e.on("shape.move.end",function(s){var d=s.context,c=d.delta,f=d.canExecute,p=f==="attach",u=d.shapes;if(f===!1)return!1;c.x=Ja(c.x),c.y=Ja(c.y),!(c.x===0&&c.y===0)&&o.moveElements(u,c,d.target,{primaryShape:d.shape,attach:p})}),e.on("element.mousedown",function(s){if(mn(s)){var d=oo(s);if(!d)throw new Error("must supply DOM mousedown event");return l(d,s.element)}});function l(s,d,c,f){if((0,R.isObject)(c)&&(f=c,c=!1),!(d.waypoints||!d.parent)&&!(0,P.classes)(s.target).has("djs-hit-no-move")){var p=Qw(d);return t.init(s,p,"shape.move",{cursor:"grabbing",autoActivate:c,data:{shape:d,context:f||{}}}),!0}}this.start=l}lu.$inject=["eventBus","dragging","modeling","selection","rules"];function eC(e){var t=(0,R.groupBy)(e,"id");return(0,R.filter)(e,function(o){for(;o=o.parent;)if(t[o.id])return!1;return!0})}var su=499,xi="djs-dragging",cu="drop-ok",du="drop-not-ok",uu="new-parent",fu="attach-ok";function pu(e,t,o,a){function r(d){return tC(i(d))}function i(d){var c=Dy(d,!0),f=c.flatMap(u=>(u.incoming||[]).concat(u.outgoing||[])),p=c.concat(f);return[...new Set(p)]}function l(d,c){[fu,cu,du,uu].forEach(function(f){f===c?t.addMarker(d,f):t.removeMarker(d,f)})}function s(d,c,f){a.addDragger(c,d.dragGroup),f&&t.addMarker(c,xi),d.allDraggedElements?d.allDraggedElements.push(c):d.allDraggedElements=[c]}e.on("shape.move.start",su,function(d){var c=d.context,f=c.shapes,p=c.allDraggedElements,u=r(f);if(!c.dragGroup){var h=(0,P.create)("g");(0,P.attr)(h,o.cls("djs-drag-group",["no-events"])),(0,P.append)(t.getActiveLayer(),h),c.dragGroup=h}u.forEach(function(g){a.addDragger(g,c.dragGroup)}),p?p=(0,R.flatten)([p,i(f)]):p=i(f),(0,R.forEach)(p,function(g){t.addMarker(g,xi)}),c.allDraggedElements=p,c.differentParents=nC(f)}),e.on("shape.move.move",su,function(d){var c=d.context,f=c.dragGroup,p=c.target,u=c.shape.parent,h=c.canExecute;p&&(h==="attach"?l(p,fu):c.canExecute&&u&&p.id!==u.id?l(p,uu):l(p,c.canExecute?cu:du)),Gt(f,d.dx,d.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(d){var c=d.context.target;c&&l(c,null)}),e.on("shape.move.cleanup",function(d){var c=d.context,f=c.allDraggedElements,p=c.dragGroup;(0,R.forEach)(f,function(u){t.removeMarker(u,xi)}),p&&(0,P.remove)(p)}),this.makeDraggable=s}pu.$inject=["eventBus","canvas","styles","previewSupport"];function tC(e){return(0,R.filter)(e,function(t){return _t(t)?(0,R.find)(e,(0,R.matchPattern)({id:t.source.id}))&&(0,R.find)(e,(0,R.matchPattern)({id:t.target.id})):!0})}function nC(e){return(0,R.size)((0,R.groupBy)(e,function(t){return t.parent&&t.parent.id}))!==1}var oC={__depends__:[Br,io,iu,co,Ln,Vr],__init__:["move","movePreview"],move:["type",lu],movePreview:["type",pu]},hu=".djs-palette-toggle",gu=".entry",aC=hu+", "+gu,ki="djs-palette-",rC="shown",Si="open",mu="two-column",iC=1e3;function it(e,t){this._eventBus=e,this._canvas=t;var o=this;e.on("tool-manager.update",function(a){var r=a.tool;o.updateToolHighlight(r)}),e.on("i18n.changed",function(){o._update()}),e.on("diagram.init",function(){o._diagramInitialized=!0,o._rebuild()})}it.$inject=["eventBus","canvas"],it.prototype.registerProvider=function(e,t){t||(t=e,e=iC),this._eventBus.on("palette.getProviders",e,function(o){o.providers.push(t)}),this._rebuild()},it.prototype.getEntries=function(){return this._getProviders().reduce(sC,{})},it.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},it.prototype._init=function(){var e=this,t=this._eventBus,o=this._getParentContainer(),a=this._container=(0,G.domify)(it.HTML_MARKUP);o.appendChild(a),(0,G.classes)(o).add(ki+rC),G.delegate.bind(a,aC,"click",function(r){var i=r.delegateTarget;if((0,G.matches)(i,hu))return e.toggle();e.trigger("click",r)}),G.event.bind(a,"mousedown",function(r){r.stopPropagation()}),G.delegate.bind(a,gu,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:a})},it.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},it.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),o=this._container,a=this._eventBus,r,i=(0,G.classes)(o),l=(0,G.classes)(t);"twoColumn"in e?r=e.twoColumn:r=this._needsCollapse(t.clientHeight,this._entries||{}),i.toggle(mu,r),l.toggle(ki+mu,r),"open"in e&&(i.toggle(Si,e.open),l.toggle(ki+Si,e.open)),a.fire("palette.changed",{twoColumn:r,open:this.isOpen()})},it.prototype._update=function(){var e=(0,G.query)(".djs-palette-entries",this._container),t=this._entries=this.getEntries();(0,G.clear)(e),(0,R.forEach)(t,function(o,a){var r=o.group||"default",i=(0,G.query)("[data-group="+pi(r)+"]",e);i||(i=(0,G.domify)('<div class="group"></div>'),(0,G.attr)(i,"data-group",r),e.appendChild(i));var l=(0,G.domify)(o.html||(o.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'));if(i.appendChild(l),!o.separator&&((0,G.attr)(l,"data-action",a),o.title&&(0,G.attr)(l,"title",o.title),o.className&&lC(l,o.className),o.imageUrl)){var s=(0,G.domify)("<img>");(0,G.attr)(s,"src",o.imageUrl),l.appendChild(s)}}),this.open()},it.prototype.trigger=function(e,t,o){var a,r,i=t.delegateTarget||t.target;return i?(a=(0,G.attr)(i,"data-action"),r=t.originalEvent||t,this.triggerEntry(a,e,r,o)):t.preventDefault()},it.prototype.triggerEntry=function(e,t,o,a){var r=this._entries[e],i;if(r&&(i=r.action,this._eventBus.fire("palette.trigger",{entry:r,event:o})!==!1)){if((0,R.isFunction)(i)){if(t==="click")return i(o,a)}else if(i[t])return i[t](o,a);o.preventDefault()}},it.prototype._layoutChanged=function(){this._toggleState({})},it.prototype._needsCollapse=function(e,t){return e<Object.keys(t).length*46+50},it.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},it.prototype.open=function(){this._toggleState({open:!0})},it.prototype.toggle=function(){this.isOpen()?this.close():this.open()},it.prototype.isActiveTool=function(e){return e&&this._activeTool===e},it.prototype.updateToolHighlight=function(e){var t,o;this._toolsContainer||(t=(0,G.query)(".djs-palette-entries",this._container),this._toolsContainer=(0,G.query)("[data-group=tools]",t)),o=this._toolsContainer,(0,R.forEach)(o.children,function(a){var r=a.getAttribute("data-action");if(r){var i=(0,G.classes)(a);r=r.replace("-tool",""),i.contains("entry")&&r===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}})},it.prototype.isOpen=function(){return(0,G.classes)(this._container).has(Si)},it.prototype._getParentContainer=function(){return this._canvas.getContainer()},it.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function lC(e,t){var o=(0,G.classes)(e);((0,R.isArray)(t)?t:t.split(/\s+/g)).forEach(function(a){o.add(a)})}function sC(e,t){var o=t.getPaletteEntries();return(0,R.isFunction)(o)?o(e):((0,R.forEach)(o,function(a,r){e[r]=a}),e)}var cC={__init__:["palette"],palette:["type",it]};function yu(e,t,o,a){e.on("element.changed",function(r){var i=r.element;(i.parent||i===t.getRootElement())&&(r.gfx=o.getGraphics(i)),r.gfx&&e.fire(Fy(i)+".changed",r)}),e.on("elements.changed",function(r){var i=r.elements;i.forEach(function(l){e.fire("element.changed",{element:l})}),a.updateContainments(i)}),e.on("shape.changed",function(r){a.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){a.update("connection",r.element,r.gfx)})}yu.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var dC={__init__:["changeSupport"],changeSupport:["type",yu]},Ya=Math.max,Ga=Math.min,uC=20;function fC(e,t,o){var a=o.x,r=o.y,i={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(i.y=e.y+r,i.height=e.height-r):t.indexOf("s")!==-1&&(i.height=e.height+r),t.indexOf("e")!==-1?i.width=e.width+a:t.indexOf("w")!==-1&&(i.x=e.x+a,i.width=e.width-a),i}function Ka(e,t,o){var a=t[e],r=o.min&&o.min[e],i=o.max&&o.max[e];return(0,R.isNumber)(r)&&(a=(/top|left/.test(e)?Ga:Ya)(a,r)),(0,R.isNumber)(i)&&(a=(/top|left/.test(e)?Ya:Ga)(a,i)),a}function pC(e,t){if(!t)return e;var o=De(e);return Cc({top:Ka("top",o,t),right:Ka("right",o,t),bottom:Ka("bottom",o,t),left:Ka("left",o,t)})}function hC(e,t,o,a){var r=De(t),i={top:/n/.test(e)?r.bottom-o.height:r.top,left:/w/.test(e)?r.right-o.width:r.left,bottom:/s/.test(e)?r.top+o.height:r.bottom,right:/e/.test(e)?r.left+o.width:r.right},l=a?De(a):i;return Cc({top:Ga(i.top,l.top),left:Ga(i.left,l.left),bottom:Ya(i.bottom,l.bottom),right:Ya(i.right,l.right)})}function Wo(e,t){return typeof e<"u"?e:uC}function gC(e,t){var o,a,r,i;return typeof t=="object"?(o=Wo(t.left),a=Wo(t.right),r=Wo(t.top),i=Wo(t.bottom)):o=a=r=i=Wo(t),{x:e.x-o,y:e.y-r,width:e.width+o+a,height:e.height+r+i}}function mC(e){return!(e.waypoints||e.type==="label")}function yC(e,t){var o;if(e.length===void 0?o=(0,R.filter)(e.children,mC):o=e,o.length)return gC(Yt(o),t)}var vu=10;function Uo(e,t,o,a){this._dragging=a,this._rules=t;var r=this;function i(d,c){var f=d.shape,p=d.direction,u=d.resizeConstraints,h;d.delta=c,h=fC(f,p,c),d.newBounds=pC(h,u),d.canExecute=r.canResize(d)}function l(d){var c=d.resizeConstraints,f=d.minBounds;c===void 0&&(f===void 0&&(f=r.computeMinResizeBox(d)),d.resizeConstraints={min:De(f)})}function s(d){var c=d.shape,f=d.canExecute,p=d.newBounds;if(f){if(p=pv(p),!vC(c,p))return;o.resizeShape(c,p)}}e.on("resize.start",function(d){l(d.context)}),e.on("resize.move",function(d){var c={x:d.dx,y:d.dy};i(d.context,c)}),e.on("resize.end",function(d){s(d.context)})}Uo.prototype.canResize=function(e){var t=this._rules,o=(0,R.pick)(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",o)},Uo.prototype.activate=function(e,t,o){var a=this._dragging,r,i;if(typeof o=="string"&&(o={direction:o}),r=(0,R.assign)({shape:t},o),i=r.direction,!i)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");a.init(e,bu(t,i),"resize",{autoActivate:!0,cursor:bC(i),data:{shape:t,context:r}})},Uo.prototype.computeMinResizeBox=function(e){var t=e.shape,o=e.direction;return hC(o,t,e.minDimensions||{width:vu,height:vu},yC(t,e.childrenBoxPadding))},Uo.$inject=["eventBus","rules","modeling","dragging"];function vC(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function bu(e,t){var o=tt(e),a=De(e),r={x:o.x,y:o.y};return t.indexOf("n")!==-1?r.y=a.top:t.indexOf("s")!==-1&&(r.y=a.bottom),t.indexOf("e")!==-1?r.x=a.right:t.indexOf("w")!==-1&&(r.x=a.left),r}function bC(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var wu="djs-resizing",Cu="resize-not-ok",wC=500;function xu(e,t,o){function a(i){var l=i.shape,s=i.newBounds,d=i.frame;d||(d=i.frame=o.addFrame(l,t.getActiveLayer()),t.addMarker(l,wu)),s.width>5&&(0,P.attr)(d,{x:s.x,width:s.width}),s.height>5&&(0,P.attr)(d,{y:s.y,height:s.height}),i.canExecute?(0,P.classes)(d).remove(Cu):(0,P.classes)(d).add(Cu)}function r(i){var l=i.shape;i.frame&&(0,P.remove)(i.frame),t.removeMarker(l,wu)}e.on("resize.move",wC,function(i){a(i.context)}),e.on("resize.cleanup",function(i){r(i.context)})}xu.$inject=["eventBus","canvas","previewSupport"];var qa=-6,Xa=8,Za=20,Jo="djs-resizer",CC=["n","w","s","e","nw","ne","se","sw"];function An(e,t,o,a){this._resize=a,this._canvas=t;var r=this;e.on("selection.changed",function(i){var l=i.newSelection;r.removeResizers(),l.length===1&&(0,R.forEach)(l,(0,R.bind)(r.addResizer,r))}),e.on("shape.changed",function(i){var l=i.element;o.isSelected(l)&&(r.removeResizers(),r.addResizer(l))})}An.prototype.makeDraggable=function(e,t,o){var a=this._resize;function r(i){mn(i)&&a.activate(i,e,o)}G.event.bind(t,"mousedown",r),G.event.bind(t,"touchstart",r)},An.prototype._createResizer=function(e,t,o,a){var r=this._getResizersParent(),i=xC(a),l=(0,P.create)("g");(0,P.classes)(l).add(Jo),(0,P.classes)(l).add(Jo+"-"+e.id),(0,P.classes)(l).add(Jo+"-"+a),(0,P.append)(r,l);var s=(0,P.create)("rect");(0,P.attr)(s,{x:-Xa/2+i.x,y:-Xa/2+i.y,width:Xa,height:Xa}),(0,P.classes)(s).add(Jo+"-visual"),(0,P.append)(l,s);var d=(0,P.create)("rect");return(0,P.attr)(d,{x:-Za/2+i.x,y:-Za/2+i.y,width:Za,height:Za}),(0,P.classes)(d).add(Jo+"-hit"),(0,P.append)(l,d),Jy(l,t,o),l},An.prototype.createResizer=function(e,t){var o=bu(e,t),a=this._createResizer(e,o.x,o.y,t);this.makeDraggable(e,a,t)},An.prototype.addResizer=function(e){var t=this;_t(e)||!this._resize.canResize({shape:e})||(0,R.forEach)(CC,function(o){t.createResizer(e,o)})},An.prototype.removeResizers=function(){(0,P.clear)(this._getResizersParent())},An.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},An.$inject=["eventBus","canvas","selection","resize"];function xC(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-qa:e.indexOf("w")!==-1&&(t.x=qa),e.indexOf("s")!==-1?t.y=-qa:e.indexOf("n")!==-1&&(t.y=qa),t}var kC={__depends__:[co,Ln,Vr],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Uo],resizePreview:["type",xu],resizeHandles:["type",An]};function Yo(e,t,o,a,r,i){this._canvas=t,this._modeling=a,this._textRenderer=i,o.registerProvider(this),e.on("element.dblclick",s=>{l(s.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],()=>{o.isActive()&&o.complete()}),e.on(["commandStack.changed"],()=>{o.isActive()&&o.cancel()}),e.on("directEditing.activate",()=>{r.removeResizers()}),e.on("create.end",500,s=>{const{context:d,isTouch:c}=s,f=d.shape,{canExecute:p}=s.context;c||p&&(d.hints&&d.hints.createElementsBehavior===!1||l(f))}),e.on("autoPlace.end",500,s=>{l(s.shape)});function l(s,d){(d||ei(s,["userTask","scriptTask","subprocess"])||s.isDirectEdit)&&o.activate(s)}}Yo.$inject=["eventBus","canvas","directEditing","modeling","resizeHandles","textRenderer"],Yo.prototype.activate=function(e){const t=Na(e);if(t===void 0)return;const o={text:t};Ge(o,this.getEditingBBox(e));const a={};return(ei(e,["userTask","scriptTask","subprocess"])||e.isDirectEdit)&&Ge(a,{centerVertically:!0}),ti(e)&&Ge(a,{autoResize:!0}),Ge(o,{options:a}),o},Yo.prototype.getEditingBBox=function(e){const t=this._canvas,o=e.label||e,a=t.getAbsoluteBBox(o),r={x:a.x+a.width/2,y:a.y+a.height/2},i={x:a.x,y:a.y},l=t.zoom(),s=this._textRenderer.getDefaultStyle(),d=this._textRenderer.getExternalStyle(),c=d.fontSize*l,f=d.lineHeight,p=s.fontSize*l,u=s.lineHeight,h={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(ei(e,["userTask","scriptTask","subprocess"])||e.isDirectEdit)&&(Ge(i,{width:a.width,height:a.height}),Ge(h,{fontSize:p+"px",lineHeight:u,paddingTop:7*l+"px",paddingBottom:7*l+"px",paddingLeft:5*l+"px",paddingRight:5*l+"px"}));const g=90*l,m=7*l,w=4*l;if(o.labelTarget&&(Ge(i,{width:g,height:a.height+m+w,x:r.x-g/2,y:a.y-m}),Ge(h,{fontSize:c+"px",lineHeight:f,paddingTop:m+"px",paddingBottom:w+"px"})),ti(o)&&!od(o)&&!Do(o)){const k=ad(e),b=t.getAbsoluteBBox({x:k.x,y:k.y,width:0,height:0}),y=c+m+w;Ge(i,{width:g,height:y,x:b.x-g/2,y:b.y-y/2}),Ge(h,{fontSize:c+"px",lineHeight:f,paddingTop:m+"px",paddingBottom:w+"px"})}return{bounds:i,style:h}},Yo.prototype.update=function(e,t){let o;SC(t)&&(t=null),this._modeling.updateLabel(e,t,o)};function SC(e){return!e||!e.trim()}var EC={__depends__:[dC,kC,ur.default],__init__:["labelEditingProvider"],labelEditingProvider:["type",Yo]};function Nn(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}Nn.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Nn.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},Nn.prototype.addDefaultSnap=function(e,t){var o=this._defaultSnaps[e];o||(o=this._defaultSnaps[e]=[]),o.push(t)},Nn.prototype.getSnapLocations=function(){return this._snapLocations},Nn.prototype.setSnapLocations=function(e){this._snapLocations=e},Nn.prototype.pointsForTarget=function(e){var t=e.id||e,o=this._targets[t];return o||(o=this._targets[t]=new Qa,o.initDefaults(this._defaultSnaps)),o};function Qa(){this._snapValues={}}Qa.prototype.add=function(e,t){var o=this._snapValues[e];o||(o=this._snapValues[e]={x:[],y:[]}),o.x.indexOf(t.x)===-1&&o.x.push(t.x),o.y.indexOf(t.y)===-1&&o.y.push(t.y)},Qa.prototype.snap=function(e,t,o,a){var r=this._snapValues[t];return r&&yw(e[o],r[o],a)},Qa.prototype.initDefaults=function(e){var t=this;(0,R.forEach)(e||{},function(o,a){(0,R.forEach)(o,function(r){t.add(a,r)})})};var _C=1250;function Zt(e,t,o){var a=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){a.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],_C,function(r){var i=r.context,l=i.shape,s=i.snapContext,d=i.target;if(!(r.originalEvent&&Js(r.originalEvent))&&!(Fa(r)||!d)){var c=s.pointsForTarget(d);c.initialized||(c=a.addSnapTargetPoints(c,l,d),c.initialized=!0),o.snap(r,c)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){o.hide()})}Zt.$inject=["elementRegistry","eventBus","snapping"],Zt.prototype.initSnap=function(e){var t=this._elementRegistry,o=e.context,a=o.shape,r=o.snapContext;r||(r=o.snapContext=new Nn);var i;t.get(a.id)?i=go(a,e):i={x:e.x+go(a).x,y:e.y+go(a).y};var l={x:i.x-a.width/2,y:i.y-a.height/2},s={x:i.x+a.width/2,y:i.y+a.height/2};return r.setSnapOrigin("mid",{x:i.x-e.x,y:i.y-e.y}),uo(a)||(r.setSnapOrigin("top-left",{x:l.x-e.x,y:l.y-e.y}),r.setSnapOrigin("bottom-right",{x:s.x-e.x,y:s.y-e.y})),r},Zt.prototype.addSnapTargetPoints=function(e,t,o){return(0,R.forEach)(this.getSnapTargets(t,o),function(a){if(uo(a)){uo(t)&&e.add("mid",go(a));return}if(_t(a)){if(a.waypoints.length<3)return;(0,R.forEach)(a.waypoints.slice(1,-1),function(r){e.add("mid",r)});return}e.add("mid",go(a))}),!(0,R.isNumber)(t.x)||!(0,R.isNumber)(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",go(t)),e},Zt.prototype.getSnapTargets=function(e,t){return Yd(t).filter(function(o){return!BC(o)})};function BC(e){return!!e.hidden}function bo(e){e.invoke(Zt,this)}(0,rn.default)(bo,Zt),bo.$inject=["injector"],bo.prototype.initSnap=function(e){return Zt.prototype.initSnap.call(this,e)},bo.prototype.addSnapTargetPoints=function(e,t,o){return Zt.prototype.addSnapTargetPoints.call(this,e,t,o)},bo.prototype.getSnapTargets=function(e,t){return Zt.prototype.getSnapTargets.call(this,e,t)};var RC=1250;function Go(e,t){var o=this;e.on(["resize.start"],function(a){o.initSnap(a)}),e.on(["resize.move","resize.end"],RC,function(a){var r=a.context,i=r.shape,l=i.parent,s=r.direction,d=r.snapContext;if(!(a.originalEvent&&Js(a.originalEvent))&&!Fa(a)){var c=d.pointsForTarget(l);c.initialized||(c=o.addSnapTargetPoints(c,i,l,s),c.initialized=!0),MC(s)&&dn(a,"x",a.x),AC(s)&&dn(a,"y",a.y),t.snap(a,c)}}),e.on(["resize.cleanup"],function(){t.hide()})}Go.prototype.initSnap=function(e){var t=e.context,o=t.shape,a=t.direction,r=t.snapContext;r||(r=t.snapContext=new Nn);var i=ku(o,a);return r.setSnapOrigin("corner",{x:i.x-e.x,y:i.y-e.y}),r},Go.prototype.addSnapTargetPoints=function(e,t,o,a){return(0,R.forEach)(this.getSnapTargets(t,o),function(r){e.add("corner",bw(r)),e.add("corner",vw(r))}),e.add("corner",ku(t,a)),e},Go.$inject=["eventBus","snapping"],Go.prototype.getSnapTargets=function(e,t){return Yd(t).filter(function(o){return!TC(o,e)&&!_t(o)&&!VC(o)&&!uo(o)})};function ku(e,t){var o=tt(e),a=De(e),r={x:o.x,y:o.y};return t.indexOf("n")!==-1?r.y=a.top:t.indexOf("s")!==-1&&(r.y=a.bottom),t.indexOf("e")!==-1?r.x=a.right:t.indexOf("w")!==-1&&(r.x=a.left),r}function TC(e,t){return e.host===t}function VC(e){return!!e.hidden}function MC(e){return e==="n"||e==="s"}function AC(e){return e==="e"||e==="w"}var NC=7,jC=1e3;function jn(e){this._canvas=e,this._asyncHide=(0,R.debounce)((0,R.bind)(this.hide,this),jC)}jn.$inject=["canvas"],jn.prototype.snap=function(e,t){var o=e.context.snapContext,a=o.getSnapLocations(),r={x:Fa(e,"x"),y:Fa(e,"y")};(0,R.forEach)(a,function(i){var l=o.getSnapOrigin(i),s={x:e.x+l.x,y:e.y+l.y};if((0,R.forEach)(["x","y"],function(d){var c;r[d]||(c=t.snap(s,i,d,NC),c!==void 0&&(r[d]={value:c,originValue:c-l[d]}))}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),(0,R.forEach)(["x","y"],function(i){var l=r[i];(0,R.isObject)(l)&&dn(e,i,l.originValue)})},jn.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),o=(0,P.create)("path");return(0,P.attr)(o,{d:"M0,0 L0,0"}),(0,P.classes)(o).add("djs-snap-line"),(0,P.append)(t,o),{update:function(a){(0,R.isNumber)(a)?e==="horizontal"?(0,P.attr)(o,{d:"M-100000,"+a+" L+100000,"+a,display:""}):(0,P.attr)(o,{d:"M "+a+",-100000 L "+a+", +100000",display:""}):(0,P.attr)(o,{display:"none"})}}},jn.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},jn.prototype.showSnapLine=function(e,t){var o=this.getSnapLine(e);o&&o.update(t),this._asyncHide()},jn.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},jn.prototype.hide=function(){(0,R.forEach)(this._snapLines,function(e){e.update()})};var PC={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Zt],resizeSnapping:["type",Go],snapping:["type",jn]},HC={__depends__:[PC],__init__:["createMoveSnapping"],createMoveSnapping:["type",bo]};function wo(e){bt.call(this,e),this.init()}wo.$inject=["eventBus"],Dn(wo,bt),wo.prototype.addRule=function(e,t,o){var a=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){a.canExecute(r,t,function(i,l,s){return o(i)},!0)})},wo.prototype.init=function(){};function Ko(e){wo.call(this,e)}Ko.$inject=["eventBus"],(0,rn.default)(Ko,wo),Ko.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return!!(t&&t.type!=""&&t.type!=null&&t.type!=null)}),this.addRule("connection.create",function(e){var t=e.source,o=e.target,a=e.hints||{},r=a.targetParent;if(a.targetAttach)return!1;r&&(o.parent=r);try{return Ei(t,o)}finally{r&&(o.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,o=e.source,a=e.target;return Ei(o,a,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.create",function(e){var t=e.target,o=e.shape;return t.parent&&(t=parent),!(o.type=="startEvent"&&(!t.children||t.children.find(a=>a.type==o.type)!=null))}),this.addRule("shape.resize",function(e){var t=e.shape;return $y(t)})},Ko.prototype.canConnect=Ei;function Ei(e,t,o){return t.type&&e.type&&e.type!="endEvent"?e.id==t.id?!1:{type:"myline"}:!1}var zC={__init__:["myRuleProvider"],myRuleProvider:["type",Ko]};function _i(e,t,o,a,r,i,l){this._create=e,this._elementFactory=t,this._handTool=o,this._lassoTool=a,this._globalConnect=r,this._palette=i,this._myOptions=l,i.registerProvider(this)}_i.$inject=["create","elementFactory","handTool","lassoTool","globalConnect","palette","myOptions"],_i.prototype.getPaletteEntries=function(){const e=this._create,t=this._elementFactory,o=this._handTool,a=this._lassoTool,r=this._globalConnect,i=this._myOptions;function l(d,c,f,p,u){function h(g){const m=t.createShape(Ge({type:d},u));e.start(g,m)}return{group:c,className:f,title:p,action:{dragstart:h,click:h}}}const s={"hand-tool":{group:"tools",className:"icon-hand-tool",title:"激活手动工具",action:{click(d){o.activateHand(d)}}},"lasso-tool":{group:"tools",className:"icon-lasso-tool",title:"激活套索工具",action:{click(d){a.activateSelection(d)}}},"global-connect-tool":{group:"tools",className:"icon-line-tool",title:"激活连线工具",action:{click(d){r.toggle(d)}}},"tool-separator":{group:"tools",separator:!0}};for(const d in i.palette){const c=i.palette[d];s[d]=l(c.type,c.group,c.className,c.title,c.options)}return s};var OC={__init__:["paletteProvider"],paletteProvider:["type",_i]},wx=50,LC=250;function DC(e,t){t||(t={});function o(u){return u.source===e?1:-1}var a=t.defaultDistance||50,r=t.direction||"e",i=t.filter,l=t.getWeight||o,s=t.maxDistance||LC,d=t.reference||"start";i||(i=IC);function c(u,h){return r==="n"?d==="start"?De(u).top-De(h).bottom:d==="center"?De(u).top-tt(h).y:De(u).top-De(h).top:r==="w"?d==="start"?De(u).left-De(h).right:d==="center"?De(u).left-tt(h).x:De(u).left-De(h).left:r==="s"?d==="start"?De(h).top-De(u).bottom:d==="center"?tt(h).y-De(u).bottom:De(h).bottom-De(u).bottom:d==="start"?De(h).left-De(u).right:d==="center"?tt(h).x-De(u).right:De(h).right-De(u).right}var f=e.incoming.filter(i).map(function(u){var h=l(u),g=h<0?c(u.source,e):c(e,u.source);return{id:u.source.id,distance:g,weight:h}}),p=e.outgoing.filter(i).map(function(u){var h=l(u),g=h>0?c(e,u.target):c(u.target,e);return{id:u.target.id,distance:g,weight:h}});return(0,R.reduce)(f.concat(p).reduce(function(u,h){return u[h.id+"__weight_"+h.weight]=h,u},{}),function(u,h){var g=h.distance,m=h.weight;return g<0||g>s||(u[String(g)]||(u[String(g)]=0),u[String(g)]+=1*m,(!u.distance||u[u.distance]<u[String(g)])&&(u.distance=g)),u},{}).distance||a}function IC(){return!0}var FC=100;function Su(e,t,o){e.on("autoPlace",FC,function(a){var r=a.shape,i=a.source;return $C(i,r)}),e.on("autoPlace.end",function(a){o.scrollToElement(a.shape)}),this.append=function(a,r,i){e.fire("autoPlace.start",{source:a,shape:r});var l=e.fire("autoPlace",{source:a,shape:r}),s=t.appendShape(a,r,l,a.parent,i);return e.fire("autoPlace.end",{source:a,shape:s}),s}}Su.$inject=["eventBus","modeling","canvas"];function $C(e,t,o){o||(o={});var a=o.defaultDistance||50,r=tt(e);return{x:De(e).right+a+t.width/2,y:r.y}}function Eu(e,t){e.on("autoPlace.end",500,function(o){t.select(o.shape)})}Eu.$inject=["eventBus","selection"];var WC={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Su],autoPlaceSelectionBehavior:["type",Eu]},UC=10,JC=(e,t)=>e.type===t;function YC(e){return e.incoming.map(t=>t.source)}function GC(e){return e.outgoing.map(t=>t.target)}function Bi(e){return GC(e).concat(YC(e))}function KC(e){let t=Bi(e);return e.host&&(t=t.concat(Bi(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((o,a)=>o.concat(Bi(a)),[]))),t.filter(o=>o.type!=="myline")}function qC(e,t,o){const a={x:t.x-o.width/2,y:t.y-o.height/2,width:o.width,height:o.height};return(0,R.find)(KC(e),r=>r===o?!1:xn(r,a,UC)==="intersect")}function XC(e,t,o,a){let r;for(;r=qC(e,o,t);)o=a(t,o,r);return o}function ZC(e){return function(t,o,a){const r={x:o.x,y:o.y};return["x","y"].forEach(i=>{const l=e[i];if(!l)return;const s=i==="x"?"width":"height",{margin:d,minDistance:c}=l;d<0?r[i]=Math.min(a[i]+d-t[s]/2,o[i]-c+d):r[i]=Math.max(a[i]+a[s]+d+t[s]/2,o[i]+c+d)}),r}}function QC(e,t){return ex(e,t)}function ex(e,t){const o=De(e),a=tt(e),r=DC(e,{filter:s=>JC(s,"myline")}),i=30,l=80;return XC(e,t,{x:o.right+r+t.width/2,y:a.y+tx("left",l)},ZC({y:{margin:i,minDistance:l}}))}function tx(e,t){return e.indexOf("top")!==-1?-1*t:e.indexOf("bottom")!==-1?t:0}function _u(e){e.on("autoPlace",t=>{const{shape:o,source:a}=t;return QC(a,o)})}_u.$inject=["eventBus"];var nx={__depends__:[WC],__init__:["myAutoPlace"],myAutoPlace:["type",_u]};function Ri(e,t,o,a,r,i,l){this._connect=e,this._modeling=o,this._elementFactory=a,this._autoPlace=r,this._create=i,this._myOptions=l,t.registerProvider(this)}Ri.$inject=["connect","contextPad","modeling","elementFactory","autoPlace","create","myOptions"],Ri.prototype.getContextPadEntries=function(e){const t=this._connect,o=this._modeling,a=this._elementFactory,r=this._autoPlace,i=this._create,l=this._myOptions;function s(){o.removeElements([e])}function d(p,u,h){t.start(p,u,h)}function c(p,u,h,g){typeof h!="string"&&(g=h);function m(k,b){const y=a.createShape(Ge({type:p},g));i.start(k,y,{source:b})}function w(k,b){const y=a.createShape(Ge({type:p},g));r.append(b,y)}return{group:"model",className:u,title:h,action:{dragstart:m,click:w}}}if(e.type==="label")return!1;if(e.type==="myline"||e.type==="endEvent")return{delete:{group:"edit",className:"icon-delete",title:"删除",action:{click:s,dragstart:s}}};const f={};for(const p in l.palette)if(p!=="create.start-event"){const u=l.palette[p];f[p]=c(u.type,u.className,u.title,u.options)}return f.connect={group:"edit",className:"icon-line-tool",title:"连线",action:{click:d,dragstart:d}},f.delete={group:"edit",className:"icon-delete",title:"删除",action:{click:s,dragstart:s}},f};var ox={__init__:["ContextPadProvider"],ContextPadProvider:["type",Ri]},ax=(0,n.defineComponent)({name:"JWorkflow",__name:"workflow",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick","elementCreate"],setup(e,{expose:t,emit:o}){const a=e,r=o,i=(0,n.ref)(),l={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let s,d=1;const c=()=>{d=1,s.get("canvas").zoom("fit-viewport")},f=()=>{const T=s.get("eventBus");T.on("element.dblclick",V=>{r("elementDblclick",V.element.businessObject)}),T.on("element.click",V=>{r("elementClick",V.element.businessObject)}),T.on("create.end",V=>{r("elementCreate",V.elements[0].businessObject)}),T.on("autoPlace.end",V=>{r("elementCreate",V.shape.businessObject)})},p=function(){return{palette:a.paletteOptions||l,lineStroke:a.lineStroke}},u=()=>{let T={__init__:["myOptions"],myOptions:["type",p]};s=new oa.default({canvas:{container:i.value},modules:[Cw,Lr,Ew,Lw,lc,Xb,$w,Uw,Jw,md,Bc,oC,iu,cC,Vc,T,nx,wd,EC,ox,OC,zC,HC,xd]});const V=s.get("canvas"),N=s.get("elementFactory");c();const z=N.createRoot();V.setRootElement(z),f()};(0,n.onMounted)(()=>{u()});const h=T=>{const V=T==null?1:d+T;s.get("canvas").zoom(V),d=V},g=()=>{s.get("commandStack").redo()},m=()=>{s.get("commandStack").undo()},w=()=>(s.get("canvas").zoom(1),kd(s.get("elementRegistry").getAll())),k=T=>{s.clear(),c(),Sd(T,s)},b=T=>{s.get("myImporter").update(T.id,T)};return t({reset:()=>{c()},zoom:T=>{h(T)},redo:()=>{g()},undo:()=>{m()},getData:()=>w(),setData:T=>{k(T)},updateElemet:T=>{b(T)}}),(T,V)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"containerRef",ref:i,class:"j-work-flow"},null,512))}}),rx=ax,Bu=fe(Kb),Ru=fe(rx),ix=(0,n.defineComponent)({name:"JInputCards",__name:"input-cards",props:{id:{type:String,default:""},modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},gutter:{type:Number,default:16},span:Number,labelWidth:[String,Number],required:{type:Boolean,default:!1}},emits:["update:modelValue","change","rowChange"],setup(e,{expose:t,emit:o}){const a=e,r=o,{t:i}=Ye(),{formData:l}=gn(),s=(0,n.computed)(()=>a.editConfig.isAddBtn!==!1),d=(0,n.computed)(()=>a.editConfig.addBtnText||"添加"),c=(0,n.computed)(()=>a.editConfig.buttonsAlign||"left"),f=(0,n.computed)(()=>a.editConfig.isRemoveBtn!==!1),p=(0,n.computed)(()=>a.editConfig.readonly),u=(0,n.computed)(()=>a.editConfig.isNullValue!==!1),h=(0,n.ref)([]),g=v=>{r("rowChange",v)},m=()=>{const v={_i:ln()};a.columns.forEach(x=>{const E=x.config?.valueRowKey||x.id||"";E&&(v[E]=Vt(x.config?.defaultValue))}),h.value.push(v),r("change",{id:a.id,value:v,data:v,formData:l,tableData:h.value,type:"add"})},w=v=>{const x=h.value[v];h.value.splice(v,1),r("change",{id:a.id,value:x,data:x,formData:l,tableData:h.value,type:"delete"})},k=()=>{const v={isOk:!0,info:""};if(a.required&&h.value.length===0)return v.isOk=!1,v.info="请添加表格数据",v;const x=h.value.length,E=a.columns,_=E.length;for(let T=0;T<x;T++){const V=h.value[T];for(let N=0;N<_;N++){const z=E[N];if(y(z,T).display!==!1&&z.rule&&z.rule.length>0){const j=z.rule.length;for(let A=0;A<j;A++){const B=z.rule[A];if(B.pattern=B.pattern?B.pattern+"":"",B.pattern&&!xt(V[z.prop||""])&&!new RegExp(B.pattern.substring(1,B.pattern.length-1)).test(V[z.prop||""]))return v.info=`${i("第")}${T+1}${i("行")},${i("第")}${N+1}${i("列")},${i(z.label)}:${i(B.message)}`,v.isOk=!1,v;if(B.required&&xt(V[z.prop||""]))return v.isOk=!1,v.info=`${i("第")}${T+1}${i("行")},${i("第")}${N+1}${i("列")},${i(z.label)}:${i("不能为空")}`,v}}}}return v};a.modelValue&&a.modelValue.length>0?(h.value=a.modelValue||[],h.value.forEach(v=>{v._i||(v._i=ln())})):(h.value=[],r("update:modelValue",h.value));const y=(v,x)=>Nt({config:v.config||{},getCompConfig:v.getCompConfig,formData:l,row:h.value[x],getTableData:()=>h.value}),C=v=>{const x=v||a.labelWidth;return typeof x=="string"?x:typeof x=="number"?x+"px":x};return t({validate:()=>k()}),_o({getTableData:()=>h.value,rowChange:g}),(v,x)=>{const E=(0,n.resolveComponent)("j-comp"),_=(0,n.resolveComponent)("el-form-item"),T=(0,n.resolveComponent)("el-col"),V=(0,n.resolveComponent)("j-button"),N=(0,n.resolveComponent)("el-row");return(0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[(0,n.createElementVNode)("div",(0,n.mergeProps)({class:"j-input-cards"},v.$attrs),[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(h.value,(z,j)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:"j-input-cards-item",key:z.i,style:{"margin-bottom":"8px"}},[(0,n.createVNode)(N,{gutter:e.gutter},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.columns,A=>((0,n.openBlock)(),(0,n.createBlock)(T,{key:A.prop,span:A.config?.span||e.span||24,style:(0,n.normalizeStyle)({"margin-bottom":(A.getInputType?A.getInputType(z):A.inputType)=="j-input-rows"?"8px":void 0})},{default:(0,n.withCtx)(()=>[(0,n.withDirectives)((0,n.createVNode)(_,{"label-width":C(A.config?.labelWidth),label:(0,n.unref)(i)(A.config?.label||""),extra:A.config?.labelExtra,required:A.config?.required},{default:(0,n.withCtx)(()=>[(0,n.createVNode)(E,(0,n.mergeProps)({ref_for:!0},A,{row:z}),null,16,["row"])]),_:2},1032,["label-width","label","extra","required"]),[[n.vShow,y(A,j).display!==!1]])]),_:2},1032,["span","style"]))),128)),f.value&&(u.value||h.value.length>1)&&!p.value?((0,n.openBlock)(),(0,n.createBlock)(V,{key:0,class:"j-input-cards-delete",size:"small",shape:"circle",icon:"mdi:close",danger:"",onClick:A=>w(j)},null,8,["onClick"])):(0,n.createCommentVNode)("",!0)]),_:2},1032,["gutter"])]))),128))],16),s.value&&!p.value?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,style:(0,n.normalizeStyle)({"text-align":c.value})},[s.value?((0,n.openBlock)(),(0,n.createBlock)(V,{key:0,type:"link",style:{"margin-right":"8px"},label:d.value,icon:"mdi:add",onClick:m},null,8,["label"])):(0,n.createCommentVNode)("",!0)],4)):(0,n.createCommentVNode)("",!0)],64)}}}),lx=ix,Tu=fe(lx),sx=[ra,ml,yl,vl,bl,wl,Cl,xl,kl,Sl,El,_l,Bl,Rl,Hl,zl,Ol,Ll,wr,gl,Dl,Il,Fl,Wl,Jl,Yl,ls,Gl,Kl,ql,Xl,Zl,Ql,es,ts,ns,os,as,rs,is,us,fs,ps,hs,ms,ys,vs,bs,ws,ss,cs,Cr,Cs,xs,ks,Ss,Es,_s,Bs,Rs,Ts,Bu,Ru,Tu],cx=e=>{sx.forEach(t=>{e.component(t.name,t)})},dx={install:cx};H.EncryptionFactory=nl,H.EventBus=mr,H.HashingFactory=Mf,H.INJECT_KEYS=pt,H.JAutoComplete=Bl,H.JBarcode=Yl,H.JButton=ra,H.JButtonSelect=us,H.JButtons=ml,H.JCascaderSelect=Sl,H.JCheckbox=El,H.JCodeMirror=ls,H.JCollapse=_s,H.JComp=hs,H.JCount=Gl,H.JCountUp=ql,H.JDataPanel=Xl,H.JDate=vl,H.JDecoratedTitle=rs,H.JDialog=zl,H.JDialogFull=Ol,H.JDivider=Zl,H.JDrawer=Ll,H.JDynamicLayer=gl,H.JEcharts=Jl,H.JEditor=Bs,H.JForm=ms,H.JFormItem=ys,H.JGuid=bs,H.JHpanel=Ql,H.JIcon=Cl,H.JInput=yl,H.JInputButton=ts,H.JInputCards=Tu,H.JInputCode=ns,H.JInputColor=os,H.JInputCount=Kl,H.JInputDecoratedTitle=is,H.JInputLayer=xs,H.JInputMap=Ts,H.JInputRows=Cs,H.JInputTag=Dl,H.JLayer=wr,H.JLayerForm=ks,H.JLayout=Rl,H.JMap=Rs,H.JMenu=cs,H.JNowTime=wl,H.JNumber=_l,H.JPage=vs,H.JPanel=ws,H.JRadio=xl,H.JRate=Il,H.JSelect=kl,H.JSlider=Fl,H.JSliderCaptcha=ss,H.JSwitch=Ss,H.JTable=Hl,H.JTablePanel=Cr,H.JTabs=Es,H.JTime=bl,H.JTitle=as,H.JTree=fs,H.JTreeSelect=ps,H.JUpload=Wl,H.JVpanel=es,H.JWorkflow=Ru,H.JWorkflowViewer=Bu,H.assign=Ge,H.buildShortUUID=ia,H.buildUUID=ln,H.clearJson=eo,H.clone=ko,H.deepClone=Vt,H.default=dx,H.eventBus=Nf,H.formatToDate=Eo,H.formatToDateTime=ca,H.fullScreenLoading=hn,H.getCompConfig=Nt,H.getCompType=sa,H.getDayText=cf,H.getFunction=pr,H.getIsInputComp=la,H.getIsTableInputComp=Wi,H.getLabel=Ui,H.getObjType=Ni,H.getTextWidth=At,H.is=Ai,H.isArray=aa,H.isNullOrEmpty=xt,H.isObject=Ku,H.loadBMap=al,H.lowerFirst=af,H.myAesDecrypt=Af,H.numberToChinese=ji,H.numberToThousandSeparator=Pi,H.pagination=tf,H.paginationEx=nf,H.set=hr,H.setGroupMap=zi,H.toArray=Di,H.toDecimal=So,H.toLeafArray=$i,H.toSimpleTree=rf,H.toTree=Oi,H.uniqueArray=of,H.upFirst=Hi,H.useAppInject=Ye,H.useAppProvide=jf,H.useAuthPageInject=cl,H.useAuthPageProvide=dl,H.useCompInject=rl,H.useCompProvide=vr,H.useFormInject=gn,H.useFormProvide=yr,H.useHMenuInject=ll,H.useHMenuProvide=sl,H.useInject=Ut,H.useLayer=zn,H.useLayerInject=Pf,H.useLayerProvide=ul,H.useMenuInject=to,H.useMenuProvide=il,H.usePageInject=fl,H.usePageProvide=pl,H.useProvide=Jt,H.useSortable=ol,H.useTableInject=ua,H.useTableProvide=_o});
|
|
28
|
+
getCompValue)=>{ return ${x} }`;let E;const k=nd(x);if(k.res)try{E=k.fn(r,a,i,o,l,c,u,d,f,h,p,g,v,m,w)}catch(T){console.log(T,"计算组件公式运行错误")}else return console.log(k.msg),"";return Number.isNaN(E)?"":(n.decimal!==void 0&&(E=E.toFixed(n.decimal)),E)}),S=(0,s.computed)(()=>{let b=C.value;return n.thousandSeparator&&(b=yg(b)),n.isChinese&&(b=mg(b)),b});return(0,s.watch)(C,b=>{_("update:modelValue",b),_("change",{value:b,data:S.value})}),(b,x)=>{const E=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createBlock)(E,{modelValue:S.value,"onUpdate:modelValue":x[0]||(x[0]=k=>S.value=k),readonly:"",size:e.size},null,8,["modelValue","size"])}}}),_N=yN,Fw=be(_N),wN={class:"j-block j-input-count"},bN={class:"j-input-count-top"},CN={class:"j-input-count-tool"},SN={style:{"font-weight":"600"}},xN={class:"j-input-count-codebox"},EN={key:0,class:"j-input-count-cursor"},kN={key:0,class:"fun_color"},TN={key:1,class:"comp_color"},RN={key:2,class:"num_color"},MN={key:3,class:"j-input-count-cursor"},BN={class:"j-input-count-bottom"},DN={class:"j-input-count-left"},AN={class:"mb-8px fw-600"},PN={class:"j-input-count-right"},NN={class:"j-input-count-funs"},LN={style:{"font-weight":"600",padding:"8px"}},IN={class:"j-input-count-funs-content"},ON={class:"j-input-count-fundes"},VN={style:{"font-size":"14px","font-weight":"300"}},zN=(0,s.defineComponent)({name:"JInputCount",__name:"input-count",props:{modelValue:String,list:{type:Array,default:()=>[]},type:{type:String,default:"primary"},size:{type:String},label:{type:String,default:"公式设置"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const{t:n}=vt(),r=e,a=t,i=[{label:1,value:1},{label:2,value:2},{label:3,value:3},{label:4,value:4},{label:5,value:5},{label:6,value:6},{label:7,value:7},{label:8,value:8},{label:9,value:9},{label:0,value:0},{label:"i",value:"i"},{label:"+",value:"+"},{label:"-",value:"-"},{label:"*",value:"*"},{label:"/",value:"/"},{label:">",value:">"},{label:"<",value:"<"},{label:"=",value:"="},{label:"(",value:"("},{label:")",value:")"},{label:"[",value:"["},{label:"]",value:"]"},{label:"'",value:"'"},{label:'"',value:'"'},{label:",",value:","},{label:".",value:"."}],o=[{label:"ABS",value:"abs",des:["ABS函数可以获取一个数的绝对值","用法:ABS(数字)","示例:ABS(-8)可以返回8,也就是-8的绝对值"]},{label:"AVERAGE",value:"average",des:["AVERAGE函数可以获取一组数值的算术平均值","用法:AVERAGE(数字1,数字2,...)","示例:AVERAGE({语文成绩},{数学成绩}, {英语成绩})返回三门课程的平均分"]},{label:"CEILING",value:"ceiling",des:["CEILING函数可以将数字增大到最接近原值的指定因数的倍数","用法:CEILING(数字,因数)","示例:CEILING(7,6)返回12,因为12比7大的同时,也是6的倍数中最接近7的数字"]},{label:"COUNT",value:"count",des:["COUNT函数可以获取参数的数量","用法:COUNT(值,值,...)","示例:COUNT(小明,小王,小张,小李)返回4,也就是人员的数量"]},{label:"COUNTIF",value:"countif",des:["COUNTIF函数可以获取数组中满足条件的参数个数","用法:COUNTIF(数组,'条件')","示例:COUNTIF(子表单.性别, '女'),可得到子表单中性别填的是'女'的数据条数;COUNTIF([1,2,3,4],'>2'),可得到1,2,3,4中大于2的数字数量,结果为2。"]},{label:"FIXED",value:"fixed",des:["FIXED函数可将数字舍入到指定的小数位数并输出为文本","用法:FIXED(数字,小数位数)","示例:FIXED(3.1415,2)返回'3.14'"]},{label:"FLOOR",value:"floor",des:["FLOOR函数可将数字减小到最接近原值的指定因数的倍数","用法:FLOOR(数字,因数)","示例:FLOOR(7,6)返回6,因为6比7小的同时,也是6的倍数中最接近7的数字"]},{label:"INT",value:"int",des:["INT函数可以获取一个数的整数部分","用法:INT(数字)","示例:INT(3.1415)返回3,也就是3.1415的整数部分"]},{label:"LARGE",value:"large",des:["LARGE函数可以获取数据集中第k个最大值","用法:LARGE(数组,k)","示例:LARGE({学生成绩.数学成绩},1)返回子表单'学生成绩'中排名第1的'数学成绩'"]},{label:"LOG",value:"log",des:["LOG函数可以根据指定底数返回数字的对数","用法:LOG(数字,底数)","示例:LOG(100,10)返回2,也就是以10为底数100的对数"]},{label:"MAX",value:"max",des:["MAX函数可以获取一组数值的最大值","用法:MAX(数字1,数字2,...)","示例:MAX({语文成绩},{数学成绩},{英语成绩})返回三门课程中的最高分"]},{label:"MIN",value:"min",des:["MIN函数可以获取一组数值的最小值","用法:MIN(数字1,数字2,...)","示例:MIN({语文成绩},{数学成绩},{英语成绩})返回三门课程中的最低分"]},{label:"MOD",value:"mod",des:["MOD函数可以获取两数相除的余数","用法:MOD(被除数,除数)","示例:MOD(4,3)返回1,也就是4/3的余数"]},{label:"POWER",value:"power",des:["POWER函数可以获取数字乘幂的结果","用法:POWER(数字,指数)","示例:POWER(3,2)返回9,也就是3的2次方"]},{label:"PRODUCT",value:"product",des:["PRODUCT函数可以获取一组数值的乘积","用法:PRODUCT(数字1,数字2,...)","示例:PRODUCT({单价}, {数量})获取总价,也就是单价和数量的乘积"]},{label:"RAND",value:"rand",des:["RAND函数可返回大于等于0且小于1的均匀分布随机实数","用法:RAND()","示例:RAND()返回0.424656"]},{label:"ROUND",value:"round",des:["ROUND函数可以将数字四舍五入到指定的位数","用法:ROUND(数字,数字位数)","示例:ROUND(3.1485,2)返回3.15"]},{label:"SMALL",value:"small",des:["SMALL函数可以返回数据集中第k个最小值","用法:SMALL(数组,k)","示例:SMALL({学生成绩.数学成绩}, 1)返回子表单'学生成绩'中排名倒数第一的'数学成绩'"]},{label:"SQRT",value:"sqrt",des:["SQRT函数可以获取一个数字的正平方根","用法:SQRT(数字)","示例:SQRT(9)返回3,也就是9的正平方根"]},{label:"SUM",value:"sum",des:["SUM函数可以获取一组数值的总和","用法:SUM(数字1,数字2,...)","示例:SUM({语文成绩},{数学成绩}, {英语成绩})返回三门课程的总分"]},{label:"SUMPRODUCT",value:"sumproduct",des:["SUMPRODUCT函数可以将数组间对应的元素相乘,并返回乘积之和,适用于加权求和","用法:SUMPRODUCT(数组,数组...)","示例:SUMPRODUCT([1,2,3],[0.1,0.2,0.3])返回1.4,也就是 1×0.1 + 2×0.2 + 3×0.3的值"]}],l=(0,s.ref)(!1),c=(0,s.ref)([]),u=(0,s.reactive)({cells:[],cursor:0}),d=(0,s.computed)({get(){return JSON.parse(r.modelValue||"[]")},set(b){a("update:modelValue",b.length>0?JSON.stringify(b):""),a("change",{value:b.length>0?JSON.stringify(b):"",data:b})}}),f=b=>{c.value=b},h=(b,x)=>{const E={value:b,type:x};if(u.cells.splice(u.cursor,0,E),u.cursor+=1,x==="fun"){const k={value:"(",type:x},T={value:")",type:x};u.cells.splice(u.cursor,0,k,T),u.cursor+=1}},p=()=>{u.cursor>0&&(u.cursor-=1)},g=()=>{u.cursor<u.cells.length&&(u.cursor+=1)},v=()=>{u.cursor>0&&(u.cells.splice(u.cursor-1,1),u.cursor-=1)},m=()=>{u.cells=[],u.cursor=0},_=()=>{u.cells=Mn(d.value),u.cursor=u.cells.length,l.value=!0},y=()=>{d.value=u.cells,l.value=!1},w=()=>{u.cells=[],u.cursor=0,l.value=!1},C=(0,s.computed)(()=>{const b={};return r.list.forEach(x=>{x.children.forEach(E=>{b[E.value]=`${x.label}.${E.label}`})}),b}),S=b=>C.value[b]||b;return(b,x)=>{const E=(0,s.resolveComponent)("j-button"),k=(0,s.resolveComponent)("j-icon"),T=(0,s.resolveComponent)("el-space"),R=(0,s.resolveComponent)("j-dialog");return(0,s.openBlock)(),(0,s.createElementBlock)("div",null,[(0,s.createVNode)(E,(0,s.mergeProps)(b.$attrs,{type:e.type,size:e.size,label:e.label,onClick:_}),null,16,["type","size","label"]),(0,s.createVNode)(R,{visible:l.value,title:(0,s.unref)(n)("公式设置"),height:800,width:1200,onOk:y,onClosed:w},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",wN,[(0,s.createElementVNode)("div",bN,[(0,s.createElementVNode)("div",CN,[(0,s.createElementVNode)("span",SN,(0,s.toDisplayString)((0,s.unref)(n)("计算公式"))+"=",1),(0,s.createVNode)(T,null,{default:(0,s.withCtx)(()=>[(0,s.createVNode)(E,{type:"text",onClick:p},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(k,{icon:"arrowLeft"})]),_:1}),(0,s.createVNode)(E,{type:"text",onClick:g},{icon:(0,s.withCtx)(()=>[(0,s.createVNode)(k,{icon:"arrowRight"})]),_:1}),(0,s.createVNode)(E,{type:"link",label:"退格",onClick:v}),(0,s.createVNode)(E,{type:"link",danger:"",label:"清空",onClick:m})]),_:1})]),(0,s.createElementVNode)("div",xN,[u.cells.length==0?((0,s.openBlock)(),(0,s.createElementBlock)("span",EN)):(0,s.createCommentVNode)("",!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(u.cells,(D,A)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:A},[D.type=="fun"?((0,s.openBlock)(),(0,s.createElementBlock)("span",kN,(0,s.toDisplayString)(D.value.toUpperCase()),1)):D.type=="comp"?((0,s.openBlock)(),(0,s.createElementBlock)("span",TN," #"+(0,s.toDisplayString)(S(D.value))+"# ",1)):D.type=="num"?((0,s.openBlock)(),(0,s.createElementBlock)("span",RN,(0,s.toDisplayString)(D.value),1)):(0,s.createCommentVNode)("",!0),A+1==u.cursor?((0,s.openBlock)(),(0,s.createElementBlock)("span",MN)):(0,s.createCommentVNode)("",!0)],64))),128))])]),(0,s.createVNode)(T,{class:"j-input-count-mid"},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(i,(D,A)=>(0,s.createVNode)(E,{key:A,label:D.label+"",onClick:L=>h(D.value,"num")},null,8,["label","onClick"])),64))]),_:1}),(0,s.createElementVNode)("div",BN,[(0,s.createElementVNode)("div",DN,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.list,(D,A)=>((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:A},[(0,s.createElementVNode)("div",AN,(0,s.toDisplayString)((0,s.unref)(n)(D.label)),1),(0,s.createVNode)(T,{size:[8,8],wrap:"",style:{"margin-bottom":"16px"}},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(D.children,L=>((0,s.openBlock)(),(0,s.createBlock)(E,{key:L.value,onClick:N=>h(L.value,"comp"),label:(0,s.unref)(n)(L.label)},null,8,["onClick","label"]))),128))]),_:2},1024)],64))),128))]),(0,s.createElementVNode)("div",PN,[(0,s.createElementVNode)("div",NN,[(0,s.createElementVNode)("span",LN,(0,s.toDisplayString)((0,s.unref)(n)("函数列表")),1),(0,s.createElementVNode)("div",IN,[((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(o,(D,A)=>(0,s.createVNode)(E,{type:"text",style:{"border-radius":"0","justify-content":"left"},key:A,onMouseover:L=>f(D.des),onClick:L=>h(D.value,"fun"),label:D.label},null,8,["onMouseover","onClick","label"])),64))])]),(0,s.createElementVNode)("div",ON,[(0,s.createElementVNode)("div",null,[(0,s.createElementVNode)("ul",null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(c.value,(D,A)=>((0,s.openBlock)(),(0,s.createElementBlock)("li",{key:A,style:{"margin-bottom":"8px"}},[(0,s.createElementVNode)("span",VN,(0,s.toDisplayString)((0,s.unref)(n)(D)),1)]))),128))])])])])])])]),_:1},8,["visible","title"])])}}}),HN=zN,jw=be(HN),FN={key:0},jN=(0,s.defineComponent)({name:"JCountUp",__name:"count-up",props:{animation:{type:Boolean,default:!0},startValue:{default:0},endValue:{},decimals:{default:0},duration:{default:2},options:{default:()=>({})},callback:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=(0,s.computed)(()=>({...n})),a=(0,s.ref)(),i=(0,s.ref)(null),o=(0,s.computed)(()=>n.options);(0,s.onMounted)(()=>{n.animation&&l()}),(0,s.watch)(()=>n.decimals,()=>{i.value&&i.value.update&&(i.value.options.decimalPlaces=n.decimals,i.value.reset(),i.value.update(n.endValue))},{deep:!0}),(0,s.watch)(()=>n.endValue,h=>{i.value&&i.value.update&&i.value.update(h)});const l=()=>{i.value||(o.value.startVal=n.startValue,o.value.decimalPlaces=n.decimals,o.value.duration=n.duration,i.value=new ES.CountUp(a.value,Number(n.endValue),o.value),i.value.start(()=>{n.callback?.(i.value)}))};return(0,s.onUnmounted)(()=>{i.value=null}),(0,s.onBeforeUnmount)(()=>{i.value=null}),t({myProps:r,el:a,init:l,start:h=>{i.value&&i.value.start&&i.value.start(()=>{h?.(i.value)})},pauseResume:()=>{i.value&&i.value.pauseResume&&i.value.pauseResume()},reset:()=>{i.value&&i.value.reset&&i.value.reset()},update:h=>{i.value&&i.value.update&&i.value.update(h)}}),(h,p)=>((0,s.openBlock)(),(0,s.createElementBlock)("span",{ref_key:"el",ref:a},[e.animation?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("span",FN,(0,s.toDisplayString)(e.endValue),1))],512))}}),$N=jN,$w=be($N),WN={class:"j-block j-data-panel"},UN={key:0,class:"j-data-panel-header"},YN={style:{color:"var(--j-color-text)","font-size":"14px","font-weight":"bold"}},GN={class:"j-data-panel-header-right"},qN={class:"j-data-panel-body"},JN=(0,s.defineComponent)({name:"JDataPanel",__name:"data-panel",props:{title:{default:void 0}},setup(e){return(t,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",WN,[e.title?((0,s.openBlock)(),(0,s.createElementBlock)("div",UN,[(0,s.createElementVNode)("div",YN,(0,s.toDisplayString)(e.title),1),(0,s.createElementVNode)("div",GN,[(0,s.renderSlot)(t.$slots,"titleRight")])])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",qN,[(0,s.renderSlot)(t.$slots,"default")])]))}}),XN=JN,Ww=be(XN),KN={class:"j-divider-content"},ZN=(0,s.defineComponent)({name:"JDivider",__name:"divider",props:{content:{},borderStyle:{default:"solid"},size:{},color:{},contentPosition:{default:"center"}},setup(e){const t=e,n=(0,s.computed)(()=>{const a={color:t.color};return t.size&&Number(t.size)&&(a.fontSize=`${t.size}px`),a}),r=(0,s.computed)(()=>({borderTopStyle:t.borderStyle}));return(a,i)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(`j-divider-container j-divider-${e.contentPosition}`),style:(0,s.normalizeStyle)(n.value)},[(0,s.createElementVNode)("div",{class:"j-divider-line j-divider-line-left",style:(0,s.normalizeStyle)(r.value)},null,4),(0,s.createElementVNode)("div",KN,[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)(e.content||""),1)]),(0,s.createElementVNode)("div",{class:"j-divider-line j-divider-line-right",style:(0,s.normalizeStyle)(r.value)},null,4)],6))}}),QN=ZN,Uw=be(QN),eL={class:"j-hpanel"},tL={class:"j-hpanel-main"},nL=(0,s.defineComponent)({name:"JHpanel",__name:"hpanel",setup(e){return(t,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",eL,[(0,s.renderSlot)(t.$slots,"left"),(0,s.createElementVNode)("div",tL,[(0,s.renderSlot)(t.$slots,"default")]),(0,s.renderSlot)(t.$slots,"right")]))}}),rL=nL,Yw=be(rL),aL={class:"j-vpanel"},iL={class:"j-vpanel-main"},oL=(0,s.defineComponent)({name:"JVpanel",__name:"vpanel",setup(e){return(t,n)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",aL,[(0,s.renderSlot)(t.$slots,"top"),(0,s.createElementVNode)("div",iL,[(0,s.renderSlot)(t.$slots,"default")]),(0,s.renderSlot)(t.$slots,"bottom")]))}}),lL=oL,Gw=be(lL),sL=(0,s.defineComponent)({name:"JInputButton",__name:"input-button",props:{modelValue:{},type:{},layerType:{},btnText:{default:"设置"},title:{},size:{default:"default"},width:{default:1e3},height:{default:600},destroyOnClose:{type:Boolean,default:!1},open:{},ok:{},beforeClose:{},closed:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(),i=(0,s.ref)(),o=async(d,f)=>{n.ok&&(d("保存数据中..."),i.value=await n.ok(),r("update:modelValue",i.value),r("change",{value:i.value}),f(),a.value.close())},l=()=>n.beforeClose?n.beforeClose(i.value):!0,c=()=>{n.closed?.()},u=()=>{a.value.open(n.title||n.btnText,n.layerType),setTimeout(()=>{n.open?.(i.value)},200)};return(0,s.watch)(()=>n.modelValue,d=>{i.value=d},{immediate:!0}),(d,f)=>{const h=(0,s.resolveComponent)("j-button"),p=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)(h,(0,s.mergeProps)({style:{width:"auto"}},d.$attrs,{type:e.type,label:e.btnText,size:e.size,onClick:u}),null,16,["type","label","size"]),(0,s.createVNode)(p,{ref_key:"layerRef",ref:a,height:e.height,width:e.width,"destroy-on-close":e.destroyOnClose,"btn-text":"确定","before-close":l,onOk:o,onClosed:c},{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(d.$slots,"default")]),_:3},8,["height","width","destroy-on-close"])],64)}}}),cL=sL,qw=be(cL),uL=(0,s.defineComponent)({name:"JInputCode",__name:"input-code",props:{modelValue:{},type:{},mode:{default:"application/json"},btnText:{default:"设置脚本"},title:{},size:{},width:{default:1200},height:{default:600},example:{default:""},beforeClose:{},isHint:{type:Boolean,default:!1},handleHint:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get:()=>n.modelValue,set:f=>{r("update:modelValue",f)}}),i=(0,s.ref)(""),o=f=>{i.value=f},l=()=>i.value,c=f=>n.beforeClose?n.beforeClose(f):!0,u=f=>{r("change",f)},d=(0,s.computed)(()=>n.modelValue&&n.modelValue.trim()?`${n.btnText}(已设置)`:n.btnText);return(f,h)=>{const p=(0,s.resolveComponent)("j-code-mirror"),g=(0,s.resolveComponent)("j-layout"),v=(0,s.resolveComponent)("j-input-button");return(0,s.openBlock)(),(0,s.createBlock)(v,{modelValue:a.value,"onUpdate:modelValue":h[1]||(h[1]=m=>a.value=m),type:e.type,"btn-text":d.value,title:e.title,size:e.size,width:e.width,height:e.height,"before-close":c,ok:l,open:o,onChange:u},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(g,{"right-move":!1,right:560},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createVNode)(p,{modelValue:i.value,"onUpdate:modelValue":h[0]||(h[0]=m=>i.value=m),mode:e.mode,"is-hint":e.isHint,"handle-hint":e.handleHint},null,8,["modelValue","mode","is-hint","handle-hint"])]),_:2},[e.example?{name:"right",fn:(0,s.withCtx)(()=>[(0,s.createVNode)(p,{"model-value":e.example,mode:e.mode,readonly:""},null,8,["model-value","mode"])]),key:"0"}:void 0]),1024)]),_:1},8,["modelValue","type","btn-text","title","size","width","height"])}}}),dL=uL,Jw=be(dL),fL=(0,s.defineComponent)({name:"JInputColor",__name:"input-color",props:{modelValue:{},placeholder:{default:"请选择颜色"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},onlyButton:{type:Boolean,default:!1},inputType:{default:"append"},showAlpha:{type:Boolean,default:!0},predefineColors:{default:()=>["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","rgba(255, 69, 0, 0.68)","rgb(255, 120, 0)","hsv(51, 100, 98)","hsva(120, 40, 94, 0.5)","hsl(181, 100%, 37%)","hsla(209, 100%, 56%, 0.73)","#c7158577"]},colorFormat:{default:"hex"},name:{},autofocus:{type:Boolean},tabindex:{},validateEvent:{type:Boolean,default:!0},inputStyle:{default:()=>({})}},emits:["update:modelValue","input","focus","blur","clear","change","color-change","active-change"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o=(0,s.ref)(),l=(0,s.computed)({get(){return r.modelValue===null||r.modelValue===void 0?o.value:r.modelValue},set(v){o.value=v,a("update:modelValue",v),a("input",v)}}),c=v=>{a("input",v)},u=v=>{a("focus",v)},d=v=>{a("blur",v)},f=()=>{a("clear"),a("update:modelValue","")},h=v=>{a("change",v)},p=v=>{a("color-change",v),a("change",v)},g=v=>{a("active-change",v)};return t({focus:()=>{i.value?.focus()},blur:()=>{i.value?.blur()},select:()=>{i.value?.select()}}),(v,m)=>{const _=(0,s.resolveComponent)("el-color-picker"),y=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-input-color",{"j-input-color-only-button":e.onlyButton},{"j-input-color-disabled":e.disabled},`j-input-color-${e.size}`])},[(0,s.createVNode)(y,(0,s.mergeProps)({ref_key:"inputRef",ref:i,modelValue:l.value,"onUpdate:modelValue":m[1]||(m[1]=w=>l.value=w),placeholder:e.placeholder,size:e.size,readonly:e.readonly||e.onlyButton,clearable:e.readonly||e.onlyButton?!1:e.clearable,disabled:e.disabled,name:e.name,autofocus:e.autofocus,tabindex:e.tabindex,"validate-event":e.validateEvent,"input-style":e.inputStyle},v.$attrs,{onInput:c,onFocus:u,onBlur:d,onClear:f,onChange:h}),{[e.inputType]:(0,s.withCtx)(()=>[(0,s.createVNode)(_,{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=w=>l.value=w),size:e.size,disabled:e.disabled||e.readonly,"show-alpha":e.showAlpha,predefine:e.predefineColors,"color-format":e.colorFormat,onChange:p,onActiveChange:g},null,8,["modelValue","size","disabled","show-alpha","predefine","color-format"])]),_:2},1040,["modelValue","placeholder","size","readonly","clearable","disabled","name","autofocus","tabindex","validate-event","input-style"])],2)}}}),hL=fL,Xw=be(hL),pL=(0,s.defineComponent)({name:"JTitle",__name:"title",props:{title:{default:""},style:{default:void 0},class:{default:void 0},color:{default:void 0},size:{default:void 0},weight:{default:"normal"},align:{default:"left"}},setup(e){const t=e,n=(0,s.computed)(()=>t.class||""),r=(0,s.computed)(()=>{const a={...t.style};return t.color&&(a.color=t.color),t.size&&(typeof t.size=="number"?a.fontSize=`${t.size}px`:a.fontSize=t.size),t.weight&&(a.fontWeight=t.weight),t.align&&(a.textAlign=t.align),a});return(a,i)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-title",n.value]),style:(0,s.normalizeStyle)(r.value)},(0,s.toDisplayString)(e.title),7))}}),gL=pL,Kw=be(gL),vL={class:"j-decorated-title-wrapper1"},mL={class:"j-decorated-title-wrapper1-line"},yL={key:3,class:"j-decorated-title-wrapper2"},_L={class:"wrapper2"},wL={class:"wrapper2-line"},bL={key:4,class:"j-decorated-title-wrapper3"},CL={class:"wrapper3"},SL={class:"wrapper3-line"},xL={key:5,class:"j-decorated-title-wrapper4"},EL={class:"wrapper4"},kL={class:"wrapper4-center"},TL={key:6,class:"j-decorated-title-wrapper5"},RL={class:"wrapper5"},ML={class:"wrapper5-left"},BL={class:"wrapper5-right"},DL=(0,s.defineComponent)({name:"JDecoratedTitle",__name:"decorated-title",props:{title:{default:""},content:{},style:{default:void 0},class:{default:void 0},color:{default:void 0},contentColor:{},backgroundColor:{},size:{default:14},contentSize:{default:12},align:{default:void 0},weight:{default:"normal"},titleType:{default:"title1"}},setup(e){const{t}=vt(),n=e,r=(0,s.computed)(()=>n.class||""),a=(0,s.computed)(()=>({"font-size":n.size?`${["title5","title7","title8","title9"].includes(n.titleType)?14:n.size}px`:"","font-weight":n.weight,color:n.color})),i=(0,s.computed)(()=>({"font-size":n.contentSize?`${n.contentSize}px`:"",color:n.contentColor})),o=(0,s.computed)(()=>({"--el-border-style":n.titleType==="title3"?"solid":"dashed",borderColor:n.backgroundColor||"var(--j-color-primary)",margin:"0 !important"})),l=(0,s.computed)(()=>n.backgroundColor||"var(--j-color-primary-hover)"),c=(0,s.computed)(()=>({...n.style}));return(u,d)=>{const f=(0,s.resolveComponent)("el-divider");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-decorated-title",r.value]),style:(0,s.normalizeStyle)(c.value)},[e.titleType==="title2"?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:0},[(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5),(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)],64)):["title3","title4"].includes(e.titleType||"")?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:1},[(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5),(0,s.createVNode)(f,{class:"m-0",style:(0,s.normalizeStyle)(o.value)},null,8,["style"]),(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)],64)):e.titleType==="title5"?((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,{key:2},[(0,s.createElementVNode)("div",vL,[(0,s.createElementVNode)("div",{class:"j-decorated-title-wrapper1-title",style:(0,s.normalizeStyle)([a.value,{backgroundColor:l.value}])},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5),(0,s.createElementVNode)("div",mL,[(0,s.createElementVNode)("div",{class:"wrapper-line",style:(0,s.normalizeStyle)({borderColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram1",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram2",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper-pm wrapper-parallelogram3",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4)])]),(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)([i.value,{textAlign:"left"}])},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)],64)):e.titleType==="title6"?((0,s.openBlock)(),(0,s.createElementBlock)("div",yL,[(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5),(0,s.createElementVNode)("div",_L,[(0,s.createElementVNode)("div",wL,[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({borderColor:l.value})},null,4)]),(0,s.createElementVNode)("div",{class:"wrapper2-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5)],4)]),(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)])):e.titleType==="title7"?((0,s.openBlock)(),(0,s.createElementBlock)("div",bL,[(0,s.createElementVNode)("div",CL,[(0,s.createElementVNode)("div",SL,[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4)]),(0,s.createElementVNode)("div",{class:"wrapper3-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5)],4)]),(0,s.createElementVNode)("p",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)])):e.titleType==="title8"?((0,s.openBlock)(),(0,s.createElementBlock)("div",xL,[(0,s.createElementVNode)("div",EL,[(0,s.createElementVNode)("div",{class:"wrapper4-bg",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",kL,[(0,s.createElementVNode)("div",{class:"wrapper4-center-label",style:(0,s.normalizeStyle)({backgroundColor:l.value})},[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5)],4),(0,s.createElementVNode)("div",{class:"wrapper4-center-triangle left-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper4-center-triangle right-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper4-center-border left-border",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper4-center-border right-border",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4)])]),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)])):e.titleType==="title9"?((0,s.openBlock)(),(0,s.createElementBlock)("div",TL,[(0,s.createElementVNode)("div",RL,[(0,s.createElementVNode)("div",ML,[(0,s.createElementVNode)("div",{class:"wrapper5-triangle wrapper5-left-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper5-block wrapper5-left-block",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),d[0]||(d[0]=(0,s.createElementVNode)("div",{class:"wrapper5-square wrapper5-left-square"},null,-1)),(0,s.createElementVNode)("div",{class:"wrapper5-line1 wrapper5-left-line1",style:(0,s.normalizeStyle)({borderColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper5-line2 wrapper5-left-line2",style:(0,s.normalizeStyle)({borderColor:l.value})},null,4)]),(0,s.createElementVNode)("div",{class:"wrapper5-center",style:(0,s.normalizeStyle)([{backgroundColor:l.value}])},[(0,s.createElementVNode)("span",{style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5)],4),(0,s.createElementVNode)("div",BL,[(0,s.createElementVNode)("div",{class:"wrapper5-triangle wrapper5-right-triangle",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper5-block wrapper5-right-block",style:(0,s.normalizeStyle)({backgroundColor:l.value})},null,4),d[1]||(d[1]=(0,s.createElementVNode)("div",{class:"wrapper5-square wrapper5-right-square"},null,-1)),(0,s.createElementVNode)("div",{class:"wrapper5-line1 wrapper5-right-line1",style:(0,s.normalizeStyle)({borderColor:l.value})},null,4),(0,s.createElementVNode)("div",{class:"wrapper5-line2 wrapper5-right-line2",style:(0,s.normalizeStyle)({borderColor:l.value})},null,4)])]),(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)(i.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.content||"")),5)])):((0,s.openBlock)(),(0,s.createElementBlock)("span",{key:7,style:(0,s.normalizeStyle)(a.value)},(0,s.toDisplayString)((0,s.unref)(t)(e.title||"")),5))],6)}}}),AL=DL,Zw=be(AL),PL={class:"j-block"},NL={class:"j-input-decorated-title-wrapper mb-0px"},LL=(0,s.defineComponent)({name:"JInputDecoratedTitle",__name:"input-decorated-title",props:{modelValue:{default:"title1"},backgroundColor:{default:void 0},color:{default:void 0},weight:{default:void 0},contentColor:{default:void 0},align:{default:void 0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const{t:n}=vt(),r=t,a=(0,s.ref)(),i=u=>{a.value?.hide(),r("update:modelValue",u),r("change",u)},o=(0,s.ref)("mdi:chevron-down"),l=()=>{o.value="mdi:chevron-up"},c=()=>{o.value="mdi:chevron-down"};return(u,d)=>{const f=(0,s.resolveComponent)("j-decorated-title"),h=(0,s.resolveComponent)("j-icon"),p=(0,s.resolveComponent)("el-popover");return(0,s.openBlock)(),(0,s.createElementBlock)("div",PL,[(0,s.createVNode)(p,{width:270,placement:"top-start",trigger:"click","popper-class":"j-input-decorated-title-popover",ref_key:"popoverRef",ref:a,onShow:l,onHide:c},{reference:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",NL,[(0,s.createVNode)(f,{title:(0,s.unref)(n)("这里是标题"),content:(0,s.unref)(n)("这里是信息描述"),titleType:e.modelValue,backgroundColor:e.backgroundColor,color:e.color,weight:e.weight,contentColor:e.contentColor,align:e.align},null,8,["title","content","titleType","backgroundColor","color","weight","contentColor","align"]),(0,s.createVNode)(h,{icon:o.value,size:20},null,8,["icon"])])]),default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(8,g=>(0,s.createElementVNode)("div",{class:"j-input-decorated-title-wrapper",key:g},[(0,s.createVNode)(f,{title:(0,s.unref)(n)("这里是标题"),content:(0,s.unref)(n)("这里是信息描述"),titleType:`title${g}`,backgroundColor:e.backgroundColor,color:e.color,weight:e.weight,contentColor:e.contentColor,align:e.align,onClick:v=>i(`title${g}`)},null,8,["title","content","titleType","backgroundColor","color","weight","contentColor","align","onClick"])])),64))]),_:1},512)])}}}),IL=LL,Qw=be(IL),OL=(0,s.defineComponent)({name:"JCodeMirror",__name:"code-mirror",props:{modelValue:{default:""},mode:{default:"javascript"},readonly:{type:Boolean,default:!1},height:{default:void 0},isHint:{type:Boolean,default:!1},handleHint:{type:Function,default:void 0},isScrollToBottom:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o=(0,s.ref)("");let l=null;const c=v=>{switch(v){case"application/javascript":case"javascript":case"text/javascript":return(0,Li.javascript)();case"css":case"text/css":return(0,RS.css)();case"html":case"text/html":return(0,MS.html)();case"json":case"application/json":return(0,BS.json)();case"sql":case"text/x-sql":return(0,DS.sql)();case"xml":case"text/xml":return(0,AS.xml)();case"python":case"text/x-python":return(0,PS.python)();case"markdown":case"text/markdown":return(0,NS.markdown)();case"java":case"text/x-java":return(0,LS.java)();case"vue":case"text/x-vue":return(0,Li.javascript)({jsx:!0,typescript:!1});case"typescript":case"application/typescript":return(0,Li.javascript)({jsx:!1,typescript:!0});case"jsx":return(0,Li.javascript)({jsx:!0,typescript:!1});case"tsx":return(0,Li.javascript)({jsx:!0,typescript:!0});default:return(0,Li.javascript)()}},u=()=>{const v=[TS.basicSetup,(0,lr.lineNumbers)(),(0,lr.highlightActiveLineGutter)(),(0,lr.highlightSpecialChars)(),(0,Ku.history)(),(0,lr.drawSelection)(),(0,lr.dropCursor)(),(0,Ii.indentOnInput)(),(0,Ii.bracketMatching)(),(0,Xu.closeBrackets)(),(0,lr.rectangularSelection)(),(0,Ii.foldGutter)(),lr.keymap.of([...Xu.closeBracketsKeymap,...Ku.defaultKeymap,...Ku.historyKeymap,...Ii.foldKeymap]),(0,Ii.syntaxHighlighting)(Ii.defaultHighlightStyle)];return v.push(c(r.mode)),r.readonly&&v.push(Ju.EditorState.readOnly.of(!0)),r.isHint&&r.handleHint&&v.push((0,Xu.autocompletion)({override:[m=>{const _=m.matchBefore(/\w*/);if(!_||_.from===_.to)return null;const y=r.handleHint(_.text);return y.length===0?null:{from:_.from,options:y.map(w=>({label:typeof w=="string"?w:w.label||w.name||"",detail:typeof w=="string"?"":w.detail||"",type:typeof w=="string"?"variable":w.type||"variable",apply:typeof w=="string"?w:w.apply||w.name||w.label||""}))}}]})),v.push(lr.EditorView.updateListener.of(m=>{if(m.docChanged){const _=m.state.doc.toString();o.value=_,a("update:modelValue",_),a("change",{value:_})}})),v},d=async()=>{i.value&&(l=new lr.EditorView({state:Ju.EditorState.create({doc:r.modelValue,extensions:u()}),parent:i.value}),o.value=r.modelValue)},f=()=>{if(!l)return;const v=l.state.doc.toString();l&&l.destroy();const m=Ju.EditorState.create({doc:v,extensions:u()});i.value&&(l=new lr.EditorView({state:m,parent:i.value}));const _=l.state.doc.toString();_!==r.modelValue&&l.dispatch({changes:{from:0,to:_.length,insert:r.modelValue}})},h=()=>{if(!l)return;const v=l.state.doc.length;l.dispatch({selection:{anchor:v,head:v},scrollIntoView:!0}),setTimeout(()=>{if(l){const m=l.state.doc.length;l.dispatch({selection:{anchor:m,head:m},scrollIntoView:!0})}},100)},p=()=>{let v=(0,kS.format)(r.modelValue);v=v.replace(/{ JCODE_SASSID }/g,"{JCODE_SASSID}").replace(/{ JCODE_SASSID_NOTT }/g,"{JCODE_SASSID_NOTT}").replace(/{ JCODE_SASSID_NOTA }/g,"{JCODE_SASSID_NOTA}").replace(/@ /g,"@"),a("update:modelValue",v),a("change",{value:v})};let g=null;return(0,s.watch)(()=>r.modelValue,v=>{v!==o.value&&(o.value=v,l&&f(),setTimeout(()=>{l&&r.isScrollToBottom&&h()}))}),(0,s.watch)(()=>r.mode,()=>{l&&f()}),(0,s.onMounted)(async()=>{await(0,s.nextTick)(),await d(),typeof window<"u"&&window.ResizeObserver&&i.value&&(g=new ResizeObserver(()=>{l&&l.dispatch({scrollIntoView:!0})}),g.observe(i.value))}),(0,s.onUnmounted)(()=>{g&&i.value&&(g.unobserve(i.value),g.disconnect(),g=null),l&&(l.destroy(),l=null)}),t({sqlFormatter:p}),(v,m)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"codeWraperRef",ref:i,class:"j-code-mirror",style:(0,s.normalizeStyle)({height:e.height?`${e.height}px`:""})},null,4))}}),VL=OL,eb=be(VL),zL=(0,s.defineComponent)({__name:"slider-captcha-action",props:{actionStyle:{},isPassing:{type:Boolean},toLeft:{type:Boolean}},setup(e,{expose:t}){const n=e,r=(0,s.useTemplateRef)("actionRef"),a=(0,s.ref)("0"),i=(0,s.computed)(()=>{const{actionStyle:l,toLeft:c}=n;return{...l,left:c?"0":a.value,backgroundColor:"var(--j-color-bg-container)",borderRadius:o.value?"6px":void 0,transition:c?"all 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0}}),o=(0,s.computed)(()=>Number.parseInt(a.value)>10&&!n.isPassing);return t({getEl:()=>r.value,getStyle:()=>r?.value?.style,setLeft:l=>{a.value=l}}),(l,c)=>{const u=(0,s.resolveComponent)("j-icon");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"actionRef",ref:r,style:(0,s.normalizeStyle)(i.value),class:"j-slider-captcha-action",name:"captcha-action"},[e.isPassing?((0,s.openBlock)(),(0,s.createBlock)(u,{key:0,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:check-circle-outline"})):((0,s.openBlock)(),(0,s.createBlock)(u,{key:1,color:"var(--j-color-text-2)",class:"nav-checked",icon:"mdi:chevron-double-right"}))],4)}}}),HL=zL,FL=(0,s.defineComponent)({__name:"slider-captcha-bar",props:{barStyle:{},toLeft:{type:Boolean}},setup(e,{expose:t}){const n=e,r=(0,s.useTemplateRef)("barRef"),a=(0,s.ref)("0"),i=(0,s.computed)(()=>{const{barStyle:o,toLeft:l}=n;return{...o,width:l?"0":a.value,transition:l?"width 300ms cubic-bezier(0.4, 0, 0.2, 1)":void 0,backgroundColor:"var(--j-color-success)",position:"absolute",height:"100%"}});return t({getEl:()=>r.value,setWidth:o=>{a.value=o}}),(o,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"barRef",ref:r,style:(0,s.normalizeStyle)(i.value)},null,4))}}),jL=FL,$L=(0,s.defineComponent)({__name:"slider-captcha-content",props:{contentStyle:{type:Object,default:()=>({})},isPassing:{type:Boolean,default:!1},animationDuration:{type:[String,Number],default:2},animationIterationCount:{type:[String,Number],default:"infinite"}},setup(e,{expose:t}){const n=e,r=(0,s.useTemplateRef)("contentRef"),a=(0,s.computed)(()=>{const{contentStyle:o}=n;return{...o,fontSize:"12px"}});t({getEl:()=>r.value});const i=(0,s.computed)(()=>({animation:`shine ${n.animationDuration}s linear ${n.animationIterationCount}`}));return(o,l)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"contentRef",ref:r,class:(0,s.normalizeClass)([{success:e.isPassing},"j-slider-captcha-content"]),style:(0,s.normalizeStyle)(a.value)},[(0,s.createElementVNode)("div",{style:(0,s.normalizeStyle)(i.value),class:"j-spine-text"},(0,s.toDisplayString)(e.isPassing?"验证成功":"请按住滑块拖动"),5)],6))}}),WL=$L,UL=(0,s.defineComponent)({name:"JSliderCaptcha",__name:"slider-captcha",props:(0,s.mergeModels)({class:{},actionStyle:{default:()=>({})},barStyle:{default:()=>({})},contentStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},successText:{default:""},text:{default:""}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:(0,s.mergeModels)(["end","move","start","success"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=t,a=(0,s.useModel)(e,"modelValue"),i=(0,s.reactive)({endTime:0,isMoving:!1,isPassing:!1,moveDistance:0,startTime:0,toLeft:!1}),o=(0,s.useTemplateRef)("wrapperRef"),l=(0,s.useTemplateRef)("barRef"),c=(0,s.useTemplateRef)("contentRef"),u=(0,s.useTemplateRef)("actionRef");(0,s.watch)(()=>i.isPassing,_=>{if(_){const{endTime:y,startTime:w}=i;r("success",{isPassing:_,time:((y-w)/1e3).toFixed(1)}),a.value=_}}),(0,s.watchEffect)(()=>{i.isPassing=!!a.value});function d(_){return"pageX"in _?_.pageX:"touches"in _&&_.touches[0]?_.touches[0].pageX:0}function f(_){i.isPassing||u.value&&(r("start",_),i.moveDistance=d(_)-Number.parseInt(u.value.getStyle().left.replace("px","")||"0",10),i.startTime=Date.now(),i.isMoving=!0)}function h(_){const y=o.value?.offsetWidth??220,w=_?.offsetWidth??40;return{actionWidth:w,offset:y-w-6,wrapperWidth:y}}function p(_){const{isMoving:y,moveDistance:w}=i;if(y){const C=(0,s.unref)(u),S=(0,s.unref)(l);if(!C||!S)return;const{actionWidth:b,offset:x,wrapperWidth:E}=h(C.getEl()),k=d(_)-w;r("move",{event:_,moveDistance:w,moveX:k}),k>0&&k<=x?(C.setLeft(`${k}px`),S.setWidth(`${k+b/2}px`)):k>x&&(C.setLeft(`${E-b}px`),S.setWidth(`${E-b/2}px`),v())}}function g(_){const{isMoving:y,isPassing:w,moveDistance:C}=i;if(y&&!w){r("end",_);const S=u.value,b=(0,s.unref)(l);if(!S||!b)return;const x=d(_)-C,{actionWidth:E,offset:k,wrapperWidth:T}=h(S.getEl());x<k?m():(S.setLeft(`${T-E}px`),b.setWidth(`${T-E/2}px`),v()),i.isMoving=!1}}function v(){i.endTime=Date.now(),i.isPassing=!0,i.isMoving=!1}function m(){i.isMoving=!1,i.isPassing=!1,i.moveDistance=0,i.toLeft=!1,i.startTime=0,i.endTime=0;const _=(0,s.unref)(u),y=(0,s.unref)(l),w=(0,s.unref)(c);!_||!y||!w||(w.getEl().style.width="100%",i.toLeft=!0,setTimeout(()=>{i.toLeft=!1,_.setLeft("0"),y.setWidth("0")},300))}return(_,y)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"wrapperRef",ref:o,class:(0,s.normalizeClass)(["j-slider-captcha slider-border",n.class]),style:(0,s.normalizeStyle)([{"background-color":"var(--j-color-bg)"},e.wrapperStyle]),onMouseleave:g,onMousemove:p,onMouseup:g,onTouchend:g,onTouchmove:p},[(0,s.createVNode)(jL,{ref_key:"barRef",ref:l,"bar-style":e.barStyle,"to-left":i.toLeft},null,8,["bar-style","to-left"]),(0,s.createVNode)(WL,{ref_key:"contentRef",ref:c,"content-style":e.contentStyle,"is-passing":i.isPassing},null,8,["content-style","is-passing"]),(0,s.createVNode)(HL,{ref_key:"actionRef",ref:u,"action-style":e.actionStyle,"is-passing":i.isPassing,"to-left":i.toLeft,onMousedown:f,onTouchstart:f},null,8,["action-style","is-passing","to-left"])],38))}}),YL=UL,tb=be(YL),GL=(0,s.defineComponent)({name:"JSubMenu",__name:"index",props:{pId:{type:String}},emits:["click"],setup(e,{emit:t}){const n=e,r=t,{getMenuMap:a,toArray:i,activeMenu:o,theme:l}=Vi(),{getHMoreMenus:c}=Wg(),u=(0,s.ref)([]);n.pId==="moreId"?u.value=c.value:u.value=i(a()[n.pId||""]||[],[]);const d=g=>{const v=u.value.find(m=>m.active);v?.value!==g.value&&(v&&(v.active=!1),r("click",g))},{list:f,containerProps:h,wrapperProps:p}=(0,Zu.useVirtualList)(u,{itemHeight:44});return(g,v)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({class:["j-sub-menu-content",{"j-menu-dark":(0,s.unref)(l)==="dark"}],style:{"max-height":"calc(100vh - 80px)","border-radius":"8px"}},(0,s.unref)(h)),[(0,s.createElementVNode)("div",(0,s.normalizeProps)((0,s.guardReactiveProps)((0,s.unref)(p))),[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(f),m=>((0,s.openBlock)(),(0,s.createBlock)(au,{key:m.data.value,"parent-actives":(0,s.unref)(o)?.pid?.split(".")||[],item:m.data,"is-sub":"",onClick:d},null,8,["parent-actives","item"]))),128))],16)],16))}}),qL=GL,JL={class:"j-menu-item-label"},XL={class:"j-menu-item-label"},KL={key:1,class:(0,s.normalizeClass)(["j-menu-item-arrow","sub"])},ZL={class:"j-menu-item-label"},QL=(0,s.defineComponent)({name:"JMenuItem",__name:"index",props:{item:{type:Object,default:()=>({})},parentActives:{type:Array,default:()=>[]},collapsed:Boolean,isSub:Boolean,isHorizontal:Boolean,isVertical:Boolean},emits:["click"],setup(e,{emit:t}){const{t:n}=vt(),{activeMenuId:r}=Vi(),a=t,i=o=>{a("click",o)};return(o,l)=>{const c=(0,s.resolveComponent)("j-icon"),u=(0,s.resolveComponent)("el-tooltip"),d=(0,s.resolveComponent)("el-popover");return e.collapsed&&!e.item.hasChildren?((0,s.openBlock)(),(0,s.createBlock)(u,{key:0,placement:"right"},{content:(0,s.withCtx)(()=>[(0,s.createElementVNode)("span",null,(0,s.toDisplayString)((0,s.unref)(n)(e.item.label)),1)]),default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-menu-item",{collapsed:e.collapsed}]),onClick:l[0]||(l[0]=(0,s.withModifiers)(f=>i(e.item),["stop"]))},[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,s.unref)(r),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,s.normalizeStyle)({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?((0,s.openBlock)(),(0,s.createBlock)(c,{key:0,icon:e.item.icon,class:"j-menu-item-icon",size:18},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",JL,(0,s.toDisplayString)((0,s.unref)(n)(e.item.label)),1),e.item.hasChildren?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:1,class:(0,s.normalizeClass)(["j-menu-item-arrow",{open:e.item.open}])},null,2)):(0,s.createCommentVNode)("",!0)],6)],2)]),_:1})):(e.collapsed||e.isSub||e.isHorizontal||e.isVertical)&&e.item.hasChildren?((0,s.openBlock)(),(0,s.createBlock)(d,{key:1,placement:e.isHorizontal?"bottom-start":"right-start","show-arrow":!1,width:"200px","popper-class":"j-sub-menu"},{reference:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-menu-item",{collapsed:e.collapsed}])},[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,s.unref)(r),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,s.normalizeStyle)({"padding-left":`${e.item.indent*34+16}px`})},[e.item.icon?((0,s.openBlock)(),(0,s.createBlock)(c,{key:0,icon:e.item.icon,style:(0,s.normalizeStyle)({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),class:"j-menu-item-icon",size:18},null,8,["icon","style"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",XL,(0,s.toDisplayString)((0,s.unref)(n)(e.item.label)),1),e.item.hasChildren&&!e.isHorizontal&&!e.isVertical?((0,s.openBlock)(),(0,s.createElementBlock)("div",KL)):(0,s.createCommentVNode)("",!0)],6)],2)]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(qL,{"p-id":e.item.value,onClick:i},null,8,["p-id"])]),_:1},8,["placement"])):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:2,class:(0,s.normalizeClass)(["j-menu-item",{collapsed:e.collapsed,sub:e.item.indent>0}]),onClick:l[1]||(l[1]=(0,s.withModifiers)(f=>i(e.item),["stop"]))},[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-menu-item-content",{active:e.item.value===(0,s.unref)(r),"p-active":e.parentActives.includes(e.item.value)}]),style:(0,s.normalizeStyle)({"padding-left":`${e.item.indent*24+16}px`})},[e.item.icon?((0,s.openBlock)(),(0,s.createBlock)(c,{key:0,icon:e.item.icon,class:"j-menu-item-icon",style:(0,s.normalizeStyle)({"margin-right":e.item.label&&(e.isSub||!e.isVertical)?"8px":0,"background-color":e.isVertical?e.item.color:"transparent"}),size:18},null,8,["icon","style"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",ZL,(0,s.toDisplayString)((0,s.unref)(n)(e.item.label)),1),e.item.hasChildren?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:1,class:(0,s.normalizeClass)(["j-menu-item-arrow",{open:e.item.open}])},null,2)):(0,s.createCommentVNode)("",!0)],6)],2))}}}),au=QL,eI=(0,s.defineComponent)({name:"JIMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},collapsed:Boolean},emits:["click"],setup(e,{emit:t}){const n=e,r=t,{activeMenu:a,theme:i}=Vi(),o=d=>{r("click",d)},{list:l,containerProps:c,wrapperProps:u}=(0,Zu.useVirtualList)((0,s.computed)(()=>n.menuList),{itemHeight:44});return(d,f)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({class:["j-menu",{collapsed:e.collapsed,"j-menu-dark":(0,s.unref)(i)==="dark"}]},(0,s.unref)(c)),[(0,s.createElementVNode)("div",(0,s.normalizeProps)((0,s.guardReactiveProps)((0,s.unref)(u))),[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(l),h=>((0,s.openBlock)(),(0,s.createBlock)(au,{key:h.data.value,"parent-actives":(0,s.unref)(a)?.pid?.split(".")||[],item:h.data,collapsed:e.collapsed,class:(0,s.normalizeClass)({"menu-item-entering":h.data.entering,"menu-item-leaving":h.data.leaving}),onClick:o},null,8,["parent-actives","item","collapsed","class"]))),128))],16)],16))}}),tI=eI,nI=(0,s.defineComponent)({name:"JHMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const n=e,r=t,{activeMenu:a,theme:i}=Vi(),o=(0,s.ref)(),l=(0,s.ref)(0);let c=null;(0,s.onMounted)(()=>{typeof window<"u"&&window.ResizeObserver&&o.value&&(c=new ResizeObserver(()=>{o.value&&(l.value=o.value.offsetWidth)}),c.observe(o.value))});const u=(0,s.computed)(()=>{const p=[];let g=0,v=0;const m=n.menuList.length;return n.menuList.forEach(_=>{v++;const y=(Ln(_.label)||0)+32+16+4+8;g+=y,(v===m&&g<=l.value||v<m&&g+56<=l.value)&&p.push(_)}),p.length<n.menuList.length&&p.push({value:"moreId",icon:"more-outlined",label:"",hasChildren:!0,indent:0,open:!1,active:!1}),p}),d=(0,s.computed)(()=>{const p=[];let g=0;const v=u.value.length;return n.menuList.forEach(m=>{g++,g>=v&&p.push(m)}),p}),f=(0,s.computed)(()=>{const p=a.value?.pid?.split(".")||[];return(p.length>1&&d.value.findIndex(g=>g.value===p[1])>-1||d.value.findIndex(g=>g.value===a.value?.value)>-1)&&p.push("moreId"),p}),h=p=>{r("click",p)};return Ug({getHMoreMenus:d}),(0,s.onUnmounted)(()=>{c&&o.value&&(c.unobserve(o.value),c.disconnect(),c=null)}),(p,g)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"menuRef",ref:o,class:(0,s.normalizeClass)(["j-menu-horizontal",{"j-menu-dark":(0,s.unref)(i)==="dark"}])},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(u.value,v=>((0,s.openBlock)(),(0,s.createBlock)(au,{key:v.value,"parent-actives":f.value,item:v,"is-horizontal":"",onClick:h},null,8,["parent-actives","item"]))),128))],2))}}),rI=nI,aI=(0,s.defineComponent)({name:"JVMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["click"],setup(e,{emit:t}){const n=e,r=t,{activeMenu:a,theme:i}=Vi(),o=["var(--j-color-primary)","var(--j-color-success)","var(--j-color-warning)","var(--j-color-error)","#16c2c0","#9154de"],l=(0,s.computed)(()=>(n.menuList.forEach((p,g)=>{p.color=o[g%o.length]}),n.menuList)),c=(0,s.computed)(()=>a.value?.pid?.split(".")||[]),u=p=>{r("click",p)},{list:d,containerProps:f,wrapperProps:h}=(0,Zu.useVirtualList)(l,{itemHeight:96});return(p,g)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",(0,s.mergeProps)({class:["j-menu-vertical",{"j-menu-dark":(0,s.unref)(i)==="dark"}]},(0,s.unref)(f)),[(0,s.createElementVNode)("div",(0,s.normalizeProps)((0,s.guardReactiveProps)((0,s.unref)(h))),[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(d),v=>((0,s.openBlock)(),(0,s.createBlock)(au,{key:v.data.value,"parent-actives":c.value,item:v.data,"is-vertical":"",onClick:u},null,8,["parent-actives","item"]))),128))],16)],16))}}),iI=aI,oI=(0,s.defineComponent)({name:"JMenu",__name:"menu",props:{menus:{type:Array,default:()=>[]},activeId:{type:String,default:void 0},collapsed:Boolean,theme:{type:String,default:"light"},mode:{type:String,default:"inline"}},emits:["click"],setup(e,{emit:t}){const n=e,r=t;let a={};const i=(0,s.ref)("");i.value=n.activeId||"";const o=(v,m,_,y,w)=>{_=_||[];for(let C=0,S=_.length;C<S;C++){const b=_[C],x={};x.pid=m,x.indent=y,i.value===b.value&&(x.active=!0),Object.keys(b).forEach(k=>{k!=="children"&&(x[k]=b[k])}),w&&w.includes(b.value)&&(x.open=!0),v.push(x);const E=b.children||[];E.length>0&&(x.hasChildren=!0,w||(a[x.value]=E),(!w||x.open&&!n.collapsed)&&o(v,`${m}.${x.value}`,E,y+1,w))}},l=(v,m)=>{const _=[];return o(_,"0",v,0,m),_},c=(0,s.ref)([]);let u=[];const d=()=>{a={},u=l(n.menus);const v=[];if(i.value&&n.mode==="inline"){const m=u.find(_=>_.value===i.value);m&&v.push(...m.pid.split("."))}c.value=l(n.menus,v)};(0,s.watch)(()=>n.menus,()=>{d()},{immediate:!0}),(0,s.watch)(()=>n.mode,()=>{d()});const f=()=>{if(c.value.find(v=>v.active)?.value!==i.value){const v=u.find(m=>m.value===i.value);if(v){const m=[];n.mode==="inline"&&m.push(...v.pid.split(".")),c.value=l(n.menus,m)}}},h=(0,s.computed)(()=>u.find(v=>v.value===i.value));(0,s.watch)(()=>n.activeId,()=>{i.value=n.activeId||"",f()}),(0,s.watch)(()=>n.collapsed,()=>{if(n.collapsed)c.value=l(n.menus,[]);else{const v=[];if(i.value){const m=u.find(_=>_.value===i.value);m&&v.push(...m.pid.split("."))}c.value=l(n.menus,v)}});const p=(0,s.computed)(()=>n.theme),g=v=>{if(console.log(v),v.hasChildren){if(n.collapsed)return;const m=[];m.push(...v.pid.split(".")),v.open||m.push(v.value);const _=l(n.menus,m),y=new Set(c.value.map(C=>C.value)),w=new Set(_.map(C=>C.value));_.forEach(C=>{y.has(C.value)||(C.entering=!0)}),c.value.forEach(C=>{w.has(C.value)||(C.leaving=!0)}),c.value=_,setTimeout(()=>{c.value.forEach(C=>{C.entering=!1,C.leaving=!1})},300)}else{if(i.value===v.value)return;i.value=v.value,r("click",v)}};return $g({getMenuMap:()=>a,toArray:l,activeMenu:h,activeMenuId:i,theme:p}),(v,m)=>e.mode==="inline"?((0,s.openBlock)(),(0,s.createBlock)(tI,{key:0,"menu-list":c.value,collapsed:e.collapsed,onClick:g},null,8,["menu-list","collapsed"])):e.mode==="horizontal"?((0,s.openBlock)(),(0,s.createBlock)(rI,{key:1,"menu-list":c.value,onClick:g},null,8,["menu-list"])):((0,s.openBlock)(),(0,s.createBlock)(iI,{key:2,"menu-list":c.value,onClick:g},null,8,["menu-list"]))}}),lI=oI,nb=be(lI),sI={class:"j-keyword-panel"},cI={key:0},uI={key:1,class:"columns-wrapper"},dI=(0,s.defineComponent)({name:"JKeywordPanel",__name:"keyword-panel",props:(0,s.mergeModels)({columns:{type:Array,default:()=>[]}},{checkAll:{default:!0},checkAllModifiers:{},checkFields:{default:()=>[]},checkFieldsModifiers:{}}),emits:["update:checkAll","update:checkFields"],setup(e,{expose:t}){const{t:n}=vt(),r=e,a=(0,s.useModel)(e,"checkAll"),i=(0,s.useModel)(e,"checkFields"),o=(0,s.ref)(!1),l=(0,s.ref)(""),c=(0,s.computed)(()=>r.columns.filter(h=>h.config?.filter?.isSearchKeyword?l.value?h.config?.label?.indexOf(l.value)!=-1:!0:!1).map(h=>({label:h.config?.label,value:h.id}))),u=()=>{a.value||(a.value=!0,o.value=!1,i.value=[])},d=h=>{h.length>0?a.value=!1:a.value=!0};return t({init:()=>{a.value?o.value=!1:o.value=!0}}),(h,p)=>{const g=(0,s.resolveComponent)("j-icon"),v=(0,s.resolveComponent)("el-input"),m=(0,s.resolveComponent)("j-checkbox");return(0,s.openBlock)(),(0,s.createElementBlock)("div",sI,[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["range-item",{active:a.value}]),onClick:u},[(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(n)("搜索全部")),1),a.value?((0,s.openBlock)(),(0,s.createBlock)(g,{key:0,icon:"mdi:check"})):(0,s.createCommentVNode)("",!0)],2),(0,s.createElementVNode)("div",{class:"range-item",onClick:p[0]||(p[0]=_=>o.value=!o.value)},[(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(n)("搜索特定字段")),1),(0,s.createVNode)(g,{icon:o.value?"mdi:keyboard-arrow-up":"mdi:keyboard-arrow-down"},null,8,["icon"])]),o.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",cI,[(0,s.createVNode)(v,{modelValue:l.value,"onUpdate:modelValue":p[1]||(p[1]=_=>l.value=_),modelModifiers:{trim:!0},class:"no-border background",placeholder:(0,s.unref)(n)("搜索"),clearable:""},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(g,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])])):(0,s.createCommentVNode)("",!0),o.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",uI,[(0,s.createVNode)(m,{modelValue:i.value,"onUpdate:modelValue":p[2]||(p[2]=_=>i.value=_),options:c.value,style:{display:"flex","flex-direction":"column"},onChange:d},null,8,["modelValue","options"])])):(0,s.createCommentVNode)("",!0)])}}}),fI=dI,hI={key:0,class:"title"},pI={class:"content"},gI={class:"relation"},vI={style:{width:"72px"}},mI={class:"btn-wrapper"},yI={class:"field-wrapper"},_I={class:"buttons"},wI=(0,s.defineComponent)({name:"JFilterPanel",__name:"filter-panel",props:(0,s.mergeModels)({columns:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},{relation:{default:"and"},relationModifiers:{},isPin:{default:!1},isPinModifiers:{}}),emits:(0,s.mergeModels)(["filter","close"],["update:relation","update:isPin"]),setup(e,{expose:t,emit:n}){const{t:r}=vt(),a=e,i=(0,s.useModel)(e,"relation"),o=(0,s.useModel)(e,"isPin"),l=(0,s.ref)([]),c=()=>{o.value=!o.value},u=[{id:"field",type:"j-select",getCompConfig:()=>({selectData:f.value.join(","),options:d.value}),config:{style:{width:o.value?"132px":"160px"},appendTo:o.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",isShowTooltip:!0,isSelectOnlyone:!0,change:({value:y,row:w})=>{const C=a.columns.find(x=>x.id===y)?.config||{};let S="eq",b="text";["options"].includes(C.dataType||"")?S="in":["dateTime"].includes(C.type||"")?(S="range",b="dateTime"):["number"].includes(C.type||"")&&(b="number"),w.method=S,w.type=C.valueType||b,w.value=void 0}}},{id:"method",type:"j-select",getCompConfig:({row:y})=>{const w=a.columns.find(C=>C.id===y.field)?.config||{};return["options","switch","dataItem","dataView"].includes(w.dataType||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"in",label:"等于任意一个"},{value:"nin",label:"不等于任意一个"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["dateTime"].includes(w.type||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"range",label:"选择范围"},{value:"formula",label:"动态筛选"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:["number"].includes(w.type||"")?{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"gte",label:"大于等于"},{value:"lte",label:"小于等于"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}:{options:[{value:"eq",label:"等于"},{value:"ne",label:"不等于"},{value:"like",label:"包含"},{value:"unlike",label:"不包含"},{value:"empty",label:"为空"},{value:"not_empty",label:"不为空"}]}},config:{style:{width:o.value?"134px":"130px"},appendTo:o.value?void 0:".j-filter-panel",persistent:!1,dataType:"options",noBorder:!0,change:({row:y})=>{y.value=void 0}}},{id:"value",type:"input",getCompType:({row:y})=>{const w=a.columns.find(C=>C.id===y.field)?.config||{};if(["options","dataItem","switch"].includes(w.dataType||"")){if(["in","nin"].includes(y.method)||["eq","ne"].includes(y.method))return"j-select"}else{if(["dateTime"].includes(w.type||""))return["formula"].includes(y.method)?"j-select":"j-date";if(["number"].includes(w.type||""))return"j-number"}return"j-input"},getCompConfig:({row:y})=>{if(["empty","not_empty"].includes(y.method||""))return{display:!1};const w=a.columns.find(S=>S.id===y.field)?.config||{},C={display:!0,placeholder:"",clearable:!0,filterable:!0};return["in","nin"].includes(y.method||"")&&(C.multiple=!0,C.collapseTags=!0,C.collapseTagsTooltip=!0),["options","dataItem"].includes(w.dataType||"")?(C.collapseTags=!0,C.collapseTagsTooltip=!0,C.dataType=w.dataType,C.dataCode=w.dataCode,C.options=w.options):["switch"].includes(w.dataType||"")?(C.options=[],C.dataType="options",w.activeValue==null?C.options.push({label:"是",value:"1"}):C.options.push({label:"是",value:w.activeValue}),w.inactiveValue==null?C.options.push({label:"否",value:"0"}):C.options.push({label:"否",value:w.inactiveValue})):["dateTime"].includes(w.type||"")&&(["formula"].includes(y.method)?(C.placeholder="",C.options=[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"明天",value:"tomorrow"},{label:"最近7天",value:"last7days"},{label:"最近30天",value:"last30days"},{label:"本周",value:"thisWeek"},{label:"上周",value:"lastWeek"},{label:"下周",value:"nextWeek"},{label:"本月",value:"thisMonth"},{label:"上月",value:"lastMonth"},{label:"下月",value:"nextMonth"},{label:"本季度",value:"thisQuarter"},{label:"上季度",value:"lastQuarter"},{label:"下季度",value:"nextQuarter"},{label:"今年",value:"thisYear"},{label:"去年",value:"lastYear"},{label:"明年",value:"nextYear"}],C.dataType="options"):(C.selectType="datetime",["range"].includes(y.method)?(C.selectType="datetimerange",C.startPlaceholder="开始时间",C.endPlaceholder="结束时间",C.defaultTime=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)]):C.placeholder="")),C},config:{style:{width:o.value?"246px":"296px",flex:o.value?"auto":"1"},appendTo:o.value?void 0:".j-filter-panel"}}];(0,s.onMounted)(()=>{l.value=a.searchFieldList});const d=(0,s.computed)(()=>a.columns.filter(y=>!y.children?.length&&!y.config?.isNotFilter).map(y=>({label:y.config?.label,value:y.id,dataType:y.config?.dataType,options:y.config?.options}))),f=(0,s.computed)(()=>l.value.map(y=>y.field)),h=({data:y})=>{if(f.value.includes(y.value))return;const w=a.columns.find(b=>b.id===y.value)?.config||{};let C="eq",S="text";["options","dataItem"].includes(w.dataType||"")?C="in":["dateTime"].includes(w.type||"")&&(C="range",S="dateTime"),l.value.push({field:y.value,method:C,type:w.valueType||S})},p=n,g=()=>{l.value.length=0},v=()=>{o.value?p("filter"):p("close",!0)},m=()=>{l.value.forEach(y=>{y.value=void 0}),p("filter")};return t({getSearchFields:()=>l.value}),(y,w)=>{const C=(0,s.resolveComponent)("j-icon"),S=(0,s.resolveComponent)("j-select"),b=(0,s.resolveComponent)("j-button-select"),x=(0,s.resolveComponent)("j-button"),E=(0,s.resolveComponent)("j-input-rows"),k=(0,s.resolveComponent)("el-tooltip");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-filter-panel",{"is-pin":o.value}])},[o.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",hI,[(0,s.createVNode)(C,{icon:"mdi:filter-outline"}),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(r)("筛选")),1)])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",pI,[(0,s.createElementVNode)("div",gI,[(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(r)("筛选出符合以下")),1),(0,s.createElementVNode)("div",vI,[(0,s.createVNode)(S,{modelValue:i.value,"onUpdate:modelValue":w[0]||(w[0]=T=>i.value=T),teleported:!1,"no-border":!0,options:[{value:"and",label:"所有"},{value:"or",label:"任一"}]},null,8,["modelValue"])]),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(r)("条件的数据")),1)]),(0,s.createElementVNode)("div",mI,[(0,s.createVNode)(b,{label:"添加过滤条件",options:d.value,"model-value":f.value.join(","),onChange:h},null,8,["options","model-value"]),l.value.length>0?((0,s.openBlock)(),(0,s.createBlock)(x,{key:0,type:"text",danger:"",label:"删除全部",onClick:g})):(0,s.createCommentVNode)("",!0)]),(0,s.createElementVNode)("div",yI,[(0,s.createVNode)(E,{modelValue:l.value,"onUpdate:modelValue":w[1]||(w[1]=T=>l.value=T),columns:u,"edit-config":{isAddBtn:!1},"is-wrap":o.value},null,8,["modelValue","is-wrap"])]),(0,s.createVNode)(k,{placement:"bottom",content:o.value?(0,s.unref)(r)("取消固定"):(0,s.unref)(r)("固定显示")},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:"pin-btn",onClick:c},[(0,s.createVNode)(C,{rotate:45,icon:o.value?"mdi:keep-off":"mdi:keep"},null,8,["icon"])])]),_:1},8,["content"])]),(0,s.createElementVNode)("div",_I,[(0,s.createVNode)(x,{label:(0,s.unref)(r)("筛选"),type:"primary",onClick:v},null,8,["label"]),(0,s.createVNode)(x,{label:(0,s.unref)(r)("清空"),icon:"mdi:delete-sweep-outline",type:"text",onClick:m},null,8,["label"])])],2)}}}),rb=wI,bI={class:"j-order-panel"},CI={class:"content"},SI={class:"btn-wrapper"},xI={class:"field-wrapper"},EI={class:"buttons"},kI=(0,s.defineComponent)({name:"JOrderPanel",__name:"order-panel",props:{columns:{type:Array,default:()=>[]}},emits:["save","clear"],setup(e,{expose:t,emit:n}){const{t:r}=vt(),a=e,i=n,o=(0,s.computed)(()=>a.columns.filter(g=>!g.children?.length&&g.config?.sorter?.isNot!==!0).map(g=>({label:g.config?.label,value:g.id}))),l=(0,s.ref)([]),c=(0,s.computed)(()=>l.value.map(g=>g.value)),u=[{id:"label",type:"j-title",getCompConfig:({row:g})=>({title:g?.label}),config:{style:{width:"180px"}}},{id:"sord",type:"j-radio",config:{dataType:"options",options:[{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],isButton:!0}}],d=({data:g})=>{c.value.includes(g.value)||l.value.push({label:g.label,value:g.value,sord:"ASC"})},f=g=>{l.value=JSON.parse(JSON.stringify(g))},h=()=>{i("save",JSON.parse(JSON.stringify(l.value)))},p=()=>{l.value=[],i("clear")};return t({init:f}),(g,v)=>{const m=(0,s.resolveComponent)("j-button-select"),_=(0,s.resolveComponent)("j-input-rows"),y=(0,s.resolveComponent)("j-button");return(0,s.openBlock)(),(0,s.createElementBlock)("div",bI,[(0,s.createElementVNode)("div",CI,[(0,s.createElementVNode)("div",SI,[(0,s.createVNode)(m,{label:"添加排序规则",options:o.value,"model-value":c.value.join(","),onChange:d},null,8,["options","model-value"])]),(0,s.createElementVNode)("div",xI,[(0,s.createVNode)(_,{modelValue:l.value,"onUpdate:modelValue":v[0]||(v[0]=w=>l.value=w),columns:u,"edit-config":{isAddBtn:!1,drag:!0}},null,8,["modelValue"])])]),(0,s.createElementVNode)("div",EI,[(0,s.createVNode)(y,{label:(0,s.unref)(r)("排序"),type:"primary",onClick:h},null,8,["label"]),l.value.length>0?((0,s.openBlock)(),(0,s.createBlock)(y,{key:0,label:(0,s.unref)(r)("清空排序"),icon:"mdi:delete-sweep",type:"text",onClick:p},null,8,["label"])):(0,s.createCommentVNode)("",!0)])])}}}),TI=kI,RI={class:"j-column-panel"},MI={class:"content"},BI={class:"search-wrapper"},DI={class:"tree-wrapper"},AI={class:"buttons"},PI=(0,s.defineComponent)({name:"JColumnPanel",__name:"column-panel",props:{columns:{type:Array,default:()=>[]},columnConfig:{type:Array}},emits:["save"],setup(e,{expose:t,emit:n}){const{t:r}=vt(),a=e,i=n,o=(0,s.ref)(),l=(0,s.ref)(""),c={},u=(0,s.ref)([]),d=(0,s.ref)([]),f=(b,x)=>{const E=[],k=new Map;b.forEach(R=>{k.set(R.id||"",R),c[R.id||""]=R});const T=new Set;return x&&x.length>0&&x.forEach(R=>{const D=k.get(R.id);if(D){T.add(D.id||"");const A={id:D.id||"",label:D.config?.label||D.id||"",type:D.type,display:D.config?.display!==!1};D.children&&D.children.length>0&&(A.children=f(D.children,R.children)),E.push(A)}}),b.forEach(R=>{if(!T.has(R.id||"")){const D={id:R.id||"",label:R.config?.label||R.id||"",type:R.type,display:R.config?.display!==!1};R.children&&R.children.length>0&&(D.children=f(R.children)),E.push(D)}}),E},h=(b,x)=>x.length===0?b:b.map(E=>{const k=x.some(R=>E.label.toLowerCase().includes(R.toLowerCase())),T=E.children?h(E.children,x):[];return k||T.length>0?{...E,children:T.length>0?T:E.children}:null}).filter(Boolean),p=(0,s.computed)(()=>{if(!l.value)return d.value;const b=l.value.split(/\s+/).filter(Boolean);return h(d.value,b)}),g=(0,s.ref)([]),v=(0,s.computed)(()=>{const b=new Map;if(a.columnConfig&&a.columnConfig.length>0){const x=E=>{E.forEach(k=>{b.set(k.id,k),k.children&&x(k.children)})};x(a.columnConfig)}return b}),m=()=>{const b=x=>{const E=[];return x.forEach(k=>{let T=!0;if(v.value.size>0){const R=v.value.get(k.id||"");R?T=R.display:T=k.config?.display!==!1}else T=k.config?.display!==!1;T&&(E.push(k.id||""),k.children&&E.push(...b(k.children)))}),E};g.value=b(a.columns)},_=(b,{node:x})=>{b.includes(x.id)?g.value.push(x.id):g.value=g.value.filter(E=>E!==x.id)},y=(b,x,E)=>E==="inner"?!1:b.parent===x.parent,w=()=>{const b=x=>x.map(E=>{const k={...E,display:g.value.includes(E.id)};return E.children&&(k.children=b(E.children)),k});i("save",b(d.value))},C=()=>{if(m(),d.value=JSON.parse(JSON.stringify(u.value)),l.value="",o.value){const b=o.value;b.setCheck&&b.setCheck(g.value);const x=b.$refs?.treeRef||b;x?.setCheckedKeys&&x.setCheckedKeys(g.value)}i("save",void 0)};return t({init:()=>{m(),u.value=f(a.columns,a.columnConfig),d.value=JSON.parse(JSON.stringify(u.value))}}),(b,x)=>{const E=(0,s.resolveComponent)("j-icon"),k=(0,s.resolveComponent)("el-input"),T=(0,s.resolveComponent)("j-tree"),R=(0,s.resolveComponent)("j-button");return(0,s.openBlock)(),(0,s.createElementBlock)("div",RI,[(0,s.createElementVNode)("div",MI,[(0,s.createElementVNode)("div",BI,[(0,s.createVNode)(k,{modelValue:l.value,"onUpdate:modelValue":x[0]||(x[0]=D=>l.value=D),modelModifiers:{trim:!0},placeholder:(0,s.unref)(r)("搜索 (多个关键词用空格隔开)"),clearable:""},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(E,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),(0,s.createElementVNode)("div",DI,[(0,s.createVNode)(T,{ref_key:"treeRef",ref:o,list:p.value,"is-tree-data":!0,"default-checked-keys":g.value,"default-expand-all":!0,checkable:"","id-key":"id",draggable:!l.value,"allow-drop":y,check:_},null,8,["list","default-checked-keys","draggable"])])]),(0,s.createElementVNode)("div",AI,[(0,s.createVNode)(R,{label:(0,s.unref)(r)("确定"),type:"primary",onClick:w},null,8,["label"]),(0,s.createVNode)(R,{label:(0,s.unref)(r)("重置"),icon:"mdi:restore",type:"text",onClick:C},null,8,["label"])])])}}}),NI=PI,LI={class:"j-table-panel-left"},II={class:"j-table-panel-top"},OI={class:"j-table-panel-top-right"},VI={key:0,style:{width:"200px"}},zI={class:"j-table-panel-main"},HI={key:0,class:"j-block j-table-panel-vnode"},FI=["onClick"],jI={key:0,class:"j-table-panel-filter-panel"},$I=(0,s.defineComponent)({name:"JTablePanel",__name:"table-panel",props:{columns:{type:Array,required:!0,default:()=>[]},isTree:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!1},parentKey:{type:String,default:""},isShowNumber:{type:Boolean,default:!0},isMultiple:{type:Boolean,default:!1},selectStateKey:{type:String,default:""},isPage:{type:Boolean,default:!1},pageSizes:Array,pageSize:{type:Number,default:100},subColumns:{type:Array,default:()=>[]},isSubShowNumber:{type:Boolean,default:!0},subActions:{type:Array,default:()=>[]},loadChildren:{type:Function,default:null},rowKey:{type:String,default:void 0},sort:String,buttons:{type:Array,default:()=>[]},batchButtons:{type:Array,default:()=>[]},actions:{type:Array,default:()=>[]},actionsMaxCount:{type:Number,default:3},actionsLabel:{type:String,default:"操作"},actionFilter:{type:Function,default:null},loadData:Function,immediate:{type:Boolean,default:!0},noPadding:Boolean,highlightMode:{type:String,default:"row"},showFilterButton:{type:Boolean,default:!0},showOrderButton:{type:Boolean,default:!0},showColumnButton:{type:Boolean,default:!0},showRefreshButton:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},renderVNode:Function},emits:["select","ready"],setup(e,{expose:t,emit:n}){const{t:r}=vt(),{openLayer:a}=La(),i=e,o=n;i.isMultiple&&!i.rowKey&&console.warn("rowKey is required when isMultiple is true");const l=(0,s.ref)();let c=[];const u=(0,s.ref)(0),d=(0,s.ref)(1);let f=i.pageSize||100;const h=(0,s.ref)(0),p=(0,s.computed)(()=>h.value>0),g=(0,s.ref)([]),v=(0,s.ref)(!1),m=(0,s.computed)(()=>i.batchButtons&&i.batchButtons.length>0),_=(0,s.computed)(()=>g.value.length>0),y=(0,s.computed)(()=>m.value&&_.value&&i.isMultiple||v.value),w=(0,s.computed)(()=>i.isPage&&!y.value);m.value&&!i.isMultiple&&console.warn("batchButtons is only valid when isMultiple is true");const C=xe=>i.rowKey?i.rowKey.split(",").map(Ae=>xe[Ae.trim()]).join("::"):"",S=(xe,Ae)=>{if(!Ae||Ae.length===0)return xe.filter(_e=>_e.config?.display!==!1).map(_e=>_e.children&&_e.children.length>0?{..._e,children:S(_e.children)}:_e);const at=new Map(xe.map(_e=>[_e.id,_e])),Ft=[];return Ae.forEach(_e=>{const St=at.get(_e.id);if(St){if(_e.display){let fn=St;St.children&&St.children.length>0&&(fn={...St,children:S(St.children,_e.children)}),Ft.push(fn)}at.delete(_e.id)}}),xe.forEach(_e=>{if(at.has(_e.id)&&_e.config?.display!==!1){let St=_e;_e.children&&_e.children.length>0&&(St={..._e,children:S(_e.children)}),Ft.push(St)}}),Ft},b=(0,s.computed)(()=>S(i.columns,he.value)),x=(0,s.computed)(()=>kg(i.columns,xe=>xe.config.label)),E=(0,s.ref)(""),k=(0,s.computed)(()=>x.value.some(xe=>xe.config?.filter?.isSearchKeyword)),T=(0,s.ref)(),R=(0,s.ref)(!0),D=(0,s.ref)([]),A=(0,s.computed)(()=>R.value?"搜索全部":`搜索范围:${x.value.filter(xe=>D.value.includes(xe.id)).map(xe=>xe.config?.label).join("、")}`),L=()=>{T.value.init()},N=(0,s.ref)(),M=(0,s.ref)(!1),I=(0,s.ref)(!1),$=(0,s.ref)(!1),ee=(0,s.ref)([]),oe=(0,s.ref)("and"),j=(0,s.ref)(),U=(0,s.ref)(!1),H=(0,s.ref)([]),B=()=>{j.value.init(H.value)},W=xe=>{H.value=xe,U.value=!1,de()},X=()=>{H.value=[],de()},K=(0,s.ref)(),ne=(0,s.ref)(!1),he=(0,s.ref)(),O=(0,s.computed)(()=>he.value!=null),Z=()=>{K.value?.init()},ue=xe=>{he.value=xe,ne.value=!1},se=(0,s.ref)(!1),we=()=>{se.value=!se.value},Te=()=>{g.value=[],l.value&&(l.value.setSelection?.([]),v.value&&(v.value=!1,l.value.setRecords(c)))},Ee=()=>{v.value=!v.value,v.value?l.value?.setRecords(g.value):l.value?.setRecords(c),l.value?.setSelection?.(g.value)},Ye=(0,s.computed)(()=>{if(g.value.length>0&&i.isMultiple){const xe=[{id:"selection_count",label:`已选${g.value.length}条`,config:{type:"text"}},{id:"toggle_selection",label:v.value?"全部":"仅选中",config:{type:"text"},click:Ee},{id:"clear_selection",label:"清空选中",config:{type:"text"},click:Te}],Ae=i.batchButtons.map(at=>({...at,click:()=>{at.click&&at.click({data:g.value,openLayer:a})}}));return[...xe,...Ae]}return i.buttons}),_t=(0,s.computed)(()=>Ye.value.filter(xe=>xe.config?.display!==!1)),$e=(0,s.ref)(null),Re=(0,s.ref)(0),Oe=()=>{Re.value=$e.value?.clientWidth||0};let Ne;(0,s.onMounted)(()=>{(0,s.nextTick)(Oe),Ne=new ResizeObserver(()=>{Oe()}),$e.value&&Ne.observe($e.value)}),(0,s.onBeforeUnmount)(()=>{Ne?.disconnect()}),(0,s.watch)(()=>_t.value,()=>{(0,s.nextTick)(Oe)},{deep:!0}),(0,s.watch)(se,()=>{(0,s.nextTick)(Oe)});const nt=(0,s.computed)(()=>{const xe=_t.value;if(xe.length===0)return[];const Ae=Re.value;if(Ae<=0)return xe;const at=Math.max(0,Ae-4),Ft=(xt,an)=>xt.groupId||`__auto_${an}`,_e=xt=>{if(xt.config?.notLabel===!0||!xt.label)return 28;const an=24,Jn=Ln(xt.label||"")||0,_n=xt.config?.icon?18:0;return Math.ceil(Jn+an+_n+2)};if((xt=>{let an=0,Jn=null;return xt.forEach((_n,cs)=>{const ar=Ft(_n,cs);Jn!==null&&(an+=ar===Jn?-1:8),an+=_e(_n),Jn=ar}),an})(xe)<=at)return xe;const fn={id:"__table_panel_more__",label:"",config:{icon:"mdi:dots-horizontal",notLabel:!0},children:[]},Gt=28,qt=[];let Nn=0,Ue=null;for(let xt=0;xt<xe.length;xt++){const an=xe[xt],Jn=Ft(an,xt);let _n=Nn;Ue!==null&&(_n+=Jn===Ue?-1:8),_n+=_e(an);const cs=xe.length-(xt+1)>0?(_n>0?8:0)+Gt:0;if(_n+cs<=at)qt.push(an),Nn=_n,Ue=Jn;else break}const ea=xe.slice(qt.length);if(ea.length===0)return xe;const Rt={...fn,children:ea};return qt.length===0?[Rt]:[...qt,Rt]});let Qt;const J=async xe=>{h.value++;const Ae={};xe&&(Qt=xe),Qt&&(Ae.query=Qt);try{const at={};at.rel=oe.value,at.cond=(N.value?.getSearchFields?.()||ee.value).filter(_e=>_e.value!==void 0&&_e.value!==null&&_e.value!==""||["empty","not_empty"].includes(_e.method)).map(_e=>({field:_e.field,method:_e.method,value:_e.value,type:_e.type})),at.cond.length>0?$.value=!0:$.value=!1,Ae.filter=at;const Ft=H.value.map(_e=>_e.value+" "+_e.sord).join(",");if(E.value&&(Ae.keyword={value:E.value,fields:R.value?x.value.filter(_e=>_e.config?.filter?.isSearchKeyword).map(_e=>_e.id):(0,s.unref)(D)}),i.loadData){if(i.isPage){Ae.pagination={rows:f,page:d.value,sort:Ft||i.sort||i.rowKey};const _e=await i.loadData(Ae)||{};c=_e.rows||[],u.value=_e.records||0}else Ae.sort=Ft,c=await i.loadData(Ae)||[],u.value=c.length;l.value?.setRecords(c),m.value?(g.value=[],v.value=!1):i.rowKey&&g.value.length>0&&l.value?.setSelection?.(g.value)}}finally{h.value=Math.max(0,h.value-1)}},de=async()=>{d.value=1,await J()},re=({rows:xe,page:Ae})=>{f=xe,d.value=Ae,J()},ie=async()=>{g.value=[],v.value=!1,d.value=1,Qt=void 0,await J()},fe=async xe=>{g.value=[],v.value=!1,await J(xe)},ke=async()=>{await ie()},Le=xe=>{o("ready",xe)},Ie=({selections:xe,record:Ae,checked:at,isMultiple:Ft})=>{let _e=[];if(!i.isMultiple){g.value=xe,o("select",{selections:xe,record:Ae,checked:at,isMultiple:Ft});return}if(m.value)_e=xe;else if(!i.rowKey)_e=xe;else{const St=new Map(xe.map(Gt=>[C(Gt),Gt])),fn=new Map(g.value.map(Gt=>[C(Gt),Gt]));c.forEach(Gt=>{const qt=C(Gt);St.has(qt)?fn.set(qt,St.get(qt)):fn.delete(qt)}),_e=Array.from(fn.values())}g.value=_e,o("select",{selections:_e,record:Ae,checked:at,isMultiple:Ft}),v.value&&_e.length===0?(v.value=!1,l.value&&l.value.setRecords(c)):v.value&&_e.length>0&&l.value&&(l.value.setRecords(_e),l.value.setSelection?.(_e))},Tt=xe=>{g.value=xe},rt=xe=>{g.value=[xe],o("select",{selections:[xe],record:xe,checked:!0,isMultiple:!1})},Rr=()=>g.value||[],Mr=xe=>{g.value=xe,l.value?.setSelection?.(xe)},Pa=()=>l.value;return(0,s.onMounted)(async()=>{i.immediate&&await fe()}),t({refreshData:fe,resetData:ie,getSelection:Rr,setSelection:Mr,clearSelection:()=>{Te()},getTableRef:Pa}),(xe,Ae)=>{const at=(0,s.resolveComponent)("j-buttons"),Ft=(0,s.resolveComponent)("j-icon"),_e=(0,s.resolveComponent)("el-popover"),St=(0,s.resolveComponent)("el-tooltip"),fn=(0,s.resolveComponent)("el-input"),Gt=(0,s.resolveComponent)("j-button"),qt=(0,s.resolveComponent)("j-table"),Nn=(0,s.resolveDirective)("loading");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-table-panel-wrapper",{fullscreen:se.value,"no-padding":e.noPadding||se.value}])},[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-table-panel",{"j-table-panel-fullscreen":se.value}])},[(0,s.createElementVNode)("div",LI,[(0,s.createElementVNode)("div",II,[(0,s.createElementVNode)("div",{ref_key:"topLeftRef",ref:$e,class:"j-table-panel-top-left"},[(0,s.createVNode)(at,{list:nt.value},null,8,["list"])],512),(0,s.createElementVNode)("div",OI,[k.value&&!y.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",VI,[(0,s.createVNode)(fn,{modelValue:E.value,"onUpdate:modelValue":Ae[2]||(Ae[2]=Ue=>E.value=Ue),modelModifiers:{trim:!0},placeholder:(0,s.unref)(r)("搜索数据"),clearable:"",class:"j-suffix",onKeyup:(0,s.withKeys)(de,["enter"]),onClear:de},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(Ft,{icon:"mdi:search"})]),suffix:(0,s.withCtx)(()=>[(0,s.createVNode)(St,{placement:"bottom",content:A.value},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",null,[(0,s.createVNode)(_e,{placement:"bottom-end","popper-style":"padding: 0",width:200,trigger:"click","show-arrow":!1,onShow:L,onHide:de},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(Ft,{icon:"mdi:keyboard-arrow-down",style:{cursor:"pointer"}})]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(fI,{ref_key:"keywordPanelRef",ref:T,"check-all":R.value,"onUpdate:checkAll":Ae[0]||(Ae[0]=Ue=>R.value=Ue),"check-fields":D.value,"onUpdate:checkFields":Ae[1]||(Ae[1]=Ue=>D.value=Ue),columns:x.value},null,8,["check-all","check-fields","columns"])]),_:1})])]),_:1},8,["content"])]),_:1},8,["modelValue","placeholder"])])):(0,s.createCommentVNode)("",!0),e.showFilterButton&&!M.value&&!y.value?((0,s.openBlock)(),(0,s.createBlock)(_e,{key:1,visible:I.value,"onUpdate:visible":Ae[6]||(Ae[6]=Ue=>I.value=Ue),placement:"bottom","popper-style":"padding: 0",width:664,trigger:"click",persistent:!1,onHide:de},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(Gt,{icon:"mdi:filter-outline",label:"筛选",type:"text",class:(0,s.normalizeClass)({active:$.value})},null,8,["class"])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(rb,{ref_key:"filterPanelRef",ref:N,"is-pin":M.value,"onUpdate:isPin":Ae[3]||(Ae[3]=Ue=>M.value=Ue),relation:oe.value,"onUpdate:relation":Ae[4]||(Ae[4]=Ue=>oe.value=Ue),"search-field-list":ee.value,columns:x.value,onFilter:de,onClose:Ae[5]||(Ae[5]=Ue=>I.value=!1)},null,8,["is-pin","relation","search-field-list","columns"])]),_:1},8,["visible"])):(0,s.createCommentVNode)("",!0),e.showOrderButton&&!y.value?((0,s.openBlock)(),(0,s.createBlock)(St,{key:2,placement:"bottom",content:(0,s.unref)(r)("排序")},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",null,[(0,s.createVNode)(_e,{visible:U.value,"onUpdate:visible":Ae[7]||(Ae[7]=Ue=>U.value=Ue),placement:"bottom","popper-style":"padding: 0",width:380,trigger:"click",onShow:B},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(Gt,{class:(0,s.normalizeClass)({active:H.value.length>0}),type:"text",icon:"mdi:sort"},null,8,["class"])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(TI,{ref_key:"orderPanelRef",ref:j,columns:x.value,onSave:W,onClear:X},null,8,["columns"])]),_:1},8,["visible"])])]),_:1},8,["content"])):(0,s.createCommentVNode)("",!0),e.showColumnButton&&!y.value?((0,s.openBlock)(),(0,s.createBlock)(St,{key:3,placement:"bottom",content:(0,s.unref)(r)("显示字段")},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",null,[(0,s.createVNode)(_e,{visible:ne.value,"onUpdate:visible":Ae[8]||(Ae[8]=Ue=>ne.value=Ue),placement:"bottom","popper-style":"padding: 0",width:400,trigger:"click",onShow:Z},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(Gt,{class:(0,s.normalizeClass)({active:O.value}),type:"text",icon:"mdi:table-headers-eye"},null,8,["class"])]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(NI,{ref_key:"columnPanelRef",ref:K,columns:e.columns,"column-config":he.value,onSave:ue},null,8,["columns","column-config"])]),_:1},8,["visible"])])]),_:1},8,["content"])):(0,s.createCommentVNode)("",!0),e.showRefreshButton&&!y.value?((0,s.openBlock)(),(0,s.createBlock)(St,{key:4,placement:"bottom",content:(0,s.unref)(r)("刷新")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(Gt,{type:"text",icon:"mdi:refresh",onClick:ke})]),_:1},8,["content"])):(0,s.createCommentVNode)("",!0),e.showFullscreenButton?((0,s.openBlock)(),(0,s.createBlock)(St,{key:5,placement:"bottom",content:se.value?(0,s.unref)(r)("退出全屏"):(0,s.unref)(r)("全屏")},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(Gt,{type:"text",icon:se.value?"mdi:fullscreen-exit":"mdi:fullscreen",onClick:we},null,8,["icon"])]),_:1},8,["content"])):(0,s.createCommentVNode)("",!0)])]),(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",zI,[e.renderVNode?((0,s.openBlock)(),(0,s.createElementBlock)("div",HI,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(c),(Ue,ea)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:e.rowKey?C(Ue):ea,onClick:Rt=>rt(Ue)},[((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(e.renderVNode(Ue))))],8,FI))),128))])):((0,s.openBlock)(),(0,s.createBlock)(qt,{key:1,ref_key:"tableRef",ref:l,"table-page":d.value,"onUpdate:tablePage":Ae[9]||(Ae[9]=Ue=>d.value=Ue),columns:b.value,"sub-columns":e.subColumns,records:(0,s.unref)(c),"is-tree":e.isTree,"default-expand-all":e.defaultExpandAll,"parent-key":e.parentKey,"is-show-number":e.isShowNumber,"is-sub-show-number":e.isSubShowNumber,"is-multiple":e.isMultiple&&!!e.rowKey,"select-state-key":e.selectStateKey,"is-page":w.value,"page-sizes":e.pageSizes,"page-size":e.pageSize,"page-total":u.value,"row-key":e.rowKey,actions:e.actions,"sub-actions":e.subActions,"actions-max-count":e.actionsMaxCount,"actions-label":e.actionsLabel,"action-filter":e.actionFilter,"highlight-mode":e.highlightMode,"load-children":e.loadChildren,onLoadPageData:re,onReady:Le,onSelectionChanged:Ie,onSelectRecordsChanged:Tt},null,8,["table-page","columns","sub-columns","records","is-tree","default-expand-all","parent-key","is-show-number","is-sub-show-number","is-multiple","select-state-key","is-page","page-sizes","page-size","page-total","row-key","actions","sub-actions","actions-max-count","actions-label","action-filter","highlight-mode","load-children"]))])),[[Nn,p.value]])]),e.showFilterButton&&M.value&&!y.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",jI,[(0,s.createVNode)(rb,{ref_key:"filterPanelRef",ref:N,"is-pin":M.value,"onUpdate:isPin":Ae[10]||(Ae[10]=Ue=>M.value=Ue),relation:oe.value,"onUpdate:relation":Ae[11]||(Ae[11]=Ue=>oe.value=Ue),"search-field-list":ee.value,columns:x.value,onFilter:de},null,8,["is-pin","relation","search-field-list","columns"])])):(0,s.createCommentVNode)("",!0)],2)],2)}}}),WI=$I,ap=be(WI),UI={class:"j-button-select"},YI={class:"search-wraper"},GI={class:"options-wraper"},qI=["onClick"],JI=(0,s.defineComponent)({name:"JButtonSelect",__name:"button-select",props:{modelValue:{default:void 0},label:{default:"添加"},popoverWidth:{default:240},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,{t:a}=vt(),i=(0,s.ref)(""),o=(0,s.computed)(()=>i.value===""?n.options:n.options.filter(u=>(u.label||"").includes(i.value))),l=(0,s.computed)(()=>n.modelValue?(n.modelValue+"").split(",").filter(Boolean):[]),c=u=>{if(u.disabled||l.value.includes(u.value))return;const d=[...l.value,u.value].join(",");r("update:modelValue",d),r("change",{value:d,data:u})};return(u,d)=>{const f=(0,s.resolveComponent)("j-button"),h=(0,s.resolveComponent)("j-icon"),p=(0,s.resolveComponent)("el-input"),g=(0,s.resolveComponent)("el-popover");return(0,s.openBlock)(),(0,s.createBlock)(g,{teleported:!1,placement:"bottom-start","popper-style":"padding: 0",width:e.popoverWidth,trigger:"click","show-arrow":!1,offset:4},{reference:(0,s.withCtx)(()=>[(0,s.createVNode)(f,{style:{"justify-content":"flex-start",padding:"4px 0",border:"0"},icon:"mdi:add",label:e.label,type:"link"},null,8,["label"])]),default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",UI,[(0,s.createElementVNode)("div",YI,[(0,s.createVNode)(p,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=v=>i.value=v),modelModifiers:{trim:!0},placeholder:(0,s.unref)(a)("搜索"),class:"no-border",clearable:""},{prefix:(0,s.withCtx)(()=>[(0,s.createVNode)(h,{icon:"mdi:search"})]),_:1},8,["modelValue","placeholder"])]),(0,s.createElementVNode)("div",GI,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(o.value,v=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:v.value,class:(0,s.normalizeClass)(["option-item",{active:l.value.includes(v.value)||v.disabled}]),onClick:(0,s.withModifiers)(m=>c(v),["stop"])},[v.icon?((0,s.openBlock)(),(0,s.createBlock)(h,{key:0,class:"j-button-select-icon",icon:v.icon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(a)(v.label)),1)],10,qI))),128))])])]),_:1},8,["width"])}}}),XI=JI,ab=be(XI),KI={class:"j-tree-item-text"},ZI={key:2,class:"j-tree-item-button-group"},QI={key:1,class:"j-block",style:{display:"flex","align-items":"center","justify-content":"center"}},eO=(0,s.defineComponent)({name:"JTree",__name:"tree",props:{loadData:Function,afterLoadData:Function,click:Function,immediate:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},defaultCheckedKeys:{type:Array,default:()=>[]},defaultExpandedKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightCurrent:{type:Boolean,default:!0},filterNode:Function,renderAfterExpand:{type:Boolean,default:!0},iconKey:{type:String,default:"nodeIcon"},iconColorKey:{type:String,default:"nodeIconColor"},list:{type:Array},dataType:String,dataCode:String,checkable:Boolean,check:Function,emptyDes:{type:String,default:"暂无数据"},defaultIcon:{type:String,default:""},defaultIconColor:{type:String,default:""},treeButtons:{type:Array,default:()=>[]},filterButton:Function,buttonDefaultIcon:{type:String,default:""},buttonIconColor:{type:String,default:""},runFlow:{type:Function},nodeClickFlow:{type:String},isHeightAuto:{type:Boolean,default:!1},theme:{type:String,default:"default"},draggable:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!1},allowDrop:Function},emits:["node-drop"],setup(e,{expose:t,emit:n}){const r=e,a=n,{useData:i,t:o}=vt(),{getDataByComp:l,loadDataByComp:c}=i(),u=(0,s.ref)(),d=(0,s.ref)(!1),f=(0,s.ref)(""),h=(0,s.ref)([]),p={children:"children",label:"label",disabled:"disabled"},g=(0,s.computed)(()=>l?l({config:r})||[]:[]),v=(0,s.computed)(()=>r.dataCode||r.dataType?g.value:r.list?(0,s.unref)(r.list):h.value),m=async()=>{d.value=!0,r.loadData&&(h.value=await r.loadData()||[]),c&&await c({type:"j-tree",config:r}),d.value=!1,(0,s.nextTick)(()=>{r.afterLoadData&&r.afterLoadData(v.value||[])})},_=(L,N=!0)=>{u.value?.setCurrentKey(L,N)},y=()=>u.value?.getCurrentKey(),w=(L,N=!1)=>{u.value?.setCheckedKeys(L,N)},C=(L=!1)=>u.value?.getCheckedKeys(L),S=async(L,N,M,I)=>{if(f.value=L.value,r.nodeClickFlow&&r.runFlow){const $=JSON.parse(r.nodeClickFlow);await r.runFlow($,{value:L.value})}r.click&&r.click(L.value,L,I)},b=(L,{checkedKeys:N,checkedNodes:M,halfCheckedKeys:I,halfCheckedNodes:$})=>{r.check&&r.check(N,{node:L,checkedNodes:M,halfCheckedKeys:I,halfCheckedNodes:$})},x=(L,N,M,I)=>{a("node-drop",L,N,M,I)},E=L=>{const N=Mn(r.treeButtons);return L&&r.filterButton?r.filterButton({buttons:N,node:L}):N},{openLayer:k}=La(),T=(L,N)=>{L.config?.disabled||L.click&&L.click({data:N,openLayer:k})},R=(0,s.ref)(""),D=(L,N)=>{R.value=L?N.value:""},A=(L,N,M)=>r.allowDrop?r.allowDrop(L,N,M):!(M=="inner"&&!N.data.canInner);return(0,s.onMounted)(async()=>{(r.immediate&&r.loadData||r.dataType||r.dataCode)&&await m()}),(0,s.watch)(()=>r.dataCode||r.dataType,()=>{m()}),t({refreshData:m,setValue:_,getValue:y,setCheck:w,getCheck:C}),(L,N)=>{const M=(0,s.resolveComponent)("j-icon"),I=(0,s.resolveComponent)("j-button"),$=(0,s.resolveComponent)("el-dropdown-item"),ee=(0,s.resolveComponent)("el-dropdown-menu"),oe=(0,s.resolveComponent)("el-dropdown"),j=(0,s.resolveComponent)("el-tree"),U=(0,s.resolveComponent)("el-empty"),H=(0,s.resolveDirective)("loading");return(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:(0,s.normalizeClass)(["j-block","j-tree",{"j-tree-menu":e.theme==="menu"}]),style:{"min-height":"60px"}},[!d.value&&v.value.length>0?((0,s.openBlock)(),(0,s.createBlock)(j,{key:0,ref_key:"treeRef",ref:u,"node-key":"value","default-checked-keys":e.defaultCheckedKeys,"default-expanded-keys":e.defaultExpandedKeys,"current-node-key":f.value,data:v.value,"default-expand-all":e.defaultExpandAll,"show-checkbox":e.checkable,props:p,"highlight-current":e.highlightCurrent,accordion:e.accordion,"filter-node-method":e.filterNode,"render-after-expand":e.renderAfterExpand,draggable:e.draggable,"allow-drop":A,"expand-on-click-node":e.expandOnClickNode,onNodeClick:S,onCheck:b,onNodeDrop:x},{default:(0,s.withCtx)(({node:B})=>[(0,s.createElementVNode)("div",{class:(0,s.normalizeClass)(["j-tree-item-wraper",{"is-focus":R.value===B.data.value}])},[B.data.openIcon?((0,s.openBlock)(),(0,s.createBlock)(M,{key:0,class:"j-tree-item-open-icon",size:18,icon:B.data.openIcon,color:B.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):(0,s.createCommentVNode)("",!0),B.data[e.iconKey]||e.defaultIcon?((0,s.openBlock)(),(0,s.createBlock)(M,{key:1,class:"j-tree-item-default-icon",size:18,icon:B.data[e.iconKey]||e.defaultIcon||"",color:B.data[e.iconColorKey]||e.defaultIconColor||""},null,8,["icon","color"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",KI,(0,s.toDisplayString)(B.label),1),E(B.data).length?((0,s.openBlock)(),(0,s.createElementBlock)("div",ZI,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(E(B.data),(W,X)=>((0,s.openBlock)(),(0,s.createBlock)(oe,{key:X,trigger:"click",onVisibleChange:K=>D(K,B.data)},{dropdown:(0,s.withCtx)(()=>[(0,s.createVNode)(ee,null,{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(W.children,(K,ne)=>((0,s.openBlock)(),(0,s.createBlock)($,{key:ne,disabled:K.disabled,divided:K.divided,onClick:(0,s.withModifiers)(he=>T(K,B.data),["stop"])},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)("div",{class:"j-flex-item",style:(0,s.normalizeStyle)({color:K.danger?"var(--j-color-danger)":K.color||e.buttonIconColor||"var(--j-color-text-2)"})},[K.icon||e.buttonDefaultIcon?((0,s.openBlock)(),(0,s.createBlock)(M,{key:0,icon:K.icon||e.buttonDefaultIcon},null,8,["icon"])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",null,(0,s.toDisplayString)((0,s.unref)(o)(K.label)),1)],4)]),_:2},1032,["disabled","divided","onClick"]))),128))]),_:2},1024)]),default:(0,s.withCtx)(()=>[(0,s.createVNode)(I,{icon:W.icon,type:"text"},null,8,["icon"])]),_:2},1032,["onVisibleChange"]))),128))])):(0,s.createCommentVNode)("",!0)],2)]),_:1},8,["default-checked-keys","default-expanded-keys","current-node-key","data","default-expand-all","show-checkbox","highlight-current","accordion","filter-node-method","render-after-expand","draggable","expand-on-click-node"])):((0,s.openBlock)(),(0,s.createElementBlock)("div",QI,[(0,s.createVNode)(U,{description:(0,s.unref)(o)(e.emptyDes)},null,8,["description"])]))],2)),[[H,d.value]])}}}),tO=eO,ib=be(tO),nO=(0,s.defineComponent)({name:"JTreeSelect",__name:"tree-select",props:{modelValue:{},options:{},checkStrictly:{type:Boolean,default:!0},renderAfterExpand:{type:Boolean,default:!0},props:{default:()=>({children:"children",label:"label",value:"value"})},size:{default:"default"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},placeholder:{default:"请选择"},dataType:{default:""},dataCode:{default:""},labelKey:{default:""},valueKey:{default:""},pidKey:{default:""},idKey:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,{useData:r}=vt(),{getDataByComp:a}=r(),i=(0,s.computed)(()=>a?a({type:"j-tree-select",config:n})||[]:[]),o=(0,s.computed)(()=>n.options?n.options:n.dataCode||n.dataType?i.value:[]),l=t,c=(0,s.computed)({get(){return n.modelValue},set(d){l("update:modelValue",d)}}),u=d=>{l("change",d)};return(d,f)=>{const h=(0,s.resolveComponent)("el-tree-select");return(0,s.openBlock)(),(0,s.createBlock)(h,{modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=p=>c.value=p),style:{width:"100%"},data:o.value,"check-strictly":e.checkStrictly,"render-after-expand":e.renderAfterExpand,props:n,size:e.size,disabled:e.disabled||e.readonly,clearable:e.clearable,placeholder:e.placeholder,onChange:u},null,8,["modelValue","data","check-strictly","render-after-expand","size","disabled","clearable","placeholder"])}}}),rO=nO,ob=be(rO),lb=be(vv),aO=Qu.default;async function iO(e,t,n){const r={...n};delete r.ruleIndex,delete r.trigger;const a=new aO({[e]:[r]});let i=[];try{await a.validate({[e]:t})}catch(o){o.errors?i=o.errors.map(({message:l})=>l):i=[r.message||"校验错误"]}return i.length>0?i[0]:""}async function oO(e,t,n){const r=n.map((a,i)=>({...a,ruleIndex:i})).sort(({warningOnly:a,ruleIndex:i},{warningOnly:o,ruleIndex:l})=>!!a==!!o?i-l:a?1:-1);for(let a=0;a<r.length;a+=1){const i=r[a];"pattern"in i&&(t+="");const o=await iO(e,t,i);if(o!=="")return{name:e,errors:o}}}function lO(e,t){const n=(i,o,l,c,u)=>{Object.keys(o).forEach(d=>{let f=d;l&&(f=`${l}.${d}`);const h=o[d],{rules:p,myGridtableId:g}=t(f,l?o:void 0,()=>c,u);if(p.length){const v=r(f,h,p);i.push(v)}g&&h.forEach(v=>{n(i,v,g,h,l?o:void 0)})})},r=(i,o,l)=>oO(i,o,l);return{validateForm:async()=>{const i=(0,s.unref)(e),o=[];n(o,i,"");const l=await Promise.all(o),c={};return l.forEach(u=>{u&&(c[u.name]={msg:u.errors})}),c},validateField:r}}var sb=({data:e,actions:t,utils:n,inputParams:r,notRunActions:a})=>{const i=l=>e.filter(c=>c.source===l).map(c=>c.target),o=async l=>{l=l||"start";const c=e.find(u=>u.id===l);if(c.config.type==="start"){const u=i(l);for(let d=0;d<u.length;d++)await o(u[d])}else{const u=t[c.config.type];u&&await u(c.config,n,async d=>{if(d=d||{},d.nodeId=l,d.next!==!1){const f=i(d.nodeId);for(let h=0;h<f.length;h++)await o(f[h])}},r,d=>{a[d]={data:e,inputParams:r}})}};return{run:o}},sO=(0,s.defineComponent)({name:"JForm",__name:"form",props:{config:{type:Object,default:()=>({})},isAutoSize:{type:Boolean,default:!0},schema:{type:Array,default:()=>[]},readonly:{type:Boolean,default:!1},actions:{type:Object,default:()=>({})}},emits:["change"],setup(e,{expose:t,emit:n}){const r=e,a=n,{useData:i,existField:o,httpGet:l,httpPost:c,success:u,warning:d,error:f,info:h,t:p}=vt();let g;i&&(g=i());const v=J=>{f&&f(J)},m=(0,s.ref)(!1),_=(0,s.computed)(()=>r.config?.gutter||16),y=(0,s.computed)(()=>r.config?.span||24),w=(0,s.computed)(()=>r.config?.labelWidth),C=(0,s.computed)(()=>r.config?.labelPosition||"right"),S=(0,s.computed)(()=>E.length===1&&(E[0].type==="j-tabs"||E[0].type==="j-layout"||E[0].config?.isAutoWindow)),b=(0,s.reactive)({}),x=(0,s.ref)({}),E=[],k={};let T={},R={},D=[],A={};const L=async J=>{m.value&&I&&(J.getTableData||rd(I,J.id,J.formData[J.id])),a("change",J),k[J.id]?.config?.codeChange&&await nt(JSON.parse(k[J.id]?.config?.codeChange),{param:J}),r.config?.codeChange&&await nt(JSON.parse(r.config?.codeChange),{param:J})},N=J=>ws(k[J]?.type||"")&&!k[J]?.config?.notInput||k[J]?.config?.isInput,M=J=>["j-table","j-input-rows","j-input-cards"].includes(k[J]?.type||"");let I;const $=(J,de)=>{Object.keys(J).forEach(re=>{const ie=J[re];de&&(re=de+"."+re),ie!=null&&typeof ie=="object"&&!ms(ie)&&$(ie,re),b[re]=ie})},ee=(J,de)=>{let re=J.id;return re||(J.config?.table&&J.config?.field?re=`${J.config.table}.${J.config.field}`:J.config?.table?re=J.config?.table:J.config?.field&&(re=J.config?.field),de&&M(de)&&(re=`${de}.${re}`)),re||_s("j")},oe=(J,de,re,ie="")=>{J.forEach(fe=>{fe.id=ee(fe,ie);const ke={id:fe.id,slot:fe.slot,type:fe.type||"",getCompType:fe.getCompType,getCompConfig:fe.getCompConfig,config:{},children:[]};de.push(ke);const{children:Le}=fe;Go(ke,fe,["children","config"]),Go(ke.config,fe.config||{},[]),k[fe.id]&&console.warn("有重复的组件id:"+fe.id),k[fe.id]=ke,r.readonly===!0&&(ke.config.readonly=!0);let Ie=!1,Tt;ie!==""&&M(ie)&&(Ie=!0,ke.config=fe.config||{},ke.config.parentTableId=ie,Tt=k[ie]?.config?.table);const rt=ke.config||{};if(N(fe.id))!re&&Ie===!1&&(rt?.defaultValue===0?b[fe.id]=rt?.defaultValue:b[fe.id]=rt?.defaultValue||void 0),rt.table&&rt.field?T[`${rt.table}_${rt.field}`.toLowerCase()]=fe.id:rt.field&&(Ie?T[`${Tt}_${rt.field}`.toLowerCase()]=fe.id:T[`${rt.field}`.toLowerCase()]=fe.id);else if(Ie&&rt.field)T[`${Tt}_${rt.field}`.toLowerCase()]=fe.id;else if(M(fe.id))!re&&!rt.isSubTable&&(b[fe.id]=[]),rt.table&&(T[rt.table.toLowerCase()||""]=fe.id),rt.isSubTable||D.push(ke);else if(rt?.defaultValue)b[fe.id]=rt?.defaultValue;else if(fe.type==="collapse"&&rt?.isExpand){const Rr=[];(rt?.groups||[]).forEach(Mr=>{Rr.push(Mr.i)}),b[fe.id]=Rr}Le&&Le.length>0&&oe(Le,ke.children,re,ke.id)})},j=async(J,de)=>{m.value=!1;const re=!!de;E.splice(0,E.length),T={},R={},D=[],I=de,Oi(b),Oi(k),re&&$(de,""),oe(J,E,re),A=Mn(b),await(0,s.nextTick)(),m.value=!0,await(0,s.nextTick)(),r.config?.codeInit&&await nt(JSON.parse(r.config?.codeInit),{param:{}})},U=(J,de,re)=>{const ie=[];return de.forEach(fe=>{const ke={};Object.keys(fe).forEach(Le=>{if(!re||re(Le,fe[Le],J)){const Ie=ue(Le);if(Ie?.type==="j-table")ke[Ie?.id||""]=U(Le,fe[Le],re);else{let Tt=T[`${J}_${Le}`.toLowerCase()]||Le;Tt=Tt.indexOf(".")!==-1?Tt.split(".")[1]:Tt,ke[Tt]=fe[Le]}}}),ie.push(ke)}),ie},H=(J,de)=>{Object.keys(J||{}).forEach(re=>{let ie=J[re];const fe=ue(re);if(fe===void 0)ie&&(ms(ie)&&(ie=ie[0]||{}),typeof ie=="object"?Object.keys(ie).forEach(ke=>{if(!de||de(re,ie[ke],re)){let Le=ke;re!=="main"&&(Le=`${re}_${ke}`),R[Le]=re,b[T[Le.toLowerCase()]||ke]=ie[ke]}}):b[re]=ie);else if(M(fe.id||"")){if(!Array.isArray(ie)){console.warn("表格数据不是数组:"+re);return}ie?.length>0?b[T[re.toLowerCase()]||re]=U(re,ie,de):b[T[re.toLowerCase()]||re]=[]}else(!de||de(re,ie,re))&&(b[T[re.toLowerCase()]||re]=ie)}),I&&Object.keys(b).forEach(re=>{const ie=ue(re);(ie===void 0||!["j-tabs","j-collapse"].includes(ie.type||""))&&rd(I,re,b[re])})},B=new Set(["parentRow","_i","_compTypeByRender"]),W=(J,de=!1)=>{const re={};return Object.keys(J).forEach(ie=>{if(B.has(ie))return;const fe=k[ie];if(fe){const ke=fe.config?.table,Le=fe.config?.field;if(de)Le?re[Le]=J[ie]:re[ie]=J[ie];else if(M(ie)){const Ie=[];J[ie].forEach(Tt=>{Ie.push(W(Tt,!0))}),re[ke||ie]=Ie}else ke&&Le?(re[ke]=re[ke]||{},re[ke][Le]=J[ie]):Le&&(re[Le]=J[ie])}else de?ie!=="_X_ROW_KEY"&&ie!=="_isHover"&&(re[ie]=J[ie]):R[ie]?(re[R[ie]]=re[R[ie]]||{},re[R[ie]][ie.replace(`${R[ie]}_`,"")]=J[ie]):re[ie]=J[ie]}),re},X=(J=!0)=>J?W(b):b,K=(J,de,re,ie)=>{let fe=k[J];if(fe==null){const Le=J.split(".");fe=k[Le[Le.length-1]]||{}}if(!fe)return{};const ke=In({config:fe.config||{},getCompConfig:fe.getCompConfig,formData:b,getTableData:re,row:de,pRowData:ie});return ke._componentId=fe?.id,ke},ne=(J,de,re,ie)=>{const fe=K(J,de,re,ie);if(fe.isNotRule!==!0&&fe.display!==!1){const ke=fe.rule||[],Le=ke.find(Ie=>Ie.type==="only");return Le&&(Le.validator=async(Ie,Tt)=>{if(Tt&&!await o({table:Ie.table,key:Ie.key,keyName:Ie.keyName,field:Ie.field,keyValue:Ie.getKeyValue?Ie.getKeyValue():"",value:Tt,paramNames:Ie.paramNames,getParams:Ie.getParams,withProjectId:Ie.withProjectId,getValue:Ie.getValue,formData:b}))throw p(Ie.message)||p("数据值重复")}),{rules:ke,myGridtableId:M(fe._componentId)?fe._componentId:""}}return{rules:[],myGridtableId:""}},{validateForm:he}=lO(b,ne),O=async()=>{x.value={};const J=await he();return Object.keys(J).length>0?(x.value=J,v(`${p(k[Object.keys(J)[0]]?.config?.label)}:${p(J[Object.keys(J)[0]].msg)}`),!1):!0},Z=()=>{x.value={},Oi(b),Object.keys(A||{}).forEach(J=>{b[J]=A[J]})},ue=J=>{let de=k[J];return de===void 0&&T[J.toLowerCase()]&&(de=k[T[J.toLowerCase()]]),de},se=({id:J,i:de,value:re,type:ie})=>{if(ie==="add")b[J].push(re);else if(ie==="delete")b[J].splice(de,1);else{const fe=ue(J);fe&&(fe.config.parentTableId?b[fe.config.parentTableId][de][J]=re:b[J]=re)}},we=({id:J,i:de})=>{const re=ue(J);if(re){if(re.config.parentTableId){const ie=b[re.config.parentTableId],fe=re.id?re.id.replace(`${re.config.parentTableId}.`,""):"";if(de!=null)return(ie[de]||{})[fe||""];const ke=[];return ie&&ie.forEach(Le=>{ke.push(Le[fe||""])}),ke}if(M(re.id||"")){const ie=[];return b[re.id||""].forEach(fe=>{ie.push(W(fe,!0))}),ie}return b[re.id||""]}if(b[J])return b[J]},Te=async({id:J,i:de})=>{const re=we({id:J,i:de}),ie=ue(J);if(ie&&g?.getLabel)if(de!==void 0){const fe=re[de],ke=b[ie.config.parentTableId||""][de],Le=In({config:ie.config,getCompConfig:ie.getCompConfig,formData:b,tableData:b[ie.config.parentTableId||""],row:ke});return await g?.getLabel({value:fe,config:Le,formData:b,tableData:b[ie.config.parentTableId||""],row:ke})}else{const fe=In({config:ie.config,getCompConfig:ie.getCompConfig,formData:b});return await g?.getLabel({value:re,config:fe,formData:b})}return re},Ee=async(J,de)=>g?.loadViewDataList?await g?.loadViewDataList(J,de,!1):[],Ye=J=>(J.set=se,J.get=we,J.setFormData=H,J.getFormData=X,J.getLabel=Te,J.getViewData=Ee,J.getDateNow=de=>Cs(new Date,de||"YYYY-MM-DD HH:mm:ss"),J.httpGet=l||(()=>{console.log("当前状态不支持")}),J.httpPost=c||(()=>{console.log("当前状态不支持")}),J.loading=de=>{na(de)},J.showMsg=({text:de,type:re})=>{switch(re){case"success":u&&u(de);break;case"warning":d&&d(de);break;case"error":f&&f(de);break;case"info":h&&h(de);break;default:h&&h(de);break}console.log("showMsg",de,re)},J),_t=async(J,de)=>{if(J&&J.trim()){J=`async (jcode) => {${J}}`;const{res:re,fn:ie}=nd(J);re&&await ie(Ye(de))}},$e=async()=>{r.config?.codeAfterSetData&&await nt(JSON.parse(r.config?.codeAfterSetData),{param:{}})},Re=async()=>{r.config?.codeBeforeSave&&await nt(JSON.parse(r.config?.codeBeforeSave),{param:{}})},Oe=async()=>{r.config?.codeAfterSave&&await nt(JSON.parse(r.config?.codeAfterSave),{param:{}})};r.schema&&j(r.schema);const Ne={},nt=async(J,de)=>{const{run:re}=sb({data:J,actions:r.actions,utils:{showLoading:na,executeEvent:_t},inputParams:de,notRunActions:Ne});await re()};return od({formData:b,components:k,errorFields:x,isAutoWindow:S,gutter:_,span:y,labelWidth:w,labelPosition:C,getValue:we,formChange:L,runFlow:nt,runFlowByNotRunActions:async J=>{const de=Ne[J];de&&(delete Ne[J],await nt(de.data,de.inputParams))}}),ld({contextType:"form"}),t({init:j,reset:Z,validate:O,setValue:se,getValue:we,getLabel:Te,setFormData:H,getFormData:X,afterSetData:$e,beforeSave:Re,afterSave:Oe}),(J,de)=>{const re=(0,s.resolveComponent)("j-form-item"),ie=(0,s.resolveComponent)("el-row"),fe=(0,s.resolveComponent)("el-form");return m.value?((0,s.openBlock)(),(0,s.createBlock)(fe,{key:0,class:(0,s.normalizeClass)(["j-form",e.isAutoSize&&"j-block",e.isAutoSize&&"j-form-auto"]),"label-position":C.value,"label-width":w.value,size:e.config?.size,onSubmit:de[0]||(de[0]=(0,s.withModifiers)(()=>{},["prevent"]))},{default:(0,s.withCtx)(()=>[S.value?((0,s.openBlock)(),(0,s.createBlock)(re,(0,s.mergeProps)({key:0},E[0],{"is-not-col":""}),null,16)):((0,s.openBlock)(),(0,s.createBlock)(ie,{key:1,gutter:_.value},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(E,ke=>(0,s.createVNode)(re,(0,s.mergeProps)({key:ke.id},{ref_for:!0},ke),null,16)),64))]),_:1},8,["gutter"]))]),_:1},8,["class","label-position","label-width","size"])):(0,s.createCommentVNode)("",!0)}}}),cO=sO,cb=be(cO),ub=be(gv),uO={class:"j-page"},dO=(0,s.defineComponent)({name:"JPage",__name:"page",props:{schema:{type:Array,default:()=>[]},noPadding:{type:Boolean,deflaut:!1},actions:{type:Object,default:()=>({})}},setup(e,{expose:t}){const n=e,r=(0,s.ref)(!1),a=(0,s.reactive)([]),i={},o=(0,s.reactive)({}),l=(y,w)=>{y.forEach(C=>{C.id=C.id||_s("c");const S={id:C.id,slot:C.slot,type:C.type||"",getCompConfig:C.getCompConfig,getCompType:C.getCompType},{children:b}=C;i[C.id]=S,S.config=[],Go(S.config,C.config||{},["defaultValue"]),C?.config?.defaultValue!==void 0&&(o[C.id]=C.config.defaultValue),w.push(S),b&&b.length>0&&(S.children=[],l(b,S.children))})},c=y=>{r.value=!1,a.splice(0,a.length),Oi(i),Oi(o),l(y,a),(0,s.nextTick)(()=>{r.value=!0})};n.schema&&c(n.schema);const{openLayer:u}=La(),d={},f=async(y,w)=>{const{run:C}=sb({data:y,actions:n.actions,utils:{showLoading:na,openLayer:u,call:v},inputParams:w,notRunActions:d});await C()},h=async y=>{const w=d[y];w&&(delete d[y],await f(w.data,w.inputParams))},p=new id,g=new Map,v=(y,w,C,...S)=>{if(C?.immediate){const b=g.get(y)||new Map;b.set(w,S),g.set(y,b)}return p.emit(y,w,...S)},m=(y,w)=>{p.on(y,w);const C=g.get(y);C&&(g.delete(y),C.forEach((S,b)=>{w(b,...S||[])}))},_=(y,w)=>{p.off(y,w)};return Xg({registerMethod:(y,w)=>(m(y,w),()=>{_(y,w)}),runFlow:f,runFlowByNotRunActions:h}),ld({contextType:"page"}),t({init:c,call:v,on:m,off:_}),(y,w)=>{const C=(0,s.resolveComponent)("j-comp");return(0,s.openBlock)(),(0,s.createElementBlock)("div",uO,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(a,S=>((0,s.openBlock)(),(0,s.createBlock)(C,{key:S.id,id:S.id,type:S.type,config:S.config,children:S.children},null,8,["id","type","config","children"]))),128))])}}}),fO=dO,db=be(fO),hO=(0,s.defineComponent)({name:"JGuid",__name:"guid",props:{modelValue:{default:void 0},size:{default:"default"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)("");return(0,s.watch)(()=>n.modelValue,i=>{i?a.value=i:(a.value=Nr(),r("update:modelValue",a.value))},{immediate:!0}),(i,o)=>{const l=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createBlock)(l,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=c=>a.value=c),readonly:"",size:e.size},null,8,["modelValue","size"])}}}),pO=hO,fb=be(pO),gO={key:0,class:"j-panel-top"},vO=["title"],mO={style:{margin:"0","font-size":"14px"}},yO={key:1},_O={key:1,class:"j-panel-bottom"},wO=(0,s.defineComponent)({name:"JPanel",__name:"panel",props:{title:{},toolBtns:{default:()=>[]},bootmBtns:{default:()=>[]},bootmRightBtns:{default:()=>[]},bodyStyle:{default:()=>({padding:"8px"})},noPadding:{type:Boolean,default:!1},notTitle:{type:Boolean,default:!1},flexWidth:{},height:{},unit:{default:"%"},notSetWidth:{type:Boolean,default:!1},size:{default:"default"}},setup(e){const{openLayer:t}=La(),n=r=>{r.config?.disabled||r.click&&r.click({openLayer:t})};return(r,a)=>{const i=(0,s.resolveComponent)("j-button"),o=(0,s.resolveComponent)("el-tooltip"),l=(0,s.resolveComponent)("j-buttons");return(0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"j-block",style:(0,s.normalizeStyle)({padding:e.noPadding?void 0:"4px",width:(e.notSetWidth?100:e.flexWidth||100)+"%",height:`${e.height?e.height+(e.unit||"%"):"100%"}`})},[(0,s.createElementVNode)("div",{class:"j-panel",style:(0,s.normalizeStyle)({"border-radius":e.noPadding?"0px":"4px"})},[e.title&&!e.notTitle||e.toolBtns&&e.toolBtns.length>0?((0,s.openBlock)(),(0,s.createElementBlock)("div",gO,[e.notTitle?(0,s.createCommentVNode)("",!0):((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,class:"j-panel-top-left",title:e.title||""},[(0,s.renderSlot)(r.$slots,"title",{},()=>[(0,s.createElementVNode)("span",mO,(0,s.toDisplayString)(e.title||""),1)])],8,vO)),e.toolBtns&&e.toolBtns.length>0?((0,s.openBlock)(),(0,s.createElementBlock)("span",yO,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.toolBtns,c=>((0,s.openBlock)(),(0,s.createBlock)(o,{key:c.id,placement:"top",content:c.label||""},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(i,(0,s.mergeProps)({ref_for:!0},c.config,{onClick:u=>n(c),type:"text",size:e.size}),null,16,["onClick","size"])]),_:2},1032,["content"]))),128))])):(0,s.createCommentVNode)("",!0)])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",{class:"j-panel-body",style:(0,s.normalizeStyle)(e.bodyStyle)},[(0,s.renderSlot)(r.$slots,"default")],4),e.bootmBtns&&e.bootmBtns.length>0||e.bootmRightBtns&&e.bootmRightBtns.length>0?((0,s.openBlock)(),(0,s.createElementBlock)("div",_O,[(0,s.createVNode)(l,{list:e.bootmBtns},null,8,["list"]),(0,s.createVNode)(l,{list:e.bootmRightBtns},null,8,["list"])])):(0,s.createCommentVNode)("",!0)],4)],4)}}}),bO=wO,hb=be(bO),CO={class:"j-input-rows"},SO={key:0,class:"j-input-rows-num"},xO={key:1,class:"j-input-rows-char"},EO=(0,s.defineComponent)({name:"JInputRows",__name:"input-rows",props:{modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},isCompact:{type:Boolean,default:!1},showNum:{type:Boolean,default:!1},showChar:{type:Boolean,default:!1},isWrap:{type:Boolean,default:!1},id:{type:String,default:""},actions:{type:Array,default:()=>[]}},emits:["update:modelValue","change","rowChange"],setup(e,{emit:t}){const n=b=>b==null,r=e,a=t,{formData:i}=ra(),o=(0,s.computed)(()=>r.editConfig.isAddBtn!==!1),l=(0,s.computed)(()=>r.editConfig.addBtnText||"添加"),c=(0,s.computed)(()=>r.editConfig.buttonsAlign||"left"),u=(0,s.computed)(()=>r.editConfig.isRemoveBtn!==!1),d=(0,s.computed)(()=>r.editConfig.readonly),f=(0,s.computed)(()=>r.editConfig.drag),h=(0,s.computed)(()=>r.editConfig.isNullValue!==!1),p=(0,s.ref)(),g=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],v=(0,s.ref)([]);r.modelValue&&r.modelValue.length>0?(v.value=r.modelValue||[],v.value.forEach(b=>{b._i||(b._i=Nr())})):(v.value=[],a("update:modelValue",v.value)),(0,s.watch)(()=>r.modelValue,b=>{v.value=r.modelValue||[],v.value=b||[],v.value.forEach(x=>{x._i||(x._i=Nr())})},{deep:!0});const _=b=>{const x={};return!r.isCompact&&b.config?.colWidth&&(x.width=`${b.config.colWidth}px`),x},y=()=>{const b={_i:Nr()};r.columns.forEach(x=>{const E=x.config?.valueRowKey||x.id||"";x.type==="j-layer-form"?x.config?.defaultValue&&Object.prototype.toString.call(x.config.defaultValue)==="[object Object]"&&Object.assign(b,Mn(x.config?.defaultValue)):E&&(b[E]=Mn(x.config?.defaultValue))}),v.value.push(b),a("change",{id:r.id,value:b,data:b,formData:i,tableData:v.value,type:"add"})},w=b=>{const x=v.value[b];v.value.splice(b,1),a("change",{id:r.id,value:x,data:x,formData:i,tableData:v.value,type:"delete"})},C=b=>{a("rowChange",b)};(0,s.onMounted)(()=>{if(!f.value||!p.value)return;const b=p.value,{initSortable:x}=Hg(b,{handle:".j-input-rows-drag",onEnd:E=>{const{oldIndex:k,newIndex:T}=E;if(n(k)||n(T)||k===T||k<0||T<0)return;const R=v.value.splice(k,1)[0];v.value.splice(T,0,R),a("change",{id:r.id,value:R,data:R,formData:i,tableData:v.value,type:"sort"})}});x()});const{row:S}=xs();return Xo({getTableData:()=>v.value,rowChange:C,pRowData:S}),(b,x)=>{const E=(0,s.resolveComponent)("j-comp"),k=(0,s.resolveComponent)("j-icon"),T=(0,s.resolveComponent)("j-button"),R=(0,s.resolveComponent)("j-buttons");return(0,s.openBlock)(),(0,s.createElementBlock)("div",CO,[(0,s.createElementVNode)("div",{ref_key:"inputRowsRef",ref:p,class:"j-input-rows-container"},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(v.value,(D,A)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:D._i+A,class:(0,s.normalizeClass)([e.isCompact?"j-space-compact":"j-space",{"j-space-wrap":e.isWrap}])},[e.showNum?((0,s.openBlock)(),(0,s.createElementBlock)("div",SO,(0,s.toDisplayString)(A+1),1)):(0,s.createCommentVNode)("",!0),e.showChar?((0,s.openBlock)(),(0,s.createElementBlock)("div",xO,(0,s.toDisplayString)(g[A%26]),1)):(0,s.createCommentVNode)("",!0),((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.columns,L=>((0,s.openBlock)(),(0,s.createBlock)(E,(0,s.mergeProps)({key:L.id,ref_for:!0},L,{row:D,style:_(L)}),null,16,["row","style"]))),128)),f.value?((0,s.openBlock)(),(0,s.createBlock)(k,{key:2,class:"j-input-rows-drag",icon:"mdi:drag"})):(0,s.createCommentVNode)("",!0),u.value&&(h.value||v.value.length>1)&&!d.value?((0,s.openBlock)(),(0,s.createBlock)(k,{key:3,icon:"mdi:delete-outline",class:"j-input-rows-delete",onClick:L=>w(A)},null,8,["onClick"])):(0,s.createCommentVNode)("",!0)],2))),128))],512),!d.value&&o.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,style:(0,s.normalizeStyle)({"text-align":c.value}),class:"j-input-rows-actions"},[o.value?((0,s.openBlock)(),(0,s.createBlock)(T,{key:0,type:"link",style:{"margin-right":"8px"},label:l.value,icon:"mdi:add",onClick:y},null,8,["label"])):(0,s.createCommentVNode)("",!0),e.actions&&e.actions.length>0?((0,s.openBlock)(),(0,s.createBlock)(R,{key:1,list:e.actions},null,8,["list"])):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0)])}}}),kO=EO,pb=be(kO),TO={class:"j-input-layer"},RO=(0,s.defineComponent)({name:"JInputLayer",__name:"input-layer",props:{modelValue:{default:""},icon:{default:"mdi:library-edit-outline"},width:{default:800},height:{default:600},title:{},placeholder:{default:"请选择"},isMultiSelect:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},idKey:{},pidKey:{default:"value"},isTree:{type:Boolean,default:!1},isPage:{type:Boolean,default:!1},sidx:{},columns:{default:()=>[]},loadLayerData:{},renderVNode:{},getText:{},beforeOpen:{},readonly:{type:Boolean,default:!1},size:{default:"default"},clearable:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},mode:{default:"serve"},searchInputList:{default:()=>[]},onlyButton:{type:Boolean,default:!1},buttonLabel:{},buttonType:{},buttonShape:{},buttonGhost:{type:Boolean},buttonDanger:{type:Boolean},isSaveSelectData:{type:Boolean,default:!1},buttons:{default:()=>[]}},emits:["update:modelValue","change"],setup(e,{expose:t,emit:n}){const r=y=>!!(y==null||typeof y=="string"&&y.trim()===""||Array.isArray(y)&&y.length===0),a=e,i=n,o=(0,s.ref)(),l=(0,s.ref)(),c=(0,s.ref)(""),u=(0,s.computed)(()=>!!a.renderVNode&&!a.isMultiSelect),d=(0,s.computed)({get(){return a.modelValue},set(y){i("update:modelValue",y)}}),f=(0,s.computed)({get(){return r(d.value)?"":a.getText?a.getText(d.value)||c.value||d.value:c.value||d.value},set(y){y||p()}}),h=async()=>{a.readonly||a.beforeOpen&&await a.beforeOpen()===!1||o.value.open()},p=()=>{c.value="",d.value="",i("change",{value:"",data:void 0})},g=async({checked:y})=>{u.value&&y&&(await(0,s.nextTick)(),await v())},v=async()=>{if(!l.value)return;const y=l.value.getSelection();if(a.isMultiSelect){const w=[],C=[];y.forEach(S=>{const b=S[a.labelKey],x=S[a.valueKey];w.push(b!=null?String(b):""),x===0||x?C.push(String(x)):C.push("")}),c.value=w.join(","),d.value=C.join(","),i("change",{value:C.join(","),data:y})}else if(y.length>0){const w=y[0],C=w[a.labelKey],S=w[a.valueKey];c.value=C!=null?String(C):"";const b=S!=null?String(S):"";d.value=b,i("change",{value:b,data:w})}else c.value="",d.value="",i("change",{value:"",data:void 0});o.value.close()},m=()=>{l.value&&l.value.clearSelection&&l.value.clearSelection()};return t({getTablePanelRef:()=>l.value}),(y,w)=>{const C=(0,s.resolveComponent)("el-input");return(0,s.openBlock)(),(0,s.createElementBlock)("div",TO,[e.onlyButton?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(ys),{key:1,type:e.buttonType,size:e.size,label:e.buttonLabel,icon:e.icon,shape:e.buttonShape,ghost:e.buttonGhost,danger:e.buttonDanger,onClick:h},null,8,["type","size","label","icon","shape","ghost","danger"])):((0,s.openBlock)(),(0,s.createBlock)(C,{key:0,modelValue:f.value,"onUpdate:modelValue":w[0]||(w[0]=S=>f.value=S),placeholder:e.placeholder,readonly:!0,size:e.size,clearable:!e.readonly&&e.clearable,onClick:h,onClear:p},(0,s.createSlots)({_:2},[e.readonly?void 0:{name:"append",fn:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(ys),{icon:e.icon,onClick:h},null,8,["icon"])]),key:"0"}]),1032,["modelValue","placeholder","size","clearable"])),(0,s.createVNode)((0,s.unref)(cd),{ref_key:"layerRef",ref:o,title:e.title||e.placeholder,width:e.width,height:e.height,"has-btns":!u.value,"btn-text":"确定",onOk:v,onClosed:m},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(ap),{ref_key:"tableRef",ref:l,columns:e.columns,"row-key":e.valueKey,"is-tree":e.isTree,"is-page":e.isPage,sort:e.sidx,"is-multiple":e.isMultiSelect,"load-data":e.loadLayerData,"render-v-node":e.renderVNode,immediate:!0,onSelect:g},null,8,["columns","row-key","is-tree","is-page","sort","is-multiple","load-data","render-v-node"])]),_:1},8,["title","width","height","has-btns"])])}}}),MO=RO,gb=be(MO),BO=(0,s.defineComponent)({name:"JLayerForm",__name:"layer-form",props:{icon:{type:String,default:"mdi:form-outline"},type:{type:String,default:"default"},size:{type:String,default:"default"},layerLabel:{type:String,default:"设置"},layerHeight:{type:Number,default:400},layerWidth:{type:Number,default:600},formConfig:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]}},setup(e){const t=e,n=ra(),{t:r}=vt(),a=(0,s.computed)(()=>t.formConfig?.gutter||16),i=(0,s.computed)(()=>t.formConfig?.span||24),o=(0,s.computed)(()=>t.formConfig?.labelWidth||n.labelWidth?.value),l=(0,s.computed)(()=>t.formConfig?.labelPosition||n.labelPosition?.value||"right"),c=(0,s.computed)(()=>t.schema?.length===1&&(t.schema?.[0]?.type==="j-tabs"||t.schema?.[0]?.type==="j-layout"||t.schema?.[0]?.config?.isAutoWindow)),u=(0,s.ref)(!1),d=()=>{u.value=!0};return od({...n,isAutoWindow:c,gutter:a,span:i,labelWidth:o}),(f,h)=>{const p=(0,s.resolveComponent)("j-button"),g=(0,s.resolveComponent)("j-form-item"),v=(0,s.resolveComponent)("el-row"),m=(0,s.resolveComponent)("el-form"),_=(0,s.resolveComponent)("j-dialog");return(0,s.openBlock)(),(0,s.createElementBlock)("div",null,[(0,s.createVNode)(p,(0,s.mergeProps)(f.$attrs,{type:e.type,size:e.size,icon:e.icon,onClick:d}),null,16,["type","size","icon"]),(0,s.createVNode)(_,{visible:u.value,"onUpdate:visible":h[1]||(h[1]=y=>u.value=y),title:(0,s.unref)(r)(e.layerLabel||"设置"),height:e.layerHeight||400,width:e.layerWidth||600,"has-btns":!1},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(m,{class:(0,s.normalizeClass)(["j-block","j-layer-form"]),"label-position":l.value,"label-width":o.value,size:e.formConfig?.size,onSubmit:h[0]||(h[0]=(0,s.withModifiers)(()=>{},["prevent"]))},{default:(0,s.withCtx)(()=>[c.value?((0,s.openBlock)(),(0,s.createBlock)(g,(0,s.normalizeProps)((0,s.mergeProps)({key:0},e.schema[0])),null,16)):((0,s.openBlock)(),(0,s.createBlock)(v,{key:1,gutter:a.value},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.schema,y=>((0,s.openBlock)(),(0,s.createBlock)(g,(0,s.mergeProps)({key:y.id,ref_for:!0},y),null,16))),128))]),_:1},8,["gutter"]))]),_:1},8,["label-position","label-width","size"])]),_:1},8,["visible","title","height","width"])])}}}),DO=BO,vb=be(DO),AO=(0,s.defineComponent)({name:"JSwitch",inheritAttrs:!1,__name:"switch",props:{modelValue:{type:[Boolean,String,Number],default:!1},size:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},activeText:{},inactiveText:{},activeIcon:{},inactiveIcon:{},activeActionIcon:{},inactiveActionIcon:{},width:{default:40},inlinePrompt:{type:Boolean,default:!1},name:{},validateEvent:{type:Boolean,default:!0},beforeChange:{},id:{},tabindex:{},ariaLabel:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.computed)({get(){return n.modelValue},set(o){r("update:modelValue",o)}}),i=o=>{r("change",o)};return(0,s.onMounted)(()=>{n.autoFocus&&!n.readonly&&setTimeout(()=>{const o=a.value===n.activeValue?n.inactiveValue:n.activeValue;a.value=o,i(o)},100)}),(o,l)=>{const c=(0,s.resolveComponent)("el-switch");return(0,s.openBlock)(),(0,s.createBlock)(c,(0,s.mergeProps)(o.$attrs,{id:e.id,modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=u=>a.value=u),size:e.size,width:e.width,"inline-prompt":e.inlinePrompt,"active-icon":e.activeIcon,"inactive-icon":e.inactiveIcon,"active-action-icon":e.activeActionIcon,"inactive-action-icon":e.inactiveActionIcon,"active-text":e.activeText,"inactive-text":e.inactiveText,"active-value":e.activeValue,"inactive-value":e.inactiveValue,name:e.name,"validate-event":e.validateEvent,"before-change":e.beforeChange,tabindex:e.tabindex,"aria-label":e.ariaLabel,loading:e.loading,disabled:e.disabled||e.readonly,onChange:i}),(0,s.createSlots)({_:2},[o.$slots["active-action"]?{name:"active-action",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(o.$slots,"active-action")]),key:"0"}:void 0,o.$slots["inactive-action"]?{name:"inactive-action",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(o.$slots,"inactive-action")]),key:"1"}:void 0,o.$slots.active?{name:"active",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(o.$slots,"active")]),key:"2"}:void 0,o.$slots.inactive?{name:"inactive",fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(o.$slots,"inactive")]),key:"3"}:void 0]),1040,["id","modelValue","size","width","inline-prompt","active-icon","inactive-icon","active-action-icon","inactive-action-icon","active-text","inactive-text","active-value","inactive-value","name","validate-event","before-change","tabindex","aria-label","loading","disabled"])}}}),PO=AO,mb=be(PO),NO=(0,s.defineComponent)({name:"JTabs",__name:"tabs",props:{modelValue:{},type:{default:""},closable:{type:Boolean,default:!1},addable:{type:Boolean,default:!1},editable:{type:Boolean,default:!1},tabPosition:{default:"top"},stretch:{type:Boolean,default:!1},beforeLeave:{},isFill:{type:Boolean}},emits:["update:modelValue","tab-click","tab-change","tab-remove","tab-add","edit"],setup(e,{emit:t}){const n=t,r=u=>{n("update:modelValue",u)},a=(u,d)=>{n("tab-click",u,d)},i=u=>{n("tab-change",u)},o=u=>{n("tab-remove",u)},l=()=>{n("tab-add")},c=(u,d)=>{n("edit",u,d)};return(u,d)=>{const f=(0,s.resolveComponent)("el-tabs");return(0,s.openBlock)(),(0,s.createBlock)(f,(0,s.mergeProps)(u.$attrs,{class:{isFill:e.isFill},"model-value":e.modelValue,type:e.type,closable:e.closable,addable:e.addable,editable:e.editable,"tab-position":e.tabPosition,stretch:e.stretch,"before-leave":e.beforeLeave,"onUpdate:modelValue":r,onTabClick:a,onTabChange:i,onTabRemove:o,onTabAdd:l,onEdit:c}),{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(u.$slots,"default")]),_:3},16,["class","model-value","type","closable","addable","editable","tab-position","stretch","before-leave"])}}}),LO=NO,yb=be(LO),IO=(0,s.defineComponent)({name:"JCollapse",__name:"collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=t,r=i=>{n("update:modelValue",i)},a=i=>{n("change",i)};return(i,o)=>{const l=(0,s.resolveComponent)("el-collapse");return(0,s.openBlock)(),(0,s.createBlock)(l,(0,s.mergeProps)(i.$attrs,{"model-value":e.modelValue,accordion:e.accordion,onChange:a,"onUpdate:modelValue":r}),{default:(0,s.withCtx)(()=>[(0,s.renderSlot)(i.$slots,"default")]),_:3},16,["model-value","accordion"])}}}),OO=IO,_b=be(OO),VO={class:"j-editor"},zO=(0,s.defineComponent)({name:"JEditor",__name:"editor",props:{value:{type:String,default:""},height:{type:[String,Number],default:300},options:{type:Object,default:()=>({})},placeholder:{type:String,default:void 0},readonly:{type:Boolean,default:!1},isUploadImg:{type:Boolean,default:!0},token:{type:String,default:""},apiUrl:{type:String,default:""}},emits:["update:value","change"],setup(e,{emit:t}){const n=e,r=t,a=(0,s.ref)(),i=(0,s.ref)(),o=(0,s.shallowRef)(),l=(0,s.computed)(()=>({height:typeof n.height=="number"?`${n.height}px`:n.height,overflowY:"hidden"}));let c=!1;const u=f=>{if(!f)return"";let h=f;return n.apiUrl&&n.token&&(h=h.replace(/{jcode_img_api}/g,`${n.apiUrl}/system/annexesfile/`).replace(/{jcode_img_token}/g,`token=${n.token}`)),h},d=f=>{if(!f)return"";let h=f;if(n.apiUrl){const p=`${n.apiUrl}/system/annexesfile/`;h=h.split(p).join("{jcode_img_api}"),n.token&&(h=h.split(`token=${n.token}`).join("{jcode_img_token}"))}return h};return(0,s.onMounted)(()=>{const f={placeholder:n.placeholder||"请输入内容...",readOnly:n.readonly,MENU_CONF:{},...n.options};f.onChange=p=>{if(c)return;const g=d(p.getHtml());r("update:value",g),r("change",{value:g})};const h=(0,hg.createEditor)({selector:a.value,html:u(n.value),config:f,mode:"default"});o.value=h,(0,hg.createToolbar)({editor:h,selector:i.value,mode:"default"})}),(0,s.watch)(()=>n.value,f=>{const h=o.value;if(h){const p=h.getHtml(),g=u(f);d(p)!==f&&(c=!0,h.setHtml(g),c=!1)}}),(0,s.watch)(()=>n.readonly,f=>{const h=o.value;h&&(f?h.disable():h.enable())}),(0,s.onBeforeUnmount)(()=>{const f=o.value;f?.destroy()}),(f,h)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",VO,[(0,s.createElementVNode)("div",{ref_key:"toolbarRef",ref:i,class:"j-editor-toolbar"},null,512),(0,s.createElementVNode)("div",{ref_key:"editorRef",ref:a,class:"j-editor-content",style:(0,s.normalizeStyle)(l.value)},null,4)]))}}),HO=Vw(zO,[["__scopeId","data-v-d513e01b"]]),wb=be(HO),FO={key:0,class:"j-map-loading"},jO=(0,s.defineComponent)({name:"JMap",__name:"map",props:{address:String,lng:Number,lat:Number,height:{type:String,default:"300px"},mapKey:{type:String,default:""}},emits:["update:address","update:lng","update:lat","change"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(!0),o=(0,s.ref)();let l=null,c=null,u=null,d=null;const f=async()=>{i.value=!0;try{l=await Fg(r.mapKey)}catch(_){console.error("Failed to load Baidu Map:",_),i.value=!1;return}if(c!=null){p(r.lng,r.lat),i.value=!1;return}if(!o.value)return;c=new l.Map(o.value,{enableMapClick:!1});const m=new l.Point(121.480248,31.236276);c.centerAndZoom(m,17),u=new l.Marker(m,{enableDragging:!0}),c.addOverlay(u),u.addEventListener("dragend",_=>{h(_.point)}),c.addControl(new l.NavigationControl({anchor:window.BMAP_ANCHOR_TOP_RIGHT,type:window.BMAP_NAVIGATION_CONTROL_SMALL})),d=new l.GeolocationControl({anchor:window.BMAP_ANCHOR_BOTTOM_LEFT}),d.addEventListener("locationSuccess",_=>{h(_.point)}),d.addEventListener("locationError",_=>{alert(_.message)}),c.addControl(d),c.addEventListener("click",_=>{h(_.point)}),c.enableScrollWheelZoom(!0),p(r.lng,r.lat),i.value=!1},h=m=>{new l.Geocoder().getLocation(m,_=>{u.setPosition(m),c.panTo(m),a("update:address",_.address),a("update:lng",m.lng),a("update:lat",m.lat),a("change",{value:{address:_.address,lng:m.lng,lat:m.lat}})})},p=(m,_)=>{if(m&&_&&l){const y=new l.Point(m,_);u&&u.setPosition(y),c&&c.panTo(y)}};let g=null;return t({setPoint:p,querySearchAsync:(m,_)=>{!c||!l||(g||(g=new l.LocalSearch(c,{onSearchComplete:y=>{const w=[];if(y){const C=y.getCurrentNumPois();for(let S=0;S<C;S++)w.push(y.getPoi(S))}_(w)}})),g.search(m))}}),(0,s.onMounted)(()=>{f()}),(m,_)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"j-map",style:(0,s.normalizeStyle)({height:e.height})},[i.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",FO,[(0,s.createVNode)(Na,{icon:"mdi:loading",class:"is-loading",size:30})])):(0,s.createCommentVNode)("",!0),(0,s.createElementVNode)("div",{ref_key:"mapRef",ref:o,class:"j-map-container"},null,512)],4))}}),$O=jO,bb=be($O),WO=(0,s.defineComponent)({name:"JInputMap",__name:"input-map",props:{modelValue:{type:[String],default:null},placeholder:{type:String,default:"请选择"},readonly:Boolean,size:{type:String},clearable:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=t,{t:a}=vt(),i=(0,s.ref)(),o=(0,s.ref)(),l=(0,s.ref)(),c=(0,s.ref)(""),u=(0,s.ref)(0),d=(0,s.ref)(0),f=(0,s.ref)(""),h=(0,s.computed)(()=>{let C=n.modelValue||"";if(n.modelValue===null&&(C=(0,s.unref)(f)),ln(C))return{address:"",lng:0,lat:0};const S=C.split(",");return{address:S[0],lng:parseFloat(S[1]),lat:parseFloat(S[2])}}),p=(0,s.computed)({get(){return h.value.address},set(){f.value="",r("update:modelValue",void 0)}}),g=()=>{o.value.blur()},v=()=>{o.value.blur(),c.value=h.value.address,u.value=h.value.lng,d.value=h.value.lat,i.value.open("请选择地址"),setTimeout(()=>{l.value?.call("map","setPoint",null,u.value,d.value)},100)},m=(0,s.ref)([]),_=[{type:"j-layout",config:{class:["j-block"]},children:[{type:"div",slot:"top",config:{style:{padding:"8px"}},children:[{type:"el-autocomplete",config:{style:{width:"100%"},placeholder:a("请填写详细地址"),modelValue:c,value:c,fetchSuggestions:async(C,S)=>{S((0,s.unref)(m))},onInput:async C=>{c.value=C,l.value?.call("map","querySearchAsync",null,C,S=>{m.value=S.map(b=>({...b,value:`(${b.title}): ${b.address}`}))})},onSelect:C=>{c.value=`(${C.title})${C.address}`,u.value=C.point.lng,d.value=C.point.lat,l.value?.call("map","setPoint",null,C.point.lng,C.point.lat)}},children:[{slot:"option",config:{h:C=>(0,s.h)("div",{},[(0,s.h)("div",{style:{color:"var(--j-color-text)","font-size":"14px"}},C.title),(0,s.h)("div",{style:{color:"var(--color-text-secondary)","font-size":"12px","margin-bottom":"4px"}},C.address)])}}]}]},{type:"j-map",id:"map",config:{address:c,lng:u,lat:d,height:"100%",onChange:C=>{c.value=C.value.address,u.value=C.value.lng,d.value=C.value.lat}}}]}],y=()=>{!ln(c.value)&&!ln(u.value)&&!ln(d.value)?(f.value=`${c.value},${u.value},${d.value}`,r("update:modelValue",f.value),r("change",f.value)):(r("update:modelValue",void 0),r("change",void 0)),i.value.close()},w=()=>{};return(C,S)=>{const b=(0,s.resolveComponent)("j-button"),x=(0,s.resolveComponent)("el-input"),E=(0,s.resolveComponent)("j-page"),k=(0,s.resolveComponent)("j-layer");return(0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createVNode)(x,{modelValue:p.value,"onUpdate:modelValue":S[0]||(S[0]=T=>p.value=T),placeholder:e.placeholder?(0,s.unref)(a)(e.placeholder):void 0,readonly:e.readonly,size:e.size,clearable:e.readonly?!1:e.clearable,onFocus:g,ref_key:"inputRef",ref:o,class:"j-input-layer"},{append:(0,s.withCtx)(()=>[(0,s.createVNode)(b,{icon:"mdi:map-marker-outline",disabled:e.readonly,size:e.size,onClick:v},null,8,["disabled","size"])]),_:1},8,["modelValue","placeholder","readonly","size","clearable"]),(0,s.createElementVNode)("div",(0,s.normalizeProps)((0,s.guardReactiveProps)(C.$attrs)),null,16),(0,s.createVNode)(k,{ref_key:"layerRef",ref:i,width:900,height:500,"btn-text":"确认",destroyOnClose:!1,onOk:y,onClosed:w,style:{height:"0"}},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(E,{style:{padding:"0"},schema:_,ref_key:"indexRef",ref:l},null,512)]),_:1},512)],64)}}}),UO=WO,Cb=be(UO);function Sb(e){!e||typeof e.stopPropagation!="function"||e.stopPropagation()}function Ro(e){return e.originalEvent||e.srcEvent}function ip(e){Sb(e),Sb(Ro(e))}function Mo(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}var xb=1500;function Eb(e,t,n){var r=this,a=n.get("dragging",!1);function i(o){if(!o.hover){var l=o.originalEvent,c=r._findTargetGfx(l),u=c&&e.get(c);c&&u&&(o.stopPropagation(),a.hover({element:u,gfx:c}),a.move(l))}}a&&t.on("drag.start",function(o){t.once("drag.move",xb,function(l){i(l)})}),(function(){var o,l;t.on("element.hover",function(c){o=c.gfx,l=c.element}),t.on("element.hover",xb,function(c){l&&t.fire("element.out",{element:l,gfx:o})}),t.on("element.out",function(){o=null,l=null})})(),this._findTargetGfx=function(o){var l,c;if(o instanceof MouseEvent)return l=Mo(o),c=document.elementFromPoint(l.x,l.y),YO(c)}}Eb.$inject=["elementRegistry","eventBus","injector"];function YO(e){return(0,te.closest)(e,"svg, .djs-element",!0)}var GO={__init__:["hoverFix"],hoverFix:["type",Eb]};function kb(){return/mac/i.test(navigator.platform)}function Tb(e,t){return(Ro(e)||e).button===t}function pa(e){return Tb(e,0)}function qO(e){return Tb(e,1)}function Rb(e){var t=Ro(e)||e;return pa(e)?kb()?t.metaKey:t.ctrlKey:!1}function op(e){var t=Ro(e)||e;return pa(e)&&t.shiftKey}function Fl(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function JO(e){return["M",e.x,e.y]}function lp(e){return["L",e.x,e.y]}function XO(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function KO(e,t){const n=e.length,r=[JO(e[0])];for(let a=1;a<n;a++){const i=e[a-1],o=e[a],l=e[a+1];if(!l||!t){r.push(lp(o));continue}const c=Math.min(t,sp(o.x-i.x,o.y-i.y),sp(l.x-o.x,l.y-o.y));if(!c){r.push(lp(o));continue}const u=iu(o,i,c),d=iu(o,i,c*.5),f=iu(o,l,c),h=iu(o,l,c*.5);r.push(lp(u)),r.push(XO(d,h,f))}return r}function iu(e,t,n){const r=t.x-e.x,a=t.y-e.y,i=n/sp(r,a);return{x:e.x+r*i,y:e.y+a*i}}function sp(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function cp(e,t,n){(0,P.isNumber)(t)&&(n=t,t=null),t||(t={});const r=(0,V.create)("path",t);return(0,P.isNumber)(n)&&(r.dataset.cornerRadius=String(n)),Mb(r,e)}function Mb(e,t){return(0,V.attr)(e,{d:Fl(KO(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function ZO(e){return!0}function ou(e){return pa(e)||qO(e)}var Bb=500;function Db(e,t,n){var r=this;function a(b,x,E){if(!l(b,x)){var k,T,R;E?T=t.getGraphics(E):(k=x.delegateTarget||x.target,k&&(T=k,E=t.get(T))),!(!T||!E)&&(R=e.fire(b,{element:E,gfx:T,originalEvent:x}),R===!1&&(x.stopPropagation(),x.preventDefault()))}}var i={};function o(b){return i[b]}function l(b,x){return!(u[b]||pa)(x)}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},u={"element.contextmenu":ZO,"element.mousedown":ou,"element.mouseup":ou,"element.click":ou,"element.dblclick":ou};function d(b,x,E){var k=c[b];if(!k)throw new Error("unmapped DOM event name <"+b+">");return a(k,x,E)}var f="svg, .djs-element";function h(b,x,E,k){var T=i[E]=function(R){a(E,R)};k&&(u[E]=k),T.$delegate=te.delegate.bind(b,f,x,T)}function p(b,x,E){var k=o(E);k&&te.delegate.unbind(b,x,k.$delegate)}function g(b){(0,P.forEach)(c,function(x,E){h(b,E,x)})}function v(b){(0,P.forEach)(c,function(x,E){p(b,E,x)})}e.on("canvas.destroy",function(b){v(b.svg)}),e.on("canvas.init",function(b){g(b.svg)}),e.on(["shape.added","connection.added"],function(b){var x=b.element,E=b.gfx;e.fire("interactionEvents.createHit",{element:x,gfx:E})}),e.on(["shape.changed","connection.changed"],Bb,function(b){var x=b.element,E=b.gfx;e.fire("interactionEvents.updateHit",{element:x,gfx:E})}),e.on("interactionEvents.createHit",Bb,function(b){var x=b.element,E=b.gfx;r.createDefaultHit(x,E)}),e.on("interactionEvents.updateHit",function(b){var x=b.element,E=b.gfx;r.updateDefaultHit(x,E)});var m=w("djs-hit djs-hit-stroke"),_=w("djs-hit djs-hit-click-stroke"),y={all:w("djs-hit djs-hit-all"),"click-stroke":_,stroke:m,"no-move":w("djs-hit djs-hit-no-move")};function w(b,x){return x=(0,P.assign)({stroke:"white",strokeWidth:15},x||{}),n.cls(b,["no-fill","no-border"],x)}function C(b,x){var E=y[x];if(!E)throw new Error("invalid hit type <"+x+">");return(0,V.attr)(b,E),b}function S(b,x){(0,V.append)(b,x)}this.removeHits=function(b){(0,P.forEach)((0,te.queryAll)(".djs-hit",b),V.remove)},this.createDefaultHit=function(b,x){var E=b.waypoints,k=b.isFrame,T;return E?this.createWaypointsHit(x,E):(T=k?"stroke":"all",this.createBoxHit(x,T,{width:b.width,height:b.height}))},this.createWaypointsHit=function(b,x){var E=cp(x);return C(E,"stroke"),S(b,E),E},this.createBoxHit=function(b,x,E){E=(0,P.assign)({x:0,y:0},E);var k=(0,V.create)("rect");return C(k,x),(0,V.attr)(k,E),S(b,k),k},this.updateDefaultHit=function(b,x){var E=(0,te.query)(".djs-hit",x);if(E)return b.waypoints?Mb(E,b.waypoints):(0,V.attr)(E,{width:b.width,height:b.height}),E},this.fire=a,this.triggerMouseEvent=d,this.mouseHandler=o,this.registerEvent=h,this.unregisterEvent=p}Db.$inject=["eventBus","elementRegistry","styles"];var up={__init__:["interactionEvents"],interactionEvents:["type",Db]};function Bo(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(r){var a=r.element;n.deselect(a)}),e.on(["diagram.clear","root.set"],function(r){n.select(null)})}Bo.$inject=["eventBus","canvas"],Bo.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var r=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:t})}},Bo.prototype.get=function(){return this._selectedElements},Bo.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},Bo.prototype.select=function(e,t){var n=this._selectedElements,r=n.slice();(0,P.isArray)(e)||(e=e?[e]:[]);var a=this._canvas,i=a.getRootElement();e=e.filter(function(o){return i===a.findRoot(o)}),t?(0,P.forEach)(e,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:r,newSelection:n})};var Ab="hover",Pb="selected";function Nb(e,t){this._canvas=e;function n(a,i){e.addMarker(a,i)}function r(a,i){e.removeMarker(a,i)}t.on("element.hover",function(a){n(a.element,Ab)}),t.on("element.out",function(a){r(a.element,Ab)}),t.on("selection.changed",function(a){function i(u){r(u,Pb)}function o(u){n(u,Pb)}var l=a.oldSelection,c=a.newSelection;(0,P.forEach)(l,function(u){c.indexOf(u)===-1&&i(u)}),(0,P.forEach)(c,function(u){l.indexOf(u)===-1&&o(u)})})}Nb.$inject=["canvas","eventBus"];function Lb(e,t,n,r){e.on("create.end",500,function(a){var i=a.context,o=i.canExecute,l=i.elements,c=(i.hints||{}).autoSelect;if(o){if(c===!1)return;(0,P.isArray)(c)?t.select(c):t.select(l.filter(QO))}}),e.on("connect.end",500,function(a){var i=a.context.connection;i&&t.select(i)}),e.on("shape.move.end",500,function(a){var i=a.previousSelection||[],o=r.get(a.context.shape.id);(0,P.find)(i,function(l){return o.id===l.id})||t.select(o)}),e.on("element.click",function(a){if(pa(a)){var i=a.element;i===n.getRootElement()&&(i=null);var o=t.isSelected(i),l=t.get().length>1,c=op(a);if(o&&l)return c?t.deselect(i):t.select(i);o?t.deselect(i):t.select(i,c)}})}Lb.$inject=["eventBus","selection","canvas","elementRegistry"];function QO(e){return!e.hidden}var Do={__init__:["selectionVisuals","selectionBehavior"],__depends__:[up],selection:["type",Bo],selectionVisuals:["type",Nb],selectionBehavior:["type",Lb]},eV=/^djs-cursor-.*$/;function dp(e){var t=(0,te.classes)(document.body);t.removeMatching(eV),e&&t.add("djs-cursor-"+e)}function Ib(){dp(null)}var tV=5e3;function Ob(e,t){t=t||"element.click";function n(){return!1}return e.once(t,tV,n),function(){e.off(t,n)}}function Vb(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ao(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zb(e){return e.altKey?!1:e.ctrlKey||e.metaKey}function Hb(e,t){return e=(0,P.isArray)(e)?e:[e],e.indexOf(t.key)!==-1||e.indexOf(t.code)!==-1}var Po=Math.round,Fb="djs-drag-active";function bi(e){e.preventDefault()}function nV(e){return typeof TouchEvent<"u"&&e instanceof TouchEvent}function rV(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function jb(e,t,n,r){var a={threshold:5,trapClick:!0},i;function o(w){var C=t.viewbox(),S=t._container.getBoundingClientRect();return{x:C.x+(w.x-S.left)/C.scale,y:C.y+(w.y-S.top)/C.scale}}function l(w,C){C=C||i;var S=e.createEvent((0,P.assign)({},C.payload,C.data,{isTouch:C.isTouch}));return e.fire("drag."+w,S)===!1?!1:e.fire(C.prefix+"."+w,S)}function c(w){var C=w.filter(function(S){return r.get(S.id)});C.length&&n.select(C)}function u(w,C){var S=i.payload,b=i.displacement,x=i.globalStart,E=Mo(w),k=Ao(E,x),T=i.localStart,R=o(E),D=Ao(R,T);if(!i.active&&(C||rV(k)>i.threshold)){if((0,P.assign)(S,{x:Po(T.x+b.x),y:Po(T.y+b.y),dx:0,dy:0},{originalEvent:w}),l("start")===!1)return m();i.active=!0,i.keepSelection||(S.previousSelection=n.get(),n.select(null)),i.cursor&&dp(i.cursor),t.addMarker(t.getRootElement(),Fb)}ip(w),i.active&&((0,P.assign)(S,{x:Po(R.x+b.x),y:Po(R.y+b.y),dx:Po(D.x),dy:Po(D.y)},{originalEvent:w}),l("move"))}function d(w){var C,S=!0;i.active&&(w&&(i.payload.originalEvent=w,ip(w)),S=l("end")),S===!1&&l("rejected"),C=_(S!==!0),l("ended",C)}function f(w){Hb("Escape",w)&&(bi(w),m())}function h(w){var C;i.active&&(C=Ob(e),setTimeout(C,400),bi(w)),d(w)}function p(w){u(w)}function g(w){var C=i.payload;C.hoverGfx=w.gfx,C.hover=w.element,l("hover")}function v(w){l("out");var C=i.payload;C.hoverGfx=null,C.hover=null}function m(w){var C;if(i){var S=i.active;S&&l("cancel"),C=_(w),S&&l("canceled",C)}}function _(w){var C,S;l("cleanup"),Ib(),i.trapClick?S=h:S=d,te.event.unbind(document,"mousemove",u),te.event.unbind(document,"dragstart",bi),te.event.unbind(document,"selectstart",bi),te.event.unbind(document,"mousedown",S,!0),te.event.unbind(document,"mouseup",S,!0),te.event.unbind(document,"keyup",f),te.event.unbind(document,"touchstart",p,!0),te.event.unbind(document,"touchcancel",m,!0),te.event.unbind(document,"touchmove",u,!0),te.event.unbind(document,"touchend",d,!0),e.off("element.hover",g),e.off("element.out",v),t.removeMarker(t.getRootElement(),Fb);var b=i.payload.previousSelection;return w!==!1&&b&&!n.get().length&&c(b),C=i,i=null,C}function y(w,C,S,b){i&&m(!1),typeof C=="string"&&(b=S,S=C,C=null),b=(0,P.assign)({},a,b||{});var x=b.data||{},E,k,T,R,D;b.trapClick?R=h:R=d,w?(E=Ro(w)||w,k=Mo(w),ip(w),E.type==="dragstart"&&bi(E)):(E=null,k={x:0,y:0}),T=o(k),C||(C=T),D=nV(E),i=(0,P.assign)({prefix:S,data:x,payload:{},globalStart:k,displacement:Ao(C,T),localStart:T,isTouch:D},b),b.manual||(D?(te.event.bind(document,"touchstart",p,!0),te.event.bind(document,"touchcancel",m,!0),te.event.bind(document,"touchmove",u,!0),te.event.bind(document,"touchend",d,!0)):(te.event.bind(document,"mousemove",u),te.event.bind(document,"dragstart",bi),te.event.bind(document,"selectstart",bi),te.event.bind(document,"mousedown",R,!0),te.event.bind(document,"mouseup",R,!0)),te.event.bind(document,"keyup",f),e.on("element.hover",g),e.on("element.out",v)),l("init"),b.autoActivate&&u(w,!0)}e.on("diagram.destroy",m),this.init=y,this.move=u,this.hover=g,this.out=v,this.end=d,this.cancel=m,this.context=function(){return i},this.setOptions=function(w){(0,P.assign)(a,w)}}jb.$inject=["eventBus","canvas","selection","elementRegistry"];var Ci={__depends__:[GO,Do],dragging:["type",jb]};function fp(e){return e.childNodes[0]}function lu(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(Math.random()*1e9)+"-"}lu.prototype.next=function(){return this._prefix+ ++this._counter};var aV=new lu("ps"),iV=["marker-start","marker-mid","marker-end"],oV=["circle","ellipse","line","path","polygon","polyline","path","rect"];function ga(e,t,n,r){this._elementRegistry=e,this._canvas=n,this._styles=r}ga.$inject=["elementRegistry","eventBus","canvas","styles"],ga.prototype.cleanUp=function(){console.warn("PreviewSupport#cleanUp is deprecated and will be removed in future versions. You do not need to manually clean up previews anymore. cf. https://github.com/bpmn-io/diagram-js/pull/906")},ga.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},ga.prototype.addDragger=function(e,t,n,r="djs-dragger"){n=n||this.getGfx(e);var a=(0,V.clone)(n),i=n.getBoundingClientRect();return this._cloneMarkers(fp(a),r),(0,V.attr)(a,this._styles.cls(r,[],{x:i.top,y:i.left})),(0,V.append)(t,a),(0,V.attr)(a,"data-preview-support-element-id",e.id),a},ga.prototype.addFrame=function(e,t){var n=(0,V.create)("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return(0,V.append)(t,n),(0,V.attr)(n,"data-preview-support-element-id",e.id),n},ga.prototype._cloneMarkers=function(e,t="djs-dragger",n=e){var r=this;e.childNodes&&e.childNodes.forEach(a=>{r._cloneMarkers(a,t,n)}),uV(e)&&iV.forEach(function(a){if((0,V.attr)(e,a)){var i=lV(e,a,r._canvas.getContainer());i&&r._cloneMarker(n,e,i,a,t)}})},ga.prototype._cloneMarker=function(e,t,n,r,a="djs-dragger"){var i=[n.id,a,aV.next()].join("-"),o=(0,te.query)("marker#"+n.id,e);e=e||this._canvas._svg;var l=o||(0,V.clone)(n);l.id=i,(0,V.classes)(l).add(a);var c=(0,te.query)(":scope > defs",e);c||(c=(0,V.create)("defs"),(0,V.append)(e,c)),(0,V.append)(c,l),(0,V.attr)(t,r,cV(l.id))};function lV(e,t,n){return(0,te.query)("marker#"+sV((0,V.attr)(e,t)),n||document)}function sV(e){return e.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]}function cV(e){return"url(#"+e+")"}function uV(e){return oV.indexOf(e.nodeName)!==-1}var hp={__init__:["previewSupport"],previewSupport:["type",ga]};function pp(e){this._commandStack=e.get("commandStack",!1)}pp.$inject=["injector"],pp.prototype.allowed=function(e,t){var n=!0,r=this._commandStack;return r&&(n=r.canExecute(e,t)),n===void 0?!0:n};var No={__init__:["rules"],rules:["type",pp]};function dV(e){return(0,P.filter)(e,function(t){return!(0,P.find)(e,function(n){return n!==t&&$b(t,n)})})}function $b(e,t){if(t){if(e===t)return t;if(e.parent)return $b(e.parent,t)}}function Wb(e,t,n){var r=!n||e.indexOf(t)===-1;return r&&e.push(t),r}function gp(e,t,n){n=n||0,(0,P.isArray)(e)||(e=[e]),(0,P.forEach)(e,function(r,a){var i=t(r,a,n);(0,P.isArray)(i)&&i.length&&gp(i,t,n+1)})}function fV(e,t,n){var r=[],a=[];return gp(e,function(i,o,l){Wb(r,i,t);var c=i.children;if((n===-1||l<n)&&c&&Wb(a,c,t))return c}),r}function hV(e,t){return fV(e,!t,-1)}function pV(e,t,n){(0,P.isUndefined)(t)&&(t=!0),(0,P.isObject)(t)&&(n=t,t=!0),n=n||{};var r=jl(n.allShapes),a=jl(n.allConnections),i=jl(n.enclosedElements),o=jl(n.enclosedConnections),l=jl(n.topLevel,t&&(0,P.groupBy)(e,function(d){return d.id}));function c(d){l[d.source.id]&&l[d.target.id]&&(l[d.id]=[d]),r[d.source.id]&&r[d.target.id]&&(o[d.id]=i[d.id]=d),a[d.id]=d}function u(d){if(i[d.id]=d,d.waypoints)o[d.id]=a[d.id]=d;else return r[d.id]=d,(0,P.forEach)(d.incoming,c),(0,P.forEach)(d.outgoing,c),d.children}return gp(e,u),{allShapes:r,allConnections:a,topLevel:l,enclosedConnections:o,enclosedElements:i}}function Cr(e,t){t=!!t,(0,P.isArray)(e)||(e=[e]);var n,r,a,i;return(0,P.forEach)(e,function(o){var l=o;o.waypoints&&!t&&(l=Cr(o.waypoints,!0));var c=l.x,u=l.y,d=l.height||0,f=l.width||0;(c<n||n===void 0)&&(n=c),(u<r||r===void 0)&&(r=u),(c+f>a||a===void 0)&&(a=c+f),(u+d>i||i===void 0)&&(i=u+d)}),{x:n,y:r,height:i-r,width:a-n}}function Ub(e,t){var n={};return(0,P.forEach)(e,function(r){var a=r;a.waypoints&&(a=Cr(a)),!(0,P.isNumber)(t.y)&&a.x>t.x&&(n[r.id]=r),!(0,P.isNumber)(t.x)&&a.y>t.y&&(n[r.id]=r),a.x>t.x&&a.y>t.y&&((0,P.isNumber)(t.width)&&(0,P.isNumber)(t.height)&&a.width+a.x<t.width+t.x&&a.height+a.y<t.height+t.y||!(0,P.isNumber)(t.width)||!(0,P.isNumber)(t.height))&&(n[r.id]=r)}),n}function gV(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function vV(e){return!!(e&&e.isFrame)}function jl(e,t){return(0,P.assign)({},e||{},t||{})}function yn(e){return(0,P.isObject)(e)&&(0,P.has)(e,"waypoints")}function Lo(e){return(0,P.isObject)(e)&&(0,P.has)(e,"labelTarget")}var mV="drop-ok",Yb="drop-not-ok",Gb="attach-ok",qb="new-parent",Jb="create",yV=2e3;function Xb(e,t,n,r,a){function i(c,u,d,f,h){if(!u)return!1;c=(0,P.filter)(c,function(y){var w=y.labelTarget;return!y.parent&&!(Lo(y)&&c.indexOf(w)!==-1)});var p=(0,P.find)(c,function(y){return!yn(y)}),g=!1,v=!1,m=!1;Zb(c)&&(g=a.allowed("shape.attach",{position:d,shape:p,target:u})),g||(Zb(c)?m=a.allowed("shape.create",{position:d,shape:p,source:f,target:u}):m=a.allowed("elements.create",{elements:c,position:d,target:u}));var _=h.connectionTarget;return m||g?(p&&f&&(v=a.allowed("connection.create",{source:_===f?p:f,target:_===f?f:p,hints:{targetParent:u,targetAttach:g}})),{attach:g,connect:v}):m===null||g===null?null:!1}function o(c,u){[Gb,mV,Yb,qb].forEach(function(d){d===u?e.addMarker(c,d):e.removeMarker(c,d)})}n.on(["create.move","create.hover"],function(c){var u=c.context,d=u.elements,f=c.hover,h=u.source,p=u.hints||{};if(!f){u.canExecute=!1,u.target=null;return}Kb(c);var g={x:c.x,y:c.y},v=u.canExecute=f&&i(d,f,g,h,p);f&&v!==null&&(u.target=f,v&&v.attach?o(f,Gb):o(f,v?qb:Yb))}),n.on(["create.end","create.out","create.cleanup"],function(c){var u=c.hover;u&&o(u,null)}),n.on("create.end",function(c){var u=c.context,d=u.source,f=u.shape,h=u.elements,p=u.target,g=u.canExecute,v=g&&g.attach,m=g&&g.connect,_=u.hints||{};if(g===!1||!p)return!1;Kb(c);var y={x:c.x,y:c.y};m?f=r.appendShape(d,f,y,p,{attach:v,connection:m===!0?{}:m,connectionTarget:_.connectionTarget}):(h=r.createElements(h,y,p,(0,P.assign)({},_,{attach:v})),f=(0,P.find)(h,function(w){return!yn(w)})),(0,P.assign)(u,{elements:h,shape:f}),(0,P.assign)(c,{elements:h,shape:f})});function l(){var c=t.context();c&&c.prefix===Jb&&t.cancel()}n.on("create.init",function(){n.on("elements.changed",l),n.once(["create.cancel","create.end"],yV,function(){n.off("elements.changed",l)})}),this.start=function(c,u,d){(0,P.isArray)(u)||(u=[u]);var f=(0,P.find)(u,function(p){return!yn(p)});if(f){d=(0,P.assign)({elements:u,hints:{},shape:f},d||{}),(0,P.forEach)(u,function(p){(0,P.isNumber)(p.x)||(p.x=0),(0,P.isNumber)(p.y)||(p.y=0)});var h=Cr((0,P.filter)(u,function(p){return!p.hidden}));(0,P.forEach)(u,function(p){yn(p)&&(p.waypoints=(0,P.map)(p.waypoints,function(g){return{x:g.x-h.x-h.width/2,y:g.y-h.y-h.height/2}})),(0,P.assign)(p,{x:p.x-h.x-h.width/2,y:p.y-h.y-h.height/2})}),t.init(c,Jb,{cursor:"grabbing",autoActivate:!0,data:{shape:f,elements:u,context:d}})}}}Xb.$inject=["canvas","dragging","eventBus","modeling","rules"];function Kb(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function Zb(e){return e&&e.length===1&&!yn(e[0])}function _V(e,t,n,r,a){var i=(0,V.createTransform)();i.setTranslate(t,n);var o=(0,V.createTransform)();o.setRotate(r||0,0,0);var l=(0,V.createTransform)();l.setScale(a||1,a||1),(0,V.transform)(e,[i,o,l])}function Sr(e,t,n){var r=(0,V.createTransform)();r.setTranslate(t,n),(0,V.transform)(e,r)}function wV(e,t){var n=(0,V.createTransform)();n.setRotate(t,0,0),(0,V.transform)(e,n)}var bV=750;function Qb(e,t,n,r,a){function i(o){var l=(0,V.create)("g");(0,V.attr)(l,a.cls("djs-drag-group",["no-events"]));var c=(0,V.create)("g");return o.forEach(function(u){var d;u.hidden||(u.waypoints?(d=n._createContainer("connection",c),n.drawConnection(fp(d),u)):(d=n._createContainer("shape",c),n.drawShape(fp(d),u),Sr(d,u.x,u.y)),r.addDragger(u,l,d))}),l}t.on("create.move",bV,function(o){var l=o.hover,c=o.context,u=c.elements,d=c.dragGroup;d||(d=c.dragGroup=i(u));var f;l?(d.parentNode||(f=e.getActiveLayer(),(0,V.append)(f,d)),Sr(d,o.x,o.y)):(0,V.remove)(d)}),t.on("create.cleanup",function(o){var l=o.context.dragGroup;l&&(0,V.remove)(l)})}Qb.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];var eC={__depends__:[Ci,hp,No,Do],__init__:["create","createPreview"],create:["type",Xb],createPreview:["type",Qb]};function $l(e,t){return!e||!t?-1:Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function vp(e,t,n,r){if(typeof r>"u"&&(r=5),!e||!t||!n)return!1;var a=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),i=$l(e,t);return Math.abs(a/i)<=r}var CV=2;function va(e,t){var n=Array.from(arguments).flat();for(const[r,a]of Object.entries({x:"v",y:"h"}))if(SV(r,n))return a;return!1}function SV(e,t){const n=t[0];return(0,P.every)(t,function(r){return Math.abs(n[e]-r[e])<=CV})}function tC(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function mp(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var xV=/,?([a-z]),?/gi,nC=parseFloat,Nt=Math,ma=Nt.PI,xr=Nt.min,Er=Nt.max,rC=Nt.pow,ya=Nt.abs,EV=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,kV=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,aC=Array.isArray||function(e){return e instanceof Array};function TV(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function RV(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return e.push(e.splice(n,1)[0])}function MV(e){function t(){var n=Array.prototype.slice.call(arguments,0).join("␀"),r=t.cache=t.cache||{},a=t.count=t.count||[];return TV(r,n)?(RV(a,n),r[n]):(a.length>=1e3&&delete r[a.shift()],a.push(n),r[n]=e(...arguments),r[n])}return t}function BV(e){if(!e)return null;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=[];return String(e).replace(EV,function(r,a,i){var o=[],l=a.toLowerCase();for(i.replace(kV,function(c,u){u&&o.push(+u)}),l=="m"&&o.length>2&&(n.push([a,...o.splice(0,2)]),l="l",a=a=="m"?"l":"L");o.length>=t[l]&&(n.push([a,...o.splice(0,t[l])]),!!t[l]););}),n.toString=_p,n}function DV(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(typeof r=="string"&&r!==r.toUpperCase())return!1}return!0}function AV(e){for(var t=0,n=e.length;t<n;t++){var r=e[t][0];if(r!=="M"&&r!=="C")return!1}return!0}function yp(e,t,n,r){return arguments.length===1&&(t=e.y,n=e.width,r=e.height,e=e.x),{x:e,y:t,width:n,height:r,x2:e+n,y2:t+r}}function _p(){return this.join(",").replace(xV,"$1")}function PV(e){for(var t=new Array(e.length),n=0,r=e.length;n<r;n++)for(var a=e[n],i=t[n]=new Array(a.length),o=0,l=a.length;o<l;o++)i[o]=a[o];return t.toString=_p,t}function iC(e,t,n,r,a,i,o,l,c){var u=1-c,d=rC(u,3),f=rC(u,2),h=c*c*c,p=d*e+f*3*c*n+u*3*c*c*a+h*o,g=d*t+f*3*c*r+u*3*c*c*i+h*l;return{x:su(p),y:su(g)}}function oC(e){var t=zV(...e);return yp(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function _a(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function NV(e,t){return e=yp(e),t=yp(t),_a(t,e.x,e.y)||_a(t,e.x2,e.y)||_a(t,e.x,e.y2)||_a(t,e.x2,e.y2)||_a(e,t.x,t.y)||_a(e,t.x2,t.y)||_a(e,t.x,t.y2)||_a(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)}function lC(e,t,n,r,a){return e*(e*(-3*t+9*n-9*r+3*a)+6*t-12*n+6*r)-3*t+3*n}function sC(e,t,n,r,a,i,o,l,c){c==null&&(c=1),c=c>1?1:c<0?0:c;for(var u=c/2,d=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,g=0;g<d;g++){var v=u*f[g]+u,m=lC(v,e,n,a,o),_=lC(v,t,r,i,l),y=m*m+_*_;p+=h[g]*Nt.sqrt(y)}return u*p}function LV(e,t,n,r,a,i,o,l){if(!(Er(e,n)<xr(a,o)||xr(e,n)>Er(a,o)||Er(t,r)<xr(i,l)||xr(t,r)>Er(i,l))){var c=(e*r-t*n)*(a-o)-(e-n)*(a*l-i*o),u=(e*r-t*n)*(i-l)-(t-r)*(a*l-i*o),d=(e-n)*(i-l)-(t-r)*(a-o);if(d){var f=su(c/d),h=su(u/d),p=+f.toFixed(2),g=+h.toFixed(2);if(!(p<+xr(e,n).toFixed(2)||p>+Er(e,n).toFixed(2)||p<+xr(a,o).toFixed(2)||p>+Er(a,o).toFixed(2)||g<+xr(t,r).toFixed(2)||g>+Er(t,r).toFixed(2)||g<+xr(i,l).toFixed(2)||g>+Er(i,l).toFixed(2)))return{x:f,y:h}}}}function su(e){return Math.round(e*1e11)/1e11}function IV(e,t,n){if(!NV(oC(e),oC(t)))return n?0:[];var r=sC(...e),a=sC(...t),i=uC(e)?1:~~(r/5)||1,o=uC(t)?1:~~(a/5)||1,l=new Array(i+1),c=new Array(o+1),u={},d=n?0:[],f,h;for(f=0;f<i+1;f++){var p=iC(...e,f/i);l[f]={x:p.x,y:p.y,t:f/i}}for(f=0;f<o+1;f++)p=iC(...t,f/o),c[f]={x:p.x,y:p.y,t:f/o};for(f=0;f<i;f++)for(h=0;h<o;h++){var g=l[f],v=l[f+1],m=c[h],_=c[h+1],y=ya(v.x-g.x)<.01?"y":"x",w=ya(_.x-m.x)<.01?"y":"x",C=LV(g.x,g.y,v.x,v.y,m.x,m.y,_.x,_.y),S;if(C){if(S=C.x.toFixed(9)+"#"+C.y.toFixed(9),u[S])continue;u[S]=!0;var b=g.t+ya((C[y]-g[y])/(v[y]-g[y]))*(v.t-g.t),x=m.t+ya((C[w]-m[w])/(_[w]-m[w]))*(_.t-m.t);b>=0&&b<=1&&x>=0&&x<=1&&(n?d++:d.push({x:C.x,y:C.y,t1:b,t2:x}))}}return d}function cC(e,t,n){e=hC(e),t=hC(t);for(var r,a,i,o,l,c,u,d,f,h,p=n?0:[],g=0,v=e.length;g<v;g++){var m=e[g];if(m[0]=="M")r=l=m[1],a=c=m[2];else{m[0]=="C"?(f=[r,a,...m.slice(1)],r=f[6],a=f[7]):(f=[r,a,r,a,l,c,l,c],r=l,a=c);for(var _=0,y=t.length;_<y;_++){var w=t[_];if(w[0]=="M")i=u=w[1],o=d=w[2];else{w[0]=="C"?(h=[i,o,...w.slice(1)],i=h[6],o=h[7]):(h=[i,o,i,o,u,d,u,d],i=u,o=d);var C=IV(f,h,n);if(n)p+=C;else{for(var S=0,b=C.length;S<b;S++)C[S].segment1=g,C[S].segment2=_,C[S].bez1=f,C[S].bez2=h;p=p.concat(C)}}}}}return p}function OV(e){return aC(e)&&aC(e[0])}function VV(e){if(DV(e))return e;var t=new Array(e.length),n=0,r=0,a=0,i=0,o=0,l;e[0][0]=="M"&&(n=+e[0][1],r=+e[0][2],a=n,i=r,o++,t[0]=["M",n,r]);for(var c,u,d=o,f=e.length;d<f;d++){if(u=e[d],l=u[0],t[d]=c=new Array(u.length),l!=l.toUpperCase())switch(c[0]=l.toUpperCase(),c[0]){case"A":c[1]=u[1],c[2]=u[2],c[3]=u[3],c[4]=u[4],c[5]=u[5],c[6]=+u[6]+n,c[7]=+u[7]+r;break;case"V":c[1]=+u[1]+r;break;case"H":c[1]=+u[1]+n;break;case"M":a=+u[1]+n,i=+u[2]+r;default:for(var h=1,p=u.length;h<p;h++)c[h]=+u[h]+(h%2?n:r)}else for(var g=0,v=u.length;g<v;g++)c[g]=u[g];switch(l=l.toUpperCase(),c[0]){case"Z":n=+a,r=+i;break;case"H":n=c[1];break;case"V":r=c[1];break;case"M":a=c[c.length-2],i=c[c.length-1];default:n=c[c.length-2],r=c[c.length-1]}}return t.toString=_p,t}function uC(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function cu(e,t,n,r){return[e,t,n,r,n,r]}function dC(e,t,n,r,a,i){var o=.3333333333333333,l=2/3;return[o*e+l*n,o*t+l*r,o*a+l*n,o*i+l*r,a,i]}function fC(e,t,n,r,a,i,o,l,c,u){var d=ma*120/180,f=ma/180*(+a||0),h=[],p,g=MV(function(K,ne,he){return{x:K*Nt.cos(he)-ne*Nt.sin(he),y:K*Nt.sin(he)+ne*Nt.cos(he)}});if(u)x=u[0],E=u[1],S=u[2],b=u[3];else{p=g(e,t,-f),e=p.x,t=p.y,p=g(l,c,-f),l=p.x,c=p.y;var v=(e-l)/2,m=(t-c)/2,_=v*v/(n*n)+m*m/(r*r);_>1&&(_=Nt.sqrt(_),n=_*n,r=_*r);var y=n*n,w=r*r,C=(i==o?-1:1)*Nt.sqrt(ya((y*w-y*m*m-w*v*v)/(y*m*m+w*v*v))),S=C*n*m/r+(e+l)/2,b=C*-r*v/n+(t+c)/2,x=Nt.asin(((t-b)/r).toFixed(9)),E=Nt.asin(((c-b)/r).toFixed(9));x=e<S?ma-x:x,E=l<S?ma-E:E,x<0&&(x=ma*2+x),E<0&&(E=ma*2+E),o&&x>E&&(x=x-ma*2),!o&&E>x&&(E=E-ma*2)}var k=E-x;if(ya(k)>d){var T=E,R=l,D=c;E=x+d*(o&&E>x?1:-1),l=S+n*Nt.cos(E),c=b+r*Nt.sin(E),h=fC(l,c,n,r,a,0,o,R,D,[E,T,S,b])}k=E-x;var A=Nt.cos(x),L=Nt.sin(x),N=Nt.cos(E),M=Nt.sin(E),I=Nt.tan(k/4),$=4/3*n*I,ee=4/3*r*I,oe=[e,t],j=[e+$*L,t-ee*A],U=[l+$*M,c-ee*N],H=[l,c];if(j[0]=2*oe[0]-j[0],j[1]=2*oe[1]-j[1],u)return[j,U,H].concat(h);h=[j,U,H].concat(h).join().split(",");for(var B=[],W=0,X=h.length;W<X;W++)B[W]=W%2?g(h[W-1],h[W],f).y:g(h[W],h[W+1],f).x;return B}function zV(e,t,n,r,a,i,o,l){for(var c=[],u=[[],[]],d,f,h,p,g,v,m,_,y=0;y<2;++y){if(y==0?(f=6*e-12*n+6*a,d=-3*e+9*n-9*a+3*o,h=3*n-3*e):(f=6*t-12*r+6*i,d=-3*t+9*r-9*i+3*l,h=3*r-3*t),ya(d)<1e-12){if(ya(f)<1e-12)continue;p=-h/f,0<p&&p<1&&c.push(p);continue}m=f*f-4*h*d,_=Nt.sqrt(m),!(m<0)&&(g=(-f+_)/(2*d),0<g&&g<1&&c.push(g),v=(-f-_)/(2*d),0<v&&v<1&&c.push(v))}for(var w=c.length,C=w,S;w--;)p=c[w],S=1-p,u[0][w]=S*S*S*e+3*S*S*p*n+3*S*p*p*a+p*p*p*o,u[1][w]=S*S*S*t+3*S*S*p*r+3*S*p*p*i+p*p*p*l;return u[0][C]=e,u[1][C]=t,u[0][C+1]=o,u[1][C+1]=l,u[0].length=u[1].length=C+2,{x0:xr(...u[0]),y0:xr(...u[1]),x1:Er(...u[0]),y1:Er(...u[1])}}function hC(e){if(OV(e)||(e=BV(e)),AV(e))return e;for(var t=PV(VV(e)),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(h,p,g){var v,m;if(!h)return["C",p.x,p.y,p.x,p.y,p.x,p.y];switch(!(h[0]in{T:1,Q:1})&&(p.qx=p.qy=null),h[0]){case"M":p.X=h[1],p.Y=h[2];break;case"A":h=["C",...fC(p.x,p.y,...h.slice(1))];break;case"S":g=="C"||g=="S"?(v=p.x*2-p.bx,m=p.y*2-p.by):(v=p.x,m=p.y),h=["C",v,m,...h.slice(1)];break;case"T":g=="Q"||g=="T"?(p.qx=p.x*2-p.qx,p.qy=p.y*2-p.qy):(p.qx=p.x,p.qy=p.y),h=["C",...dC(p.x,p.y,p.qx,p.qy,h[1],h[2])];break;case"Q":p.qx=h[1],p.qy=h[2],h=["C",...dC(p.x,p.y,h[1],h[2],h[3],h[4])];break;case"L":h=["C",...cu(p.x,p.y,h[1],h[2])];break;case"H":h=["C",...cu(p.x,p.y,h[1],p.y)];break;case"V":h=["C",...cu(p.x,p.y,p.x,h[1])];break;case"Z":h=["C",...cu(p.x,p.y,p.X,p.Y)];break}return h},a=function(h,p){if(h[p].length>7){h[p].shift();for(var g=h[p];g.length;)i[p]="A",h.splice(p++,0,["C",...g.splice(0,6)]);h.splice(p,1),u=t.length}},i=[],o="",l="",c=0,u=t.length;c<u;c++){t[c]&&(o=t[c][0]),o!="C"&&(i[c]=o,c&&(l=i[c-1])),t[c]=r(t[c],n,l),i[c]!="A"&&o=="C"&&(i[c]="C"),a(t,c);var d=t[c],f=d.length;n.x=d[f-2],n.y=d[f-1],n.bx=nC(d[f-4])||n.x,n.by=nC(d[f-3])||n.y}return t}function HV(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Wl(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function ut(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function pC(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function FV(e){return Wl({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function jV(e){for(var t=e.waypoints,n=t.reduce(function(l,c,u){var d=t[u-1];if(d){var f=l[l.length-1],h=f&&f.endLength||0,p=UV(d,c);l.push({start:d,end:c,startLength:h,endLength:h+p,length:p})}return l},[]),r=n.reduce(function(l,c){return l+c.length},0)/2,a=0,i=n[a];i.endLength<r;)i=n[++a];var o=(r-i.startLength)/i.length;return{x:i.start.x+(i.end.x-i.start.x)*o,y:i.start.y+(i.end.y-i.start.y)*o}}function Mt(e){return yn(e)?jV(e):FV(e)}function wa(e,t,n){n=n||0,(0,P.isObject)(n)||(n={x:n,y:n});var r=ut(e),a=ut(t),i=r.bottom+n.y<=a.top,o=r.left-n.x>=a.right,l=r.top-n.y>=a.bottom,c=r.right+n.x<=a.left,u=i?"top":l?"bottom":null,d=c?"left":o?"right":null;return d&&u?u+"-"+d:d||u||"intersect"}function wp(e,t,n){var r=$V(e,t);return r.length===1||r.length===2&&$l(r[0],r[1])<1?Wl(r[0]):r.length>1?(r=(0,P.sortBy)(r,function(a){var i=Math.floor(a.t2*100)||1;return i=100-i,i=(i<10?"0":"")+i,a.segment2+"#"+i}),Wl(r[n?0:r.length-1])):null}function $V(e,t){return cC(e,t)}function WV(e){e=e.slice();for(var t=0,n,r,a;e[t];)n=e[t],r=e[t-1],a=e[t+1],$l(n,a)===0||vp(r,a,n)?e.splice(t,1):t++;return e}function UV(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gC(e,t,n,r){function a(o,l){return r.allowed("connection.create",{source:o,target:l})}function i(o,l){return a(l,o)}e.on("connect.hover",function(o){var l=o.context,c=l.start,u=o.hover,d;if(l.hover=u,d=l.canExecute=a(c,u),!(0,P.isNil)(d)){if(d!==!1){l.source=c,l.target=u;return}d=l.canExecute=i(c,u),!(0,P.isNil)(d)&&d!==!1&&(l.source=u,l.target=c)}}),e.on(["connect.out","connect.cleanup"],function(o){var l=o.context;l.hover=null,l.source=null,l.target=null,l.canExecute=!1}),e.on("connect.end",function(o){var l=o.context,c=l.canExecute,u=l.connectionStart,d={x:o.x,y:o.y},f=l.source,h=l.target;if(!c)return!1;var p=null,g={connectionStart:bp(l)?d:u,connectionEnd:bp(l)?u:d};(0,P.isObject)(c)&&(p=c),l.connection=n.connect(f,h,p,g)}),this.start=function(o,l,c,u){(0,P.isObject)(c)||(u=c,c=Mt(l)),t.init(o,"connect",{autoActivate:u,data:{shape:l,context:{start:l,connectionStart:c}}})}}gC.$inject=["eventBus","dragging","modeling","rules"];function bp(e){var t=e.hover,n=e.source,r=e.target;return t&&n&&t===n&&n!==r}var YV=1100,GV=900,vC="connect-ok",mC="connect-not-ok";function yC(e,t,n){var r=e.get("connectionPreview",!1);r&&t.on("connect.move",function(a){var i=a.context,o=i.canExecute,l=i.hover,c=i.source,u=i.start,d=i.startPosition,f=i.target,h=i.connectionStart||d,p=i.connectionEnd||{x:a.x,y:a.y},g=h,v=p;bp(i)&&(g=p,v=h),r.drawPreview(i,o,{source:c||u,target:f||l,connectionStart:g,connectionEnd:v})}),t.on("connect.hover",GV,function(a){var i=a.context,o=a.hover,l=i.canExecute;l!==null&&n.addMarker(o,l?vC:mC)}),t.on(["connect.out","connect.cleanup"],YV,function(a){var i=a.hover;i&&(n.removeMarker(i,vC),n.removeMarker(i,mC))}),r&&t.on("connect.cleanup",function(a){r.cleanUp(a.context)})}yC.$inject=["injector","eventBus","canvas"];var Cp={__depends__:[Do,No,Ci],__init__:["connectPreview"],connect:["type",gC],connectPreview:["type",yC]},qV=15;function _C(e,t){var n;function r(l){return o(l.originalEvent)}e.on("canvas.focus.changed",function(l){l.focused?e.on("element.mousedown",500,r):e.off("element.mousedown",r)});function a(l){var c=n.start,u=n.button,d=Mo(l),f=Ao(d,c);!n.dragging&&JV(f)>qV&&(n.dragging=!0,u===0&&Ob(e),dp("grab")),n.dragging&&(f=Ao(d,n.last||n.start),t.scroll({dx:f.x,dy:f.y}),n.last=d),l.preventDefault()}function i(l){te.event.unbind(document,"mousemove",a),te.event.unbind(document,"mouseup",i),n=null,Ib()}function o(l){if(!(0,te.closest)(l.target,".djs-draggable")){var c=l.button;if(!(c>=2||l.ctrlKey||l.shiftKey||l.altKey))return n={button:c,start:Mo(l)},te.event.bind(document,"mousemove",a),te.event.bind(document,"mouseup",i),!0}}this.isActive=function(){return!!n}}_C.$inject=["eventBus","canvas"];function JV(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}var wC={__init__:["moveCanvas"],moveCanvas:["type",_C]};function Sp(e){return Math.log(e)/Math.log(10)}function bC(e,t){var n=Sp(e.min),r=Sp(e.max);return(Math.abs(n)+Math.abs(r))/t}function XV(e,t){return Math.max(e.min,Math.min(e.max,t))}var KV=Math.sign||function(e){return e>=0?1:-1},xp={min:.2,max:4},CC=10,ZV=.1,QV=.75;function kr(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=(0,P.bind)(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||QV;var r=this;t.on("canvas.mouseover",function(){r._init(e.enabled!==!1)}),t.on("canvas.mouseout",function(){r._init(!1)})}kr.$inject=["config.zoomScroll","eventBus","canvas"],kr.prototype.scroll=function(t){this._canvas.scroll(t)},kr.prototype.reset=function(){this._canvas.zoom("fit-viewport")},kr.prototype.zoom=function(t,n){var r=bC(xp,CC*2);this._totalDelta+=t,Math.abs(this._totalDelta)>ZV&&(this._zoom(t,n,r),this._totalDelta=0)},kr.prototype._handleWheel=function(t){if(this._enabled){var n=this._container;t.preventDefault();var r=t.ctrlKey||kb()&&t.metaKey,a=t.shiftKey,i=-1*this._scale,o;if(r?i*=t.deltaMode===0?.02:.32:i*=t.deltaMode===0?1:16,r){var l=n.getBoundingClientRect(),c={x:t.clientX-l.left,y:t.clientY-l.top};o=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*KV(t.deltaY)*i,this.zoom(o,c)}else a?o={dx:i*t.deltaY,dy:0}:o={dx:i*t.deltaX,dy:i*t.deltaY},this.scroll(o)}},kr.prototype.stepZoom=function(t,n){var r=bC(xp,CC);this._zoom(t,n,r)},kr.prototype._zoom=function(e,t,n){var r=this._canvas,a=e>0?1:-1,i=Sp(r.zoom()),o=Math.round(i/n)*n;o+=n*a;var l=Math.pow(10,o);r.zoom(XV(xp,l),t)},kr.prototype.toggle=function(t){var n=this._container,r=this._handleWheel,a=this._enabled;return typeof t>"u"&&(t=!a),a!==t&&te.event[t?"bind":"unbind"](n,"wheel",r,!1),this._enabled=t,t},kr.prototype._init=function(e){this.toggle(e)};var SC={__init__:["zoomScroll"],zoomScroll:["type",kr]};function Ct(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ct.$inject=["eventBus","injector"],Ct.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";const n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction()},Ct.prototype.canExecute=function(e,t){const n={command:e,context:t},r=this._getHandler(e);let a=this._fire(e,"canExecute",n);if(a===void 0){if(!r)return!1;r.canExecute&&(a=r.canExecute(t))}return a},Ct.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Ct.prototype.undo=function(){let e=this._getUndoAction(),t;if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),t=this._getUndoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ct.prototype.redo=function(){let e=this._getRedoAction(),t;if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),t=this._getRedoAction(),!(!t||t.id!==e.id));)e=t;this._popAction()}},Ct.prototype.register=function(e,t){this._setHandler(e,t)},Ct.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");const n=this._injector.instantiate(t);this.register(e,n)},Ct.prototype.canUndo=function(){return!!this._getUndoAction()},Ct.prototype.canRedo=function(){return!!this._getRedoAction()},Ct.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ct.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ct.prototype._internalUndo=function(e){const t=e.command,n=e.context,r=this._getHandler(t);this._atomicDo(()=>{this._fire(t,"revert",e),r.revert&&this._markDirty(r.revert(n)),this._revertedAction(e),this._fire(t,"reverted",e)})},Ct.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);const r=t?[e+"."+t,t]:[e];let a;n=this._eventBus.createEvent(n);for(const i of r)if(a=this._eventBus.fire("commandStack."+i,n),n.cancelBubble)break;return a},Ct.prototype._createId=function(){return this._uid++},Ct.prototype._atomicDo=function(e){const t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ct.prototype._internalExecute=function(e,t){const n=e.command,r=e.context,a=this._getHandler(n);if(!a)throw new Error("no command handler registered for <"+n+">");this._pushAction(e),t||(this._fire(n,"preExecute",e),a.preExecute&&a.preExecute(r),this._fire(n,"preExecuted",e)),this._atomicDo(()=>{this._fire(n,"execute",e),a.execute&&this._markDirty(a.execute(r)),this._executedAction(e,t),this._fire(n,"executed",e)}),t||(this._fire(n,"postExecute",e),a.postExecute&&a.postExecute(r),this._fire(n,"postExecuted",e)),this._popAction()},Ct.prototype._pushAction=function(e){const t=this._currentExecution,n=t.actions,r=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=r&&r.id||this._createId()),n.push(e)},Ct.prototype._popAction=function(){const e=this._currentExecution,t=e.trigger,n=e.actions,r=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:(0,P.uniqueBy)("id",r.reverse())}),r.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ct.prototype._markDirty=function(e){const t=this._currentExecution;e&&(e=(0,P.isArray)(e)?e:[e],t.dirty=t.dirty.concat(e))},Ct.prototype._executedAction=function(e,t){const n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ct.prototype._revertedAction=function(e){this._stackIdx--},Ct.prototype._getHandler=function(e){return this._handlerMap[e]},Ct.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var e5={commandStack:["type",Ct]};function Si(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function uu(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function ba(e,t,n){if(!(!e||!t)){typeof n!="number"&&(n=-1);var r=e.indexOf(t);if(r!==-1){if(r===n)return;if(n!==-1)e.splice(r,1);else return}n!==-1?e.splice(n,0,t):e.push(t)}}function Ep(e,t){return!e||!t?-1:e.indexOf(t)}function Io(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}var t5=1e3;function rn(e){this._eventBus=e}rn.$inject=["eventBus"];function n5(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}rn.prototype.on=function(e,t,n,r,a,i){if(((0,P.isFunction)(t)||(0,P.isNumber)(t))&&(i=a,a=r,r=n,n=t,t=null),(0,P.isFunction)(n)&&(i=a,a=r,r=n,n=t5),(0,P.isObject)(a)&&(i=a,a=!1),!(0,P.isFunction)(r))throw new Error("handlerFn must be a function");(0,P.isArray)(e)||(e=[e]);var o=this._eventBus;(0,P.forEach)(e,function(l){var c=["commandStack",l,t].filter(function(u){return u}).join(".");o.on(c,n,a?n5(r,i):r,i)})},rn.prototype.canExecute=Xr("canExecute"),rn.prototype.preExecute=Xr("preExecute"),rn.prototype.preExecuted=Xr("preExecuted"),rn.prototype.execute=Xr("execute"),rn.prototype.executed=Xr("executed"),rn.prototype.postExecute=Xr("postExecute"),rn.prototype.postExecuted=Xr("postExecuted"),rn.prototype.revert=Xr("revert"),rn.prototype.reverted=Xr("reverted");function Xr(e){return function(n,r,a,i,o){((0,P.isFunction)(n)||(0,P.isNumber)(n))&&(o=i,i=a,a=r,r=n,n=null),this.on(n,e,r,a,i,o)}}var r5=250,xC=1400;function kp(e,t,n){rn.call(this,t);var r=e.get("movePreview",!1);t.on("shape.move.start",xC,function(a){var i=a.context,o=i.shapes,l=i.validatedShapes;i.shapes=EC(o),i.validatedShapes=EC(l)}),r&&t.on("shape.move.start",r5,function(a){var i=a.context,o=i.shapes,l=[];(0,P.forEach)(o,function(c){(0,P.forEach)(c.labels,function(u){!u.hidden&&i.shapes.indexOf(u)===-1&&l.push(u),c.labelTarget&&l.push(c)})}),(0,P.forEach)(l,function(c){r.makeDraggable(i,c,!0)})}),this.preExecuted("elements.move",xC,function(a){var i=a.context.closure,o=i.enclosedElements,l=[];(0,P.forEach)(o,function(c){(0,P.forEach)(c.labels,function(u){o[u.id]||l.push(u)})}),i.addAll(l)}),this.preExecute(["connection.delete","shape.delete"],function(a){var i=a.context;Io((i.connection||i.shape).labels,function(o){n.removeShape(o,{nested:!0})})}),this.execute("shape.delete",function(a){var i=a.context,o=i.shape,l=o.labelTarget;l&&(i.labelTargetIndex=Ep(l.labels,o),i.labelTarget=l,o.labelTarget=null)}),this.revert("shape.delete",function(a){var i=a.context,o=i.shape,l=i.labelTarget,c=i.labelTargetIndex;l&&(ba(l.labels,o,c),o.labelTarget=l)})}Si(kp,rn),kp.$inject=["injector","eventBus","modeling"];function EC(e){return(0,P.filter)(e,function(t){return e.indexOf(t.labelTarget)===-1})}var a5={__init__:["labelSupport"],labelSupport:["type",kp]};function kC(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function TC(e,t){if(t){let n=e;return Object.keys(t).forEach(r=>{n=n.replace(new RegExp(`{${r}}`,"g"),t[r])}),n}return e}function i5(e,t,n,r){var a=n.inverse;return Object.defineProperty(e,"remove",{value:function(i){var o=this.indexOf(i);return o!==-1&&(this.splice(o,1),t.unset(i,a,r)),i}}),Object.defineProperty(e,"contains",{value:function(i){return this.indexOf(i)!==-1}}),Object.defineProperty(e,"add",{value:function(i,o){var l=this.indexOf(i);if(typeof o>"u"){if(l!==-1)return;o=this.length}l!==-1&&this.splice(l,1),this.splice(o,0,i),l===-1&&t.set(i,a,r)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e}function o5(e){return e.__refs_collection===!0}function l5(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)}function RC(e,t,n){var r=i5(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:r}),r.length&&r.forEach(function(a){e.set(a,t.inverse,n)})}function s5(e,t,n){var r=t.inverse,a=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,enumerable:t.enumerable,get:function(){return a},set:function(i){if(i!==a){var o=a;a=null,o&&e.unset(o,r,n),a=i,e.set(a,r,n)}}})}function qn(e,t){if(!(this instanceof qn))return new qn(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}qn.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?RC(this,t,e):s5(this,t,e)},qn.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return o5(n)||RC(this,t,e),n},qn.prototype.ensureBound=function(e,t){l5(e,t)||this.bind(e,t)},qn.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},qn.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Tp=new qn({name:"children",enumerable:!0,collection:!0},{name:"parent"}),MC=new qn({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),BC=new qn({name:"attachers",collection:!0},{name:"host"}),DC=new qn({name:"outgoing",collection:!0},{name:"source"}),AC=new qn({name:"incoming",collection:!0},{name:"target"});function Oo(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Tp.bind(this,"parent"),MC.bind(this,"labels"),DC.bind(this,"outgoing"),AC.bind(this,"incoming")}function Ul(){Oo.call(this),Tp.bind(this,"children"),BC.bind(this,"host"),BC.bind(this,"attachers")}Si(Ul,Oo);function PC(){Oo.call(this),Tp.bind(this,"children")}Si(PC,Ul);function NC(){Ul.call(this),MC.bind(this,"labelTarget")}Si(NC,Ul);function LC(){Oo.call(this),DC.bind(this,"source"),AC.bind(this,"target")}Si(LC,Oo);var c5={connection:LC,shape:Ul,label:NC,root:PC};function u5(e,t){var n=c5[e];if(!n)throw new Error("unknown type: <"+e+">");return(0,P.assign)(new n,t)}function d5(e){return e instanceof Oo}function Ca(){this._uid=12}Ca.prototype.createRoot=function(e){return this.create("root",e)},Ca.prototype.createLabel=function(e){return this.create("label",e)},Ca.prototype.createShape=function(e){return this.create("shape",e)},Ca.prototype.createConnection=function(e){return this.create("connection",e)},Ca.prototype.create=function(e,t){return t=(0,P.assign)({},t||{}),t.id||(t.id=e+"_"+this._uid++),u5(e,t)};var f5={width:90,height:20};function xi(){Ca.call(this),this._translate=TC}(0,Pr.default)(xi,Ca),xi.$inject=[],xi.prototype.baseCreate=Ca.prototype.create,xi.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,wt({type:"label"},f5,t)):this.createFlowElement(e,t)},xi.prototype.createFlowElement=function(e,t){if(t==null||t===void 0||t==="")return this.baseCreate(e,t);t.businessObject=t.businessObject||{id:kC()},e==="connection"&&(t.type="myline");const{businessObject:n}=t;n.type=t.type;const r=this._getDefaultSize(n.type);return t=wt({businessObject:n,id:n.id},r,t),this.baseCreate(e,t)},xi.prototype._getDefaultSize=function(e){let t={width:100,height:80};switch(e){case"startEvent":case"endEvent":case"myEvent":t={width:36,height:36};break;case"gatewayAnd":case"gatewayXor":case"gatewayInclusive":t={width:50,height:50};break;case"subprocess":case"userTask":case"scriptTask":t={width:100,height:80};break}return t};function du(e,t){this._modeling=e,this._canvas=t}du.$inject=["modeling","canvas"],du.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,r=e.alignment;(0,P.forEach)(n,function(a){var i={x:0,y:0};(0,P.isDefined)(r.left)?i.x=r.left-a.x:(0,P.isDefined)(r.right)?i.x=r.right-a.width-a.x:(0,P.isDefined)(r.center)?i.x=r.center-Math.round(a.width/2)-a.x:(0,P.isDefined)(r.top)?i.y=r.top-a.y:(0,P.isDefined)(r.bottom)?i.y=r.bottom-a.height-a.y:(0,P.isDefined)(r.middle)&&(i.y=r.middle-Math.round(a.height/2)-a.y),t.moveElements([a],i,a.parent)})},du.prototype.postExecute=function(e){};function fu(e){this._modeling=e}fu.$inject=["modeling"],fu.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,r=e.shape,a=e.hints||{};r=e.shape=this._modeling.createShape(r,e.position,n,{attach:a.attach}),e.shape=r},fu.prototype.postExecute=function(e){var t=e.hints||{};h5(e.source,e.shape)||(t.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))};function h5(e,t){return(0,P.some)(e.outgoing,function(n){return n.target===t})}function hu(e,t){this._canvas=e,this._layouter=t}hu.$inject=["canvas","layouter"],hu.prototype.execute=function(e){var t=e.connection,n=e.source,r=e.target,a=e.parent,i=e.parentIndex,o=e.hints;if(!n||!r)throw new Error("source and target required");if(!a)throw new Error("parent required");return t.source=n,t.target=r,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,o)),this._canvas.addConnection(t,a,i),t},hu.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var pu=Math.round;function Rp(e){this._modeling=e}Rp.$inject=["modeling"],Rp.prototype.preExecute=function(e){var t=e.elements,n=e.parent,r=e.parentIndex,a=e.position,i=e.hints,o=this._modeling;(0,P.forEach)(t,function(d){(0,P.isNumber)(d.x)||(d.x=0),(0,P.isNumber)(d.y)||(d.y=0)});var l=Cr((0,P.filter)(t,function(d){return!d.hidden}));(0,P.forEach)(t,function(d){yn(d)&&(d.waypoints=(0,P.map)(d.waypoints,function(f){return{x:pu(f.x-l.x-l.width/2+a.x),y:pu(f.y-l.y-l.height/2+a.y)}})),(0,P.assign)(d,{x:pu(d.x-l.x-l.width/2+a.x),y:pu(d.y-l.y-l.height/2+a.y)})});var c=dV(t),u={};(0,P.forEach)(t,function(d){if(yn(d)){u[d.id]=(0,P.isNumber)(r)?o.createConnection(u[d.source.id],u[d.target.id],r,d,d.parent||n,i):o.createConnection(u[d.source.id],u[d.target.id],d,d.parent||n,i);return}var f=(0,P.assign)({},i);c.indexOf(d)===-1&&(f.autoResize=!1),Lo(d)&&(f=(0,P.omit)(f,["attach"])),u[d.id]=(0,P.isNumber)(r)?o.createShape(d,(0,P.pick)(d,["x","y","width","height"]),d.parent||n,r,f):o.createShape(d,(0,P.pick)(d,["x","y","width","height"]),d.parent||n,f)}),e.elements=(0,P.values)(u)};var IC=Math.round;function Sa(e){this._canvas=e}Sa.$inject=["canvas"],Sa.prototype.execute=function(e){var t=e.shape,n=e.position,r=e.parent,a=e.parentIndex;if(!r)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?(0,P.assign)(t,n):(0,P.assign)(t,{x:n.x-IC(t.width/2),y:n.y-IC(t.height/2)}),this._canvas.addShape(t,r,a),t},Sa.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t};function Yl(e){Sa.call(this,e)}Si(Yl,Sa),Yl.$inject=["canvas"];var p5=Sa.prototype.execute;Yl.prototype.execute=function(e){var t=e.shape;return v5(t),t.labelTarget=e.labelTarget,p5.call(this,e)};var g5=Sa.prototype.revert;Yl.prototype.revert=function(e){return e.shape.labelTarget=null,g5.call(this,e)};function v5(e){["width","height"].forEach(function(t){typeof e[t]>"u"&&(e[t]=0)})}function Gl(e,t){this._canvas=e,this._modeling=t}Gl.$inject=["canvas","modeling"],Gl.prototype.preExecute=function(e){var t=this._modeling,n=e.connection;Io(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),Io(n.outgoing,function(r){t.removeConnection(r,{nested:!0})})},Gl.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Ep(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Gl.prototype.revert=function(e){var t=e.connection,n=e.parent,r=e.parentIndex;return t.source=e.source,t.target=e.target,ba(n.children,t,r),this._canvas.addConnection(t,n),t};function Mp(e,t){this._modeling=e,this._elementRegistry=t}Mp.$inject=["modeling","elementRegistry"],Mp.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry,r=e.elements;(0,P.forEach)(r,function(a){n.get(a.id)&&(a.waypoints?t.removeConnection(a):t.removeShape(a))})};function ql(e,t){this._canvas=e,this._modeling=t}ql.$inject=["canvas","modeling"],ql.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Io(n.incoming,function(r){t.removeConnection(r,{nested:!0})}),Io(n.outgoing,function(r){t.removeConnection(r,{nested:!0})}),Io(n.children,function(r){yn(r)?t.removeConnection(r,{nested:!0}):t.removeShape(r,{nested:!0})})},ql.prototype.execute=function(e){var t=this._canvas,n=e.shape,r=n.parent;return e.oldParent=r,e.oldParentIndex=Ep(r.children,n),t.removeShape(n),n},ql.prototype.revert=function(e){var t=this._canvas,n=e.shape,r=e.oldParent,a=e.oldParentIndex;return ba(r.children,n,a),t.addShape(n,r),n};function gu(e){this._modeling=e}gu.$inject=["modeling"];var OC={x:"y",y:"x"};gu.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,r=e.axis,a=e.dimension;function i(m,_){m.range.min=Math.min(_[r],m.range.min),m.range.max=Math.max(_[r]+_[a],m.range.max)}function o(m){return m[r]+m[a]/2}function l(m){return m.length-1}function c(m){return m.max-m.min}function u(m,_){var y={y:0};y[r]=m-o(_),y[r]&&(y[OC[r]]=0,t.moveElements([_],y,_.parent))}var d=n[0],f=l(n),h=n[f],p,g,v=0;(0,P.forEach)(n,function(m,_){var y,w,C;if(m.elements.length<2){_&&_!==n.length-1&&(i(m,m.elements[0]),v+=c(m.range));return}y=(0,P.sortBy)(m.elements,r),w=y[0],_===f&&(w=y[l(y)]),C=o(w),m.range=null,(0,P.forEach)(y,function(S){if(u(C,S),m.range===null){m.range={min:S[r],max:S[r]+S[a]};return}i(m,S)}),_&&_!==n.length-1&&(v+=c(m.range))}),g=Math.abs(h.range.min-d.range.max),p=Math.round((g-v)/(n.length-1)),!(p<n.length-1)&&(0,P.forEach)(n,function(m,_){var y={},w;m===d||m===h||(w=n[_-1],m.range.max=0,(0,P.forEach)(m.elements,function(C,S){y[OC[r]]=0,y[r]=w.range.max-C[r]+p,m.range.min!==C[r]&&(y[r]+=C[r]-m.range.min),y[r]&&t.moveElements([C],y,C.parent),m.range.max=Math.max(C[r]+C[a],S?m.range.max:0)}))})},gu.prototype.postExecute=function(e){};function vu(e,t){this._layouter=e,this._canvas=t}vu.$inject=["layouter","canvas"],vu.prototype.execute=function(e){var t=e.connection,n=t.waypoints;return(0,P.assign)(e,{oldWaypoints:n}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},vu.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function Bp(){}Bp.prototype.execute=function(e){var t=e.connection,n=e.delta,r=e.newParent||t.parent,a=e.newParentIndex,i=t.parent;return e.oldParent=i,e.oldParentIndex=uu(i.children,t),ba(r.children,t,a),t.parent=r,(0,P.forEach)(t.waypoints,function(o){o.x+=n.x,o.y+=n.y,o.original&&(o.original.x+=n.x,o.original.y+=n.y)}),t},Bp.prototype.revert=function(e){var t=e.connection,n=t.parent,r=e.oldParent,a=e.oldParentIndex,i=e.delta;return uu(n.children,t),ba(r.children,t,a),t.parent=r,(0,P.forEach)(t.waypoints,function(o){o.x-=i.x,o.y-=i.y,o.original&&(o.original.x-=i.x,o.original.y-=i.y)}),t};function mu(e,t,n){var r=Vb(t),a=Vb(n),i=Ao(e,r),o={x:i.x*(n.width/t.width),y:i.y*(n.height/t.height)};return Wl({x:a.x+o.x,y:a.y+o.y})}function Dp(e,t,n){var r=yu(e),a=zC(r,t),i=r[0];return a.length?a[a.length-1]:mu(i.original||i,n,t)}function Ap(e,t,n){var r=yu(e),a=zC(r,t),i=r[r.length-1];return a.length?a[0]:mu(i.original||i,n,t)}function Pp(e,t,n){var r=yu(e),a=VC(t,n),i=r[0];return mu(i.original||i,a,t)}function Np(e,t,n){var r=yu(e),a=VC(t,n),i=r[r.length-1];return mu(i.original||i,a,t)}function VC(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function yu(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function zC(e,t){return(0,P.filter)((0,P.map)(e,y5),function(n){return m5(n,t)})}function m5(e,t){return wa(t,e,1)==="intersect"}function y5(e){return e.original||e}function Lp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}Lp.prototype.add=function(e,t){return this.addAll([e],t)},Lp.prototype.addAll=function(e,t){var n=pV(e,!!t,this);return(0,P.assign)(this,n),this};function Jl(e){this._modeling=e}Jl.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},Jl.prototype.moveClosure=function(e,t,n,r,a){var i=this._modeling,o=e.allShapes,l=e.allConnections,c=e.enclosedConnections,u=e.topLevel,d=!1;a&&a.parent===n&&(d=!0),(0,P.forEach)(o,function(f){i.moveShape(f,t,u[f.id]&&!d&&n,{recurse:!1,layout:!1})}),(0,P.forEach)(l,function(f){var h=!!o[f.source.id],p=!!o[f.target.id];c[f.id]&&h&&p?i.moveConnection(f,t,u[f.id]&&!d&&n):i.layoutConnection(f,{connectionStart:h&&Pp(f,f.source,t),connectionEnd:p&&Np(f,f.target,t)})})},Jl.prototype.getClosure=function(e){return new Lp().addAll(e,!0)};function _u(e){this._helper=new Jl(e)}_u.$inject=["modeling"],_u.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},_u.prototype.postExecute=function(e){var t=e.hints,n;t&&t.primaryShape&&(n=t.primaryShape,t.oldParent=n.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,n)};function Ei(e){this._modeling=e,this._helper=new Jl(e)}Ei.$inject=["modeling"],Ei.prototype.execute=function(e){var t=e.shape,n=e.delta,r=e.newParent||t.parent,a=e.newParentIndex,i=t.parent;return e.oldBounds=(0,P.pick)(t,["x","y","width","height"]),e.oldParent=i,e.oldParentIndex=uu(i.children,t),ba(r.children,t,a),(0,P.assign)(t,{parent:r,x:t.x+n.x,y:t.y+n.y}),t},Ei.prototype.postExecute=function(e){var t=e.shape,n=e.delta,r=e.hints,a=this._modeling;r.layout!==!1&&((0,P.forEach)(t.incoming,function(i){a.layoutConnection(i,{connectionEnd:Np(i,t,n)})}),(0,P.forEach)(t.outgoing,function(i){a.layoutConnection(i,{connectionStart:Pp(i,t,n)})})),r.recurse!==!1&&this.moveChildren(e)},Ei.prototype.revert=function(e){var t=e.shape,n=e.oldParent,r=e.oldParentIndex,a=e.delta;return ba(n.children,t,r),(0,P.assign)(t,{parent:n,x:t.x-a.x,y:t.y-a.y}),t},Ei.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},Ei.prototype.getNewParent=function(e){return e.newParent||e.shape.parent};function Xl(e){this._modeling=e}Xl.$inject=["modeling"],Xl.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,r=e.connection,a=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return(0,P.isArray)(a)&&(e.oldWaypoints=r.waypoints,r.waypoints=a),t&&(e.oldSource=r.source,r.source=t),n&&(e.oldTarget=r.target,r.target=n),r},Xl.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,r=e.newTarget,a=e.dockingOrPoints,i=e.hints||{},o={};i.connectionStart&&(o.connectionStart=i.connectionStart),i.connectionEnd&&(o.connectionEnd=i.connectionEnd),i.layoutConnection!==!1&&(n&&(!r||i.docking==="source")&&(o.connectionStart=o.connectionStart||HC((0,P.isArray)(a)?a[0]:a)),r&&(!n||i.docking==="target")&&(o.connectionEnd=o.connectionEnd||HC((0,P.isArray)(a)?a[a.length-1]:a)),i.newWaypoints&&(o.waypoints=i.newWaypoints),this._modeling.layoutConnection(t,o))},Xl.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,r=e.oldWaypoints,a=e.connection;return t&&(a.source=t),n&&(a.target=n),r&&(a.waypoints=r),a};function HC(e){return e.original||e}function Kr(e,t){this._modeling=e,this._rules=t}Kr.$inject=["modeling","rules"],Kr.prototype.preExecute=function(e){var t=this,n=this._modeling,r=this._rules,a=e.oldShape,i=e.newData,o=e.hints||{},l;function c(g,v,m){return r.allowed("connection.reconnect",{connection:m,source:g,target:v})}var u={x:i.x,y:i.y},d={x:a.x,y:a.y,width:a.width,height:a.height};l=e.newShape=e.newShape||t.createShape(i,u,a.parent,o),a.host&&n.updateAttachment(l,a.host);var f;o.moveChildren!==!1&&(f=a.children.slice(),n.moveElements(f,{x:0,y:0},l,o));var h=a.incoming.slice(),p=a.outgoing.slice();(0,P.forEach)(h,function(g){var v=g.source;c(v,l,g)&&t.reconnectEnd(g,l,Ap(g,l,d),o)}),(0,P.forEach)(p,function(g){var v=g.target;c(l,v,g)&&t.reconnectStart(g,l,Dp(g,l,d),o)})},Kr.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},Kr.prototype.execute=function(e){},Kr.prototype.revert=function(e){},Kr.prototype.createShape=function(e,t,n,r){return this._modeling.createShape(e,t,n,r)},Kr.prototype.reconnectStart=function(e,t,n,r){this._modeling.reconnectStart(e,t,n,r)},Kr.prototype.reconnectEnd=function(e,t,n,r){this._modeling.reconnectEnd(e,t,n,r)};function Kl(e){this._modeling=e}Kl.$inject=["modeling"],Kl.prototype.execute=function(e){var t=e.shape,n=e.newBounds,r=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(r&&(n.width<r.width||n.height<r.height))throw new Error("width and height cannot be less than minimum height and width");if(!r&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},(0,P.assign)(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Kl.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,r=e.oldBounds;(e.hints||{}).layout!==!1&&((0,P.forEach)(n.incoming,function(a){t.layoutConnection(a,{connectionEnd:Ap(a,n,r)})}),(0,P.forEach)(n.outgoing,function(a){t.layoutConnection(a,{connectionStart:Dp(a,n,r)})}))},Kl.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return(0,P.assign)(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t};function _5(e,t){var n=[];return(0,P.forEach)(e.concat(t),function(r){var a=r.incoming,i=r.outgoing;(0,P.forEach)(a.concat(i),function(o){var l=o.source,c=o.target;(Zl(e,l)||Zl(e,c)||Zl(t,l)||Zl(t,c))&&(Zl(n,o)||n.push(o))})}),n}function Zl(e,t){return e.indexOf(t)!==-1}function w5(e,t,n){var r=e.x,a=e.y,i=e.width,o=e.height,l=n.x,c=n.y;switch(t){case"n":return{x:r,y:a+c,width:i,height:o-c};case"s":return{x:r,y:a,width:i,height:o+c};case"w":return{x:r+l,y:a,width:i-l,height:o};case"e":return{x:r,y:a,width:i+l,height:o};default:throw new Error("unknown direction: "+t)}}function xa(e){this._modeling=e}xa.$inject=["modeling"],xa.prototype.preExecute=function(e){var t=e.delta,n=e.direction,r=e.movingShapes,a=e.resizingShapes,i=e.start,o={};this.moveShapes(r,t),(0,P.forEach)(a,function(l){o[l.id]=C5(l)}),this.resizeShapes(a,t,n),this.updateConnectionWaypoints(_5(r,a),t,n,i,r,a,o)},xa.prototype.execute=function(){},xa.prototype.revert=function(){},xa.prototype.moveShapes=function(e,t){var n=this;(0,P.forEach)(e,function(r){n._modeling.moveShape(r,t,null,{autoResize:!1,layout:!1,recurse:!1})})},xa.prototype.resizeShapes=function(e,t,n){var r=this;(0,P.forEach)(e,function(a){var i=w5(a,n,t);r._modeling.resizeShape(a,i,null,{attachSupport:!1,autoResize:!1,layout:!1})})},xa.prototype.updateConnectionWaypoints=function(e,t,n,r,a,i,o){var l=this,c=a.concat(i);(0,P.forEach)(e,function(u){var d=u.source,f=u.target,h=b5(u),p=jC(n),g={};Ea(c,d)&&Ea(c,f)?(h=(0,P.map)(h,function(v){return $C(v,r,n)&&(v[p]=v[p]+t[p]),v.original&&$C(v.original,r,n)&&(v.original[p]=v.original[p]+t[p]),v}),l._modeling.updateWaypoints(u,h,{labelBehavior:!1})):(Ea(c,d)||Ea(c,f))&&(Ea(a,d)?g.connectionStart=Pp(u,d,t):Ea(a,f)?g.connectionEnd=Np(u,f,t):Ea(i,d)?g.connectionStart=Dp(u,d,o[d.id]):Ea(i,f)&&(g.connectionEnd=Ap(u,f,o[f.id])),l._modeling.layoutConnection(u,g))})};function FC(e){return(0,P.assign)({},e)}function b5(e){return(0,P.map)(e.waypoints,function(t){return t=FC(t),t.original&&(t.original=FC(t.original)),t})}function jC(e){switch(e){case"n":return"y";case"w":return"x";case"s":return"y";case"e":return"x"}}function $C(e,t,n){var r=jC(n);if(/e|s/.test(n))return e[r]>t;if(/n|w/.test(n))return e[r]<t}function Ea(e,t){return e.indexOf(t)!==-1}function C5(e){return{x:e.x,y:e.y,height:e.height,width:e.width}}function wu(e){this._modeling=e}wu.$inject=["modeling"],wu.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=WC(n),t.collapsed=!t.collapsed;var r=UC(n,t.collapsed);return[t].concat(r)},wu.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,r=t.children,a=YC(r,n);return t.collapsed=!t.collapsed,[t].concat(a)};function WC(e){var t={};return(0,P.forEach)(e,function(n){t[n.id]=n.hidden,n.children&&(t=(0,P.assign)({},t,WC(n.children)))}),t}function UC(e,t){var n=[];return(0,P.forEach)(e,function(r){r.hidden=t,n=n.concat(r),r.children&&(n=n.concat(UC(r.children,r.collapsed||t)))}),n}function YC(e,t){var n=[];return(0,P.forEach)(e,function(r){r.hidden=t[r.id],n=n.concat(r),r.children&&(n=n.concat(YC(r.children,t)))}),n}function bu(e){this._modeling=e}bu.$inject=["modeling"],bu.prototype.execute=function(e){var t=e.shape,n=e.newHost,r=t.host;return e.oldHost=r,e.attacherIdx=GC(r,t),qC(n,t),t.host=n,t},bu.prototype.revert=function(e){var t=e.shape,n=e.newHost,r=e.oldHost,a=e.attacherIdx;return t.host=r,GC(n,t),qC(r,t,a),t};function GC(e,t){return uu(e&&e.attachers,t)}function qC(e,t,n){if(e){var r=e.attachers;r||(e.attachers=r=[]),ba(r,t,n)}}function Ip(){}Ip.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},Ip.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t};function st(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var r=this;e.on("diagram.init",function(){r.registerHandlers(n)})}st.$inject=["eventBus","elementFactory","commandStack"],st.prototype.getHandlers=function(){return{"shape.append":fu,"shape.create":Sa,"shape.delete":ql,"shape.move":Ei,"shape.resize":Kl,"shape.replace":Kr,"shape.toggleCollapse":wu,spaceTool:xa,"label.create":Yl,"connection.create":hu,"connection.delete":Gl,"connection.move":Bp,"connection.layout":vu,"connection.updateWaypoints":Ip,"connection.reconnect":Xl,"elements.create":Rp,"elements.move":_u,"elements.delete":Mp,"elements.distribute":gu,"elements.align":du,"element.updateAttachment":bu}},st.prototype.registerHandlers=function(e){(0,P.forEach)(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},st.prototype.moveShape=function(e,t,n,r,a){typeof r=="object"&&(a=r,r=null);var i={shape:e,delta:t,newParent:n,newParentIndex:r,hints:a||{}};this._commandStack.execute("shape.move",i)},st.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},st.prototype.moveElements=function(e,t,n,r){r=r||{};var a=r.attach,i=n,o;a===!0?(o=n,i=n.parent):a===!1&&(o=null);var l={shapes:e,delta:t,newParent:i,newHost:o,hints:r};this._commandStack.execute("elements.move",l)},st.prototype.moveConnection=function(e,t,n,r,a){typeof r=="object"&&(a=r,r=void 0);var i={connection:e,delta:t,newParent:n,newParentIndex:r,hints:a||{}};this._commandStack.execute("connection.move",i)},st.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},st.prototype.createConnection=function(e,t,n,r,a,i){typeof n=="object"&&(i=a,a=r,r=n,n=void 0),r=this._create("connection",r);var o={source:e,target:t,parent:a,parentIndex:n,connection:r,hints:i};return this._commandStack.execute("connection.create",o),o.connection},st.prototype.createShape=function(e,t,n,r,a){typeof r!="number"&&(a=r,r=void 0),a=a||{};var i=a.attach,o,l;e=this._create("shape",e),i?(o=n.parent,l=n):o=n;var c={position:t,shape:e,parent:o,parentIndex:r,host:l,hints:a};return this._commandStack.execute("shape.create",c),c.shape},st.prototype.createElements=function(e,t,n,r,a){(0,P.isArray)(e)||(e=[e]),typeof r!="number"&&(a=r,r=void 0),a=a||{};var i={position:t,elements:e,parent:n,parentIndex:r,hints:a};return this._commandStack.execute("elements.create",i),i.elements},st.prototype.createLabel=function(e,t,n,r){n=this._create("label",n);var a={labelTarget:e,position:t,parent:r||e.parent,shape:n};return this._commandStack.execute("label.create",a),a.shape},st.prototype.appendShape=function(e,t,n,r,a){a=a||{},t=this._create("shape",t);var i={source:e,position:n,target:r,shape:t,connection:a.connection,connectionParent:a.connectionParent,hints:a};return this._commandStack.execute("shape.append",i),i.shape},st.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},st.prototype.distributeElements=function(e,t,n){var r={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",r)},st.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},st.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},st.prototype.replaceShape=function(e,t,n){var r={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",r),r.newShape},st.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},st.prototype.resizeShape=function(e,t,n,r){var a={shape:e,newBounds:t,minBounds:n,hints:r};this._commandStack.execute("shape.resize",a)},st.prototype.createSpace=function(e,t,n,r,a){var i={delta:n,direction:r,movingShapes:e,resizingShapes:t,start:a};this._commandStack.execute("spaceTool",i)},st.prototype.updateWaypoints=function(e,t,n){var r={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",r)},st.prototype.reconnect=function(e,t,n,r,a){var i={connection:e,newSource:t,newTarget:n,dockingOrPoints:r,hints:a||{}};this._commandStack.execute("connection.reconnect",i)},st.prototype.reconnectStart=function(e,t,n,r){r||(r={}),this.reconnect(e,t,e.target,n,(0,P.assign)(r,{docking:"source"}))},st.prototype.reconnectEnd=function(e,t,n,r){r||(r={}),this.reconnect(e,e.source,t,n,(0,P.assign)(r,{docking:"target"}))},st.prototype.connect=function(e,t,n,r){return this.createConnection(e,t,n||{},e.parent,r)},st.prototype._create=function(e,t){return d5(t)?t:this._elementFactory.create(e,t)},st.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};function JC(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Op(e,t){if(!e||!t||!Array.isArray(t))return!1;const n=e.type||e.businessObject&&e.businessObject.type;return t.includes(n)}function S5(e,t){Array.isArray(e)&&e.forEach(t)}function Cu(e){const t=e.businessObject;if(t)return t.name||""}function x5(e,t){const n=e.businessObject;return n.name=t,e}var E5={width:90,height:20},g4=15;function Vp(e){return["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(e.type)}function XC(e){return Ql(e.label)}function k5(e){const t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)],a=T5(e),i=Math.atan((r.y-n.y)/(r.x-n.x));let{x:o,y:l}=a;return Math.abs(i)<Math.PI/2?l-=15:o+=15,{x:o,y:l}}function T5(e){const t=e.length/2-1,n=e[Math.floor(t)],r=e[Math.ceil(t+.01)];return{x:n.x+(r.x-n.x)/2,y:n.y+(r.y-n.y)/2}}function KC(e){return e.waypoints?k5(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+E5.height/2}}function Ql(e){return e&&!!e.labelTarget}var R5={width:0,height:0};function ZC(e,t){function n(l,c){const u=l.label||l,d=l.labelTarget||l;return x5(u,c,d!==u),[u,d]}function r(l){const{element:c,newLabel:u}=l,{businessObject:d}=c;if(!Ql(c)&&Vp(c)&&!XC(c)&&!QC(u)){let h=KC(c);h={x:h.x,y:h.y+7},e.createLabel(c,h,{id:d.id+"_label",businessObject:d})}}function a(l){return l.oldLabel=Cu(l.element),n(l.element,l.newLabel)}function i(l){return n(l.element,l.oldLabel)}function o(l){const{element:c,newLabel:u}=l,d=c.label||c,f=l.hints||{};let{newBounds:h}=l;if(!Ql(d))return;if(Ql(d)&&QC(u)){f.removeShape!==!1&&e.removeShape(d,{unsetLabel:!1});return}const p=Cu(d);typeof h>"u"&&(h=t.getExternalLabelBounds(d,p)),h&&e.resizeShape(d,h,R5)}this.preExecute=r,this.execute=a,this.revert=i,this.postExecute=o}ZC.$inject=["modeling","textRenderer"];function QC(e){return!e||!e.trim()}function es(e,t,n){st.call(this,e,t,n)}(0,Pr.default)(es,st),es.$inject=["eventBus","elementFactory","commandStack"],es.prototype.getHandlers=function(){const e=st.prototype.getHandlers.call(this);return e["element.updateLabel"]=ZC,e},es.prototype.updateLabel=function(e,t,n,r){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:r||{}})};function zp(e,t){rn.call(this,e);function n(r){const{context:a}=r,i=a.hints||{};let o;!a.cropped&&i.createElementsBehavior!==!1&&(o=a.connection,o.waypoints=t.getCroppedWaypoints(o),a.cropped=!0)}this.executed(["connection.layout","connection.create"],n)}(0,Pr.default)(zp,rn),zp.$inject=["eventBus","connectionDocking"];function e1(){}e1.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||Mt(t.source||e.source),t.connectionEnd||Mt(t.target||e.target)]};var Su=20,M5=5,xu=Math.round,t1=20,B5={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function D5(e,t){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[t].test(e)}function A5(e,t){return{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[e].test(t)}function n1(e,t,n){var r=wa(t,e,M5),a=n.split(":")[0],i=xu((t.x-e.x)/2+e.x),o=xu((t.y-e.y)/2+e.y),l,c,u=A5(a,r),d=/h|r|l/.test(a),f=!1,h=!1;return u?(l=d?{x:i,y:e.y}:{x:e.x,y:o},c=d?"h:h":"v:v"):(f=D5(r,a),c=d?"h:v":"v:h",f?d?(h=o===e.y,l={x:e.x+Su*(/l/.test(a)?-1:1),y:h?o+Su:o}):(h=i===e.x,l={x:h?i+Su:i,y:e.y+Su*(/t/.test(a)?-1:1)}):l={x:i,y:o}),{waypoints:Hp(e,l,c).concat(l),directions:c,turnNextDirections:h}}function P5(e,t,n){return n1(e,t,n)}function N5(e,t,n){var r=n1(t,e,r1(n));return{waypoints:r.waypoints.slice().reverse(),directions:r1(r.directions),turnNextDirections:r.turnNextDirections}}function L5(e,t){var n=e.directions.split(":")[1],r=t.directions.split(":")[0];e.turnNextDirections&&(n=n=="h"?"v":"h"),t.turnNextDirections&&(r=r=="h"?"v":"h");var a=n+":"+r;return{waypoints:Hp(e.waypoints[e.waypoints.length-1],t.waypoints[0],a),directions:a}}function r1(e){return e.split(":").reverse().join(":")}function I5(e,t,n){var r=xu((t.x-e.x)/2+e.x),a=xu((t.y-e.y)/2+e.y);if(n==="h:v")return[{x:t.x,y:e.y}];if(n==="v:h")return[{x:e.x,y:t.y}];if(n==="h:h")return[{x:r,y:e.y},{x:r,y:t.y}];if(n==="v:v")return[{x:e.x,y:a},{x:t.x,y:a}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}function Hp(e,t,n){if(n=n||"h:h",!U5(n))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(i1(n)){var r=P5(e,t,n),a=N5(e,t,n),i=L5(r,a);return[].concat(r.waypoints,i.waypoints,a.waypoints)}return I5(e,t,n)}function O5(e,t,n){var r=Hp(e,t,n);return r.unshift(e),r.push(t),l1(r)}function V5(e,t,n,r,a){var i=(0,P.without)(a&&a.preferredLayouts||[],"straight")[0]||"h:h",o=wa(e,t,B5[i]||0),l=W5(o,i);n=n||Mt(e),r=r||Mt(t);var c=l.split(":");return O5(o1(n,e,c[0],Y5(o)),o1(r,t,c[1],o),l)}function z5(e,t,n,r,a,i){(0,P.isArray)(n)&&(a=n,i=r,n=Mt(e),r=Mt(t)),i=(0,P.assign)({preferredLayouts:[]},i),a=a||[];var o=i.preferredLayouts.indexOf("straight")!==-1&&F5(e,t,n,r,i);return o||(o=i.connectionEnd&&$5(t,e,r,a),o)||(o=i.connectionStart&&j5(e,t,n,a),o)?o:!i.connectionStart&&!i.connectionEnd&&a&&a.length?a:V5(e,t,n,r,i)}function H5(e,t,n){return e>=t&&e<=n}function a1(e,t,n){return H5(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function F5(e,t,n,r,a){var i={},o,l=wa(e,t);return/^(top|bottom|left|right)$/.test(l)?(/top|bottom/.test(l)&&(o="x"),/left|right/.test(l)&&(o="y"),a.preserveDocking==="target"?a1(o,r,e)?(i[o]=r[o],[{x:i.x!==void 0?i.x:n.x,y:i.y!==void 0?i.y:n.y,original:{x:i.x!==void 0?i.x:n.x,y:i.y!==void 0?i.y:n.y}},{x:r.x,y:r.y}]):null:a1(o,n,t)?(i[o]=n[o],[{x:n.x,y:n.y},{x:i.x!==void 0?i.x:r.x,y:i.y!==void 0?i.y:r.y,original:{x:i.x!==void 0?i.x:r.x,y:i.y!==void 0?i.y:r.y}}]):null):null}function j5(e,t,n,r){return Fp(e,t,n,r)}function $5(e,t,n,r){var a=r.slice().reverse();return a=Fp(e,t,n,a),a?a.reverse():null}function Fp(e,t,n,r){function a(d){return d.length<3?!0:d.length>4?!1:!!(0,P.find)(d,function(f,h){var p=d[h-1];return p&&$l(f,p)<3})}function i(d,f,h){switch(va(f,d)){case"v":return{x:h.x,y:d.y};case"h":return{x:d.x,y:h.y}}return{x:d.x,y:d.y}}function o(d,f,h){var p;for(p=d.length-2;p!==0;p--)if(tC(d[p],f,t1)||tC(d[p],h,t1))return d.slice(p);return d}if(a(r))return null;var l=r[0],c=r.slice(),u;return c[0]=n,c[1]=i(c[1],l,n),u=o(c,e,t),u!==c&&(c=Fp(e,t,n,u)),c&&va(c)?null:c}function W5(e,t){if(i1(t))return t;switch(e){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}function U5(e){return e&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(e)}function i1(e){return e&&/t|r|b|l/.test(e)}function Y5(e){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[e]}function o1(e,t,n,r){if(n==="h"&&(n=/left/.test(r)?"l":"r"),n==="v"&&(n=/top/.test(r)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function l1(e){return e.reduce(function(t,n,r){var a=t[t.length-1],i=e[r+1];return vp(a,i,n,0)||t.push(n),t},[])}function jp(){}(0,Pr.default)(jp,e1);var ki=(e,t)=>e.type===t;jp.prototype.layoutConnection=function(e,t){t||(t={});const n=t.source||e.source,r=t.target||e.target,a=t.waypoints||e.waypoints;let{connectionStart:i,connectionEnd:o}=t,l,c;return o===void 0&&(i=Eu(a&&a[0],n),o=Eu(a&&a[a.length-1],r)),i||(i=Eu(a&&a[0],n)),o||(o=Eu(a&&a[a.length-1],r)),ki(e,"myline")&&(n===r?l={preferredLayouts:G5(n,e)}:ki(n,"gatewayAnd")||ki(n,"gatewayXor")||ki(n,"gatewayInclusive")?l={preferredLayouts:["v:h"]}:ki(r,"gatewayAnd")||ki(r,"gatewayXor")||ki(r,"gatewayInclusive")?l={preferredLayouts:["h:v"]}:l={preferredLayouts:["h:h"]}),l&&(l=wt(l,t),c=l1(z5(n,r,i,o,a,l))),c||[i,o]};function Eu(e,t){return e?e.original||e:Mt(t)}function G5(e,t){const{waypoints:n}=t,r=n&&n.length&&wa(n[0],e);return r==="top"?["t:r"]:r==="right"?["r:b"]:r==="left"?["l:t"]:["b:l"]}function s1(e){return(0,P.assign)({original:e.point.original||e.point},e.actual)}function ka(e,t){this._elementRegistry=e,this._graphicsFactory=t}ka.$inject=["elementRegistry","graphicsFactory"],ka.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var r=this.getDockingPoint(e,t,!0),a=this.getDockingPoint(e,n),i=e.waypoints.slice(r.idx+1,a.idx);return i.unshift(s1(r)),i.push(s1(a)),i},ka.prototype.getDockingPoint=function(e,t,n){var r=e.waypoints,a=n?0:r.length-1,i=r[a];return{point:i,actual:this._getIntersection(t,e,n)||i,idx:a}},ka.prototype._getIntersection=function(e,t,n){return wp(this._getShapePath(e),this._getConnectionPath(t),n)},ka.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},ka.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},ka.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};var c1={__depends__:[e5,a5,Do],__init__:["modeling","elementUpdater"],modeling:["type",es],layouter:["type",jp],elementUpdater:["type",zp],elementFactory:["type",xi],connectionDocking:["type",ka]},q5=1e3;function Ti(e,t){var n=this;t=t||q5,e.on(["render.shape","render.connection"],t,function(r,a){var i=r.type,o=a.element,l=a.gfx,c=a.attrs;if(n.canRender(o))return i==="render.shape"?n.drawShape(l,o,c):n.drawConnection(l,o,c)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(r,a){if(n.canRender(a))return r.type==="render.getShapePath"?n.getShapePath(a):n.getConnectionPath(a)})}Ti.prototype.canRender=function(e){},Ti.prototype.drawShape=function(e,t){},Ti.prototype.drawConnection=function(e,t){},Ti.prototype.getShapePath=function(e){},Ti.prototype.getConnectionPath=function(e){};function J5(e){return e.businessObject}function ku(e,t){return e.businessObject.strokeWidth||t||1}function rr(e,t){return e.businessObject.fillColor||t||"var(--j-color-bg-container)"}function Bt(e,t){return e.businessObject.strokeColor||t||"var(--j-color-text)"}function X5(e){const t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2;return Fl([["M",t,n],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])}function K5(e,t){const{x:n,y:r,width:a,height:i}=e;return Fl([["M",n+t,r],["l",a-t*2,0],["a",t,t,0,0,1,t,t],["l",0,i-t*2],["a",t,t,0,0,1,-t,t],["l",t*2-a,0],["a",t,t,0,0,1,-t,-t],["l",0,t*2-i],["a",t,t,0,0,1,t,-t],["z"]])}function Z5(e){const{x:t,y:n,width:r,height:a}=e,i=r/2,o=a/2;return Fl([["M",t+i,n],["l",i,o],["l",-i,o],["l",-i,-o],["z"]])}function Q5(e){const{x:t,y:n,width:r,height:a}=e;return Fl([["M",t,n],["l",r,0],["l",0,a],["l",-r,0],["z"]])}var $p=10,Wp=.95,Ta=(e,t)=>e.type===t;function Ri(e,t,n,r,a,i,o){Ti.call(this,e,o);const l="var(--j-color-bg-container)",c="var(--j-color-text)",u={};Object.keys(i.palette).forEach(N=>{const M=i.palette[N];u[M.type]=M.options});const{computeStyle:d}=t;function f(N){return L[N]}function h(N){return t.computeStyle(N,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:c,strokeWidth:2})}function p(N){return t.computeStyle(N,{strokeLinecap:"round",strokeLinejoin:"round",stroke:c,strokeWidth:2,fill:"white"})}function g(N,M,I,$){I=h(I);const ee=cp(M,I,$);return(0,V.append)(N,ee),ee}function v(N,M,I){return g(N,M,I,5)}function m(N,M,I,$,ee){JC($)&&(ee=$,$=0),$=$||0,ee=d(ee,{stroke:c,strokeWidth:2,fill:l}),ee.fill==="none"&&delete ee.fillOpacity;const oe=M/2,j=I/2,U=(0,V.create)("circle");return(0,V.attr)(U,{cx:oe,cy:j,r:Math.round((M+I)/4-$)}),(0,V.attr)(U,ee),(0,V.append)(N,U),U}function _(N,M,I,$,ee,oe){JC(ee)&&(oe=ee,ee=0),ee=ee||0,oe=d(oe,{stroke:c,strokeWidth:2,fill:l});const j=(0,V.create)("rect");return(0,V.attr)(j,{x:ee,y:ee,width:M-ee*2,height:I-ee*2,rx:$,ry:$}),(0,V.attr)(j,oe),(0,V.append)(N,j),j}function y(N,M,I){I=d(I,["no-fill"],{strokeWidth:2,stroke:c});const $=(0,V.create)("path");return(0,V.attr)($,{d:M}),(0,V.attr)($,I),(0,V.append)(N,$),$}function w(N,M,I,$){const ee=M/2,oe=I/2,j=[{x:ee,y:0},{x:M,y:oe},{x:ee,y:I},{x:0,y:oe}].map(H=>H.x+","+H.y).join(" ");$=d($,{stroke:c,strokeWidth:2,fill:l});const U=(0,V.create)("polygon");return(0,V.attr)(U,{points:j}),(0,V.attr)(U,$),(0,V.append)(N,U),U}function C(N,M,I,$){return y(M,I,wt({"data-marker":N},$))}function S(N,M,I){I=wt({size:{width:100}},I);const $=a.createText(M||"",I);return(0,V.classes)($).add("djs-label"),(0,V.append)(N,$),$}function b(N,M,I){return S(N,J5(M).name,{box:M,align:I,padding:5,style:{fill:Bt(M,c)}})}function x(N,M){const I={width:90,height:30,x:M.width/2+M.x,y:M.height/2+M.y};return S(N,Cu(M),{box:I,fitBox:!0,style:wt({},a.getExternalStyle(),{fill:Bt(M,c)})})}function E(N,M,I){const $=I&&I.indexOf("SubProcessMarker")!==-1;let ee;$?ee={seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:ee={seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},S5(I,oe=>{f(oe)(N,M,ee)})}function k(N){return N.replace(/[^0-9a-zA-z]+/g,"_")}function T(N,M){const{ref:I={x:0,y:0},scale:$=1,element:ee,parentGfx:oe=r._svg}=M,j=(0,V.create)("marker",{id:N,viewBox:"0 0 20 20",refX:I.x,refY:I.y,markerWidth:20*$,markerHeight:20*$,orient:"auto"});(0,V.append)(j,ee);let U=(0,te.query)(":scope > defs",oe);U||(U=(0,V.create)("defs"),(0,V.append)(oe,U)),(0,V.append)(U,j)}function R(N,M,I,$){const ee=M+"-"+k(I)+"-"+k($)+"-"+kC();return D(N,ee,M,I,$),"url(#"+ee+")"}function D(N,M,I,$,ee){I==="sequenceflow-end"&&T(M,{element:(0,V.create)("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:ee,stroke:ee,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:N}),I==="messageflow-start"&&T(M,{element:(0,V.create)("circle",{cx:6,cy:6,r:3.5,...p({fill:$,stroke:ee,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:N}),I==="messageflow-end"&&T(M,{element:(0,V.create)("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:$,stroke:ee,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:N}),I==="association-start"&&T(M,{element:(0,V.create)("path",{d:"M 11 5 L 1 10 L 11 15",...h({fill:"none",stroke:ee,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:N}),I==="association-end"&&T(M,{element:(0,V.create)("path",{d:"M 1 5 L 11 10 L 1 15",...h({fill:"none",stroke:ee,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:N}),I==="conditional-flow-marker"&&T(M,{element:(0,V.create)("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:$,stroke:ee})}),ref:{x:-1,y:10},scale:.5,parentGfx:N}),I==="conditional-default-flow-marker"&&T(M,{element:(0,V.create)("path",{d:"M 6 4 L 10 16",...p({stroke:ee,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:N})}function A(N,M,I,$){const ee=u[M.type]?.icon||M.icon;ee&&y(N,n.getScaledPath(ee,{abspos:{x:I,y:$}}),{strokeWidth:0,fill:Bt(M,u[M.type]?.iconFill||M.iconFill)})}const L={event(N,M,I){return"fillOpacity"in I||(I.fillOpacity=Wp),m(N,M.width,M.height,I)},startEvent(N,M){const I={fill:rr(M,u.startEvent?.fill||M.fill),stroke:Bt(M,u.startEvent?.stroke||M.stroke),strokeWidth:ku(M,u.startEvent?.strokeWidth||M.strokeWidth)},$=f("event")(N,M,I);return A(N,M,18,18),$},endEvent(N,M){const I=f("event")(N,M,{strokeWidth:ku(M,u.endEvent?.strokeWidth||M.strokeWidth||4),fill:rr(M,u.endEvent?.fill||M.fill),stroke:Bt(M,u.endEvent?.stroke||M.stroke)});return A(N,M,18,18),I},gateway(N,M){const I={fillOpacity:Wp,strokeWidth:ku(M,u[M.type]?.strokeWidth||M.strokeWidth||4),fill:rr(M,u[M.type]?.fill||M.fill),stroke:Bt(M,u[M.type]?.stroke||M.stroke)};return w(N,M.width,M.height,I)},gatewayAnd(N,M){const I=f("gateway")(N,M);return y(N,n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:u[M.type]?.width||M.width,containerHeight:u[M.type]?.height||M.height,position:{mx:.47,my:.29}}),{strokeWidth:1,fill:Bt(M,u[M.type]?.iconFill||M.iconFill),stroke:Bt(M,u[M.type]?.iconFill||M.iconFill)}),I},gatewayXor(N,M){const I=f("gateway")(N,M);return y(N,n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:M.width,containerHeight:M.height,position:{mx:.32,my:.3}}),{strokeWidth:1,fill:Bt(M,u[M.type]?.iconFill||M.iconFill),stroke:Bt(M,u[M.type]?.iconFill||M.iconFill)}),I},gatewayInclusive(N,M){const I=f("gateway")(N,M);return m(N,M.width,M.height,M.height*.24,{strokeWidth:2.5,fill:Bt(M,l),stroke:Bt(M,u[M.type]?.iconFill||M.iconFill)}),I},activity(N,M,I){return I=I||{},"fillOpacity"in I||(I.fillOpacity=Wp),_(N,M.width,M.height,$p,I)},task(N,M){const I={fill:rr(M,l),stroke:Bt(M,c)},$=f("activity")(N,M,I);return b(N,M,"center-middle"),E(N,M),$},userTask(N,M){const I=f("task")(N,M),$=15,ee=12;return y(N,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:$,y:ee}}),{strokeWidth:.5,fill:rr(M,l),stroke:Bt(M,c)}),y(N,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:$,y:ee}}),{strokeWidth:.5,fill:rr(M,l),stroke:Bt(M,c)}),y(N,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:$,y:ee}}),{strokeWidth:.5,fill:Bt(M,c),stroke:Bt(M,c)}),I},scriptTask(N,M){const I=f("task")(N,M);return y(N,n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Bt(M,c)}),I},SubProcessMarker(N,M){Sr(_(N,14,14,0,{strokeWidth:1,fill:rr(M,l),stroke:Bt(M,c)}),M.width/2-7.5,M.height-20),C("sub-process",N,n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:M.width,containerHeight:M.height,position:{mx:(M.width/2-7.5)/M.width,my:(M.height-20)/M.height}}),{fill:rr(M,l),stroke:Bt(M,c)})},subprocess(N,M,I){I=wt({fill:rr(M,l),stroke:Bt(M,c)},I);const $=f("activity")(N,M,I);return b(N,M,"center-middle"),E(N,M,["SubProcessMarker"]),$},label(N,M){return x(N,M)},myline(N,M){const I=rr(M,i.lineStroke||l),$=Bt(M,i.lineStroke||c);return v(N,M.waypoints,{markerEnd:R(N,"sequenceflow-end",I,$),stroke:$})},default(N,M){const I={strokeWidth:ku(M,u[M.type]?.strokeWidth||M.strokeWidth||1),fill:rr(M,u[M.type]?.fill||M.fill),stroke:Bt(M,u[M.type]?.stroke||M.stroke)},$=_(N,M.width,M.height,M.radius||$p,I);return b(N,M,"center-middle"),E(N,M),A(N,M,M.iconX,M.iconY),$}};this.handlers=L,this._drawPath=y}(0,Pr.default)(Ri,Ti),Ri.$inject=["eventBus","styles","pathMap","canvas","textRenderer","myOptions"],Ri.prototype.canRender=function(){return!0},Ri.prototype.drawShape=function(e,t){const{type:n}=t;return(this.handlers[n]||this.handlers.default)(e,t)},Ri.prototype.drawConnection=function(e,t){const{type:n}=t,r=this.handlers[n];return r(e,t)},Ri.prototype.getShapePath=function(e){return Ta(e,"startEvent")||Ta(e,"endEvent")?X5(e):Ta(e,"userTask")||Ta(e,"scriptTask")||Ta(e,"subprocess")?K5(e,$p):Ta(e,"gatewayAnd")||Ta(e,"gatewayXor")||Ta(e,"gatewayInclusive")?Z5(e):Q5(e)};var ez=0,tz={width:150,height:50};function nz(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}function rz(e){return(0,P.isObject)(e)?(0,P.assign)({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}var Up=null;function az(){return Up||(Up=document.createElement("canvas").getContext("2d")),Up}function iz(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(u1(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}function u1(e){if(e!=null)return typeof e=="number"||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function oz(e,t){var n=az();if(!n)return{width:0,height:0};n.font=iz(t),"letterSpacing"in n&&(n.letterSpacing=u1(t.letterSpacing)||"0px");var r=e==="",a=r?"dummy":e.replace(/\s+$/,""),i=n.measureText(a);return{width:r?0:i.width,height:"fontBoundingBoxAscent"in i?i.fontBoundingBoxAscent+i.fontBoundingBoxDescent:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent}}function lz(e,t,n){for(var r=e.shift(),a=r,i;;){if(i=oz(a,n),i.width=a?i.width:0,a===" "||a===""||i.width<Math.round(t)||a.length<2)return sz(e,a,r,i);a=uz(a,i.width,t)}}function sz(e,t,n,r){if(t.length<n.length){var a=n.slice(t.length).trim();e.unshift(a)}return{width:r.width,height:r.height,text:t}}var d1="";function cz(e,t){var n=e.split(/(\s|-|\u00AD)/g),r,a=[],i=0;if(n.length>1)for(;r=n.shift();)if(r.length+i<t)a.push(r),i+=r.length;else{(r==="-"||r===d1)&&a.pop();break}var o=a[a.length-1];return o&&o===d1&&(a[a.length-1]="-"),a.join("")}function uz(e,t,n){var r=Math.max(e.length*(n/t),1),a=cz(e,r);return a||(a=e.slice(0,Math.max(Math.round(r-1),1))),a}function Tu(e){this._config=(0,P.assign)({},{size:tz,padding:ez,style:{},align:"center-top"},e||{})}Tu.prototype.createText=function(e,t){return this.layoutText(e,t).element},Tu.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},Tu.prototype.layoutText=function(e,t){for(var n=(0,P.assign)({},this._config.size,t.box),r=(0,P.assign)({},this._config.style,t.style),a=nz(t.align||this._config.align),i=rz(t.padding!==void 0?t.padding:this._config.padding),o=t.fitBox||!1,l=dz(r),c=e.split(/\u00AD?\r?\n/),u=[],d=n.width-i.left-i.right;c.length;)u.push(lz(c,d,r));a.vertical==="middle"&&(i.top=i.bottom=0);var f=(0,P.reduce)(u,function(v,m,_){return v+(l||m.height)},0)+i.top+i.bottom,h=(0,P.reduce)(u,function(v,m,_){return m.width>v?m.width:v},0),p=i.top;a.vertical==="middle"&&(p+=(n.height-f)/2),p-=(l||u[0].height)/4;var g=(0,V.create)("text");return(0,V.attr)(g,r),(0,P.forEach)(u,function(v){var m;switch(p+=l||v.height,a.horizontal){case"left":m=i.left;break;case"right":m=(o?h:d)-i.right-v.width;break;default:m=Math.max(((o?h:d)-v.width)/2+i.left,0)}var _=(0,V.create)("tspan");(0,V.attr)(_,{x:m,y:p}),_.textContent=v.text,(0,V.append)(g,_)}),{dimensions:{width:h,height:f},element:g}};function dz(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}var fz=12,hz=1.2,pz=30;function f1(e){const t=wt({fontFamily:"Arial, sans-serif",fontSize:fz,fontWeight:"normal",lineHeight:hz},e&&e.defaultStyle||{}),n=wt({},t,{fontSize:parseInt(t.fontSize,10)-1},e&&e.externalStyle||{}),r=new Tu({style:t});this.getExternalLabelBounds=function(a,i){const o=r.getDimensions(i,{box:{width:90,height:30,x:a.width/2+a.x,y:a.height/2+a.y},style:n});return{x:Math.round(a.x+a.width/2-o.width/2),y:Math.round(a.y),width:Math.ceil(o.width),height:Math.ceil(o.height)}},this.getTextAnnotationBounds=function(a,i){const o=r.getDimensions(i,{box:a,style:t,align:"left-top",padding:5});return{x:a.x,y:a.y,width:a.width,height:Math.max(pz,Math.round(o.height))}},this.createText=function(a,i){return r.createText(a,i||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return n}}f1.$inject=["config.textRenderer"];function gz(){this.pathMap={GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,n){let r,a;n.abspos?(r=n.abspos.x,a=n.abspos.y):(r=n.containerWidth*n.position.mx,a=n.containerHeight*n.position.my);let i={};typeof t=="object"?(i=t,i.d.indexOf("{mx},{my}")===-1&&(i.d="m {mx},{my}"+i.d),i.width&&(r-=i.width/2),i.height&&(a-=i.height/2)):i=this.pathMap[t];const o={};if(n.position){const l=n.containerHeight/i.height*n.yScaleFactor,c=n.containerWidth/i.width*n.xScaleFactor;for(let u=0;u<i.heightElements.length;u++)o["y"+u]=i.heightElements[u]*l;for(let u=0;u<i.widthElements.length;u++)o["x"+u]=i.widthElements[u]*c}return _z(i.d,{mx:r,my:a,e:o})}}var vz=/\{([^}]+)\}/g,mz=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;function yz(e,t,n){let r=n;return t.replace(mz,(a,i,o,l,c)=>{i=i||l,r&&(i in r&&(r=r[i]),typeof r=="function"&&c&&(r=r()))}),r=(r==null||r===n?e:r)+"",r}function _z(e,t){return String(e).replace(vz,(n,r)=>yz(n,r,t))}var h1={__init__:["myRenderer"],myRenderer:["type",Ri],textRenderer:["type",f1],pathMap:["type",gz]};function p1(e,t){return wt({id:e.id,type:e.type,businessObject:e},t)}function wz(e,t,n){const r=e.waypoint;return!r||r.length<2?[Mt(t),Mt(n)]:r.map(a=>({x:a.x,y:a.y}))}function Ra(e,t,n,r,a,i){this._eventBus=e,this._canvas=n,this._elementFactory=r,this._elementRegistry=a,this._translate=TC,this._textRenderer=i,this._modeling=t}Ra.$inject=["eventBus","modeling","canvas","elementFactory","elementRegistry","textRenderer"],Ra.prototype.add=function(e){let t;const{label:n}=e;if(n&&(n.id=e.id,n.name=e.name,delete e.label),e.type==="myline"){const r=this._getSource(e),a=this._getTarget(e);t=this._elementFactory.createConnection(p1(e,{source:r,target:a,waypoints:wz(e,r,a)})),this._canvas.addConnection(t)}else{const r=this._elementFactory._getDefaultSize(e.type);t=this._elementFactory.createShape(p1(e,{x:Math.round(e.x),y:Math.round(e.y),width:r.width,height:r.height,isFrame:!1})),this._canvas.addShape(t)}return n&&t&&this.addLabel(n,t),t},Ra.prototype.addLabel=function(e,t){const n=this._elementFactory.createLabel({id:e.id+"_label",labelTarget:t,type:"label",x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height),businessObject:e});return this._canvas.addShape(n,t.parent)},Ra.prototype.update=function(e,t){const n=this._elementRegistry.get(e);n.businessObject=wt(n.businessObject,t),t.type==="myline"?(this._canvas.removeConnection(n),this._canvas.addConnection(n,n.parent)):(this._canvas.removeShape(n),this._canvas.addShape(n,n.parent));const r=this._elementRegistry.get(e+"_label");if(r)r.businessObject=n.businessObject,this._canvas.removeShape(r),this._canvas.addShape(r,n.parent);else{const{name:a}=t;if(a&&["startEvent","myEvent","endEvent","gatewayAnd","gatewayXor","gatewayInclusive","myline"].includes(t.type)){const i={x:t.x+12,y:t.y+42,width:10,height:10,name:a,id:e},o=this._textRenderer.getExternalLabelBounds(i,t.name);this._modeling.resizeShape(i,o,{width:0,height:0}),n&&this.addLabel(i,n)}}},Ra.prototype._getSource=function(e){return this._getElement(e.from)},Ra.prototype._getTarget=function(e){return this._getElement(e.to)},Ra.prototype._getElement=function(e){return this._elementRegistry.get(e)};var g1={myImporter:["type",Ra]},v1=e=>{const t=[];return e.forEach(n=>{if(n.type!==void 0){const r=n.businessObject;if(n.type==="myline")n.source&&n.target&&(r.from=n.source.id,r.to=n.target.id,r.waypoint=n.waypoints.map(a=>({x:a.x,y:a.y})),t.push(r));else if(n.type!=="label")r.x=n.x,r.y=n.y,t.push(r);else{const a=t.find(i=>i.id===r.id);a&&(a.name=r.name||"",a.label={x:n.x,y:n.y,height:n.height,width:n.width})}}}),t},m1=(e,t)=>{const n=t.get("myImporter"),r=e.filter(i=>i.type!=="myline"),a=e.filter(i=>i.type==="myline");r.forEach(i=>{n.add(i)}),a.forEach(i=>{n.add(i)})},bz=(0,s.defineComponent)({name:"JWorkflowViewer",__name:"workflow-viewer",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let l,c=1;const u=()=>{c=1,l.get("canvas").zoom("fit-viewport")},d=()=>{const b=l.get("eventBus");b.on("element.dblclick",x=>{a("elementDblclick",x.element.businessObject)}),b.on("element.click",x=>{a("elementClick",x.element.businessObject)})},f=function(){return{palette:r.paletteOptions||o,lineStroke:r.lineStroke}},h=()=>{let b={__init__:["myOptions"],myOptions:["type",f]};l=new vs.default({canvas:{container:i.value},modules:[Cp,eC,c1,wC,SC,b,h1,g1]});const x=l.get("canvas"),E=l.get("elementFactory");u();const k=E.createRoot();x.setRootElement(k),d()};(0,s.onMounted)(()=>{h()});const p=b=>{const x=b==null?1:c+b;l.get("canvas").zoom(x),c=x},g=()=>(l.get("canvas").zoom(1),v1(l.get("elementRegistry").getAll())),v=b=>{l.clear(),u(),m1(b,l)},m=b=>{l.get("myImporter").update(b.id,b)};return t({reset:()=>{u()},zoom:b=>{p(b)},getData:()=>g(),setData:b=>{v(b)},updateElemet:b=>{m(b)}}),(b,x)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"containerRef",ref:i,class:"j-work-flow"},null,512))}}),Cz=bz;function Yp(e){return e&&e[e.length-1]}function y1(e){return e.y}function _1(e){return e.x}var Sz={left:_1,center:_1,right:function(e){return e.x+e.width},top:y1,middle:y1,bottom:function(e){return e.y+e.height}};function Vo(e,t){this._modeling=e,this._rules=t}Vo.$inject=["modeling","rules"],Vo.prototype._getOrientationDetails=function(e){var t=["top","bottom","middle"],n="x",r="width";return t.indexOf(e)!==-1&&(n="y",r="height"),{axis:n,dimension:r}},Vo.prototype._isType=function(e,t){return t.indexOf(e)!==-1},Vo.prototype._alignmentPosition=function(e,t){var n=this._getOrientationDetails(e),r=n.axis,a=n.dimension,i={},o={},l=!1,c,u,d;function f(h,p){return Math.round((h[r]+p[r]+p[a])/2)}if(this._isType(e,["left","top"]))i[e]=t[0][r];else if(this._isType(e,["right","bottom"]))d=Yp(t),i[e]=d[r]+d[a];else if(this._isType(e,["center","middle"])){if((0,P.forEach)(t,function(h){var p=h[r]+Math.round(h[a]/2);o[p]?o[p].elements.push(h):o[p]={elements:[h],center:p}}),c=(0,P.sortBy)(o,function(h){return h.elements.length>1&&(l=!0),h.elements.length}),l)return i[e]=Yp(c).center,i;u=t[0],t=(0,P.sortBy)(t,function(h){return h[r]+h[a]}),d=Yp(t),i[e]=f(u,d)}return i},Vo.prototype.trigger=function(e,t){var n=this._modeling,r,a=(0,P.filter)(e,function(c){return!(c.waypoints||c.host||c.labelTarget)});if(r=this._rules.allowed("elements.align",{elements:a}),(0,P.isArray)(r)&&(a=r),!(a.length<2||!r)){var i=Sz[t],o=(0,P.sortBy)(a,i),l=this._alignmentPosition(t,o);n.alignElements(o,l)}};var xz={__init__:["alignElements"],alignElements:["type",Vo]},Ru=Math.round,Ez=Math.max;function kz(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}function Tz(e){var t=[];return e.forEach(function(n,r){t.push([r===0?"M":"L",n.x,n.y])}),t}var w1=10;function Rz(e,t){var n,r;for(n=0;r=e[n];n++)if($l(r,t)<=w1)return{point:e[n],bendpoint:!0,index:n};return null}function Mz(e,t){var n=cC(kz(t,w1),Tz(e)),r=n[0],a=n[n.length-1],i;return r?r!==a?r.segment2!==a.segment2?(i=Ez(r.segment2,a.segment2)-1,{point:e[i],bendpoint:!0,index:i}):{point:{x:Ru(r.x+a.x)/2,y:Ru(r.y+a.y)/2},index:r.segment2}:{point:{x:Ru(r.x),y:Ru(r.y)},index:r.segment2}:null}function Bz(e,t){return Rz(e,t)||Mz(e,t)}function Dz(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Az(e,t,n){var r=[{n:e[0]-n[0],lambda:t[0]},{n:e[1]-n[1],lambda:t[1]}],a=r[0].n*t[0]+r[1].n*t[1],i=r[0].lambda*t[0]+r[1].lambda*t[1];return-a/i}function b1(e,t){var n=t[0],r=t[1],a={x:r.x-n.x,y:r.y-n.y},i=Az([n.x,n.y],[a.x,a.y],[e.x,e.y]);return{x:n.x+i*a.x,y:n.y+i*a.y}}function Pz(e,t){var n=b1(e,t);return Dz({x:n.x-e.x,y:n.y-e.y})}var C1="djs-bendpoint",S1="djs-segment-dragger";function Nz(e,t){var n=Mo(t),r=e._container.getBoundingClientRect(),a={x:r.left,y:r.top},i=e.viewbox();return{x:i.x+(n.x-a.x)/i.scale,y:i.y+(n.y-a.y)/i.scale}}function Gp(e,t,n){return Bz(t,Nz(e,n))}function qp(e,t){var n=(0,V.create)("g");(0,V.classes)(n).add(C1),(0,V.append)(e,n);var r=(0,V.create)("circle");(0,V.attr)(r,{cx:0,cy:0,r:4}),(0,V.classes)(r).add("djs-visual"),(0,V.append)(n,r);var a=(0,V.create)("circle");return(0,V.attr)(a,{cx:0,cy:0,r:10}),(0,V.classes)(a).add("djs-hit"),(0,V.append)(n,a),t&&(0,V.classes)(n).add(t),n}function Lz(e,t,n,r){var a=(0,V.create)("g");(0,V.append)(e,a);var i=18,o=6,l=11,c=Oz(t,n,r),u=o+l,d=(0,V.create)("rect");(0,V.attr)(d,{x:-i/2,y:-o/2,width:i,height:o}),(0,V.classes)(d).add("djs-visual"),(0,V.append)(a,d);var f=(0,V.create)("rect");return(0,V.attr)(f,{x:-c/2,y:-u/2,width:c,height:u}),(0,V.classes)(f).add("djs-hit"),(0,V.append)(a,f),wV(a,r==="v"?90:0,0,0),a}function x1(e,t,n){var r=(0,V.create)("g"),a=mp(t,n),i=va(t,n);return(0,V.append)(e,r),Lz(r,t,n,i),(0,V.classes)(r).add(S1),(0,V.classes)(r).add(i==="h"?"horizontal":"vertical"),Sr(r,a.x,a.y),r}function Jp(e){return Math.abs(Math.round(e*2/3))}function Iz(e,t){return b1(e,Vz(e,t))}function Oz(e,t,n){var r=t.x-e.x,a=t.y-e.y;return Jp(n==="h"?r:a)}function Vz(e,t){for(var n=t.waypoints,r=1/0,a,i=0;i<n.length-1;i++){var o=n[i],l=n[i+1],c=Pz(e,[o,l]);c<r&&(r=c,a=i)}return[n[a],n[a+1]]}function Xp(e){return CSS.escape(e)}function E1(e,t,n,r,a){function i(w,C,S){var b=w.index,x=w.point,E,k,T,R,D,A;return b<=0||w.bendpoint?!1:(E=C[b-1],k=C[b],T=mp(E,k),R=va(E,k),D=Math.abs(x.x-T.x),A=Math.abs(x.y-T.y),R&&D<=S&&A<=S)}function o(w,C){var S=w.waypoints,b,x,E,k;return C.index<=0||C.bendpoint||(b={start:S[C.index-1],end:S[C.index]},x=va(b.start,b.end),!x)?null:(x==="h"?E=b.end.x-b.start.x:E=b.end.y-b.start.y,k=Jp(E)/2,k)}function l(w,C){var S=C.waypoints,b=Gp(t,S,w),x;if(b)return x=o(C,b),i(b,S,x)?a.start(w,C,b.index):r.start(w,C,b.index,!b.bendpoint),!0}function c(w,C,S){te.event.bind(w,C,function(b){n.triggerMouseEvent(C,b,S),b.stopPropagation()})}function u(w,C){var S=t.getLayer("overlays"),b=(0,te.query)('.djs-bendpoints[data-element-id="'+Xp(w.id)+'"]',S);return!b&&C&&(b=(0,V.create)("g"),(0,V.attr)(b,{"data-element-id":w.id}),(0,V.classes)(b).add("djs-bendpoints"),(0,V.append)(S,b),c(b,"mousedown",w),c(b,"click",w),c(b,"dblclick",w)),b}function d(w,C){return(0,te.query)('.djs-segment-dragger[data-segment-idx="'+w+'"]',C)}function f(w,C){C.waypoints.forEach(function(S,b){var x=qp(w);(0,V.append)(w,x),Sr(x,S.x,S.y)}),qp(w,"floating")}function h(w,C){for(var S=C.waypoints,b,x,E,k=1;k<S.length;k++)b=S[k-1],x=S[k],va(b,x)&&(E=x1(w,b,x),(0,V.attr)(E,{"data-segment-idx":k}),c(E,"mousemove",C))}function p(w){(0,P.forEach)((0,te.queryAll)("."+C1,w),function(C){(0,V.remove)(C)})}function g(w){(0,P.forEach)((0,te.queryAll)("."+S1,w),function(C){(0,V.remove)(C)})}function v(w){var C=u(w);return C||(C=u(w,!0),f(C,w),h(C,w)),C}function m(w){var C=u(w);C&&(g(C),p(C),h(C,w),f(C,w))}function _(w,C){var S=(0,te.query)(".floating",w),b=C.point;S&&Sr(S,b.x,b.y)}function y(w,C,S){var b=d(C.index,w),x=S[C.index-1],E=S[C.index],k=C.point,T=mp(x,E),R=va(x,E),D,A;b&&(D=zz(b),A={x:k.x-T.x,y:k.y-T.y},R==="v"&&(A={x:A.y,y:A.x}),Sr(D,A.x,A.y))}e.on("connection.changed",function(w){m(w.element)}),e.on("connection.remove",function(w){var C=u(w.element);C&&(0,V.remove)(C)}),e.on("element.marker.update",function(w){var C=w.element,S;C.waypoints&&(S=v(C),w.add?(0,V.classes)(S).add(w.marker):(0,V.classes)(S).remove(w.marker))}),e.on("element.mousemove",function(w){var C=w.element,S=C.waypoints,b,x;if(S){if(b=u(C,!0),x=Gp(t,S,w.originalEvent),!x)return;_(b,x),x.bendpoint||y(b,x,S)}}),e.on("element.mousedown",function(w){if(pa(w)){var C=w.originalEvent,S=w.element;if(S.waypoints)return l(C,S)}}),e.on("selection.changed",function(w){var C=w.newSelection[0];C&&C.waypoints&&v(C)}),e.on("element.hover",function(w){var C=w.element;C.waypoints&&(v(C),n.registerEvent(w.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(w){n.unregisterEvent(w.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(w){var C=w.element,S=w.newId;if(C.waypoints){var b=u(C);b&&(0,V.attr)(b,{"data-element-id":S})}}),this.addHandles=v,this.updateHandles=m,this.getBendpointsContainer=u,this.getSegmentDragger=d}E1.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];function zz(e){return(0,te.query)(".djs-visual",e)}var k1=Math.round,Mi="reconnectStart",Bi="reconnectEnd",ts="updateWaypoints";function Kp(e,t,n,r,a,i){this._injector=e,this.start=function(o,l,c,u){var d=n.getGraphics(l),f=l.source,h=l.target,p=l.waypoints,g;!u&&c===0?g=Mi:!u&&c===p.length-1?g=Bi:g=ts;var v=g===ts?"connection.updateWaypoints":"connection.reconnect",m=a.allowed(v,{connection:l,source:f,target:h});m===!1&&(m=a.allowed(v,{connection:l,source:h,target:f})),m!==!1&&r.init(o,"bendpoint.move",{data:{connection:l,connectionGfx:d,context:{allowed:m,bendpointIndex:c,connection:l,source:f,target:h,insert:u,type:g}}})},t.on("bendpoint.move.hover",function(o){var l=o.context,c=l.connection,u=c.source,d=c.target,f=o.hover,h=l.type;l.hover=f;var p;if(f){var g=h===ts?"connection.updateWaypoints":"connection.reconnect";if(p=l.allowed=a.allowed(g,{connection:c,source:h===Mi?f:u,target:h===Bi?f:d}),p){l.source=h===Mi?f:u,l.target=h===Bi?f:d;return}p===!1&&(p=l.allowed=a.allowed(g,{connection:c,source:h===Bi?f:d,target:h===Mi?f:u})),p&&(l.source=h===Bi?f:d,l.target=h===Mi?f:u)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(o){var l=o.context,c=l.type;l.hover=null,l.source=null,l.target=null,c!==ts&&(l.allowed=!1)}),t.on("bendpoint.move.end",function(o){var l=o.context,c=l.allowed,u=l.bendpointIndex,d=l.connection,f=l.insert,h=d.waypoints.slice(),p=l.source,g=l.target,v=l.type,m=l.hints||{},_={x:k1(o.x),y:k1(o.y)};if(!c)return!1;v===ts?(f?h.splice(u,0,_):h[u]=_,m.bendpointMove={insert:f,bendpointIndex:u},h=this.cropWaypoints(d,h),i.updateWaypoints(d,WV(h),m)):(v===Mi?(m.docking="source",Mu(l)&&(m.docking="target",m.newWaypoints=h.reverse())):v===Bi&&(m.docking="target",Mu(l)&&(m.docking="source",m.newWaypoints=h.reverse())),i.reconnect(d,p,g,_,m))},this)}Kp.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Kp.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var r=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=r,t};function Mu(e){var t=e.hover,n=e.source,r=e.target,a=e.type;if(a===Mi)return t&&r&&t===r&&n!==r;if(a===Bi)return t&&n&&t===n&&n!==r}var Hz="reconnectStart",Fz="reconnectEnd",T1="updateWaypoints",ns="connect-ok",Bu="connect-not-ok",R1="connect-hover",M1="djs-updating",B1="djs-dragging",D1=1100;function A1(e,t,n,r){this._injector=t;var a=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(i){var o=i.context,l=o.bendpointIndex,c=o.connection,u=o.insert,d=c.waypoints,f=d.slice();o.waypoints=d,u&&f.splice(l,0,{x:i.x,y:i.y}),c.waypoints=f,(0,V.classes)(o.draggerGfx=qp(r.getLayer("overlays"))).add("djs-dragging"),r.addMarker(c,B1),r.addMarker(c,M1)}),n.on("bendpoint.move.hover",function(i){var o=i.context,l=o.allowed,c=o.hover,u=o.type;if(c){if(r.addMarker(c,R1),u===T1)return;l?(r.removeMarker(c,Bu),r.addMarker(c,ns)):l===!1&&(r.removeMarker(c,ns),r.addMarker(c,Bu))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],D1,function(i){var o=i.context,l=o.hover,c=o.target;l&&(r.removeMarker(l,R1),r.removeMarker(l,c?ns:Bu))}),n.on("bendpoint.move.move",function(i){var o=i.context,l=o.allowed,c=o.bendpointIndex,u=o.draggerGfx,d=o.hover,f=o.type,h=o.connection,p=h.source,g=h.target,v=h.waypoints.slice(),m={x:i.x,y:i.y},_=o.hints||{},y={};a&&(_.connectionStart&&(y.connectionStart=_.connectionStart),_.connectionEnd&&(y.connectionEnd=_.connectionEnd),f===Hz?Mu(o)?(y.connectionEnd=y.connectionEnd||m,y.source=g,y.target=d||p,v=v.reverse()):(y.connectionStart=y.connectionStart||m,y.source=d||p,y.target=g):f===Fz?Mu(o)?(y.connectionStart=y.connectionStart||m,y.source=d||g,y.target=p,v=v.reverse()):(y.connectionEnd=y.connectionEnd||m,y.source=p,y.target=d||g):(y.noCropping=!0,y.noLayout=!0,v[c]=m),f===T1&&(v=e.cropWaypoints(h,v)),y.waypoints=v,a.drawPreview(o,l,y)),Sr(u,i.x,i.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],D1,function(i){var o=i.context,l=o.connection,c=o.draggerGfx,u=o.hover,d=o.target;l.waypoints=o.waypoints,(0,V.remove)(c),r.removeMarker(l,M1),r.removeMarker(l,B1),u&&(r.removeMarker(u,ns),r.removeMarker(u,d?ns:Bu)),a&&a.cleanUp(o)})}A1.$inject=["bendpointMove","injector","eventBus","canvas"];var P1="connect-hover",N1="djs-updating";function L1(e,t,n){return Zp(e,t,e[t]+n)}function Zp(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function jz(e,t,n,r){var a=Math.max(t[r],n[r]),i=Math.min(t[r],n[r]),o=20;return Zp(t,r,Math.min(Math.max(i+o,e[r]),a-o))}function I1(e){return e==="x"?"y":"x"}function O1(e,t,n){var r,a;return e.original?e.original:(r=Mt(t),a=I1(n),Zp(e,a,r[a]))}function V1(e,t,n,r,a,i){var o=e.get("connectionDocking",!1);this.start=function(f,h,p){var g,v=n.getGraphics(h),m=p-1,_=p,y=h.waypoints,w=y[m],C=y[_],S=Gp(n,y,f),b=va(w,C),x,E;b&&(x=b==="v"?"x":"y",m===0&&(w=O1(w,h.source,x)),_===y.length-1&&(C=O1(C,h.target,x)),S?E=S.point:E={x:(w.x+C.x)/2,y:(w.y+C.y)/2},g={connection:h,segmentStartIndex:m,segmentEndIndex:_,segmentStart:w,segmentEnd:C,axis:x,dragPosition:E},r.init(f,E,"connectionSegment.move",{cursor:x==="x"?"resize-ew":"resize-ns",data:{connection:h,connectionGfx:v,context:g}}))};function l(f,h){if(!o)return h;var p=f.waypoints,g;return f.waypoints=h,g=o.getCroppedWaypoints(f),f.waypoints=p,g}function c(f){a.update("connection",f.connection,f.connectionGfx)}function u(f,h,p){var g=f.newWaypoints,v=g[f.segmentStartIndex+h],m=g[f.segmentEndIndex+h],_=jz(p,v,m,I1(f.axis));Sr(f.draggerGfx,_.x,_.y)}function d(f,h){var p=0;return{waypoints:f.filter(function(g,v){return vp(f[v-1],f[v+1],g)?(p=v<=h?p-1:p,!1):!0}),segmentOffset:p}}t.on("connectionSegment.move.start",function(f){var h=f.context,p=f.connection,g=n.getLayer("overlays");h.originalWaypoints=p.waypoints.slice(),h.draggerGfx=x1(g,h.segmentStart,h.segmentEnd),(0,V.classes)(h.draggerGfx).add("djs-dragging"),n.addMarker(p,N1)}),t.on("connectionSegment.move.move",function(f){var h=f.context,p=h.connection,g=h.segmentStartIndex,v=h.segmentEndIndex,m=h.segmentStart,_=h.segmentEnd,y=h.axis,w=h.originalWaypoints.slice(),C=L1(m,y,f["d"+y]),S=L1(_,y,f["d"+y]),b=w.length,x=0;w[g]=C,w[v]=S;var E,k;g<2&&(E=wa(p.source,C),g===1?E==="intersect"&&(w.shift(),w[0]=C,x--):E!=="intersect"&&(w.unshift(m),x++)),v>b-3&&(k=wa(p.target,S),v===b-2?k==="intersect"&&(w.pop(),w[w.length-1]=S):k!=="intersect"&&w.push(_)),h.newWaypoints=p.waypoints=l(p,w),u(h,x,f),h.newSegmentStartIndex=g+x,c(f)}),t.on("connectionSegment.move.hover",function(f){f.context.hover=f.hover,n.addMarker(f.hover,P1)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(f){var h=f.context.hover;h&&n.removeMarker(h,P1)}),t.on("connectionSegment.move.cleanup",function(f){var h=f.context,p=h.connection;h.draggerGfx&&(0,V.remove)(h.draggerGfx),n.removeMarker(p,N1)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(f){var h=f.context,p=h.connection;p.waypoints=h.originalWaypoints,c(f)}),t.on("connectionSegment.move.end",function(f){var h=f.context,p=h.connection,g=h.newWaypoints,v=h.newSegmentStartIndex;g=g.map(function(S){return{original:S.original,x:Math.round(S.x),y:Math.round(S.y)}});var m=d(g,v),_=m.waypoints,y=l(p,_),w=m.segmentOffset,C={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:v+w}};i.updateWaypoints(p,y,C)})}V1.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var $z=Math.abs,z1=Math.round;function Wz(e,t,n){n=n===void 0?10:n;var r,a;for(r=0;r<t.length;r++)if(a=t[r],$z(a-e)<=n)return a}function Uz(e){return{x:e.x,y:e.y}}function Yz(e){return{x:e.x+e.width,y:e.y+e.height}}function zo(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:z1(e.x+e.width/2),y:z1(e.y+e.height/2)}}function Du(e,t){var n=e.snapped;return n?typeof t=="string"?n[t]:n.x&&n.y:!1}function Zr(e,t,n){if(typeof t!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var r,a=e[t],i=e.snapped=e.snapped||{};return n===!1?i[t]=!1:(i[t]=!0,r=n-a,e[t]+=r,e["d"+t]+=r),a}function H1(e){return e.children||[]}var Gz=Math.abs,F1=Math.round,Qp=10;function j1(e){function t(i,o){if((0,P.isArray)(i)){for(var l=i.length;l--;)if(Gz(i[l]-o)<=Qp)return i[l]}else{i=+i;var c=o%i;if(c<Qp)return o-c;if(c>i-Qp)return o-c+i}return o}function n(i,o){if(i.waypoints)return Iz(o,i);if(i.width)return{x:F1(i.width/2+i.x),y:F1(i.height/2+i.y)}}function r(i){var o=i.context,l=o.snapPoints,c=o.connection,u=c.waypoints,d=o.segmentStart,f=o.segmentStartIndex,h=o.segmentEnd,p=o.segmentEndIndex,g=o.axis;if(l)return l;var v=[u[f-1],d,h,u[p+1]];return f<2&&v.unshift(n(c.source,i)),p>u.length-3&&v.unshift(n(c.target,i)),o.snapPoints=l={horizontal:[],vertical:[]},(0,P.forEach)(v,function(m){m&&(m=m.original||m,g==="y"&&l.horizontal.push(m.y),g==="x"&&l.vertical.push(m.x))}),l}e.on("connectionSegment.move.move",1500,function(i){var o=r(i),l=i.x,c=i.y,u,d;if(o){u=t(o.vertical,l),d=t(o.horizontal,c);var f=l-u,h=c-d;(0,P.assign)(i,{dx:i.dx-f,dy:i.dy-h,x:u,y:d}),(f||o.vertical.indexOf(l)!==-1)&&Zr(i,"x",u),(h||o.horizontal.indexOf(c)!==-1)&&Zr(i,"y",d)}});function a(i){var o=i.snapPoints,l=i.connection.waypoints,c=i.bendpointIndex;if(o)return o;var u=[l[c-1],l[c+1]];return i.snapPoints=o={horizontal:[],vertical:[]},(0,P.forEach)(u,function(d){d&&(d=d.original||d,o.horizontal.push(d.y),o.vertical.push(d.x))}),o}e.on(["connect.hover","connect.move","connect.end"],1500,function(i){var o=i.context.hover,l=o&&n(o,i);!yn(o)||!l||!l.x||!l.y||(Zr(i,"x",l.x),Zr(i,"y",l.y))}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var o=i.context,l=a(o),c=o.hover,u=c&&n(c,i),d=i.x,f=i.y,h,p;if(l){h=t(u?l.vertical.concat([u.x]):l.vertical,d),p=t(u?l.horizontal.concat([u.y]):l.horizontal,f);var g=d-h,v=f-p;(0,P.assign)(i,{dx:i.dx-g,dy:i.dy-v,x:i.x-g,y:i.y-v}),(g||l.vertical.indexOf(d)!==-1)&&Zr(i,"x",h),(v||l.horizontal.indexOf(f)!==-1)&&Zr(i,"y",p)}})}j1.$inject=["eventBus"];var qz={__depends__:[Ci,No],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",E1],bendpointMove:["type",Kp],bendpointMovePreview:["type",A1],connectionSegmentMove:["type",V1],bendpointSnapping:["type",j1]},Jz="djs-dragger";function Qr(e,t,n,r){this._canvas=t,this._graphicsFactory=n,this._elementFactory=r,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Qr.$inject=["injector","canvas","graphicsFactory","elementFactory"],Qr.prototype.drawPreview=function(e,t,n){n=n||{};var r=e.connectionPreviewGfx,a=e.getConnection,i=n.source,o=n.target,l=n.waypoints,c=n.connectionStart,u=n.connectionEnd,d=n.noLayout,f=n.noCropping,h=n.noNoop,p,g=this;if(r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),(0,V.clear)(r),a||(a=e.getConnection=Xz(function(v,m,_){return g.getConnection(v,m,_)})),t&&(p=a(t,i,o)),!p){!h&&this.drawNoopPreview(r,n);return}p.waypoints=l||[],this._layouter&&!d&&(p.waypoints=this._layouter.layoutConnection(p,{source:i,target:o,connectionStart:c,connectionEnd:u,waypoints:n.waypoints||p.waypoints})),(!p.waypoints||!p.waypoints.length)&&(p.waypoints=[i?Mt(i):c,o?Mt(o):u]),this._connectionDocking&&(i||o)&&!f&&(p.waypoints=this._connectionDocking.getCroppedWaypoints(p,i,o)),this._graphicsFactory.drawConnection(r,p,{stroke:"var(--element-dragger-color)"})},Qr.prototype.drawNoopPreview=function(e,t){var n=t.source,r=t.target,a=t.connectionStart||Mt(n),i=t.connectionEnd||Mt(r),o=this.cropWaypoints(a,i,n,r);(0,V.append)(e,this.createNoopConnection(o[0],o[1]))},Qr.prototype.cropWaypoints=function(e,t,n,r){var a=this._graphicsFactory,i=n&&a.getShapePath(n),o=r&&a.getShapePath(r),l=a.getConnectionPath({waypoints:[e,t]});return e=n&&wp(i,l,!0)||e,t=r&&wp(o,l,!1)||t,[e,t]},Qr.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&(0,V.remove)(e.connectionPreviewGfx)},Qr.prototype.getConnection=function(e){var t=Kz(e);return this._elementFactory.createConnection(t)},Qr.prototype.createConnectionPreviewGfx=function(){var e=(0,V.create)("g");return(0,V.attr)(e,{pointerEvents:"none"}),(0,V.classes)(e).add(Jz),(0,V.append)(this._canvas.getActiveLayer(),e),e},Qr.prototype.createNoopConnection=function(e,t){return cp([e,t],{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"})};function Xz(e){var t={};return function(n){var r=JSON.stringify(n),a=t[r];return a||(a=t[r]=e.apply(null,arguments)),a}}function Kz(e){return(0,P.isObject)(e)?e:{}}var Zz={__init__:["connectionPreview"],connectionPreview:["type",Qr]},Qz=new lu("ov"),eH=500;function Yt(e,t,n,r){this._eventBus=t,this._canvas=n,this._elementRegistry=r,this._ids=Qz,this._overlayDefaults=(0,P.assign)({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=tH(n.getContainer()),this._init()}Yt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],Yt.prototype.get=function(e){if((0,P.isString)(e)&&(e={id:e}),(0,P.isString)(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?(0,P.filter)(t.overlays,(0,P.matchPattern)({type:e.type})):t.overlays.slice():[]}else return e.type?(0,P.filter)(this._overlays,(0,P.matchPattern)({type:e.type})):e.id?this._overlays[e.id]:null},Yt.prototype.add=function(e,t,n){if((0,P.isObject)(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var r=this._ids.next();return n=(0,P.assign)({},this._overlayDefaults,n,{id:r,type:t,element:e,html:n.html}),this._addOverlay(n),r},Yt.prototype.remove=function(e){var t=this.get(e)||[];(0,P.isArray)(t)||(t=[t]);var n=this;(0,P.forEach)(t,function(r){var a=n._getOverlayContainer(r.element,!0);if(r&&((0,te.remove)(r.html),(0,te.remove)(r.htmlContainer),delete r.htmlContainer,delete r.element,delete n._overlays[r.id]),a){var i=a.overlays.indexOf(r);i!==-1&&a.overlays.splice(i,1)}})},Yt.prototype.isShown=function(){return this._overlayRoot.style.display!=="none"},Yt.prototype.show=function(){Au(this._overlayRoot)},Yt.prototype.hide=function(){Au(this._overlayRoot,!1)},Yt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],(0,te.clear)(this._overlayRoot)},Yt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,r=t.x,a=t.y;if(t.waypoints){var i=Cr(t);r=i.x,a=i.y}$1(n,r,a),(0,te.attr)(e.html,"data-container-id",t.id)},Yt.prototype._updateOverlay=function(e){var t=e.position,n=e.htmlContainer,r=e.element,a=t.left,i=t.top;if(t.right!==void 0){var o;r.waypoints?o=Cr(r).width:o=r.width,a=t.right*-1+o}if(t.bottom!==void 0){var l;r.waypoints?l=Cr(r).height:l=r.height,i=t.bottom*-1+l}$1(n,a||0,i||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Yt.prototype._createOverlayContainer=function(e){var t=(0,te.domify)('<div class="djs-overlays" />');(0,te.assignStyle)(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Yt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";W1(this._overlayRoot,n)},Yt.prototype._getOverlayContainer=function(e,t){var n=(0,P.find)(this._overlayContainers,function(r){return r.element===e});return!n&&!t?this._createOverlayContainer(e):n},Yt.prototype._addOverlay=function(e){var t=e.id,n=e.element,r=e.html,a,i;r.get&&r.constructor.prototype.jquery&&(r=r.get(0)),(0,P.isString)(r)&&(r=(0,te.domify)(r)),i=this._getOverlayContainer(n),a=(0,te.domify)('<div class="djs-overlay" data-overlay-id="'+t+'">'),(0,te.assignStyle)(a,{position:"absolute"}),a.appendChild(r),e.type&&(0,te.classes)(a).add("djs-overlay-"+e.type);var o=this._canvas.findRoot(n),l=this._canvas.getRootElement();Au(a,o===l),e.htmlContainer=a,i.overlays.push(e),i.html.appendChild(a),this._overlays[t]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},Yt.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=this._canvas.findRoot(e.element),a=n&&n.minZoom,i=n&&n.maxZoom,o=e.htmlContainer,l=this._canvas.getRootElement(),c=!0;(r!==l||n&&((0,P.isDefined)(a)&&a>t.scale||(0,P.isDefined)(i)&&i<t.scale))&&(c=!1),Au(o,c),this._updateOverlayScale(e,t)},Yt.prototype._updateOverlayScale=function(e,t){var n=e.scale,r,a,i=e.htmlContainer,o,l="";n!==!0&&(n===!1?(r=1,a=1):(r=n.min,a=n.max),(0,P.isDefined)(r)&&t.scale<r&&(o=(1/t.scale||1)*r),(0,P.isDefined)(a)&&t.scale>a&&(o=(1/t.scale||1)*a)),(0,P.isDefined)(o)&&(l="scale("+o+","+o+")"),W1(i,l)},Yt.prototype._updateOverlaysVisibilty=function(e){var t=this;(0,P.forEach)(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Yt.prototype._init=function(){var e=this._eventBus,t=this;function n(r){t._updateRoot(r),t._updateOverlaysVisibilty(r),t.show()}e.on("canvas.viewbox.changing",function(r){t.hide()}),e.on("canvas.viewbox.changed",function(r){n(r.viewbox)}),e.on(["shape.remove","connection.remove"],function(r){var a=r.element;(0,P.forEach)(t.get({element:a}),function(l){t.remove(l.id)});var i=t._getOverlayContainer(a);if(i){(0,te.remove)(i.html);var o=t._overlayContainers.indexOf(i);o!==-1&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",eH,function(r){var a=r.element,i=t._getOverlayContainer(a,!0);i&&((0,P.forEach)(i.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(r){var a=t._getOverlayContainer(r.element,!0);a&&(0,te.classes)(a.html)[r.add?"add":"remove"](r.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};function tH(e){var t=(0,te.domify)('<div class="djs-overlay-container" />');return(0,te.assignStyle)(t,{position:"absolute",width:0,height:0}),e.insertBefore(t,e.firstChild),t}function $1(e,t,n){(0,te.assignStyle)(e,{left:t+"px",top:n+"px"})}function Au(e,t){e.style.display=t===!1?"none":""}function W1(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}var nH={__init__:["overlays"],overlays:["type",Yt]},rH=new lu;function Ho(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(t=>{this.cancel(t)})})}Ho.$inject=["eventBus"],Ho.prototype.schedule=function(e,t=rH.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},Ho.prototype._schedule=function(e,t){const n=aH();return{executionId:setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(r){n.reject(r)}}catch(r){console.error("Scheduler#_schedule execution failed",r)}}),promise:n.promise}},Ho.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},Ho.prototype._cancel=function(e){clearTimeout(e.executionId)};function aH(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var iH={scheduler:["type",Ho]},oH="djs-element-hidden",Pu=".entry",lH=1e3,U1=8,sH=300;function Lt(e,t,n,r){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=r,this._current=null,this._init()}Lt.$inject=["canvas","elementRegistry","eventBus","scheduler"],Lt.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,r=n.length?n.length===1?n[0]:n:null;r?e.open(r,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,r=e._current;if(r){var a=r.target,i=(0,P.isArray)(a)?a:[a];if(i.filter(function(l){return n.includes(l)}).length){e.close();var o=i.filter(function(l){return e._elementRegistry.get(l.id)});o.length&&e._updateAndOpen(o.length>1?o:o[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,r=e._current;((0,P.isArray)(r.target)?r.target:[r.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},Lt.prototype._createContainer=function(){var e=(0,te.domify)('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},Lt.prototype.registerProvider=function(e,t){t||(t=e,e=lH),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},Lt.prototype.getEntries=function(e){var t=this._getProviders(),n=(0,P.isArray)(e)?"getMultiElementContextPadEntries":"getContextPadEntries",r={};return(0,P.forEach)(t,function(a){if((0,P.isFunction)(a[n])){var i=a[n](e);(0,P.isFunction)(i)?r=i(r):(0,P.forEach)(i,function(o,l){r[l]=o})}}),r},Lt.prototype.trigger=function(e,t,n){var r=this,a,i,o=t.delegateTarget||t.target;if(!o)return t.preventDefault();if(a=(0,te.attr)(o,"data-action"),i=t.originalEvent||t,e==="mouseover"){this._timeout=setTimeout(function(){r._mouseout=r.triggerEntry(a,"hover",i,n)},sH);return}else if(e==="mouseout"){clearTimeout(this._timeout),this._mouseout&&(this._mouseout(),this._mouseout=null);return}return this.triggerEntry(a,e,i,n)},Lt.prototype.triggerEntry=function(e,t,n,r){if(this.isShown()){var a=this._current.target,i=this._current.entries[e];if(i){var o=i.action;if(this._eventBus.fire("contextPad.trigger",{entry:i,event:n})!==!1){if((0,P.isFunction)(o)){if(t==="click")return o(n,a,r)}else if(o[t])return o[t](n,a,r);n.preventDefault()}}}},Lt.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},Lt.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Lt.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this._createHtml(e),r;(0,P.forEach)(t,function(a,i){var o=a.group||"default",l=(0,te.domify)(a.html||'<div class="entry" draggable="true"></div>'),c;(0,te.attr)(l,"data-action",i),c=(0,te.query)("[data-group="+Xp(o)+"]",n),c||(c=(0,te.domify)('<div class="group"></div>'),(0,te.attr)(c,"data-group",o),n.appendChild(c)),c.appendChild(l),a.className&&cH(l,a.className),a.title&&(0,te.attr)(l,"title",a.title),a.imageUrl&&(r=(0,te.domify)("<img>"),(0,te.attr)(r,"src",a.imageUrl),r.style.width="100%",r.style.height="100%",l.appendChild(r))}),(0,te.classes)(n).add("open"),this._current={entries:t,html:n,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},Lt.prototype._createHtml=function(e){var t=this,n=(0,te.domify)('<div class="djs-context-pad"></div>');return te.delegate.bind(n,Pu,"click",function(r){t.trigger("click",r)}),te.delegate.bind(n,Pu,"dragstart",function(r){t.trigger("dragstart",r)}),te.delegate.bind(n,Pu,"mouseover",function(r){t.trigger("mouseover",r)}),te.delegate.bind(n,Pu,"mouseout",function(r){t.trigger("mouseout",r)}),te.event.bind(n,"mousedown",function(r){r.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},Lt.prototype.getPad=function(e){console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888"));let t;return this.isOpen()&&dH(this._current.target,e)?t=this._current.html:t=this._createHtml(e),{html:t}},Lt.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Lt.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return(0,P.isArray)(e)!==(0,P.isArray)(n)?!1:(0,P.isArray)(e)?e.length===n.length&&(0,P.every)(e,function(r){return n.includes(r)}):n===e},Lt.prototype.isShown=function(){return this.isOpen()&&(0,te.classes)(this._current.html).has("open")},Lt.prototype.show=function(){this.isOpen()&&((0,te.classes)(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},Lt.prototype.hide=function(){this.isOpen()&&((0,te.classes)(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},Lt.prototype._getPosition=function(e){if(!(0,P.isArray)(e)&&yn(e)){var t=this._canvas.viewbox(),n=uH(e),r=n.x*t.scale-t.x*t.scale,a=n.y*t.scale-t.y*t.scale;return{left:r+U1*this._canvas.zoom(),top:a}}var i=this._canvas.getContainer().getBoundingClientRect(),o=this._getTargetBounds(e);return{left:o.right-i.left+U1*this._canvas.zoom(),top:o.top-i.top}},Lt.prototype._updatePosition=function(){const e=()=>{if(this.isOpen()){var t=this._current.html,n=this._getPosition(this._current.target);"x"in n&&"y"in n?(t.style.left=n.x+"px",t.style.top=n.y+"px"):["top","right","bottom","left"].forEach(function(r){r in n&&(t.style[r]=n[r]+"px")})}};this._scheduler.schedule(e,"ContextPad#_updatePosition")},Lt.prototype._updateVisibility=function(){const e=()=>{if(this.isOpen()){var t=this,n=this._current.target;((0,P.isArray)(n)?n:[n]).some(function(r){return t._canvas.hasMarker(r,oH)})?t.hide():t.show()}};this._scheduler.schedule(e,"ContextPad#_updateVisibility")},Lt.prototype._getTargetBounds=function(e){var t=this;return((0,P.isArray)(e)?e:[e]).map(function(n){return t._canvas.getGraphics(n)}).reduce(function(n,r){const a=r.getBoundingClientRect();return n.top=Math.min(n.top,a.top),n.right=Math.max(n.right,a.right),n.bottom=Math.max(n.bottom,a.bottom),n.left=Math.min(n.left,a.left),n.x=n.left,n.y=n.top,n.width=n.right-n.left,n.height=n.bottom-n.top,n},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};function cH(e,t){var n=(0,te.classes)(e);t=(0,P.isArray)(t)?t:t.split(/\s+/g),t.forEach(function(r){n.add(r)})}function uH(e){return e.waypoints[e.waypoints.length-1]}function dH(e,t){return e=(0,P.isArray)(e)?e:[e],t=(0,P.isArray)(t)?t:[t],e.length===t.length&&(0,P.every)(e,function(n){return t.includes(n)})}var fH={__depends__:[up,iH,nH],contextPad:["type",Lt]},hH=250;function Di(e){this._eventBus=e,this._tools=[],this._active=null}Di.$inject=["eventBus"],Di.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},Di.prototype.isActive=function(e){return e&&this._active===e},Di.prototype.length=function(e){return this._tools.length},Di.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Di.prototype.bindEvents=function(e,t){var n=this._eventBus,r=[];n.on(t.tool+".init",function(a){if(!a.context.reactivate&&this.isActive(e)){this.setActive(null);return}this.setActive(e)},this),(0,P.forEach)(t,function(a){r.push(a+".ended"),r.push(a+".canceled")}),n.on(r,hH,function(a){this._active&&(pH(a)||this.setActive(null))},this)};function pH(e){var t=e.originalEvent&&e.originalEvent.target;return t&&(0,te.closest)(t,'.group[data-group="tools"]')}var eg={__depends__:[Ci],__init__:["toolManager"],toolManager:["type",Di]};function tg(e){var t=this;this._lastMoveEvent=null;function n(r){t._lastMoveEvent=r}e.on("canvas.init",function(r){(t._svg=r.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}tg.$inject=["eventBus"],tg.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||gH(0,0)};function gH(e,t){var n=document.createEvent("MouseEvent"),r=e,a=t,i=e,o=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,r,a,i,o,!1,!1,!1,!1,0,null),n}var ng={__init__:["mouse"],mouse:["type",tg]},rg=1500,Y1="grab";function Fo(e,t,n,r,a,i){this._dragging=n,this._mouse=i;var o=this,l=r.get("keyboard",!1);a.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",rg,function(c){if(Rb(c))return o.activateMove(c.originalEvent,!0),!1}),l&&l.addListener(rg,function(c){if(!(!G1(c.keyEvent)||o.isActive())){var u=o._mouse.getLastMoveEvent();o.activateMove(u,!!u)}},"keyboard.keydown"),l&&l.addListener(rg,function(c){!G1(c.keyEvent)||!o.isActive()||o.toggle()},"keyboard.keyup"),e.on("hand.end",function(c){var u=c.originalEvent.target;if(!c.hover&&!(u instanceof SVGElement))return!1;e.once("hand.ended",function(){o.activateMove(c.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(c){var u=t.viewbox().scale;t.scroll({dx:c.dx*u,dy:c.dy*u})}),e.on("hand.move.end",function(c){var u=c.context.reactivate;return!Rb(c)&&u&&e.once("hand.move.ended",function(d){o.activateHand(d.originalEvent,!0,!0)}),!1})}Fo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Fo.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Y1,data:{context:n||{}}})},Fo.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Y1,data:{context:{reactivate:n}}})},Fo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},Fo.prototype.isActive=function(){var e=this._dragging.context();return e?/^(hand|hand\.move)$/.test(e.prefix):!1};function G1(e){return Hb("Space",e)}var vH={__depends__:[eg,ng],__init__:["handTool"],handTool:["type",Fo]},q1="crosshair",J1="selected",mH="djs-dragging-active-lasso";function Ma(e,t,n,r,a,i,o){this._selection=a,this._dragging=n,this._mouse=o;var l=this,c={create:function(f){var h=t.getActiveLayer(),p=f.frame=(0,V.create)("rect");(0,V.attr)(p,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),(0,V.append)(h,p),u(!0),this.update(f)},update:function(f){var h=f.frame,p=f.bbox;h&&p&&(0,V.attr)(h,{x:p.x,y:p.y,width:p.width,height:p.height});var g=f.marked,v=f.lastMarked;if(g&&v){for(const m of v)g.has(m)||t.removeMarker(m,J1);for(const m of g)v.has(m)||t.addMarker(m,J1)}},remove:function(f){this.update(f),f.frame&&(0,V.remove)(f.frame),u(!1)}};function u(f){(0,V.classes)(t.getContainer()).toggle(mH,f)}function d(f){var h=r.getAll();return new Set((0,P.values)(Ub(h,f)))}i.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(f){var h=f.originalEvent.target;!f.hover&&!(h instanceof SVGElement)||e.once("lasso.selection.ended",function(){l.activateLasso(f.originalEvent,!0)})}),e.on("lasso.end",0,function(f){var h=f.context;l._select(Array.from(h.marked))}),e.on("lasso.start",function(f){var h=f.context;h.bbox=X1(f),h.add=op(f),h.lastMarked=new Set(a.get()),h.add?h.marked=h.lastMarked:h.marked=new Set,h.initialMarked=h.marked,c.create(h)}),e.on("lasso.move",function(f){var h=f.context,p=d(h.bbox=X1(f)),g=h.initialMarked.union(p);h.lastMarked=h.marked,h.marked=g,c.update(h)}),e.on("lasso.cleanup",function(f){var h=f.context;h.lastMarked=h.marked,h.marked=new Set(a.get()),c.remove(f.context)}),e.on("element.mousedown",1500,function(f){if(op(f))return l.activateLasso(f.originalEvent),!0})}Ma.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],Ma.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:q1,data:{context:{}},keepSelection:!0})},Ma.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:q1,data:{context:{}},keepSelection:!0})},Ma.prototype._select=function(e){this._selection.select(e)},Ma.prototype.select=function(e,t,n=[]){var r=(0,P.values)(Ub(e,t));this._select([...n,...r])},Ma.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Ma.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};function X1(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y},r;return t.x<=n.x&&t.y<n.y||t.x<n.x&&t.y<=n.y?r={x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.x&&t.y<=n.y?r={x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x<n.x&&t.y>=n.y?r={x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?r={x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:r={x:n.x,y:n.y,width:0,height:0},r}var yH={__depends__:[eg,ng],__init__:["lassoTool"],lassoTool:["type",Ma]},K1="connect-ok",Z1="connect-not-ok";function jo(e,t,n,r,a,i,o){var l=this;this._dragging=t,this._rules=i,this._mouse=o,a.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(c){var u=c.context,d=c.hover,f=u.canStartConnect=l.canStartConnect(d);f!==null&&(u.startTarget=d,r.addMarker(d,f?K1:Z1))}),e.on(["global-connect.out","global-connect.cleanup"],function(c){var u=c.context.startTarget,d=c.context.canStartConnect;u&&r.removeMarker(u,d?K1:Z1)}),e.on(["global-connect.ended"],function(c){var u=c.context.startTarget,d={x:c.x,y:c.y};if(l.canStartConnect(u))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,d)}),!1})}jo.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],jo.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},jo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},jo.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},jo.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};var _H={__depends__:[Cp,No,Ci,eg,ng],globalConnect:["type",jo]},wH=500,bH=1e3;function Ai(e,t){this._eventBus=e,this.offset=5;var n=t.cls("djs-outline",["no-fill"]),r=this;function a(i){var o=(0,V.create)("rect");return(0,V.attr)(o,(0,P.assign)({x:0,y:0,rx:4,width:100,height:100},n)),o}e.on(["shape.added","shape.changed"],wH,function(i){var o=i.element,l=i.gfx,c=(0,te.query)(".djs-outline",l);c||(c=r.getOutline(o)||a(l),(0,V.append)(l,c)),r.updateShapeOutline(c,o)}),e.on(["connection.added","connection.changed"],function(i){var o=i.element,l=i.gfx,c=(0,te.query)(".djs-outline",l);c||(c=a(l),(0,V.append)(l,c)),r.updateConnectionOutline(c,o)})}Ai.prototype.updateShapeOutline=function(e,t){var n=!1,r=this._getProviders();r.length&&(0,P.forEach)(r,function(a){n=n||a.updateOutline(t,e)}),n||(0,V.attr)(e,{x:-this.offset,y:-this.offset,width:t.width+this.offset*2,height:t.height+this.offset*2})},Ai.prototype.updateConnectionOutline=function(e,t){var n=Cr(t);(0,V.attr)(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+this.offset*2,height:n.height+this.offset*2})},Ai.prototype.registerProvider=function(e,t){t||(t=e,e=bH),this._eventBus.on("outline.getProviders",e,function(n){n.providers.push(t)})},Ai.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"outline.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},Ai.prototype.getOutline=function(e){var t;return(0,P.forEach)(this._getProviders(),function(n){(0,P.isFunction)(n.getOutline)&&(t=t||n.getOutline(e))}),t},Ai.$inject=["eventBus","styles","elementRegistry"];var Nu=6;function ag(e,t,n){this._canvas=t;var r=this;e.on("element.changed",function(a){n.isSelected(a.element)&&r._updateMultiSelectionOutline(n.get())}),e.on("selection.changed",function(a){var i=a.newSelection;r._updateMultiSelectionOutline(i)})}ag.prototype._updateMultiSelectionOutline=function(e){var t=this._canvas.getLayer("selectionOutline");(0,V.clear)(t);var n=e.length>1;if((0,V.classes)(this._canvas.getContainer())[n?"add":"remove"]("djs-multi-select"),!!n){var r=CH(Cr(e)),a=(0,V.create)("rect");(0,V.attr)(a,(0,P.assign)({rx:3},r)),(0,V.classes)(a).add("djs-selection-outline"),(0,V.append)(t,a)}},ag.$inject=["eventBus","canvas","selection"];function CH(e){return{x:e.x-Nu,y:e.y-Nu,width:e.width+Nu*2,height:e.height+Nu*2}}var Q1={__depends__:[Do],__init__:["outline","multiSelectionOutline"],outline:["type",Ai],multiSelectionOutline:["type",ag]},SH=500,xH=1250,EH=1500,Lu=Math.round;function kH(e){return{x:e.x+Lu(e.width/2),y:e.y+Lu(e.height/2)}}function eS(e,t,n,r,a){function i(l,c,u,d){return a.allowed("elements.move",{shapes:l,delta:c,position:u,target:d})}e.on("shape.move.start",EH,function(l){var c=l.context,u=l.shape,d=r.get().slice();d.indexOf(u)===-1&&(d=[u]),d=TH(d),(0,P.assign)(c,{shapes:d,validatedShapes:d,shape:u})}),e.on("shape.move.start",xH,function(l){var c=l.context,u=c.validatedShapes;if(!(c.canExecute=i(u)))return!1}),e.on("shape.move.move",SH,function(l){var c=l.context,u=c.validatedShapes,d=l.hover,f={x:l.dx,y:l.dy},h=i(u,f,{x:l.x,y:l.y},d);if(c.delta=f,c.canExecute=h,h===null){c.target=null;return}c.target=d}),e.on("shape.move.end",function(l){var c=l.context,u=c.delta,d=c.canExecute,f=d==="attach",h=c.shapes;if(d===!1)return!1;u.x=Lu(u.x),u.y=Lu(u.y),!(u.x===0&&u.y===0)&&n.moveElements(h,u,c.target,{primaryShape:c.shape,attach:f})}),e.on("element.mousedown",function(l){if(pa(l)){var c=Ro(l);if(!c)throw new Error("must supply DOM mousedown event");return o(c,l.element)}});function o(l,c,u,d){if((0,P.isObject)(u)&&(d=u,u=!1),!(c.waypoints||!c.parent)&&!(0,V.classes)(l.target).has("djs-hit-no-move")){var f=kH(c);return t.init(l,f,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:c,context:d||{}}}),!0}}this.start=o}eS.$inject=["eventBus","dragging","modeling","selection","rules"];function TH(e){var t=(0,P.groupBy)(e,"id");return(0,P.filter)(e,function(n){for(;n=n.parent;)if(t[n.id])return!1;return!0})}var tS=499,ig="djs-dragging",nS="drop-ok",rS="drop-not-ok",aS="new-parent",iS="attach-ok";function oS(e,t,n,r){function a(c){return RH(i(c))}function i(c){var u=hV(c,!0),d=u.flatMap(h=>(h.incoming||[]).concat(h.outgoing||[])),f=u.concat(d);return[...new Set(f)]}function o(c,u){[iS,nS,rS,aS].forEach(function(d){d===u?t.addMarker(c,d):t.removeMarker(c,d)})}function l(c,u,d){r.addDragger(u,c.dragGroup),d&&t.addMarker(u,ig),c.allDraggedElements?c.allDraggedElements.push(u):c.allDraggedElements=[u]}e.on("shape.move.start",tS,function(c){var u=c.context,d=u.shapes,f=u.allDraggedElements,h=a(d);if(!u.dragGroup){var p=(0,V.create)("g");(0,V.attr)(p,n.cls("djs-drag-group",["no-events"])),(0,V.append)(t.getActiveLayer(),p),u.dragGroup=p}h.forEach(function(g){r.addDragger(g,u.dragGroup)}),f?f=(0,P.flatten)([f,i(d)]):f=i(d),(0,P.forEach)(f,function(g){t.addMarker(g,ig)}),u.allDraggedElements=f,u.differentParents=MH(d)}),e.on("shape.move.move",tS,function(c){var u=c.context,d=u.dragGroup,f=u.target,h=u.shape.parent,p=u.canExecute;f&&(p==="attach"?o(f,iS):u.canExecute&&h&&f.id!==h.id?o(f,aS):o(f,u.canExecute?nS:rS)),Sr(d,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var u=c.context.target;u&&o(u,null)}),e.on("shape.move.cleanup",function(c){var u=c.context,d=u.allDraggedElements,f=u.dragGroup;(0,P.forEach)(d,function(h){t.removeMarker(h,ig)}),f&&(0,V.remove)(f)}),this.makeDraggable=l}oS.$inject=["eventBus","canvas","styles","previewSupport"];function RH(e){return(0,P.filter)(e,function(t){return yn(t)?(0,P.find)(e,(0,P.matchPattern)({id:t.source.id}))&&(0,P.find)(e,(0,P.matchPattern)({id:t.target.id})):!0})}function MH(e){return(0,P.size)((0,P.groupBy)(e,function(t){return t.parent&&t.parent.id}))!==1}var BH={__depends__:[up,Do,Q1,No,Ci,hp],__init__:["move","movePreview"],move:["type",eS],movePreview:["type",oS]},lS=".djs-palette-toggle",sS=".entry",DH=lS+", "+sS,og="djs-palette-",AH="shown",lg="open",cS="two-column",PH=1e3;function It(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(r){var a=r.tool;n.updateToolHighlight(a)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}It.$inject=["eventBus","canvas"],It.prototype.registerProvider=function(e,t){t||(t=e,e=PH),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},It.prototype.getEntries=function(){return this._getProviders().reduce(LH,{})},It.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},It.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),r=this._container=(0,te.domify)(It.HTML_MARKUP);n.appendChild(r),(0,te.classes)(n).add(og+AH),te.delegate.bind(r,DH,"click",function(a){var i=a.delegateTarget;if((0,te.matches)(i,lS))return e.toggle();e.trigger("click",a)}),te.event.bind(r,"mousedown",function(a){a.stopPropagation()}),te.delegate.bind(r,sS,"dragstart",function(a){e.trigger("dragstart",a)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:r})},It.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},It.prototype._toggleState=function(e){e=e||{};var t=this._getParentContainer(),n=this._container,r=this._eventBus,a,i=(0,te.classes)(n),o=(0,te.classes)(t);"twoColumn"in e?a=e.twoColumn:a=this._needsCollapse(t.clientHeight,this._entries||{}),i.toggle(cS,a),o.toggle(og+cS,a),"open"in e&&(i.toggle(lg,e.open),o.toggle(og+lg,e.open)),r.fire("palette.changed",{twoColumn:a,open:this.isOpen()})},It.prototype._update=function(){var e=(0,te.query)(".djs-palette-entries",this._container),t=this._entries=this.getEntries();(0,te.clear)(e),(0,P.forEach)(t,function(n,r){var a=n.group||"default",i=(0,te.query)("[data-group="+Xp(a)+"]",e);i||(i=(0,te.domify)('<div class="group"></div>'),(0,te.attr)(i,"data-group",a),e.appendChild(i));var o=(0,te.domify)(n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'));if(i.appendChild(o),!n.separator&&((0,te.attr)(o,"data-action",r),n.title&&(0,te.attr)(o,"title",n.title),n.className&&NH(o,n.className),n.imageUrl)){var l=(0,te.domify)("<img>");(0,te.attr)(l,"src",n.imageUrl),o.appendChild(l)}}),this.open()},It.prototype.trigger=function(e,t,n){var r,a,i=t.delegateTarget||t.target;return i?(r=(0,te.attr)(i,"data-action"),a=t.originalEvent||t,this.triggerEntry(r,e,a,n)):t.preventDefault()},It.prototype.triggerEntry=function(e,t,n,r){var a=this._entries[e],i;if(a&&(i=a.action,this._eventBus.fire("palette.trigger",{entry:a,event:n})!==!1)){if((0,P.isFunction)(i)){if(t==="click")return i(n,r)}else if(i[t])return i[t](n,r);n.preventDefault()}},It.prototype._layoutChanged=function(){this._toggleState({})},It.prototype._needsCollapse=function(e,t){return e<Object.keys(t).length*46+50},It.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},It.prototype.open=function(){this._toggleState({open:!0})},It.prototype.toggle=function(){this.isOpen()?this.close():this.open()},It.prototype.isActiveTool=function(e){return e&&this._activeTool===e},It.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=(0,te.query)(".djs-palette-entries",this._container),this._toolsContainer=(0,te.query)("[data-group=tools]",t)),n=this._toolsContainer,(0,P.forEach)(n.children,function(r){var a=r.getAttribute("data-action");if(a){var i=(0,te.classes)(r);a=a.replace("-tool",""),i.contains("entry")&&a===e?i.add("highlighted-entry"):i.remove("highlighted-entry")}})},It.prototype.isOpen=function(){return(0,te.classes)(this._container).has(lg)},It.prototype._getParentContainer=function(){return this._canvas.getContainer()},It.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';function NH(e,t){var n=(0,te.classes)(e);((0,P.isArray)(t)?t:t.split(/\s+/g)).forEach(function(r){n.add(r)})}function LH(e,t){var n=t.getPaletteEntries();return(0,P.isFunction)(n)?n(e):((0,P.forEach)(n,function(r,a){e[a]=r}),e)}var IH={__init__:["palette"],palette:["type",It]};function uS(e,t,n,r){e.on("element.changed",function(a){var i=a.element;(i.parent||i===t.getRootElement())&&(a.gfx=n.getGraphics(i)),a.gfx&&e.fire(gV(i)+".changed",a)}),e.on("elements.changed",function(a){var i=a.elements;i.forEach(function(o){e.fire("element.changed",{element:o})}),r.updateContainments(i)}),e.on("shape.changed",function(a){r.update("shape",a.element,a.gfx)}),e.on("connection.changed",function(a){r.update("connection",a.element,a.gfx)})}uS.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var OH={__init__:["changeSupport"],changeSupport:["type",uS]},Iu=Math.max,Ou=Math.min,VH=20;function zH(e,t,n){var r=n.x,a=n.y,i={x:e.x,y:e.y,width:e.width,height:e.height};return t.indexOf("n")!==-1?(i.y=e.y+a,i.height=e.height-a):t.indexOf("s")!==-1&&(i.height=e.height+a),t.indexOf("e")!==-1?i.width=e.width+r:t.indexOf("w")!==-1&&(i.x=e.x+r,i.width=e.width-r),i}function Vu(e,t,n){var r=t[e],a=n.min&&n.min[e],i=n.max&&n.max[e];return(0,P.isNumber)(a)&&(r=(/top|left/.test(e)?Ou:Iu)(r,a)),(0,P.isNumber)(i)&&(r=(/top|left/.test(e)?Iu:Ou)(r,i)),r}function HH(e,t){if(!t)return e;var n=ut(e);return pC({top:Vu("top",n,t),right:Vu("right",n,t),bottom:Vu("bottom",n,t),left:Vu("left",n,t)})}function FH(e,t,n,r){var a=ut(t),i={top:/n/.test(e)?a.bottom-n.height:a.top,left:/w/.test(e)?a.right-n.width:a.left,bottom:/s/.test(e)?a.top+n.height:a.bottom,right:/e/.test(e)?a.left+n.width:a.right},o=r?ut(r):i;return pC({top:Ou(i.top,o.top),left:Ou(i.left,o.left),bottom:Iu(i.bottom,o.bottom),right:Iu(i.right,o.right)})}function rs(e,t){return typeof e<"u"?e:VH}function jH(e,t){var n,r,a,i;return typeof t=="object"?(n=rs(t.left),r=rs(t.right),a=rs(t.top),i=rs(t.bottom)):n=r=a=i=rs(t),{x:e.x-n,y:e.y-a,width:e.width+n+r,height:e.height+a+i}}function $H(e){return!(e.waypoints||e.type==="label")}function WH(e,t){var n;if(e.length===void 0?n=(0,P.filter)(e.children,$H):n=e,n.length)return jH(Cr(n),t)}var dS=10;function as(e,t,n,r){this._dragging=r,this._rules=t;var a=this;function i(c,u){var d=c.shape,f=c.direction,h=c.resizeConstraints,p;c.delta=u,p=zH(d,f,u),c.newBounds=HH(p,h),c.canExecute=a.canResize(c)}function o(c){var u=c.resizeConstraints,d=c.minBounds;u===void 0&&(d===void 0&&(d=a.computeMinResizeBox(c)),c.resizeConstraints={min:ut(d)})}function l(c){var u=c.shape,d=c.canExecute,f=c.newBounds;if(d){if(f=HV(f),!UH(u,f))return;n.resizeShape(u,f)}}e.on("resize.start",function(c){o(c.context)}),e.on("resize.move",function(c){var u={x:c.dx,y:c.dy};i(c.context,u)}),e.on("resize.end",function(c){l(c.context)})}as.prototype.canResize=function(e){var t=this._rules,n=(0,P.pick)(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},as.prototype.activate=function(e,t,n){var r=this._dragging,a,i;if(typeof n=="string"&&(n={direction:n}),a=(0,P.assign)({shape:t},n),i=a.direction,!i)throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");r.init(e,fS(t,i),"resize",{autoActivate:!0,cursor:YH(i),data:{shape:t,context:a}})},as.prototype.computeMinResizeBox=function(e){var t=e.shape,n=e.direction;return FH(n,t,e.minDimensions||{width:dS,height:dS},WH(t,e.childrenBoxPadding))},as.$inject=["eventBus","rules","modeling","dragging"];function UH(e,t){return e.x!==t.x||e.y!==t.y||e.width!==t.width||e.height!==t.height}function fS(e,t){var n=Mt(e),r=ut(e),a={x:n.x,y:n.y};return t.indexOf("n")!==-1?a.y=r.top:t.indexOf("s")!==-1&&(a.y=r.bottom),t.indexOf("e")!==-1?a.x=r.right:t.indexOf("w")!==-1&&(a.x=r.left),a}function YH(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}var hS="djs-resizing",pS="resize-not-ok",GH=500;function gS(e,t,n){function r(i){var o=i.shape,l=i.newBounds,c=i.frame;c||(c=i.frame=n.addFrame(o,t.getActiveLayer()),t.addMarker(o,hS)),l.width>5&&(0,V.attr)(c,{x:l.x,width:l.width}),l.height>5&&(0,V.attr)(c,{y:l.y,height:l.height}),i.canExecute?(0,V.classes)(c).remove(pS):(0,V.classes)(c).add(pS)}function a(i){var o=i.shape;i.frame&&(0,V.remove)(i.frame),t.removeMarker(o,hS)}e.on("resize.move",GH,function(i){r(i.context)}),e.on("resize.cleanup",function(i){a(i.context)})}gS.$inject=["eventBus","canvas","previewSupport"];var zu=-6,Hu=8,Fu=20,is="djs-resizer",qH=["n","w","s","e","nw","ne","se","sw"];function Ba(e,t,n,r){this._resize=r,this._canvas=t;var a=this;e.on("selection.changed",function(i){var o=i.newSelection;a.removeResizers(),o.length===1&&(0,P.forEach)(o,(0,P.bind)(a.addResizer,a))}),e.on("shape.changed",function(i){var o=i.element;n.isSelected(o)&&(a.removeResizers(),a.addResizer(o))})}Ba.prototype.makeDraggable=function(e,t,n){var r=this._resize;function a(i){pa(i)&&r.activate(i,e,n)}te.event.bind(t,"mousedown",a),te.event.bind(t,"touchstart",a)},Ba.prototype._createResizer=function(e,t,n,r){var a=this._getResizersParent(),i=JH(r),o=(0,V.create)("g");(0,V.classes)(o).add(is),(0,V.classes)(o).add(is+"-"+e.id),(0,V.classes)(o).add(is+"-"+r),(0,V.append)(a,o);var l=(0,V.create)("rect");(0,V.attr)(l,{x:-Hu/2+i.x,y:-Hu/2+i.y,width:Hu,height:Hu}),(0,V.classes)(l).add(is+"-visual"),(0,V.append)(o,l);var c=(0,V.create)("rect");return(0,V.attr)(c,{x:-Fu/2+i.x,y:-Fu/2+i.y,width:Fu,height:Fu}),(0,V.classes)(c).add(is+"-hit"),(0,V.append)(o,c),_V(o,t,n),o},Ba.prototype.createResizer=function(e,t){var n=fS(e,t),r=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,r,t)},Ba.prototype.addResizer=function(e){var t=this;yn(e)||!this._resize.canResize({shape:e})||(0,P.forEach)(qH,function(n){t.createResizer(e,n)})},Ba.prototype.removeResizers=function(){(0,V.clear)(this._getResizersParent())},Ba.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ba.$inject=["eventBus","canvas","selection","resize"];function JH(e){var t={x:0,y:0};return e.indexOf("e")!==-1?t.x=-zu:e.indexOf("w")!==-1&&(t.x=zu),e.indexOf("s")!==-1?t.y=-zu:e.indexOf("n")!==-1&&(t.y=zu),t}var XH={__depends__:[No,Ci,hp],__init__:["resize","resizePreview","resizeHandles"],resize:["type",as],resizePreview:["type",gS],resizeHandles:["type",Ba]};function os(e,t,n,r,a,i){this._canvas=t,this._modeling=r,this._textRenderer=i,n.registerProvider(this),e.on("element.dblclick",l=>{o(l.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],()=>{n.isActive()&&n.complete()}),e.on(["commandStack.changed"],()=>{n.isActive()&&n.cancel()}),e.on("directEditing.activate",()=>{a.removeResizers()}),e.on("create.end",500,l=>{const{context:c,isTouch:u}=l,d=c.shape,{canExecute:f}=l.context;u||f&&(c.hints&&c.hints.createElementsBehavior===!1||o(d))}),e.on("autoPlace.end",500,l=>{o(l.shape)});function o(l,c){(c||Op(l,["userTask","scriptTask","subprocess"])||l.isDirectEdit)&&n.activate(l)}}os.$inject=["eventBus","canvas","directEditing","modeling","resizeHandles","textRenderer"],os.prototype.activate=function(e){const t=Cu(e);if(t===void 0)return;const n={text:t};wt(n,this.getEditingBBox(e));const r={};return(Op(e,["userTask","scriptTask","subprocess"])||e.isDirectEdit)&&wt(r,{centerVertically:!0}),Vp(e)&&wt(r,{autoResize:!0}),wt(n,{options:r}),n},os.prototype.getEditingBBox=function(e){const t=this._canvas,n=e.label||e,r=t.getAbsoluteBBox(n),a={x:r.x+r.width/2,y:r.y+r.height/2},i={x:r.x,y:r.y},o=t.zoom(),l=this._textRenderer.getDefaultStyle(),c=this._textRenderer.getExternalStyle(),u=c.fontSize*o,d=c.lineHeight,f=l.fontSize*o,h=l.lineHeight,p={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(Op(e,["userTask","scriptTask","subprocess"])||e.isDirectEdit)&&(wt(i,{width:r.width,height:r.height}),wt(p,{fontSize:f+"px",lineHeight:h,paddingTop:7*o+"px",paddingBottom:7*o+"px",paddingLeft:5*o+"px",paddingRight:5*o+"px"}));const g=90*o,v=7*o,m=4*o;if(n.labelTarget&&(wt(i,{width:g,height:r.height+v+m,x:a.x-g/2,y:r.y-v}),wt(p,{fontSize:u+"px",lineHeight:d,paddingTop:v+"px",paddingBottom:m+"px"})),Vp(n)&&!XC(n)&&!Ql(n)){const _=KC(e),y=t.getAbsoluteBBox({x:_.x,y:_.y,width:0,height:0}),w=u+v+m;wt(i,{width:g,height:w,x:y.x-g/2,y:y.y-w/2}),wt(p,{fontSize:u+"px",lineHeight:d,paddingTop:v+"px",paddingBottom:m+"px"})}return{bounds:i,style:p}},os.prototype.update=function(e,t){let n;KH(t)&&(t=null),this._modeling.updateLabel(e,t,n)};function KH(e){return!e||!e.trim()}var ZH={__depends__:[OH,XH,ed.default],__init__:["labelEditingProvider"],labelEditingProvider:["type",os]};function Da(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}Da.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Da.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},Da.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Da.prototype.getSnapLocations=function(){return this._snapLocations},Da.prototype.setSnapLocations=function(e){this._snapLocations=e},Da.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new ju,n.initDefaults(this._defaultSnaps)),n};function ju(){this._snapValues={}}ju.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},ju.prototype.snap=function(e,t,n,r){var a=this._snapValues[t];return a&&Wz(e[n],a[n],r)},ju.prototype.initDefaults=function(e){var t=this;(0,P.forEach)(e||{},function(n,r){(0,P.forEach)(n,function(a){t.add(r,a)})})};var QH=1250;function Tr(e,t,n){var r=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(a){r.initSnap(a)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],QH,function(a){var i=a.context,o=i.shape,l=i.snapContext,c=i.target;if(!(a.originalEvent&&zb(a.originalEvent))&&!(Du(a)||!c)){var u=l.pointsForTarget(c);u.initialized||(u=r.addSnapTargetPoints(u,o,c),u.initialized=!0),n.snap(a,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}Tr.$inject=["elementRegistry","eventBus","snapping"],Tr.prototype.initSnap=function(e){var t=this._elementRegistry,n=e.context,r=n.shape,a=n.snapContext;a||(a=n.snapContext=new Da);var i;t.get(r.id)?i=zo(r,e):i={x:e.x+zo(r).x,y:e.y+zo(r).y};var o={x:i.x-r.width/2,y:i.y-r.height/2},l={x:i.x+r.width/2,y:i.y+r.height/2};return a.setSnapOrigin("mid",{x:i.x-e.x,y:i.y-e.y}),Lo(r)||(a.setSnapOrigin("top-left",{x:o.x-e.x,y:o.y-e.y}),a.setSnapOrigin("bottom-right",{x:l.x-e.x,y:l.y-e.y})),a},Tr.prototype.addSnapTargetPoints=function(e,t,n){return(0,P.forEach)(this.getSnapTargets(t,n),function(r){if(Lo(r)){Lo(t)&&e.add("mid",zo(r));return}if(yn(r)){if(r.waypoints.length<3)return;(0,P.forEach)(r.waypoints.slice(1,-1),function(a){e.add("mid",a)});return}e.add("mid",zo(r))}),!(0,P.isNumber)(t.x)||!(0,P.isNumber)(t.y)||this._elementRegistry.get(t.id)&&e.add("mid",zo(t)),e},Tr.prototype.getSnapTargets=function(e,t){return H1(t).filter(function(n){return!eF(n)})};function eF(e){return!!e.hidden}function $o(e){e.invoke(Tr,this)}(0,Pr.default)($o,Tr),$o.$inject=["injector"],$o.prototype.initSnap=function(e){return Tr.prototype.initSnap.call(this,e)},$o.prototype.addSnapTargetPoints=function(e,t,n){return Tr.prototype.addSnapTargetPoints.call(this,e,t,n)},$o.prototype.getSnapTargets=function(e,t){return Tr.prototype.getSnapTargets.call(this,e,t)};var tF=1250;function ls(e,t){var n=this;e.on(["resize.start"],function(r){n.initSnap(r)}),e.on(["resize.move","resize.end"],tF,function(r){var a=r.context,i=a.shape,o=i.parent,l=a.direction,c=a.snapContext;if(!(r.originalEvent&&zb(r.originalEvent))&&!Du(r)){var u=c.pointsForTarget(o);u.initialized||(u=n.addSnapTargetPoints(u,i,o,l),u.initialized=!0),aF(l)&&Zr(r,"x",r.x),iF(l)&&Zr(r,"y",r.y),t.snap(r,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}ls.prototype.initSnap=function(e){var t=e.context,n=t.shape,r=t.direction,a=t.snapContext;a||(a=t.snapContext=new Da);var i=vS(n,r);return a.setSnapOrigin("corner",{x:i.x-e.x,y:i.y-e.y}),a},ls.prototype.addSnapTargetPoints=function(e,t,n,r){return(0,P.forEach)(this.getSnapTargets(t,n),function(a){e.add("corner",Yz(a)),e.add("corner",Uz(a))}),e.add("corner",vS(t,r)),e},ls.$inject=["eventBus","snapping"],ls.prototype.getSnapTargets=function(e,t){return H1(t).filter(function(n){return!nF(n,e)&&!yn(n)&&!rF(n)&&!Lo(n)})};function vS(e,t){var n=Mt(e),r=ut(e),a={x:n.x,y:n.y};return t.indexOf("n")!==-1?a.y=r.top:t.indexOf("s")!==-1&&(a.y=r.bottom),t.indexOf("e")!==-1?a.x=r.right:t.indexOf("w")!==-1&&(a.x=r.left),a}function nF(e,t){return e.host===t}function rF(e){return!!e.hidden}function aF(e){return e==="n"||e==="s"}function iF(e){return e==="e"||e==="w"}var oF=7,lF=1e3;function Aa(e){this._canvas=e,this._asyncHide=(0,P.debounce)((0,P.bind)(this.hide,this),lF)}Aa.$inject=["canvas"],Aa.prototype.snap=function(e,t){var n=e.context.snapContext,r=n.getSnapLocations(),a={x:Du(e,"x"),y:Du(e,"y")};(0,P.forEach)(r,function(i){var o=n.getSnapOrigin(i),l={x:e.x+o.x,y:e.y+o.y};if((0,P.forEach)(["x","y"],function(c){var u;a[c]||(u=t.snap(l,i,c,oF),u!==void 0&&(a[c]={value:u,originValue:u-o[c]}))}),a.x&&a.y)return!1}),this.showSnapLine("vertical",a.x&&a.x.value),this.showSnapLine("horizontal",a.y&&a.y.value),(0,P.forEach)(["x","y"],function(i){var o=a[i];(0,P.isObject)(o)&&Zr(e,i,o.originValue)})},Aa.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=(0,V.create)("path");return(0,V.attr)(n,{d:"M0,0 L0,0"}),(0,V.classes)(n).add("djs-snap-line"),(0,V.append)(t,n),{update:function(r){(0,P.isNumber)(r)?e==="horizontal"?(0,V.attr)(n,{d:"M-100000,"+r+" L+100000,"+r,display:""}):(0,V.attr)(n,{d:"M "+r+",-100000 L "+r+", +100000",display:""}):(0,V.attr)(n,{display:"none"})}}},Aa.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Aa.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Aa.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Aa.prototype.hide=function(){(0,P.forEach)(this._snapLines,function(e){e.update()})};var sF={__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Tr],resizeSnapping:["type",ls],snapping:["type",Aa]},cF={__depends__:[sF],__init__:["createMoveSnapping"],createMoveSnapping:["type",$o]};function Wo(e){rn.call(this,e),this.init()}Wo.$inject=["eventBus"],Si(Wo,rn),Wo.prototype.addRule=function(e,t,n){var r=this;typeof e=="string"&&(e=[e]),e.forEach(function(a){r.canExecute(a,t,function(i,o,l){return n(i)},!0)})},Wo.prototype.init=function(){};function ss(e){Wo.call(this,e)}ss.$inject=["eventBus"],(0,Pr.default)(ss,Wo),ss.prototype.init=function(){this.addRule("connection.start",function(e){var t=e.source;return!!(t&&t.type!=""&&t.type!=null&&t.type!=null)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,r=e.hints||{},a=r.targetParent;if(r.targetAttach)return!1;a&&(n.parent=a);try{return sg(t,n)}finally{a&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection,n=e.source,r=e.target;return sg(n,r,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.create",function(e){var t=e.target,n=e.shape;return t.parent&&(t=parent),!(n.type=="startEvent"&&(!t.children||t.children.find(r=>r.type==n.type)!=null))}),this.addRule("shape.resize",function(e){var t=e.shape;return vV(t)})},ss.prototype.canConnect=sg;function sg(e,t,n){return t.type&&e.type&&e.type!="endEvent"?e.id==t.id?!1:{type:"myline"}:!1}var uF={__init__:["myRuleProvider"],myRuleProvider:["type",ss]};function cg(e,t,n,r,a,i,o){this._create=e,this._elementFactory=t,this._handTool=n,this._lassoTool=r,this._globalConnect=a,this._palette=i,this._myOptions=o,i.registerProvider(this)}cg.$inject=["create","elementFactory","handTool","lassoTool","globalConnect","palette","myOptions"],cg.prototype.getPaletteEntries=function(){const e=this._create,t=this._elementFactory,n=this._handTool,r=this._lassoTool,a=this._globalConnect,i=this._myOptions;function o(c,u,d,f,h){function p(g){const v=t.createShape(wt({type:c},h));e.start(g,v)}return{group:u,className:d,title:f,action:{dragstart:p,click:p}}}const l={"hand-tool":{group:"tools",className:"icon-hand-tool",title:"激活手动工具",action:{click(c){n.activateHand(c)}}},"lasso-tool":{group:"tools",className:"icon-lasso-tool",title:"激活套索工具",action:{click(c){r.activateSelection(c)}}},"global-connect-tool":{group:"tools",className:"icon-line-tool",title:"激活连线工具",action:{click(c){a.toggle(c)}}},"tool-separator":{group:"tools",separator:!0}};for(const c in i.palette){const u=i.palette[c];l[c]=o(u.type,u.group,u.className,u.title,u.options)}return l};var dF={__init__:["paletteProvider"],paletteProvider:["type",cg]},v4=50,fF=250;function hF(e,t){t||(t={});function n(h){return h.source===e?1:-1}var r=t.defaultDistance||50,a=t.direction||"e",i=t.filter,o=t.getWeight||n,l=t.maxDistance||fF,c=t.reference||"start";i||(i=pF);function u(h,p){return a==="n"?c==="start"?ut(h).top-ut(p).bottom:c==="center"?ut(h).top-Mt(p).y:ut(h).top-ut(p).top:a==="w"?c==="start"?ut(h).left-ut(p).right:c==="center"?ut(h).left-Mt(p).x:ut(h).left-ut(p).left:a==="s"?c==="start"?ut(p).top-ut(h).bottom:c==="center"?Mt(p).y-ut(h).bottom:ut(p).bottom-ut(h).bottom:c==="start"?ut(p).left-ut(h).right:c==="center"?Mt(p).x-ut(h).right:ut(p).right-ut(h).right}var d=e.incoming.filter(i).map(function(h){var p=o(h),g=p<0?u(h.source,e):u(e,h.source);return{id:h.source.id,distance:g,weight:p}}),f=e.outgoing.filter(i).map(function(h){var p=o(h),g=p>0?u(e,h.target):u(h.target,e);return{id:h.target.id,distance:g,weight:p}});return(0,P.reduce)(d.concat(f).reduce(function(h,p){return h[p.id+"__weight_"+p.weight]=p,h},{}),function(h,p){var g=p.distance,v=p.weight;return g<0||g>l||(h[String(g)]||(h[String(g)]=0),h[String(g)]+=1*v,(!h.distance||h[h.distance]<h[String(g)])&&(h.distance=g)),h},{}).distance||r}function pF(){return!0}var gF=100;function mS(e,t,n){e.on("autoPlace",gF,function(r){var a=r.shape,i=r.source;return vF(i,a)}),e.on("autoPlace.end",function(r){n.scrollToElement(r.shape)}),this.append=function(r,a,i){e.fire("autoPlace.start",{source:r,shape:a});var o=e.fire("autoPlace",{source:r,shape:a}),l=t.appendShape(r,a,o,r.parent,i);return e.fire("autoPlace.end",{source:r,shape:l}),l}}mS.$inject=["eventBus","modeling","canvas"];function vF(e,t,n){n||(n={});var r=n.defaultDistance||50,a=Mt(e);return{x:ut(e).right+r+t.width/2,y:a.y}}function yS(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}yS.$inject=["eventBus","selection"];var mF={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",mS],autoPlaceSelectionBehavior:["type",yS]},yF=10,_F=(e,t)=>e.type===t;function wF(e){return e.incoming.map(t=>t.source)}function bF(e){return e.outgoing.map(t=>t.target)}function ug(e){return bF(e).concat(wF(e))}function CF(e){let t=ug(e);return e.host&&(t=t.concat(ug(e.host))),e.attachers&&(t=t.concat(e.attachers.reduce((n,r)=>n.concat(ug(r)),[]))),t.filter(n=>n.type!=="myline")}function SF(e,t,n){const r={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height};return(0,P.find)(CF(e),a=>a===n?!1:wa(a,r,yF)==="intersect")}function xF(e,t,n,r){let a;for(;a=SF(e,n,t);)n=r(t,n,a);return n}function EF(e){return function(t,n,r){const a={x:n.x,y:n.y};return["x","y"].forEach(i=>{const o=e[i];if(!o)return;const l=i==="x"?"width":"height",{margin:c,minDistance:u}=o;c<0?a[i]=Math.min(r[i]+c-t[l]/2,n[i]-u+c):a[i]=Math.max(r[i]+r[l]+c+t[l]/2,n[i]+u+c)}),a}}function kF(e,t){return TF(e,t)}function TF(e,t){const n=ut(e),r=Mt(e),a=hF(e,{filter:l=>_F(l,"myline")}),i=30,o=80;return xF(e,t,{x:n.right+a+t.width/2,y:r.y+RF("left",o)},EF({y:{margin:i,minDistance:o}}))}function RF(e,t){return e.indexOf("top")!==-1?-1*t:e.indexOf("bottom")!==-1?t:0}function _S(e){e.on("autoPlace",t=>{const{shape:n,source:r}=t;return kF(r,n)})}_S.$inject=["eventBus"];var MF={__depends__:[mF],__init__:["myAutoPlace"],myAutoPlace:["type",_S]};function dg(e,t,n,r,a,i,o){this._connect=e,this._modeling=n,this._elementFactory=r,this._autoPlace=a,this._create=i,this._myOptions=o,t.registerProvider(this)}dg.$inject=["connect","contextPad","modeling","elementFactory","autoPlace","create","myOptions"],dg.prototype.getContextPadEntries=function(e){const t=this._connect,n=this._modeling,r=this._elementFactory,a=this._autoPlace,i=this._create,o=this._myOptions;function l(){n.removeElements([e])}function c(f,h,p){t.start(f,h,p)}function u(f,h,p,g){typeof p!="string"&&(g=p);function v(_,y){const w=r.createShape(wt({type:f},g));i.start(_,w,{source:y})}function m(_,y){const w=r.createShape(wt({type:f},g));a.append(y,w)}return{group:"model",className:h,title:p,action:{dragstart:v,click:m}}}if(e.type==="label")return!1;if(e.type==="myline"||e.type==="endEvent")return{delete:{group:"edit",className:"icon-delete",title:"删除",action:{click:l,dragstart:l}}};const d={};for(const f in o.palette)if(f!=="create.start-event"){const h=o.palette[f];d[f]=u(h.type,h.className,h.title,h.options)}return d.connect={group:"edit",className:"icon-line-tool",title:"连线",action:{click:c,dragstart:c}},d.delete={group:"edit",className:"icon-delete",title:"删除",action:{click:l,dragstart:l}},d};var BF={__init__:["ContextPadProvider"],ContextPadProvider:["type",dg]},DF=(0,s.defineComponent)({name:"JWorkflow",__name:"workflow",props:{paletteOptions:{default:void 0},lineStroke:{default:void 0}},emits:["elementDblclick","elementClick","elementCreate"],setup(e,{expose:t,emit:n}){const r=e,a=n,i=(0,s.ref)(),o={"create.start-event":{className:"icon-start-event",type:"startEvent",group:"event",title:"创建开始事件"},"create.end-event":{className:"icon-end-event",type:"endEvent",group:"event",title:"创建结束事件"},"create.and-gateway":{className:"icon-gateway1",type:"gatewayAnd",group:"gateway",title:"并行网关"},"create.xor-gateway":{className:"icon-gateway2",type:"gatewayXor",group:"gateway",title:"互排网关"},"create.inclusive-gateway":{className:"icon-gateway3",type:"gatewayInclusive",group:"gateway",title:"包含网关"},"create.task":{className:"icon-gateway4",type:"userTask",group:"activity",title:"创建任务"},"create.script":{className:"icon-gateway5",type:"scriptTask",group:"activity",title:"创建脚本"},"create.subprocess":{className:"icon-subprocess",type:"subprocess",group:"activity",title:"创建子流程"}};let l,c=1;const u=()=>{c=1,l.get("canvas").zoom("fit-viewport")},d=()=>{const T=l.get("eventBus");T.on("element.dblclick",R=>{a("elementDblclick",R.element.businessObject)}),T.on("element.click",R=>{a("elementClick",R.element.businessObject)}),T.on("create.end",R=>{a("elementCreate",R.elements[0].businessObject)}),T.on("autoPlace.end",R=>{a("elementCreate",R.shape.businessObject)})},f=function(){return{palette:r.paletteOptions||o,lineStroke:r.lineStroke}},h=()=>{let T={__init__:["myOptions"],myOptions:["type",f]};l=new vs.default({canvas:{container:i.value},modules:[qz,Cp,Zz,fH,eC,xz,vH,yH,_H,c1,wC,BH,Q1,IH,SC,T,MF,h1,ZH,BF,dF,uF,cF,g1]});const R=l.get("canvas"),D=l.get("elementFactory");u();const A=D.createRoot();R.setRootElement(A),d()};(0,s.onMounted)(()=>{h()});const p=T=>{const R=T==null?1:c+T;l.get("canvas").zoom(R),c=R},g=()=>{l.get("commandStack").redo()},v=()=>{l.get("commandStack").undo()},m=()=>(l.get("canvas").zoom(1),v1(l.get("elementRegistry").getAll())),_=T=>{l.clear(),u(),m1(T,l)},y=T=>{l.get("myImporter").update(T.id,T)};return t({reset:()=>{u()},zoom:T=>{p(T)},redo:()=>{g()},undo:()=>{v()},getData:()=>m(),setData:T=>{_(T)},updateElemet:T=>{y(T)}}),(T,R)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref_key:"containerRef",ref:i,class:"j-work-flow"},null,512))}}),AF=DF,wS=be(Cz),bS=be(AF),PF=(0,s.defineComponent)({name:"JInputCards",__name:"input-cards",props:{id:{type:String,default:""},modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},editConfig:{type:Object,default:()=>({})},gutter:{type:Number,default:16},span:Number,labelWidth:[String,Number],required:{type:Boolean,default:!1}},emits:["update:modelValue","change","rowChange"],setup(e,{expose:t,emit:n}){const r=e,a=n,{t:i}=vt(),{formData:o}=ra(),l=(0,s.computed)(()=>r.editConfig.isAddBtn!==!1),c=(0,s.computed)(()=>r.editConfig.addBtnText||"添加"),u=(0,s.computed)(()=>r.editConfig.buttonsAlign||"left"),d=(0,s.computed)(()=>r.editConfig.isRemoveBtn!==!1),f=(0,s.computed)(()=>r.editConfig.readonly),h=(0,s.computed)(()=>r.editConfig.isNullValue!==!1),p=(0,s.ref)([]),g=b=>{a("rowChange",b)},v=()=>{const b={_i:Nr()};r.columns.forEach(x=>{const E=x.config?.valueRowKey||x.id||"";E&&(b[E]=Mn(x.config?.defaultValue))}),p.value.push(b),a("change",{id:r.id,value:b,data:b,formData:o,tableData:p.value,type:"add"})},m=b=>{const x=p.value[b];p.value.splice(b,1),a("change",{id:r.id,value:x,data:x,formData:o,tableData:p.value,type:"delete"})},_=()=>{const b={isOk:!0,info:""};if(r.required&&p.value.length===0)return b.isOk=!1,b.info="请添加表格数据",b;const x=p.value.length,E=r.columns,k=E.length;for(let T=0;T<x;T++){const R=p.value[T];for(let D=0;D<k;D++){const A=E[D];if(w(A,T).display!==!1&&A.rule&&A.rule.length>0){const L=A.rule.length;for(let N=0;N<L;N++){const M=A.rule[N];if(M.pattern=M.pattern?M.pattern+"":"",M.pattern&&!ln(R[A.prop||""])&&!new RegExp(M.pattern.substring(1,M.pattern.length-1)).test(R[A.prop||""]))return b.info=`${i("第")}${T+1}${i("行")},${i("第")}${D+1}${i("列")},${i(A.label)}:${i(M.message)}`,b.isOk=!1,b;if(M.required&&ln(R[A.prop||""]))return b.isOk=!1,b.info=`${i("第")}${T+1}${i("行")},${i("第")}${D+1}${i("列")},${i(A.label)}:${i("不能为空")}`,b}}}}return b};r.modelValue&&r.modelValue.length>0?(p.value=r.modelValue||[],p.value.forEach(b=>{b._i||(b._i=Nr())})):(p.value=[],a("update:modelValue",p.value));const w=(b,x)=>In({config:b.config||{},getCompConfig:b.getCompConfig,formData:o,row:p.value[x],getTableData:()=>p.value}),C=b=>{const x=b||r.labelWidth;return typeof x=="string"?x:typeof x=="number"?x+"px":x};return t({validate:()=>_()}),Xo({getTableData:()=>p.value,rowChange:g}),(b,x)=>{const E=(0,s.resolveComponent)("j-comp"),k=(0,s.resolveComponent)("el-form-item"),T=(0,s.resolveComponent)("el-col"),R=(0,s.resolveComponent)("j-button"),D=(0,s.resolveComponent)("el-row");return(0,s.openBlock)(),(0,s.createElementBlock)(s.Fragment,null,[(0,s.createElementVNode)("div",(0,s.mergeProps)({class:"j-input-cards"},b.$attrs),[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(p.value,(A,L)=>((0,s.openBlock)(),(0,s.createElementBlock)("div",{class:"j-input-cards-item",key:A.i,style:{"margin-bottom":"8px"}},[(0,s.createVNode)(D,{gutter:e.gutter},{default:(0,s.withCtx)(()=>[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.columns,N=>((0,s.openBlock)(),(0,s.createBlock)(T,{key:N.prop,span:N.config?.span||e.span||24,style:(0,s.normalizeStyle)({"margin-bottom":(N.getInputType?N.getInputType(A):N.inputType)=="j-input-rows"?"8px":void 0})},{default:(0,s.withCtx)(()=>[(0,s.withDirectives)((0,s.createVNode)(k,{"label-width":C(N.config?.labelWidth),label:(0,s.unref)(i)(N.config?.label||""),extra:N.config?.labelExtra,required:N.config?.required},{default:(0,s.withCtx)(()=>[(0,s.createVNode)(E,(0,s.mergeProps)({ref_for:!0},N,{row:A}),null,16,["row"])]),_:2},1032,["label-width","label","extra","required"]),[[s.vShow,w(N,L).display!==!1]])]),_:2},1032,["span","style"]))),128)),d.value&&(h.value||p.value.length>1)&&!f.value?((0,s.openBlock)(),(0,s.createBlock)(R,{key:0,class:"j-input-cards-delete",size:"small",shape:"circle",icon:"mdi:close",danger:"",onClick:N=>m(L)},null,8,["onClick"])):(0,s.createCommentVNode)("",!0)]),_:2},1032,["gutter"])]))),128))],16),l.value&&!f.value?((0,s.openBlock)(),(0,s.createElementBlock)("div",{key:0,style:(0,s.normalizeStyle)({"text-align":u.value})},[l.value?((0,s.openBlock)(),(0,s.createBlock)(R,{key:0,type:"link",style:{"margin-right":"8px"},label:c.value,icon:"mdi:add",onClick:v},null,8,["label"])):(0,s.createCommentVNode)("",!0)],4)):(0,s.createCommentVNode)("",!0)],64)}}}),NF=PF,CS=be(NF),LF=[ys,Qg,ev,tv,nv,rv,av,iv,ov,lv,sv,cv,uv,dv,_v,wv,bv,Cv,cd,Zg,Sv,xv,Ev,Tv,zw,Hw,eb,Fw,jw,$w,Ww,Uw,Yw,Gw,qw,Jw,Xw,Kw,Zw,Qw,ab,ib,ob,lb,cb,ub,db,fb,hb,tb,nb,ap,pb,gb,vb,mb,yb,_b,wb,bb,Cb,wS,bS,CS],IF=e=>{LF.forEach(t=>{e.component(t.name,t)})},OF={install:IF};z.EncryptionFactory=zg,z.EventBus=id,z.HashingFactory=xx,z.INJECT_KEYS=Ut,z.JAutoComplete=uv,z.JBarcode=Hw,z.JButton=ys,z.JButtonSelect=ab,z.JButtons=Qg,z.JCascaderSelect=lv,z.JCheckbox=sv,z.JCodeMirror=eb,z.JCollapse=_b,z.JComp=lb,z.JCount=Fw,z.JCountUp=$w,z.JDataPanel=Ww,z.JDate=tv,z.JDecoratedTitle=Zw,z.JDialog=wv,z.JDialogFull=bv,z.JDivider=Uw,z.JDrawer=Cv,z.JDynamicLayer=Zg,z.JEcharts=zw,z.JEditor=wb,z.JForm=cb,z.JFormItem=ub,z.JGuid=fb,z.JHpanel=Yw,z.JIcon=av,z.JInput=ev,z.JInputButton=qw,z.JInputCards=CS,z.JInputCode=Jw,z.JInputColor=Xw,z.JInputCount=jw,z.JInputDecoratedTitle=Qw,z.JInputLayer=gb,z.JInputMap=Cb,z.JInputRows=pb,z.JInputTag=Sv,z.JLayer=cd,z.JLayerForm=vb,z.JLayout=dv,z.JMap=bb,z.JMenu=nb,z.JNowTime=rv,z.JNumber=cv,z.JPage=db,z.JPanel=hb,z.JRadio=iv,z.JRate=xv,z.JSelect=ov,z.JSlider=Ev,z.JSliderCaptcha=tb,z.JSwitch=mb,z.JTable=_v,z.JTablePanel=ap,z.JTabs=yb,z.JTime=nv,z.JTitle=Kw,z.JTree=ib,z.JTreeSelect=ob,z.JUpload=Tv,z.JVpanel=Gw,z.JWorkflow=bS,z.JWorkflowViewer=wS,z.assign=wt,z.buildShortUUID=_s,z.buildUUID=Nr,z.clearJson=Oi,z.clone=Go,z.deepClone=Mn,z.default=OF,z.eventBus=kx,z.formatToDate=Jo,z.formatToDateTime=Cs,z.fullScreenLoading=na,z.getCompConfig=In,z.getCompType=bs,z.getDayText=tx,z.getFunction=nd,z.getIsInputComp=ws,z.getIsTableInputComp=Tg,z.getLabel=Rg,z.getObjType=vg,z.getTextWidth=Ln,z.is=gg,z.isArray=ms,z.isNullOrEmpty=ln,z.isObject=jS,z.loadBMap=Fg,z.lowerFirst=KS,z.myAesDecrypt=Ex,z.numberToChinese=mg,z.numberToThousandSeparator=yg,z.pagination=qS,z.paginationEx=JS,z.set=rd,z.setGroupMap=wg,z.toArray=Sg,z.toDecimal=qo,z.toLeafArray=kg,z.toSimpleTree=ZS,z.toTree=bg,z.uniqueArray=XS,z.upFirst=_g,z.useAppInject=vt,z.useAppProvide=Tx,z.useAuthPageInject=Yg,z.useAuthPageProvide=Gg,z.useCompInject=jg,z.useCompProvide=ld,z.useFormInject=ra,z.useFormProvide=od,z.useHMenuInject=Wg,z.useHMenuProvide=Ug,z.useInject=sr,z.useLayer=La,z.useLayerInject=Rx,z.useLayerProvide=qg,z.useMenuInject=Vi,z.useMenuProvide=$g,z.usePageInject=Jg,z.usePageProvide=Xg,z.useProvide=cr,z.useSortable=Hg,z.useTableInject=xs,z.useTableProvide=Xo});
|