ace-component-lib 0.0.22 → 0.0.23

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.
@@ -1,4 +1,4 @@
1
- (function(Rt,tt){typeof exports=="object"&&typeof module<"u"?module.exports=tt(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("dayjs"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","dayjs","@wangeditor/editor-for-vue"],tt):(Rt=typeof globalThis<"u"?globalThis:Rt||self,Rt["ace-component-lib"]=tt(Rt.pinia,Rt.editor,Rt.Vue,Rt.elementPlus,Rt.dayjs,Rt.editorForVue))})(this,function(Rt,tt,e,E,on,sc){"use strict";const YI="";let Dm=class{constructor(r){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,r),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let r="";this.settings.url&&!this.settings.asyncUrl&&(r=this.settings.url);let n=this;if(this.settings.asyncUrl)return void n.settings.asyncUrl(function(a){let i=n.getPrintWindow(a);n.settings.preview?n.previewIfrmaeLoad():n.print(i)},n.settings.vue);let o=this.getPrintWindow(r);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(r,n,o){r.addEventListener?r.addEventListener(n,o,!1):r.attachEvent?r.attachEvent("on"+n,o):r["on"+n]=o}previewIfrmaeLoad(){let r=document.getElementById("vue-pirnt-nb-previewBox");if(r){let n=this,o=r.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){n.previewBoxShow(),n.removeCanvasImg(),n.settings.previewOpenCallback()}),this.addEvent(r.querySelector(".previewBodyUtilPrintBtn"),"click",function(){n.settings.beforeOpenCallback(),n.settings.openCallback(),o.contentWindow.print(),n.settings.closeCallback()})}}removeCanvasImg(){let r=this;try{if(r.elsdom){let n=r.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<n.length;o++)n[o].remove()}}catch(n){console.log(n)}}print(r){var n=this;let o=document.getElementById(this.settings.id)||r.f,a=document.getElementById(this.settings.id).contentWindow||r.f.contentWindow;n.settings.beforeOpenCallback(),n.addEvent(o,"load",function(){a.focus(),n.settings.openCallback(),a.print(),o.remove(),n.settings.closeCallback(),n.removeCanvasImg()})}write(r){r.open(),r.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),r.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let r="",n="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,i=>{r+=i}),[].forEach.call(document.querySelectorAll("link"),function(i){i.href.indexOf(".css")>=0&&(n+=`<link type="text/css" rel="stylesheet" href="${i.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let i=0;i<a.length;i++)try{if(a[i].cssRules||a[i].rules){let l=a[i].cssRules||a[i].rules;for(let s=0;s<l.length;s++)o+=l[s].cssText}}catch(l){console.log(a[i].href+l)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,i=>{n+=`<link type="text/css" rel="stylesheet" href="${i}">`}),`<head><title>${this.settings.popTitle}</title>${r}${n}<style type="text/css">${o}</style></head>`}getBody(){let r=this.settings.ids;return r=r.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(r)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(r){let n=r.querySelectorAll("canvas");for(let o=0;o<n.length;o++)if(!n[o].style.display){let a=n[o].parentNode,i=n[o].toDataURL("image/png"),l=new Image;l.className="canvasImg",l.style.display="none",l.src=i,a.appendChild(l)}return r}getFormData(r){let n=r.cloneNode(!0),o=n.querySelectorAll("input,select,textarea"),a=n.querySelectorAll(".canvasImg,canvas"),i=-1;for(let l=0;l<a.length;l++){let s=a[l].parentNode,d=a[l];d.tagName.toLowerCase()==="canvas"?s.removeChild(d):d.style.display="block"}for(let l=0;l<o.length;l++){let s=o[l],d=s.getAttribute("type"),c=o[l];if(d||(d=s.tagName==="SELECT"?"select":s.tagName==="TEXTAREA"?"textarea":""),s.tagName==="INPUT")d==="radio"||d==="checkbox"?s.checked&&c.setAttribute("checked",s.checked):(c.value=s.value,c.setAttribute("value",s.value));else if(d==="select"){i++;for(let f=0;f<r.querySelectorAll("select").length;f++){let u=r.querySelectorAll("select")[f];if(!u.getAttribute("newbs")&&u.setAttribute("newbs",f),u.getAttribute("newbs")==i){let p=r.querySelectorAll("select")[i].selectedIndex;s.options[p].setAttribute("selected",!0)}}}else c.innerHTML=s.value,c.setAttribute("html",s.value)}return n}getPrintWindow(r){var n=this.Iframe(r);return{f:n,win:n.contentWindow||n,doc:n.doc}}previewBoxShow(){let r=document.getElementById("vue-pirnt-nb-previewBox");r&&(document.querySelector("html").setAttribute("style","overflow: hidden"),r.style.display="block")}previewBoxHide(){let r=document.getElementById("vue-pirnt-nb-previewBox");r&&(document.querySelector("html").setAttribute("style","overflow: visible;"),r.querySelector("iframe")&&r.querySelector("iframe").remove(),r.style.display="none")}previewBox(){let r=document.getElementById("vue-pirnt-nb-previewBox"),n="previewBody";if(r)return r.querySelector("iframe")&&r.querySelector("iframe").remove(),{close:r.querySelector(".previewClose"),previewBody:r.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let i=this.close;i.setAttribute("class","previewClose"),i.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let l=document.createElement("div"),s=document.createElement("div");l.setAttribute("class","closeBefore"),l.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),s.setAttribute("class","closeAfter"),s.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),i.appendChild(l),i.appendChild(s),a.appendChild(i),this.previewBody=document.createElement("div");let d=this.previewBody;d.setAttribute("class",n),d.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(d);let c=document.createElement("div");c.setAttribute("class","previewBodyUtil"),c.setAttribute("style","height: 32px;background: #474747;position: relative;"),d.appendChild(c),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),c.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(r,n){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",r),o.setAttribute("src",n),o}Iframe(r){let n=this.settings.id;r=r||new Date().getTime();let o=this,a=this.iframeBox(n,r);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let i=this.previewBox(),l=i.previewBody,s=i.close;l.appendChild(a),this.addEvent(s,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(i){throw new Error(i+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var cc={directiveName:"print",mounted(t,r,n){let o=r.instance,a="";var i,l,s;l="click",s=()=>{if(typeof r.value=="string")a=r.value;else{if(typeof r.value!="object"||!r.value.id)return void window.print();{a=r.value.id;let c=a.replace(new RegExp("#","g"),"");document.getElementById(c)||(console.log("id in Error"),a="")}}d()},(i=t).addEventListener?i.addEventListener(l,s,!1):i.attachEvent?i.attachEvent("on"+l,s):i["on"+l]=s;const d=()=>{new Dm({ids:a,vue:o,url:r.value.url,standard:"",extraHead:r.value.extraHead,extraCss:r.value.extraCss,zIndex:r.value.zIndex||20002,previewTitle:r.value.previewTitle||"打印预览",previewPrintBtnLabel:r.value.previewPrintBtnLabel||"打印",popTitle:r.value.popTitle,preview:r.value.preview||!1,asyncUrl:r.value.asyncUrl,previewBeforeOpenCallback(){r.value.previewBeforeOpenCallback&&r.value.previewBeforeOpenCallback(o)},previewOpenCallback(){r.value.previewOpenCallback&&r.value.previewOpenCallback(o)},openCallback(){r.value.openCallback&&r.value.openCallback(o)},closeCallback(){r.value.closeCallback&&r.value.closeCallback(o)},beforeOpenCallback(){r.value.beforeOpenCallback&&r.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",cc)}},Rr=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Rr||{});let li=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((r,n)=>(n&=63,n<36?r+=n.toString(36):n<62?r+=(n-26).toString(36).toUpperCase():n>62?r+="-":r+="_",r),"");const Re=Rt.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,r){this.sketchRuleLine.h=t,this.sketchRuleLine.v=r},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(r=>!t.includes(r.id))),this.setTargetWidget(this.getTargetWidget.filter(r=>!t.includes(r.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(r=>{const n=this.getWidgetList.find(o=>o.id==r);n&&this.pasteWidget.push(n)})},pasteWidgetItem(){this.pasteWidget.forEach(n=>{const o=JSON.parse(JSON.stringify(n));let a=o.x,i=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?i=this.stageHeight-o.h-40:i+=40,this.widgetConfg.list.unshift({...o,id:li(),x:a,y:i,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,r)=>r.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
1
+ (function(Rt,qe){typeof exports=="object"&&typeof module<"u"?module.exports=qe(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("dayjs"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","dayjs","@wangeditor/editor-for-vue"],qe):(Rt=typeof globalThis<"u"?globalThis:Rt||self,Rt["ace-component-lib"]=qe(Rt.pinia,Rt.editor,Rt.Vue,Rt.elementPlus,Rt.dayjs,Rt.editorForVue))})(this,function(Rt,qe,e,E,on,sc){"use strict";const YI="";let Dm=class{constructor(r){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,r),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let r="";this.settings.url&&!this.settings.asyncUrl&&(r=this.settings.url);let n=this;if(this.settings.asyncUrl)return void n.settings.asyncUrl(function(a){let i=n.getPrintWindow(a);n.settings.preview?n.previewIfrmaeLoad():n.print(i)},n.settings.vue);let o=this.getPrintWindow(r);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(r,n,o){r.addEventListener?r.addEventListener(n,o,!1):r.attachEvent?r.attachEvent("on"+n,o):r["on"+n]=o}previewIfrmaeLoad(){let r=document.getElementById("vue-pirnt-nb-previewBox");if(r){let n=this,o=r.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){n.previewBoxShow(),n.removeCanvasImg(),n.settings.previewOpenCallback()}),this.addEvent(r.querySelector(".previewBodyUtilPrintBtn"),"click",function(){n.settings.beforeOpenCallback(),n.settings.openCallback(),o.contentWindow.print(),n.settings.closeCallback()})}}removeCanvasImg(){let r=this;try{if(r.elsdom){let n=r.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<n.length;o++)n[o].remove()}}catch(n){console.log(n)}}print(r){var n=this;let o=document.getElementById(this.settings.id)||r.f,a=document.getElementById(this.settings.id).contentWindow||r.f.contentWindow;n.settings.beforeOpenCallback(),n.addEvent(o,"load",function(){a.focus(),n.settings.openCallback(),a.print(),o.remove(),n.settings.closeCallback(),n.removeCanvasImg()})}write(r){r.open(),r.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),r.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let r="",n="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,i=>{r+=i}),[].forEach.call(document.querySelectorAll("link"),function(i){i.href.indexOf(".css")>=0&&(n+=`<link type="text/css" rel="stylesheet" href="${i.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let i=0;i<a.length;i++)try{if(a[i].cssRules||a[i].rules){let l=a[i].cssRules||a[i].rules;for(let s=0;s<l.length;s++)o+=l[s].cssText}}catch(l){console.log(a[i].href+l)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,i=>{n+=`<link type="text/css" rel="stylesheet" href="${i}">`}),`<head><title>${this.settings.popTitle}</title>${r}${n}<style type="text/css">${o}</style></head>`}getBody(){let r=this.settings.ids;return r=r.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(r)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(r){let n=r.querySelectorAll("canvas");for(let o=0;o<n.length;o++)if(!n[o].style.display){let a=n[o].parentNode,i=n[o].toDataURL("image/png"),l=new Image;l.className="canvasImg",l.style.display="none",l.src=i,a.appendChild(l)}return r}getFormData(r){let n=r.cloneNode(!0),o=n.querySelectorAll("input,select,textarea"),a=n.querySelectorAll(".canvasImg,canvas"),i=-1;for(let l=0;l<a.length;l++){let s=a[l].parentNode,d=a[l];d.tagName.toLowerCase()==="canvas"?s.removeChild(d):d.style.display="block"}for(let l=0;l<o.length;l++){let s=o[l],d=s.getAttribute("type"),c=o[l];if(d||(d=s.tagName==="SELECT"?"select":s.tagName==="TEXTAREA"?"textarea":""),s.tagName==="INPUT")d==="radio"||d==="checkbox"?s.checked&&c.setAttribute("checked",s.checked):(c.value=s.value,c.setAttribute("value",s.value));else if(d==="select"){i++;for(let f=0;f<r.querySelectorAll("select").length;f++){let u=r.querySelectorAll("select")[f];if(!u.getAttribute("newbs")&&u.setAttribute("newbs",f),u.getAttribute("newbs")==i){let p=r.querySelectorAll("select")[i].selectedIndex;s.options[p].setAttribute("selected",!0)}}}else c.innerHTML=s.value,c.setAttribute("html",s.value)}return n}getPrintWindow(r){var n=this.Iframe(r);return{f:n,win:n.contentWindow||n,doc:n.doc}}previewBoxShow(){let r=document.getElementById("vue-pirnt-nb-previewBox");r&&(document.querySelector("html").setAttribute("style","overflow: hidden"),r.style.display="block")}previewBoxHide(){let r=document.getElementById("vue-pirnt-nb-previewBox");r&&(document.querySelector("html").setAttribute("style","overflow: visible;"),r.querySelector("iframe")&&r.querySelector("iframe").remove(),r.style.display="none")}previewBox(){let r=document.getElementById("vue-pirnt-nb-previewBox"),n="previewBody";if(r)return r.querySelector("iframe")&&r.querySelector("iframe").remove(),{close:r.querySelector(".previewClose"),previewBody:r.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let i=this.close;i.setAttribute("class","previewClose"),i.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let l=document.createElement("div"),s=document.createElement("div");l.setAttribute("class","closeBefore"),l.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),s.setAttribute("class","closeAfter"),s.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),i.appendChild(l),i.appendChild(s),a.appendChild(i),this.previewBody=document.createElement("div");let d=this.previewBody;d.setAttribute("class",n),d.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(d);let c=document.createElement("div");c.setAttribute("class","previewBodyUtil"),c.setAttribute("style","height: 32px;background: #474747;position: relative;"),d.appendChild(c),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),c.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(r,n){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",r),o.setAttribute("src",n),o}Iframe(r){let n=this.settings.id;r=r||new Date().getTime();let o=this,a=this.iframeBox(n,r);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let i=this.previewBox(),l=i.previewBody,s=i.close;l.appendChild(a),this.addEvent(s,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(i){throw new Error(i+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var cc={directiveName:"print",mounted(t,r,n){let o=r.instance,a="";var i,l,s;l="click",s=()=>{if(typeof r.value=="string")a=r.value;else{if(typeof r.value!="object"||!r.value.id)return void window.print();{a=r.value.id;let c=a.replace(new RegExp("#","g"),"");document.getElementById(c)||(console.log("id in Error"),a="")}}d()},(i=t).addEventListener?i.addEventListener(l,s,!1):i.attachEvent?i.attachEvent("on"+l,s):i["on"+l]=s;const d=()=>{new Dm({ids:a,vue:o,url:r.value.url,standard:"",extraHead:r.value.extraHead,extraCss:r.value.extraCss,zIndex:r.value.zIndex||20002,previewTitle:r.value.previewTitle||"打印预览",previewPrintBtnLabel:r.value.previewPrintBtnLabel||"打印",popTitle:r.value.popTitle,preview:r.value.preview||!1,asyncUrl:r.value.asyncUrl,previewBeforeOpenCallback(){r.value.previewBeforeOpenCallback&&r.value.previewBeforeOpenCallback(o)},previewOpenCallback(){r.value.previewOpenCallback&&r.value.previewOpenCallback(o)},openCallback(){r.value.openCallback&&r.value.openCallback(o)},closeCallback(){r.value.closeCallback&&r.value.closeCallback(o)},beforeOpenCallback(){r.value.beforeOpenCallback&&r.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",cc)}},Rr=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Rr||{});let li=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((r,n)=>(n&=63,n<36?r+=n.toString(36):n<62?r+=(n-26).toString(36).toUpperCase():n>62?r+="-":r+="_",r),"");const Re=Rt.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,r){this.sketchRuleLine.h=t,this.sketchRuleLine.v=r},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(r=>!t.includes(r.id))),this.setTargetWidget(this.getTargetWidget.filter(r=>!t.includes(r.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(r=>{const n=this.getWidgetList.find(o=>o.id==r);n&&this.pasteWidget.push(n)})},pasteWidgetItem(){this.pasteWidget.forEach(n=>{const o=JSON.parse(JSON.stringify(n));let a=o.x,i=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?i=this.stageHeight-o.h-40:i+=40,this.widgetConfg.list.unshift({...o,id:li(),x:a,y:i,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,r)=>r.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
2
2
  * Compressor.js v1.2.1
3
3
  * https://fengyuanchen.github.io/compressorjs
4
4
  *
@@ -12,10 +12,10 @@
12
12
  * @author RubaXa <trash@rubaxa.org>
13
13
  * @author owenm <owen23355@gmail.com>
14
14
  * @license MIT
15
- */function Oc(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,o)}return n}function tr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Oc(Object(n),!0).forEach(function(o){Jg(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Po(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Po=function(r){return typeof r}:Po=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Po(t)}function Jg(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function dr(){return dr=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},dr.apply(this,arguments)}function Kg(t,r){if(t==null)return{};var n={},o=Object.keys(t),a,i;for(i=0;i<o.length;i++)a=o[i],!(r.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Zg(t,r){if(t==null)return{};var n=Kg(t,r),o,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)o=i[a],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Qg="1.15.2";function fr(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ur=fr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),jn=fr(/Edge/i),Ic=fr(/firefox/i),Pn=fr(/safari/i)&&!fr(/chrome/i)&&!fr(/android/i),zc=fr(/iP(ad|od|hone)/i),Rc=fr(/chrome/i)&&fr(/android/i),Mc={capture:!1,passive:!1};function $e(t,r,n){t.addEventListener(r,n,!ur&&Mc)}function Se(t,r,n){t.removeEventListener(r,n,!ur&&Mc)}function Uo(t,r){if(r){if(r[0]===">"&&(r=r.substring(1)),t)try{if(t.matches)return t.matches(r);if(t.msMatchesSelector)return t.msMatchesSelector(r);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(r)}catch{return!1}return!1}}function e0(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ht(t,r,n,o){if(t){n=n||document;do{if(r!=null&&(r[0]===">"?t.parentNode===n&&Uo(t,r):Uo(t,r))||o&&t===n)return t;if(t===n)break}while(t=e0(t))}return null}var Ac=/\s+/g;function Vt(t,r,n){if(t&&r)if(t.classList)t.classList[n?"add":"remove"](r);else{var o=(" "+t.className+" ").replace(Ac," ").replace(" "+r+" "," ");t.className=(o+(n?" "+r:"")).replace(Ac," ")}}function de(t,r,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),r===void 0?n:n[r];!(r in o)&&r.indexOf("webkit")===-1&&(r="-webkit-"+r),o[r]=n+(typeof n=="string"?"":"px")}}function an(t,r){var n="";if(typeof t=="string")n=t;else do{var o=de(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!r&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function Lc(t,r,n){if(t){var o=t.getElementsByTagName(r),a=0,i=o.length;if(n)for(;a<i;a++)n(o[a],a);return o}return[]}function rr(){var t=document.scrollingElement;return t||document.documentElement}function qe(t,r,n,o,a){if(!(!t.getBoundingClientRect&&t!==window)){var i,l,s,d,c,f,u;if(t!==window&&t.parentNode&&t!==rr()?(i=t.getBoundingClientRect(),l=i.top,s=i.left,d=i.bottom,c=i.right,f=i.height,u=i.width):(l=0,s=0,d=window.innerHeight,c=window.innerWidth,f=window.innerHeight,u=window.innerWidth),(r||n)&&t!==window&&(a=a||t.parentNode,!ur))do if(a&&a.getBoundingClientRect&&(de(a,"transform")!=="none"||n&&de(a,"position")!=="static")){var p=a.getBoundingClientRect();l-=p.top+parseInt(de(a,"border-top-width")),s-=p.left+parseInt(de(a,"border-left-width")),d=l+i.height,c=s+i.width;break}while(a=a.parentNode);if(o&&t!==window){var h=an(a||t),m=h&&h.a,y=h&&h.d;h&&(l/=y,s/=m,u/=m,f/=y,d=l+f,c=s+u)}return{top:l,left:s,bottom:d,right:c,width:u,height:f}}}function Fc(t,r,n){for(var o=Cr(t,!0),a=qe(t)[r];o;){var i=qe(o)[n],l=void 0;if(n==="top"||n==="left"?l=a>=i:l=a<=i,!l)return o;if(o===rr())break;o=Cr(o,!1)}return!1}function ln(t,r,n,o){for(var a=0,i=0,l=t.children;i<l.length;){if(l[i].style.display!=="none"&&l[i]!==le.ghost&&(o||l[i]!==le.dragged)&&Ht(l[i],n.draggable,t,!1)){if(a===r)return l[i];a++}i++}return null}function gi(t,r){for(var n=t.lastElementChild;n&&(n===le.ghost||de(n,"display")==="none"||r&&!Uo(n,r));)n=n.previousElementSibling;return n||null}function Mt(t,r){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==le.clone&&(!r||Uo(t,r))&&n++;return n}function jc(t){var r=0,n=0,o=rr();if(t)do{var a=an(t),i=a.a,l=a.d;r+=t.scrollLeft*i,n+=t.scrollTop*l}while(t!==o&&(t=t.parentNode));return[r,n]}function t0(t,r){for(var n in t)if(t.hasOwnProperty(n)){for(var o in r)if(r.hasOwnProperty(o)&&r[o]===t[n][o])return Number(n)}return-1}function Cr(t,r){if(!t||!t.getBoundingClientRect)return rr();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var a=de(n);if(n.clientWidth<n.scrollWidth&&(a.overflowX=="auto"||a.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(a.overflowY=="auto"||a.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return rr();if(o||r)return n;o=!0}}while(n=n.parentNode);return rr()}function r0(t,r){if(t&&r)for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n]);return t}function yi(t,r){return Math.round(t.top)===Math.round(r.top)&&Math.round(t.left)===Math.round(r.left)&&Math.round(t.height)===Math.round(r.height)&&Math.round(t.width)===Math.round(r.width)}var Un;function Pc(t,r){return function(){if(!Un){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Un=setTimeout(function(){Un=void 0},r)}}}function n0(){clearTimeout(Un),Un=void 0}function Uc(t,r,n){t.scrollLeft+=r,t.scrollTop+=n}function Wc(t){var r=window.Polymer,n=window.jQuery||window.Zepto;return r&&r.dom?r.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Gc(t,r,n){var o={};return Array.from(t.children).forEach(function(a){var i,l,s,d;if(!(!Ht(a,r.draggable,t,!1)||a.animated||a===n)){var c=qe(a);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,c.left),o.top=Math.min((l=o.top)!==null&&l!==void 0?l:1/0,c.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,c.right),o.bottom=Math.max((d=o.bottom)!==null&&d!==void 0?d:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var kt="Sortable"+new Date().getTime();function o0(){var t=[],r;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(a){if(!(de(a,"display")==="none"||a===le.ghost)){t.push({target:a,rect:qe(a)});var i=tr({},t[t.length-1].rect);if(a.thisAnimationDuration){var l=an(a,!0);l&&(i.top-=l.f,i.left-=l.e)}a.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(t0(t,{target:o}),1)},animateAll:function(o){var a=this;if(!this.options.animation){clearTimeout(r),typeof o=="function"&&o();return}var i=!1,l=0;t.forEach(function(s){var d=0,c=s.target,f=c.fromRect,u=qe(c),p=c.prevFromRect,h=c.prevToRect,m=s.rect,y=an(c,!0);y&&(u.top-=y.f,u.left-=y.e),c.toRect=u,c.thisAnimationDuration&&yi(p,u)&&!yi(f,u)&&(m.top-u.top)/(m.left-u.left)===(f.top-u.top)/(f.left-u.left)&&(d=i0(m,p,h,a.options)),yi(u,f)||(c.prevFromRect=f,c.prevToRect=u,d||(d=a.options.animation),a.animate(c,m,u,d)),d&&(i=!0,l=Math.max(l,d),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},d),c.thisAnimationDuration=d)}),clearTimeout(r),i?r=setTimeout(function(){typeof o=="function"&&o()},l):typeof o=="function"&&o(),t=[]},animate:function(o,a,i,l){if(l){de(o,"transition",""),de(o,"transform","");var s=an(this.el),d=s&&s.a,c=s&&s.d,f=(a.left-i.left)/(d||1),u=(a.top-i.top)/(c||1);o.animatingX=!!f,o.animatingY=!!u,de(o,"transform","translate3d("+f+"px,"+u+"px,0)"),this.forRepaintDummy=a0(o),de(o,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),de(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){de(o,"transition",""),de(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},l)}}}}function a0(t){return t.offsetWidth}function i0(t,r,n,o){return Math.sqrt(Math.pow(r.top-t.top,2)+Math.pow(r.left-t.left,2))/Math.sqrt(Math.pow(r.top-n.top,2)+Math.pow(r.left-n.left,2))*o.animation}var sn=[],bi={initializeByDefault:!0},Wn={mount:function(r){for(var n in bi)bi.hasOwnProperty(n)&&!(n in r)&&(r[n]=bi[n]);sn.forEach(function(o){if(o.pluginName===r.pluginName)throw"Sortable: Cannot mount plugin ".concat(r.pluginName," more than once")}),sn.push(r)},pluginEvent:function(r,n,o){var a=this;this.eventCanceled=!1,o.cancel=function(){a.eventCanceled=!0};var i=r+"Global";sn.forEach(function(l){n[l.pluginName]&&(n[l.pluginName][i]&&n[l.pluginName][i](tr({sortable:n},o)),n.options[l.pluginName]&&n[l.pluginName][r]&&n[l.pluginName][r](tr({sortable:n},o)))})},initializePlugins:function(r,n,o,a){sn.forEach(function(s){var d=s.pluginName;if(!(!r.options[d]&&!s.initializeByDefault)){var c=new s(r,n,r.options);c.sortable=r,c.options=r.options,r[d]=c,dr(o,c.defaults)}});for(var i in r.options)if(r.options.hasOwnProperty(i)){var l=this.modifyOption(r,i,r.options[i]);typeof l<"u"&&(r.options[i]=l)}},getEventProperties:function(r,n){var o={};return sn.forEach(function(a){typeof a.eventProperties=="function"&&dr(o,a.eventProperties.call(n[a.pluginName],r))}),o},modifyOption:function(r,n,o){var a;return sn.forEach(function(i){r[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(a=i.optionListeners[n].call(r[i.pluginName],o))}),a}};function l0(t){var r=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,i=t.cloneEl,l=t.toEl,s=t.fromEl,d=t.oldIndex,c=t.newIndex,f=t.oldDraggableIndex,u=t.newDraggableIndex,p=t.originalEvent,h=t.putSortable,m=t.extraEventProperties;if(r=r||n&&n[kt],!!r){var y,g=r.options,b="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ur&&!jn?y=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(o,!0,!0)),y.to=l||n,y.from=s||n,y.item=a||n,y.clone=i,y.oldIndex=d,y.newIndex=c,y.oldDraggableIndex=f,y.newDraggableIndex=u,y.originalEvent=p,y.pullMode=h?h.lastPutMode:void 0;var w=tr(tr({},m),Wn.getEventProperties(o,r));for(var _ in w)y[_]=w[_];n&&n.dispatchEvent(y),g[b]&&g[b].call(r,y)}}var s0=["evt"],bt=function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.evt,i=Zg(o,s0);Wn.pluginEvent.bind(le)(r,n,tr({dragEl:ee,parentEl:He,ghostEl:he,rootEl:Fe,nextEl:Ar,lastDownEl:Wo,cloneEl:Pe,cloneHidden:Sr,dragStarted:Hn,putSortable:ot,activeSortable:le.active,originalEvent:a,oldIndex:cn,oldDraggableIndex:Gn,newIndex:Nt,newDraggableIndex:xr,hideGhostForTarget:Zc,unhideGhostForTarget:Qc,cloneNowHidden:function(){Sr=!0},cloneNowShown:function(){Sr=!1},dispatchSortableEvent:function(s){ct({sortable:n,name:s,originalEvent:a})}},i))};function ct(t){l0(tr({putSortable:ot,cloneEl:Pe,targetEl:ee,rootEl:Fe,oldIndex:cn,oldDraggableIndex:Gn,newIndex:Nt,newDraggableIndex:xr},t))}var ee,He,he,Fe,Ar,Wo,Pe,Sr,cn,Nt,Gn,xr,Go,ot,dn=!1,Ho=!1,Yo=[],Lr,Yt,_i,wi,Hc,Yc,Hn,fn,Yn,Xn=!1,Xo=!1,qo,it,Ci=[],Si=!1,Jo=[],Ko=typeof document<"u",Zo=zc,Xc=jn||ur?"cssFloat":"float",c0=Ko&&!Rc&&!zc&&"draggable"in document.createElement("div"),qc=function(){if(Ko){if(ur)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Jc=function(r,n){var o=de(r),a=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=ln(r,0,n),l=ln(r,1,n),s=i&&de(i),d=l&&de(l),c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+qe(i).width,f=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+qe(l).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var u=s.float==="left"?"left":"right";return l&&(d.clear==="both"||d.clear===u)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||c>=a&&o[Xc]==="none"||l&&o[Xc]==="none"&&c+f>a)?"vertical":"horizontal"},d0=function(r,n,o){var a=o?r.left:r.top,i=o?r.right:r.bottom,l=o?r.width:r.height,s=o?n.left:n.top,d=o?n.right:n.bottom,c=o?n.width:n.height;return a===s||i===d||a+l/2===s+c/2},f0=function(r,n){var o;return Yo.some(function(a){var i=a[kt].options.emptyInsertThreshold;if(!(!i||gi(a))){var l=qe(a),s=r>=l.left-i&&r<=l.right+i,d=n>=l.top-i&&n<=l.bottom+i;if(s&&d)return o=a}}),o},Kc=function(r){function n(i,l){return function(s,d,c,f){var u=s.options.group.name&&d.options.group.name&&s.options.group.name===d.options.group.name;if(i==null&&(l||u))return!0;if(i==null||i===!1)return!1;if(l&&i==="clone")return i;if(typeof i=="function")return n(i(s,d,c,f),l)(s,d,c,f);var p=(l?s:d).options.group.name;return i===!0||typeof i=="string"&&i===p||i.join&&i.indexOf(p)>-1}}var o={},a=r.group;(!a||Po(a)!="object")&&(a={name:a}),o.name=a.name,o.checkPull=n(a.pull,!0),o.checkPut=n(a.put),o.revertClone=a.revertClone,r.group=o},Zc=function(){!qc&&he&&de(he,"display","none")},Qc=function(){!qc&&he&&de(he,"display","")};Ko&&!Rc&&document.addEventListener("click",function(t){if(Ho)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ho=!1,!1},!0);var Fr=function(r){if(ee){r=r.touches?r.touches[0]:r;var n=f0(r.clientX,r.clientY);if(n){var o={};for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[kt]._onDragOver(o)}}},u0=function(r){ee&&ee.parentNode[kt]._isOutsideThisEl(r.target)};function le(t,r){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=r=dr({},r),t[kt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Jc(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,s){l.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:le.supportPointer!==!1&&"PointerEvent"in window&&!Pn,emptyInsertThreshold:5};Wn.initializePlugins(this,t,n);for(var o in n)!(o in r)&&(r[o]=n[o]);Kc(r);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=r.forceFallback?!1:c0,this.nativeDraggable&&(this.options.touchStartThreshold=1),r.supportPointer?$e(t,"pointerdown",this._onTapStart):($e(t,"mousedown",this._onTapStart),$e(t,"touchstart",this._onTapStart)),this.nativeDraggable&&($e(t,"dragover",this),$e(t,"dragenter",this)),Yo.push(this.el),r.store&&r.store.get&&this.sort(r.store.get(this)||[]),dr(this,o0())}le.prototype={constructor:le,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(fn=null)},_getDirection:function(r,n){return typeof this.options.direction=="function"?this.options.direction.call(this,r,n,ee):this.options.direction},_onTapStart:function(r){if(r.cancelable){var n=this,o=this.el,a=this.options,i=a.preventOnFilter,l=r.type,s=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,d=(s||r).target,c=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||d,f=a.filter;if(w0(o),!ee&&!(/mousedown|pointerdown/.test(l)&&r.button!==0||a.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Pn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=Ht(d,a.draggable,o,!1),!(d&&d.animated)&&Wo!==d)){if(cn=Mt(d),Gn=Mt(d,a.draggable),typeof f=="function"){if(f.call(this,r,d,this)){ct({sortable:n,rootEl:c,name:"filter",targetEl:d,toEl:o,fromEl:o}),bt("filter",n,{evt:r}),i&&r.cancelable&&r.preventDefault();return}}else if(f&&(f=f.split(",").some(function(u){if(u=Ht(c,u.trim(),o,!1),u)return ct({sortable:n,rootEl:u,name:"filter",targetEl:d,fromEl:o,toEl:o}),bt("filter",n,{evt:r}),!0}),f)){i&&r.cancelable&&r.preventDefault();return}a.handle&&!Ht(c,a.handle,o,!1)||this._prepareDragStart(r,s,d)}}},_prepareDragStart:function(r,n,o){var a=this,i=a.el,l=a.options,s=i.ownerDocument,d;if(o&&!ee&&o.parentNode===i){var c=qe(o);if(Fe=i,ee=o,He=ee.parentNode,Ar=ee.nextSibling,Wo=o,Go=l.group,le.dragged=ee,Lr={target:ee,clientX:(n||r).clientX,clientY:(n||r).clientY},Hc=Lr.clientX-c.left,Yc=Lr.clientY-c.top,this._lastX=(n||r).clientX,this._lastY=(n||r).clientY,ee.style["will-change"]="all",d=function(){if(bt("delayEnded",a,{evt:r}),le.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Ic&&a.nativeDraggable&&(ee.draggable=!0),a._triggerDragStart(r,n),ct({sortable:a,name:"choose",originalEvent:r}),Vt(ee,l.chosenClass,!0)},l.ignore.split(",").forEach(function(f){Lc(ee,f.trim(),xi)}),$e(s,"dragover",Fr),$e(s,"mousemove",Fr),$e(s,"touchmove",Fr),$e(s,"mouseup",a._onDrop),$e(s,"touchend",a._onDrop),$e(s,"touchcancel",a._onDrop),Ic&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ee.draggable=!0),bt("delayStart",this,{evt:r}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(jn||ur))){if(le.eventCanceled){this._onDrop();return}$e(s,"mouseup",a._disableDelayedDrag),$e(s,"touchend",a._disableDelayedDrag),$e(s,"touchcancel",a._disableDelayedDrag),$e(s,"mousemove",a._delayedDragTouchMoveHandler),$e(s,"touchmove",a._delayedDragTouchMoveHandler),l.supportPointer&&$e(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(d,l.delay)}else d()}},_delayedDragTouchMoveHandler:function(r){var n=r.touches?r.touches[0]:r;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ee&&xi(ee),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;Se(r,"mouseup",this._disableDelayedDrag),Se(r,"touchend",this._disableDelayedDrag),Se(r,"touchcancel",this._disableDelayedDrag),Se(r,"mousemove",this._delayedDragTouchMoveHandler),Se(r,"touchmove",this._delayedDragTouchMoveHandler),Se(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,n){n=n||r.pointerType=="touch"&&r,!this.nativeDraggable||n?this.options.supportPointer?$e(document,"pointermove",this._onTouchMove):n?$e(document,"touchmove",this._onTouchMove):$e(document,"mousemove",this._onTouchMove):($e(ee,"dragend",this),$e(Fe,"dragstart",this._onDragStart));try{document.selection?ea(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,n){if(dn=!1,Fe&&ee){bt("dragStarted",this,{evt:n}),this.nativeDraggable&&$e(document,"dragover",u0);var o=this.options;!r&&Vt(ee,o.dragClass,!1),Vt(ee,o.ghostClass,!0),le.active=this,r&&this._appendGhost(),ct({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Yt){this._lastX=Yt.clientX,this._lastY=Yt.clientY,Zc();for(var r=document.elementFromPoint(Yt.clientX,Yt.clientY),n=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(Yt.clientX,Yt.clientY),r!==n);)n=r;if(ee.parentNode[kt]._isOutsideThisEl(r),n)do{if(n[kt]){var o=void 0;if(o=n[kt]._onDragOver({clientX:Yt.clientX,clientY:Yt.clientY,target:r,rootEl:n}),o&&!this.options.dragoverBubble)break}r=n}while(n=n.parentNode);Qc()}},_onTouchMove:function(r){if(Lr){var n=this.options,o=n.fallbackTolerance,a=n.fallbackOffset,i=r.touches?r.touches[0]:r,l=he&&an(he,!0),s=he&&l&&l.a,d=he&&l&&l.d,c=Zo&&it&&jc(it),f=(i.clientX-Lr.clientX+a.x)/(s||1)+(c?c[0]-Ci[0]:0)/(s||1),u=(i.clientY-Lr.clientY+a.y)/(d||1)+(c?c[1]-Ci[1]:0)/(d||1);if(!le.active&&!dn){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(r,!0)}if(he){l?(l.e+=f-(_i||0),l.f+=u-(wi||0)):l={a:1,b:0,c:0,d:1,e:f,f:u};var p="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");de(he,"webkitTransform",p),de(he,"mozTransform",p),de(he,"msTransform",p),de(he,"transform",p),_i=f,wi=u,Yt=i}r.cancelable&&r.preventDefault()}},_appendGhost:function(){if(!he){var r=this.options.fallbackOnBody?document.body:Fe,n=qe(ee,!0,Zo,!0,r),o=this.options;if(Zo){for(it=r;de(it,"position")==="static"&&de(it,"transform")==="none"&&it!==document;)it=it.parentNode;it!==document.body&&it!==document.documentElement?(it===document&&(it=rr()),n.top+=it.scrollTop,n.left+=it.scrollLeft):it=rr(),Ci=jc(it)}he=ee.cloneNode(!0),Vt(he,o.ghostClass,!1),Vt(he,o.fallbackClass,!0),Vt(he,o.dragClass,!0),de(he,"transition",""),de(he,"transform",""),de(he,"box-sizing","border-box"),de(he,"margin",0),de(he,"top",n.top),de(he,"left",n.left),de(he,"width",n.width),de(he,"height",n.height),de(he,"opacity","0.8"),de(he,"position",Zo?"absolute":"fixed"),de(he,"zIndex","100000"),de(he,"pointerEvents","none"),le.ghost=he,r.appendChild(he),de(he,"transform-origin",Hc/parseInt(he.style.width)*100+"% "+Yc/parseInt(he.style.height)*100+"%")}},_onDragStart:function(r,n){var o=this,a=r.dataTransfer,i=o.options;if(bt("dragStart",this,{evt:r}),le.eventCanceled){this._onDrop();return}bt("setupClone",this),le.eventCanceled||(Pe=Wc(ee),Pe.removeAttribute("id"),Pe.draggable=!1,Pe.style["will-change"]="",this._hideClone(),Vt(Pe,this.options.chosenClass,!1),le.clone=Pe),o.cloneId=ea(function(){bt("clone",o),!le.eventCanceled&&(o.options.removeCloneOnHide||Fe.insertBefore(Pe,ee),o._hideClone(),ct({sortable:o,name:"clone"}))}),!n&&Vt(ee,i.dragClass,!0),n?(Ho=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Se(document,"mouseup",o._onDrop),Se(document,"touchend",o._onDrop),Se(document,"touchcancel",o._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(o,a,ee)),$e(document,"drop",o),de(ee,"transform","translateZ(0)")),dn=!0,o._dragStartId=ea(o._dragStarted.bind(o,n,r)),$e(document,"selectstart",o),Hn=!0,Pn&&de(document.body,"user-select","none")},_onDragOver:function(r){var n=this.el,o=r.target,a,i,l,s=this.options,d=s.group,c=le.active,f=Go===d,u=s.sort,p=ot||c,h,m=this,y=!1;if(Si)return;function g(z,M){bt(z,m,tr({evt:r,isOwner:f,axis:h?"vertical":"horizontal",revert:l,dragRect:a,targetRect:i,canSort:u,fromSortable:p,target:o,completed:w,onMove:function(F,G){return Qo(Fe,n,ee,a,F,qe(F),r,G)},changed:_},M))}function b(){g("dragOverAnimationCapture"),m.captureAnimationState(),m!==p&&p.captureAnimationState()}function w(z){return g("dragOverCompleted",{insertion:z}),z&&(f?c._hideClone():c._showClone(m),m!==p&&(Vt(ee,ot?ot.options.ghostClass:c.options.ghostClass,!1),Vt(ee,s.ghostClass,!0)),ot!==m&&m!==le.active?ot=m:m===le.active&&ot&&(ot=null),p===m&&(m._ignoreWhileAnimating=o),m.animateAll(function(){g("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(o===ee&&!ee.animated||o===n&&!o.animated)&&(fn=null),!s.dragoverBubble&&!r.rootEl&&o!==document&&(ee.parentNode[kt]._isOutsideThisEl(r.target),!z&&Fr(r)),!s.dragoverBubble&&r.stopPropagation&&r.stopPropagation(),y=!0}function _(){Nt=Mt(ee),xr=Mt(ee,s.draggable),ct({sortable:m,name:"change",toEl:n,newIndex:Nt,newDraggableIndex:xr,originalEvent:r})}if(r.preventDefault!==void 0&&r.cancelable&&r.preventDefault(),o=Ht(o,s.draggable,n,!0),g("dragOver"),le.eventCanceled)return y;if(ee.contains(r.target)||o.animated&&o.animatingX&&o.animatingY||m._ignoreWhileAnimating===o)return w(!1);if(Ho=!1,c&&!s.disabled&&(f?u||(l=He!==Fe):ot===this||(this.lastPutMode=Go.checkPull(this,c,ee,r))&&d.checkPut(this,c,ee,r))){if(h=this._getDirection(r,o)==="vertical",a=qe(ee),g("dragOverValid"),le.eventCanceled)return y;if(l)return He=Fe,b(),this._hideClone(),g("revert"),le.eventCanceled||(Ar?Fe.insertBefore(ee,Ar):Fe.appendChild(ee)),w(!0);var C=gi(n,s.draggable);if(!C||g0(r,h,this)&&!C.animated){if(C===ee)return w(!1);if(C&&n===r.target&&(o=C),o&&(i=qe(o)),Qo(Fe,n,ee,a,o,i,r,!!o)!==!1)return b(),C&&C.nextSibling?n.insertBefore(ee,C.nextSibling):n.appendChild(ee),He=n,_(),w(!0)}else if(C&&m0(r,h,this)){var S=ln(n,0,s,!0);if(S===ee)return w(!1);if(o=S,i=qe(o),Qo(Fe,n,ee,a,o,i,r,!1)!==!1)return b(),n.insertBefore(ee,S),He=n,_(),w(!0)}else if(o.parentNode===n){i=qe(o);var x=0,v,V=ee.parentNode!==n,$=!d0(ee.animated&&ee.toRect||a,o.animated&&o.toRect||i,h),B=h?"top":"left",R=Fc(o,"top","top")||Fc(ee,"top","top"),T=R?R.scrollTop:void 0;fn!==o&&(v=i[B],Xn=!1,Xo=!$&&s.invertSwap||V),x=y0(r,o,i,h,$?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Xo,fn===o);var k;if(x!==0){var O=Mt(ee);do O-=x,k=He.children[O];while(k&&(de(k,"display")==="none"||k===he))}if(x===0||k===o)return w(!1);fn=o,Yn=x;var N=o.nextElementSibling,D=!1;D=x===1;var I=Qo(Fe,n,ee,a,o,i,r,D);if(I!==!1)return(I===1||I===-1)&&(D=I===1),Si=!0,setTimeout(h0,30),b(),D&&!N?n.appendChild(ee):o.parentNode.insertBefore(ee,D?N:o),R&&Uc(R,0,T-R.scrollTop),He=ee.parentNode,v!==void 0&&!Xo&&(qo=Math.abs(v-qe(o)[B])),_(),w(!0)}if(n.contains(ee))return w(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Se(document,"mousemove",this._onTouchMove),Se(document,"touchmove",this._onTouchMove),Se(document,"pointermove",this._onTouchMove),Se(document,"dragover",Fr),Se(document,"mousemove",Fr),Se(document,"touchmove",Fr)},_offUpEvents:function(){var r=this.el.ownerDocument;Se(r,"mouseup",this._onDrop),Se(r,"touchend",this._onDrop),Se(r,"pointerup",this._onDrop),Se(r,"touchcancel",this._onDrop),Se(document,"selectstart",this)},_onDrop:function(r){var n=this.el,o=this.options;if(Nt=Mt(ee),xr=Mt(ee,o.draggable),bt("drop",this,{evt:r}),He=ee&&ee.parentNode,Nt=Mt(ee),xr=Mt(ee,o.draggable),le.eventCanceled){this._nulling();return}dn=!1,Xo=!1,Xn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),vi(this.cloneId),vi(this._dragStartId),this.nativeDraggable&&(Se(document,"drop",this),Se(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pn&&de(document.body,"user-select",""),de(ee,"transform",""),r&&(Hn&&(r.cancelable&&r.preventDefault(),!o.dropBubble&&r.stopPropagation()),he&&he.parentNode&&he.parentNode.removeChild(he),(Fe===He||ot&&ot.lastPutMode!=="clone")&&Pe&&Pe.parentNode&&Pe.parentNode.removeChild(Pe),ee&&(this.nativeDraggable&&Se(ee,"dragend",this),xi(ee),ee.style["will-change"]="",Hn&&!dn&&Vt(ee,ot?ot.options.ghostClass:this.options.ghostClass,!1),Vt(ee,this.options.chosenClass,!1),ct({sortable:this,name:"unchoose",toEl:He,newIndex:null,newDraggableIndex:null,originalEvent:r}),Fe!==He?(Nt>=0&&(ct({rootEl:He,name:"add",toEl:He,fromEl:Fe,originalEvent:r}),ct({sortable:this,name:"remove",toEl:He,originalEvent:r}),ct({rootEl:He,name:"sort",toEl:He,fromEl:Fe,originalEvent:r}),ct({sortable:this,name:"sort",toEl:He,originalEvent:r})),ot&&ot.save()):Nt!==cn&&Nt>=0&&(ct({sortable:this,name:"update",toEl:He,originalEvent:r}),ct({sortable:this,name:"sort",toEl:He,originalEvent:r})),le.active&&((Nt==null||Nt===-1)&&(Nt=cn,xr=Gn),ct({sortable:this,name:"end",toEl:He,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){bt("nulling",this),Fe=ee=He=he=Ar=Pe=Wo=Sr=Lr=Yt=Hn=Nt=xr=cn=Gn=fn=Yn=ot=Go=le.dragged=le.ghost=le.clone=le.active=null,Jo.forEach(function(r){r.checked=!0}),Jo.length=_i=wi=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":ee&&(this._onDragOver(r),p0(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],n,o=this.el.children,a=0,i=o.length,l=this.options;a<i;a++)n=o[a],Ht(n,l.draggable,this.el,!1)&&r.push(n.getAttribute(l.dataIdAttr)||_0(n));return r},sort:function(r,n){var o={},a=this.el;this.toArray().forEach(function(i,l){var s=a.children[l];Ht(s,this.options.draggable,a,!1)&&(o[i]=s)},this),n&&this.captureAnimationState(),r.forEach(function(i){o[i]&&(a.removeChild(o[i]),a.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var r=this.options.store;r&&r.set&&r.set(this)},closest:function(r,n){return Ht(r,n||this.options.draggable,this.el,!1)},option:function(r,n){var o=this.options;if(n===void 0)return o[r];var a=Wn.modifyOption(this,r,n);typeof a<"u"?o[r]=a:o[r]=n,r==="group"&&Kc(o)},destroy:function(){bt("destroy",this);var r=this.el;r[kt]=null,Se(r,"mousedown",this._onTapStart),Se(r,"touchstart",this._onTapStart),Se(r,"pointerdown",this._onTapStart),this.nativeDraggable&&(Se(r,"dragover",this),Se(r,"dragenter",this)),Array.prototype.forEach.call(r.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Yo.splice(Yo.indexOf(this.el),1),this.el=r=null},_hideClone:function(){if(!Sr){if(bt("hideClone",this),le.eventCanceled)return;de(Pe,"display","none"),this.options.removeCloneOnHide&&Pe.parentNode&&Pe.parentNode.removeChild(Pe),Sr=!0}},_showClone:function(r){if(r.lastPutMode!=="clone"){this._hideClone();return}if(Sr){if(bt("showClone",this),le.eventCanceled)return;ee.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(Pe,ee):Ar?Fe.insertBefore(Pe,Ar):Fe.appendChild(Pe),this.options.group.revertClone&&this.animate(ee,Pe),de(Pe,"display",""),Sr=!1}}};function p0(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Qo(t,r,n,o,a,i,l,s){var d,c=t[kt],f=c.options.onMove,u;return window.CustomEvent&&!ur&&!jn?d=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(d=document.createEvent("Event"),d.initEvent("move",!0,!0)),d.to=r,d.from=t,d.dragged=n,d.draggedRect=o,d.related=a||r,d.relatedRect=i||qe(r),d.willInsertAfter=s,d.originalEvent=l,t.dispatchEvent(d),f&&(u=f.call(c,d,l)),u}function xi(t){t.draggable=!1}function h0(){Si=!1}function m0(t,r,n){var o=qe(ln(n.el,0,n.options,!0)),a=Gc(n.el,n.options,he),i=10;return r?t.clientX<a.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<a.top-i||t.clientY<o.bottom&&t.clientX<o.left}function g0(t,r,n){var o=qe(gi(n.el,n.options.draggable)),a=Gc(n.el,n.options,he),i=10;return r?t.clientX>a.right+i||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+i||t.clientX>o.right&&t.clientY>o.top}function y0(t,r,n,o,a,i,l,s){var d=o?t.clientY:t.clientX,c=o?n.height:n.width,f=o?n.top:n.left,u=o?n.bottom:n.right,p=!1;if(!l){if(s&&qo<c*a){if(!Xn&&(Yn===1?d>f+c*i/2:d<u-c*i/2)&&(Xn=!0),Xn)p=!0;else if(Yn===1?d<f+qo:d>u-qo)return-Yn}else if(d>f+c*(1-a)/2&&d<u-c*(1-a)/2)return b0(r)}return p=p||l,p&&(d<f+c*i/2||d>u-c*i/2)?d>f+c/2?1:-1:0}function b0(t){return Mt(ee)<Mt(t)?1:-1}function _0(t){for(var r=t.tagName+t.className+t.src+t.href+t.textContent,n=r.length,o=0;n--;)o+=r.charCodeAt(n);return o.toString(36)}function w0(t){Jo.length=0;for(var r=t.getElementsByTagName("input"),n=r.length;n--;){var o=r[n];o.checked&&Jo.push(o)}}function ea(t){return setTimeout(t,0)}function vi(t){return clearTimeout(t)}Ko&&$e(document,"touchmove",function(t){(le.active||dn)&&t.cancelable&&t.preventDefault()}),le.utils={on:$e,off:Se,css:de,find:Lc,is:function(r,n){return!!Ht(r,n,r,!1)},extend:r0,throttle:Pc,closest:Ht,toggleClass:Vt,clone:Wc,index:Mt,nextTick:ea,cancelNextTick:vi,detectDirection:Jc,getChild:ln},le.get=function(t){return t[kt]},le.mount=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r[0].constructor===Array&&(r=r[0]),r.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(le.utils=tr(tr({},le.utils),o.utils)),Wn.mount(o)})},le.create=function(t,r){return new le(t,r)},le.version=Qg;var Je=[],qn,Ei,Vi=!1,ki,Ni,ta,Jn;function C0(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?$e(document,"dragover",this._handleAutoScroll):this.options.supportPointer?$e(document,"pointermove",this._handleFallbackAutoScroll):o.touches?$e(document,"touchmove",this._handleFallbackAutoScroll):$e(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Se(document,"dragover",this._handleAutoScroll):(Se(document,"pointermove",this._handleFallbackAutoScroll),Se(document,"touchmove",this._handleFallbackAutoScroll),Se(document,"mousemove",this._handleFallbackAutoScroll)),ed(),ra(),n0()},nulling:function(){ta=Ei=qn=Vi=Jn=ki=Ni=null,Je.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var a=this,i=(n.touches?n.touches[0]:n).clientX,l=(n.touches?n.touches[0]:n).clientY,s=document.elementFromPoint(i,l);if(ta=n,o||this.options.forceAutoScrollFallback||jn||ur||Pn){$i(n,this.options,s,o);var d=Cr(s,!0);Vi&&(!Jn||i!==ki||l!==Ni)&&(Jn&&ed(),Jn=setInterval(function(){var c=Cr(document.elementFromPoint(i,l),!0);c!==d&&(d=c,ra()),$i(n,a.options,c,o)},10),ki=i,Ni=l)}else{if(!this.options.bubbleScroll||Cr(s,!0)===rr()){ra();return}$i(n,this.options,Cr(s,!1),!1)}}},dr(t,{pluginName:"scroll",initializeByDefault:!0})}function ra(){Je.forEach(function(t){clearInterval(t.pid)}),Je=[]}function ed(){clearInterval(Jn)}var $i=Pc(function(t,r,n,o){if(r.scroll){var a=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,l=r.scrollSensitivity,s=r.scrollSpeed,d=rr(),c=!1,f;Ei!==n&&(Ei=n,ra(),qn=r.scroll,f=r.scrollFn,qn===!0&&(qn=Cr(n,!0)));var u=0,p=qn;do{var h=p,m=qe(h),y=m.top,g=m.bottom,b=m.left,w=m.right,_=m.width,C=m.height,S=void 0,x=void 0,v=h.scrollWidth,V=h.scrollHeight,$=de(h),B=h.scrollLeft,R=h.scrollTop;h===d?(S=_<v&&($.overflowX==="auto"||$.overflowX==="scroll"||$.overflowX==="visible"),x=C<V&&($.overflowY==="auto"||$.overflowY==="scroll"||$.overflowY==="visible")):(S=_<v&&($.overflowX==="auto"||$.overflowX==="scroll"),x=C<V&&($.overflowY==="auto"||$.overflowY==="scroll"));var T=S&&(Math.abs(w-a)<=l&&B+_<v)-(Math.abs(b-a)<=l&&!!B),k=x&&(Math.abs(g-i)<=l&&R+C<V)-(Math.abs(y-i)<=l&&!!R);if(!Je[u])for(var O=0;O<=u;O++)Je[O]||(Je[O]={});(Je[u].vx!=T||Je[u].vy!=k||Je[u].el!==h)&&(Je[u].el=h,Je[u].vx=T,Je[u].vy=k,clearInterval(Je[u].pid),(T!=0||k!=0)&&(c=!0,Je[u].pid=setInterval((function(){o&&this.layer===0&&le.active._onTouchMove(ta);var N=Je[this.layer].vy?Je[this.layer].vy*s:0,D=Je[this.layer].vx?Je[this.layer].vx*s:0;typeof f=="function"&&f.call(le.dragged.parentNode[kt],D,N,t,ta,Je[this.layer].el)!=="continue"||Uc(Je[this.layer].el,D,N)}).bind({layer:u}),24))),u++}while(r.bubbleScroll&&p!==d&&(p=Cr(p,!1)));Vi=c}},30),td=function(r){var n=r.originalEvent,o=r.putSortable,a=r.dragEl,i=r.activeSortable,l=r.dispatchSortableEvent,s=r.hideGhostForTarget,d=r.unhideGhostForTarget;if(n){var c=o||i;s();var f=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,u=document.elementFromPoint(f.clientX,f.clientY);d(),c&&!c.el.contains(u)&&(l("spill"),this.onSpill({dragEl:a,putSortable:o}))}};function Di(){}Di.prototype={startIndex:null,dragStart:function(r){var n=r.oldDraggableIndex;this.startIndex=n},onSpill:function(r){var n=r.dragEl,o=r.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var a=ln(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(n,a):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:td},dr(Di,{pluginName:"revertOnSpill"});function Bi(){}Bi.prototype={onSpill:function(r){var n=r.dragEl,o=r.putSortable,a=o||this.sortable;a.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),a.animateAll()},drop:td},dr(Bi,{pluginName:"removeOnSpill"}),le.mount(new C0),le.mount(Bi,Di);const na=t=>document.getElementById(t.id),rd=t=>{let r=`translate(${t.x}px, ${t.y}px)`;return{width:t.w+"px",height:t.h+"px",zIndex:t.z,transform:r}},nd=t=>(e.pushScopeId("data-v-dbbe6fca"),t=t(),e.popScopeId(),t),S0=nd(()=>e.createElementVNode("div",{class:"flex h-10 items-center p-2",style:{"background-color":"var(--design-bg-color3)"}},[e.createElementVNode("span",{class:"w-1 h-4 bg-color-primary mr-2 rounded-sm"}),e.createTextVNode(" 图层 ")],-1)),x0={class:"flex-1 overflow-hidden"},v0={id:"sortableLayer"},E0=["onMouseenter","onClick"],V0=nd(()=>e.createElementVNode("i",{class:"ri-drag-move-2-line text-xl mr-2 ml-2 sortable-handle cursor-move"},null,-1)),k0=["title"],N0=e.defineComponent({__name:"layer",setup(t){const r=Re();e.getCurrentInstance();const n=e.ref(null),o=e.computed(()=>r.targetsWidget.map(i=>i.id));e.nextTick(()=>{n.value=new le(document.getElementById("sortableLayer"),{handle:".sortable-handle",preventOnFilter:!0,onEnd({newIndex:i,oldIndex:l}){const s=r.widgetConfg.list,d=s.splice(l,1)[0];s.splice(i,0,d),s.reverse().forEach((c,f)=>{c.z=f}),r.sortWidgetList()}})});const a=i=>{const l=na(i);r.setTargetWidget([l])};return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[S0,e.createElementVNode("div",x0,[e.createVNode(e.unref(E.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",v0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).getWidgetList,s=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item h-10 flex items-center pl-2 pr-2",{active:e.unref(o).includes(s.id),"hover-item":e.unref(r).widgetHoverIds.includes(s.id)}]),key:s.id,onMouseenter:e.withModifiers(d=>e.unref(r).setWidgetHoverIds([s.id]),["stop"]),onMouseleave:l[0]||(l[0]=e.withModifiers(d=>e.unref(r).setWidgetHoverIds([]),["stop"])),onClick:e.withModifiers(d=>a(s),["stop"])},[V0,e.createElementVNode("div",{class:"text-xs whitespace-nowrap overflow-hidden text-ellipsis",title:s.name},e.toDisplayString(s.name),9,k0)],42,E0))),128))])]),_:1})])],64))}}),qI="",$0=Be(N0,[["__scopeId","data-v-dbbe6fca"]]),ke={root:{}},D0={...ke,customize:{decorationColor1:"#1296db",decorationColor2:"#0de7c2"}},B0=Object.freeze(Object.defineProperty({__proto__:null,default:D0},Symbol.toStringTag,{value:"Module"})),T0={...ke,customize:{decorationColor1:"#00c2ff",decorationColor2:"rgba(0, 194, 255, 0.3)"}},O0=Object.freeze(Object.defineProperty({__proto__:null,default:T0},Symbol.toStringTag,{value:"Module"})),I0={...ke,customize:{decorationColor1:"#1a98fc",decorationColor2:"#2cf7fe"}},z0=Object.freeze(Object.defineProperty({__proto__:null,default:I0},Symbol.toStringTag,{value:"Module"})),R0={...ke,customize:{decorationColor1:null,decorationColor2:null,scanDuration:3,haloDuration:2}},M0=Object.freeze(Object.defineProperty({__proto__:null,default:R0},Symbol.toStringTag,{value:"Module"})),A0={...ke,customize:{decorationColor1:"#1296db",decorationColor2:"#0de7c2",duration:6,reverse:!1}},L0=Object.freeze(Object.defineProperty({__proto__:null,default:A0},Symbol.toStringTag,{value:"Module"})),F0={...ke,customize:{decorationColor1:"#7acaec",decorationColor2:"#000"}},j0=Object.freeze(Object.defineProperty({__proto__:null,default:F0},Symbol.toStringTag,{value:"Module"})),P0={...ke,customize:{decorationColor1:"rgba(255, 255, 255, 0.3)",decorationColor2:"rgba(255, 255, 255, 0.3)",duration:3,reverse:!1}},U0=Object.freeze(Object.defineProperty({__proto__:null,default:P0},Symbol.toStringTag,{value:"Module"})),W0={...ke,customize:{decorationColor1:"#3f96a5",decorationColor2:"#3f96a5",duration:1.2}},G0=Object.freeze(Object.defineProperty({__proto__:null,default:W0},Symbol.toStringTag,{value:"Module"})),H0={...ke,customize:{decorationColor1:"#7acaec",decorationColor2:"#7acaec"}},Y0=Object.freeze(Object.defineProperty({__proto__:null,default:H0},Symbol.toStringTag,{value:"Module"})),X0={...ke,customize:{decorationColor1:"#3f96a5",decorationColor2:"#3f96a5",reverse:!1}},q0=Object.freeze(Object.defineProperty({__proto__:null,default:X0},Symbol.toStringTag,{value:"Module"})),J0={...ke,customize:{decorationColor1:"rgba(3, 166, 224, 0.8)",decorationColor2:"rgba(3, 166, 224, 0.5)",duration:3}},K0=Object.assign({"../decoration/decoration1/setting.ts":B0,"../decoration/decoration10/setting.ts":O0,"../decoration/decoration11/setting.ts":z0,"../decoration/decoration12/setting.ts":M0,"../decoration/decoration2/setting.ts":L0,"../decoration/decoration3/setting.ts":j0,"../decoration/decoration4/setting.ts":U0,"../decoration/decoration5/setting.ts":G0,"../decoration/decoration6/setting.ts":Y0,"../decoration/decoration8/setting.ts":q0,"../decoration/decoration9/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:J0},Symbol.toStringTag,{value:"Module"}))}),Ti=[];for(const[t,r]of Object.entries(K0)){const n=t.split("/")[2];let o={};switch(n){case"decoration1":o={name:"装饰一",w:350,h:30};break;case"decoration2":o={name:"装饰二(可旋转)",w:350,h:20};break;case"decoration3":o={name:"装饰三",w:350,h:30};break;case"decoration4":o={name:"装饰四",w:30,h:320};break;case"decoration5":o={name:"装饰五",w:350,h:50};break;case"decoration6":o={name:"装饰六",w:350,h:50};break;case"decoration8":o={name:"装饰七(可旋转)",w:350,h:50};break;case"decoration9":o={name:"装饰八",w:150,h:150};break;case"decoration10":o={name:"装饰九",w:350,h:50};break;case"decoration11":o={name:"装饰十",w:350,h:100};break;case"decoration12":o={name:"装饰十一",w:150,h:150};break}Ti.push({...o,type:n,...r.default})}Ti.sort((t,r)=>Number(t.type.replace("decoration",""))-Number(r.type.replace("decoration","")));const Z0={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},Q0=Object.freeze(Object.defineProperty({__proto__:null,default:Z0},Symbol.toStringTag,{value:"Module"})),ey={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ty=Object.freeze(Object.defineProperty({__proto__:null,default:ey},Symbol.toStringTag,{value:"Module"})),ry={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",titleWidth:250,title:"我是标题"}},ny=Object.freeze(Object.defineProperty({__proto__:null,default:ry},Symbol.toStringTag,{value:"Module"})),oy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ay=Object.freeze(Object.defineProperty({__proto__:null,default:oy},Symbol.toStringTag,{value:"Module"})),iy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ly=Object.freeze(Object.defineProperty({__proto__:null,default:iy},Symbol.toStringTag,{value:"Module"})),sy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},cy=Object.freeze(Object.defineProperty({__proto__:null,default:sy},Symbol.toStringTag,{value:"Module"})),dy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},fy=Object.freeze(Object.defineProperty({__proto__:null,default:dy},Symbol.toStringTag,{value:"Module"})),uy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",reverse:!1}},py=Object.freeze(Object.defineProperty({__proto__:null,default:uy},Symbol.toStringTag,{value:"Module"})),hy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",reverse:!1}},my=Object.freeze(Object.defineProperty({__proto__:null,default:hy},Symbol.toStringTag,{value:"Module"})),gy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},yy=Object.freeze(Object.defineProperty({__proto__:null,default:gy},Symbol.toStringTag,{value:"Module"})),by={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},_y=Object.freeze(Object.defineProperty({__proto__:null,default:by},Symbol.toStringTag,{value:"Module"})),wy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",duration:3,reverse:!1}},Cy=Object.freeze(Object.defineProperty({__proto__:null,default:wy},Symbol.toStringTag,{value:"Module"})),Sy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},xy=Object.assign({"../border/border1/setting.ts":Q0,"../border/border10/setting.ts":ty,"../border/border11/setting.ts":ny,"../border/border12/setting.ts":ay,"../border/border13/setting.ts":ly,"../border/border2/setting.ts":cy,"../border/border3/setting.ts":fy,"../border/border4/setting.ts":py,"../border/border5/setting.ts":my,"../border/border6/setting.ts":yy,"../border/border7/setting.ts":_y,"../border/border8/setting.ts":Cy,"../border/border9/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:Sy},Symbol.toStringTag,{value:"Module"}))}),Oi=[];for(const[t,r]of Object.entries(xy)){const n=t.split("/")[2],a={name:{border1:"边框一",border2:"边框二",border3:"边框三",border4:"边框四(可翻转)",border5:"边框五(可翻转)",border6:"边框六",border7:"边框七",border8:"边框八",border9:"边框九",border10:"边框十",border11:"边框十一",border12:"边框十二",border13:"边框十三"}[n],w:450,h:320,type:n,...r.default};Oi.push({...a})}Oi.sort((t,r)=>Number(t.type.replace("border",""))-Number(r.type.replace("border","")));const vy={...ke,customize:{gradientColor0:"#1296db",gradientColor1:"#1296db",width:2}},Ey=Object.freeze(Object.defineProperty({__proto__:null,default:vy},Symbol.toStringTag,{value:"Module"})),Vy={...ke,customize:{url:"https://cn.bing.com/"}},ky=Object.freeze(Object.defineProperty({__proto__:null,default:Vy},Symbol.toStringTag,{value:"Module"})),Ny={...ke,customize:{fit:"contain",url:"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"}},$y=Object.freeze(Object.defineProperty({__proto__:null,default:Ny},Symbol.toStringTag,{value:"Module"})),Dy={...ke,customize:{title:"1234",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},By=Object.freeze(Object.defineProperty({__proto__:null,default:Dy},Symbol.toStringTag,{value:"Module"})),Ty={...ke,customize:{colorPosition:"bottom",gradientColor0:"#1296db",gradientColor1:"#1296db",borderRadius:0}},Oy=Object.freeze(Object.defineProperty({__proto__:null,default:Ty},Symbol.toStringTag,{value:"Module"})),Iy={...ke,customize:{title:"文本数据",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},zy=Object.freeze(Object.defineProperty({__proto__:null,default:Iy},Symbol.toStringTag,{value:"Module"})),Ry={...ke,customize:{title:"1234",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},My=Object.freeze(Object.defineProperty({__proto__:null,default:Ry},Symbol.toStringTag,{value:"Module"})),Ay={...ke,customize:{gradientColor0:"#1296db",gradientColor1:"#1296db",height:2}},Ly=Object.assign({"../basic/horizontal-line/setting.ts":Ey,"../basic/iframe/setting.ts":ky,"../basic/img/setting.ts":$y,"../basic/number/setting.ts":By,"../basic/square/setting.ts":Oy,"../basic/text/setting.ts":zy,"../basic/time/setting.ts":My,"../basic/vertical-line/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:Ay},Symbol.toStringTag,{value:"Module"}))}),Ii=[];for(const[t,r]of Object.entries(Ly)){const n=t.split("/")[2];let o={};switch(n){case"square":o={name:"正方形",w:200,h:200};break;case"img":o={name:"图片",w:200,h:200};break;case"number":o={name:"数字",w:200,h:50};break;case"text":o={name:"文本",w:200,h:50};break;case"time":o={name:"当前时间",w:200,h:50};break;case"horizontal-line":o={name:"竖线",w:10,h:100};break;case"vertical-line":o={name:"横线",w:100,h:10};break;case"iframe":o={name:"iframe",w:1e3,h:500};break}Ii.push({...o,type:n,...r.default})}const od={text:1,number:2,img:3,time:4,"vertical-line":5,"horizontal-line":6,circular:7,square:8,iframe:9};Ii.sort((t,r)=>(od[t.type]??99)-(od[r.type]??99));const Fy=t=>(e.pushScopeId("data-v-6e8b9f81"),t=t(),e.popScopeId(),t),jy={class:"text-xs"},Py={class:"flex h-10 items-center p-2",style:{"background-color":"var(--design-bg-color3)"}},Uy=Fy(()=>e.createElementVNode("span",{class:"w-1 h-4 bg-color-primary mr-2 rounded-sm"},null,-1)),Wy={class:"flex-1 overflow-hidden p-2"},Gy=["onClick"],Hy=["data-type","data-id"],Yy={class:"p-1 text-xs text-ellipsis overflow-hidden whitespace-nowrap",style:{"background-color":"var(--design-bg-color4)"}},Xy={class:"flex justify-center items-center"},qy={key:0,class:"flex items-center justify-center pb-3 mt-2"},Jy=["onClick"],Ky=["data-type","data-ptype"],Zy={class:"p-1 text-xs",style:{"background-color":"var(--design-bg-color4)"}},Qy={class:"flex items-center justify-center pt-1 pb-1",style:{"background-color":"var(--design-bg-color3)"}},eb=e.defineComponent({__name:"leftPannel",setup(t){const{proxy:r}=e.getCurrentInstance(),{echartsTypeList:n}=r.$globalUtils,o=e.ref([{label:"图层",type:"layer",icon:"ri-stack-line"},{label:"基础",type:"base",icon:"ri-supabase-line",list:Ii},{label:"指标",type:"indicators",icon:"ri-database-2-line",list:[]},{label:"边框",type:"border",icon:"ri-body-scan-line",list:Oi},{label:"装饰",type:"decoration",icon:"ri-sparkling-line",list:Ti}]),a=e.ref("layer"),i=l=>{const s=e.unref(o).find(d=>d.type=="indicators");s&&(s.list=s.list.map(d=>({...d,isOpen:d.isOpen?!1:d.id==l.id})))};return e.nextTick(()=>{r.$baseHttp.get("/api/ace-data-center/indicators/loadIndicatorsMenu",{params:{projectId:r.$baseGetCurrentProjectId}}).then(l=>{const s=[],d=e.unref(o).find(c=>c.type=="indicators");d&&(d.list=Object.keys(l.data).map((c,f)=>({name:c,id:c,isOpen:f==0,children:l.data[c].map(u=>{var p;return{...u,echartsType:(p=u.echarts)!=null&&p.length?u.echarts[0].echartsType:""}})})),s.push(...d.list.map(c=>c.children))),e.nextTick(()=>{document.querySelectorAll(".drag-node").forEach(f=>{const{ptype:u,type:p,id:h}=f.dataset;f.addEventListener("dragstart",m=>{var g;let y=(g=e.unref(o).find(b=>b.type==u))==null?void 0:g.list.find(b=>b.type==p);if(p=="MODEL_INDICATORS"){const b=s.flat().find(_=>_.id==h),w=b==null?void 0:b.echarts.find(_=>_.echartsType==b.echartsType);y={name:`${b.name}(${n[w.echartsType].name})`,chartType:b.echartsType,chartId:b.id,indicatorsId:h,w:500,h:500,customize:w.echartsConfig}}m.dataTransfer.setData("dragComponent",JSON.stringify({...y,id:li(),locked:!1}))})}),document.addEventListener("drop",f=>{f.preventDefault()},!1)})})}),(l,s)=>(e.openBlock(),e.createBlock(e.unref(E.ElTabs),{"tab-position":"left",modelValue:e.unref(a),"onUpdate:modelValue":s[0]||(s[0]=d=>e.isRef(a)?a.value=d:null),onKeydownCapture:s[1]||(s[1]=e.withKeys(e.withModifiers(()=>{},["stop","prevent"]),["native"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),d=>(e.openBlock(),e.createBlock(e.unref(E.ElTabPane),{name:d.type,key:d.type},{label:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("i",{class:e.normalizeClass(["text-xl",d.icon])},null,2),e.createElementVNode("div",jy,e.toDisplayString(d.label),1)])]),default:e.withCtx(()=>[d.type=="layer"?(e.openBlock(),e.createBlock($0,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Py,[Uy,e.createTextVNode(" "+e.toDisplayString(d.label),1)]),e.createElementVNode("div",Wy,[e.createVNode(e.unref(E.ElScrollbar),null,{default:e.withCtx(()=>[d.type=="indicators"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(d.list,c=>(e.openBlock(),e.createElementBlock("div",{key:c.label},[e.createElementVNode("div",{class:"mb-2 cursor-pointer text-ellipsis overflow-hidden whitespace-nowrap",onClick:f=>i(c)},[e.createElementVNode("i",{class:e.normalizeClass(["text-base",c.isOpen?"ri-folder-open-line":"ri-folder-line"])},null,2),e.createTextVNode(" "+e.toDisplayString(c.name),1)],8,Gy),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.children,f=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,{key:f.modelId},[f.type=="MODEL_INDICATORS"&&((u=f.echarts)!=null&&u.length)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"drag-node cursor-move mb-2",draggable:!0,"data-type":f.type,"data-id":f.id},[e.createElementVNode("div",Yy,e.toDisplayString(f.name),1),e.createElementVNode("div",Xy,[e.createElementVNode("div",{class:e.normalizeClass([`bg-${f.echartsType}`,"item-img"])},null,2)]),f.echarts.length>1?(e.openBlock(),e.createElementBlock("div",qy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.echarts,p=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass([[e.unref(n)[p.echartsType].icon,p.echartsType==f.echartsType?"activeCode":""],"cursor-pointer chart-item"]),onClick:h=>f.echartsType=p.echartsType,key:p.code},null,10,Jy))),128))])):e.createCommentVNode("",!0)],8,Hy)):e.createCommentVNode("",!0)],64)}),128))],512),[[e.vShow,c.isOpen]])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(d.list,c=>(e.openBlock(),e.createElementBlock("div",{key:d.type,class:"drag-node cursor-move mb-2",draggable:!0,"data-type":c.type,"data-ptype":d.type},[e.createElementVNode("div",Zy,e.toDisplayString(c.name),1),e.createElementVNode("div",Qy,[e.createElementVNode("div",{class:e.normalizeClass([`bg-${c.type}`,"item-img"])},null,2)])],8,Ky))),128))]),_:2},1024)])],64))]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"]))}}),QI="",tb=Be(eb,[["__scopeId","data-v-6e8b9f81"]]);function rb(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function zi(t){return typeof t=="function"?t():e.unref(t)}const ad=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nb=Object.prototype.toString,ob=t=>nb.call(t)==="[object Object]",ab=()=>{};function ib(t){var r;const n=zi(t);return(r=n==null?void 0:n.$el)!=null?r:n}const id=ad?window:void 0,lb=ad?window.document:void 0;function ld(...t){let r,n,o,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,a]=t,r=id):[r,n,o,a]=t,!r)return ab;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(f=>f()),i.length=0},s=(f,u,p,h)=>(f.addEventListener(u,p,h),()=>f.removeEventListener(u,p,h)),d=e.watch(()=>[ib(r),zi(a)],([f,u])=>{if(l(),!f)return;const p=ob(u)?{...u}:u;i.push(...n.flatMap(h=>o.map(m=>s(f,h,m,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return rb(c),c}function sb(t){return typeof t=="function"?t:typeof t=="string"?r=>r.key===t:Array.isArray(t)?r=>t.includes(r.key):()=>!0}function cb(...t){let r,n,o={};t.length===3?(r=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(r=!0,n=t[0],o=t[1]):(r=t[0],n=t[1]):(r=!0,n=t[0]);const{target:a=id,eventName:i="keydown",passive:l=!1,dedupe:s=!1}=o,d=sb(r);return ld(a,i,f=>{f.repeat&&zi(s)||d(f)&&n(f)},l)}const db=["mousedown","mouseup","keydown","keyup"];function fb(t,r={}){const{events:n=db,document:o=lb,initial:a=null}=r,i=e.ref(a);return o&&n.forEach(l=>{ld(o,l,s=>{typeof s.getModifierState=="function"&&(i.value=s.getModifierState(t))})}),i}var ub=Object.defineProperty,sd=Object.getOwnPropertySymbols,pb=Object.prototype.hasOwnProperty,hb=Object.prototype.propertyIsEnumerable,cd=(t,r,n)=>r in t?ub(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,mb=(t,r)=>{for(var n in r||(r={}))pb.call(r,n)&&cd(t,n,r[n]);if(sd)for(var n of sd(r))hb.call(r,n)&&cd(t,n,r[n]);return t};const gb={scale:Number,thick:Number,palette:Object,index:Number,start:Number,vertical:Boolean,value:Number,isShowReferLine:Boolean};var oa=(t,r)=>{const n=t.__vccOpts||t;for(const[o,a]of r)n[o]=a;return n};const yb=e.defineComponent({name:"LineRuler",props:gb,emits:["onMouseDown","onRelease","onRemove"],setup(t,{emit:r}){const n=e.ref(0),o=e.ref(!0);e.onMounted(()=>{n.value=t.value});const a=f=>{o.value=f>=0},i=e.computed(()=>{const f=(n.value-t.start)*t.scale;a(f);const u=f+"px";return t.vertical?{top:u}:{left:u}}),l=e.computed(()=>{var f;const u=`1px solid ${(f=t.palette)==null?void 0:f.lineColor}`,p=t.vertical?{borderTop:u}:{borderLeft:u},h=t.isShowReferLine?t.vertical?"ns-resize":"ew-resize":"none";return mb({cursor:h},p)}),s=e.computed(()=>t.vertical?{left:t.thick+"px"}:{top:t.thick+"px"});return{startValue:n,showLine:o,offset:i,borderCursor:l,actionStyle:s,handleDown:f=>{const u=t.vertical?f.clientY:f.clientX,p=n.value;r("onMouseDown");const h=y=>{const g=t.vertical?y.clientY:y.clientX,b=Math.round(p+(g-u)/t.scale);n.value=b},m=()=>{r("onRelease",n.value,t.index),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",m)},handleRemove:()=>{r("onRemove",t.index)}}}}),bb={class:"value"};function _b(t,r,n,o,a,i){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"line",style:e.normalizeStyle([t.offset,t.borderCursor]),onMousedown:r[1]||(r[1]=(...l)=>t.handleDown&&t.handleDown(...l))},[e.createElementVNode("div",{class:"action",style:e.normalizeStyle(t.actionStyle)},[e.createElementVNode("span",{class:"del",onClick:r[0]||(r[0]=(...l)=>t.handleRemove&&t.handleRemove(...l))},"×"),e.createElementVNode("span",bb,e.toDisplayString(t.startValue),1)],4)],36)),[[e.vShow,t.showLine]])}var wb=oa(yb,[["render",_b],["__scopeId","data-v-7cc5d020"]]);const Cb=t=>t<=.25?40:t<=.5?20:t<=1?10:t<=2?5:t<=4?2:1,dd=.83,Sb=(t,r,n,o,a,i)=>{const{scale:l,width:s,height:d,ratio:c,palette:f}=a,{bgColor:u,fontColor:p,shadowColor:h,longfgColor:m,shortfgColor:y}=f;if(t.scale(c,c),t.clearRect(0,0,s,d),t.fillStyle=u,t.fillRect(0,0,s,d),o){const $=(n-r)*l,B=o*l;t.fillStyle=h,i?t.fillRect($,0,B,d*3/8):t.fillRect(0,$,s*3/8,B)}const g=Cb(l),b=g*l,w=g*10,_=w*l,C=Math.floor(r/g)*g,S=Math.floor(r/w)*w,x=(C-r)/g*b,v=(S-r)/w*_,V=r+Math.ceil((i?s:d)/l);t.beginPath(),t.fillStyle=p,t.strokeStyle=m;for(let $=S,B=0;$<V;$+=w,B++){const R=v+B*_+.5;i?t.moveTo(R,0):t.moveTo(0,R),t.save(),i?t.translate(R,d*.4):t.translate(s*.4,R),i||t.rotate(-Math.PI/2),t.scale(dd/c,dd/c),t.fillText($.toString(),4*c,7*c),t.restore(),i?t.lineTo(R,d*9/16):t.lineTo(s*9/16,R)}t.stroke(),t.closePath(),t.beginPath(),t.strokeStyle=y;for(let $=C,B=0;$<V;$+=g,B++){const R=x+B*b+.5;i?t.moveTo(R,0):t.moveTo(0,R),$%w!==0&&(i?t.lineTo(R,d*1/4):t.lineTo(s*1/4,R))}t.stroke(),t.closePath(),t.setTransform(1,0,0,1,0,0)},xb=e.defineComponent({name:"CanvasRuler",props:{showIndicator:Boolean,valueNum:Number,scale:Number,ratio:Number,palette:Object,vertical:Boolean,start:Number,width:Number,height:Number,selectStart:Number,selectLength:Number},emits:["onAddLine","update:showIndicator","update:valueNum"],setup(t,{emit:r}){const n=e.reactive({canvasContext:null});let o=1;const a=e.ref(null);e.onMounted(()=>{o=t.ratio||window.devicePixelRatio||1,i(),l(o),s(o)});const i=()=>{n.canvasContext=a.value&&a.value.getContext("2d")},l=c=>{if(a.value){a.value.width=t.width*c,a.value.height=t.height*c;const f=n.canvasContext;f&&(f.font=`${12*c}px -apple-system,
15
+ */function Oc(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,o)}return n}function tr(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Oc(Object(n),!0).forEach(function(o){Jg(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oc(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Po(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Po=function(r){return typeof r}:Po=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Po(t)}function Jg(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function dr(){return dr=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},dr.apply(this,arguments)}function Kg(t,r){if(t==null)return{};var n={},o=Object.keys(t),a,i;for(i=0;i<o.length;i++)a=o[i],!(r.indexOf(a)>=0)&&(n[a]=t[a]);return n}function Zg(t,r){if(t==null)return{};var n=Kg(t,r),o,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)o=i[a],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Qg="1.15.2";function fr(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var ur=fr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),jn=fr(/Edge/i),Ic=fr(/firefox/i),Pn=fr(/safari/i)&&!fr(/chrome/i)&&!fr(/android/i),zc=fr(/iP(ad|od|hone)/i),Rc=fr(/chrome/i)&&fr(/android/i),Mc={capture:!1,passive:!1};function $e(t,r,n){t.addEventListener(r,n,!ur&&Mc)}function Se(t,r,n){t.removeEventListener(r,n,!ur&&Mc)}function Uo(t,r){if(r){if(r[0]===">"&&(r=r.substring(1)),t)try{if(t.matches)return t.matches(r);if(t.msMatchesSelector)return t.msMatchesSelector(r);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(r)}catch{return!1}return!1}}function e0(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Ht(t,r,n,o){if(t){n=n||document;do{if(r!=null&&(r[0]===">"?t.parentNode===n&&Uo(t,r):Uo(t,r))||o&&t===n)return t;if(t===n)break}while(t=e0(t))}return null}var Ac=/\s+/g;function Vt(t,r,n){if(t&&r)if(t.classList)t.classList[n?"add":"remove"](r);else{var o=(" "+t.className+" ").replace(Ac," ").replace(" "+r+" "," ");t.className=(o+(n?" "+r:"")).replace(Ac," ")}}function de(t,r,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),r===void 0?n:n[r];!(r in o)&&r.indexOf("webkit")===-1&&(r="-webkit-"+r),o[r]=n+(typeof n=="string"?"":"px")}}function an(t,r){var n="";if(typeof t=="string")n=t;else do{var o=de(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!r&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function Lc(t,r,n){if(t){var o=t.getElementsByTagName(r),a=0,i=o.length;if(n)for(;a<i;a++)n(o[a],a);return o}return[]}function rr(){var t=document.scrollingElement;return t||document.documentElement}function Je(t,r,n,o,a){if(!(!t.getBoundingClientRect&&t!==window)){var i,l,s,d,c,f,u;if(t!==window&&t.parentNode&&t!==rr()?(i=t.getBoundingClientRect(),l=i.top,s=i.left,d=i.bottom,c=i.right,f=i.height,u=i.width):(l=0,s=0,d=window.innerHeight,c=window.innerWidth,f=window.innerHeight,u=window.innerWidth),(r||n)&&t!==window&&(a=a||t.parentNode,!ur))do if(a&&a.getBoundingClientRect&&(de(a,"transform")!=="none"||n&&de(a,"position")!=="static")){var p=a.getBoundingClientRect();l-=p.top+parseInt(de(a,"border-top-width")),s-=p.left+parseInt(de(a,"border-left-width")),d=l+i.height,c=s+i.width;break}while(a=a.parentNode);if(o&&t!==window){var h=an(a||t),m=h&&h.a,y=h&&h.d;h&&(l/=y,s/=m,u/=m,f/=y,d=l+f,c=s+u)}return{top:l,left:s,bottom:d,right:c,width:u,height:f}}}function Fc(t,r,n){for(var o=Cr(t,!0),a=Je(t)[r];o;){var i=Je(o)[n],l=void 0;if(n==="top"||n==="left"?l=a>=i:l=a<=i,!l)return o;if(o===rr())break;o=Cr(o,!1)}return!1}function ln(t,r,n,o){for(var a=0,i=0,l=t.children;i<l.length;){if(l[i].style.display!=="none"&&l[i]!==le.ghost&&(o||l[i]!==le.dragged)&&Ht(l[i],n.draggable,t,!1)){if(a===r)return l[i];a++}i++}return null}function gi(t,r){for(var n=t.lastElementChild;n&&(n===le.ghost||de(n,"display")==="none"||r&&!Uo(n,r));)n=n.previousElementSibling;return n||null}function Mt(t,r){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==le.clone&&(!r||Uo(t,r))&&n++;return n}function jc(t){var r=0,n=0,o=rr();if(t)do{var a=an(t),i=a.a,l=a.d;r+=t.scrollLeft*i,n+=t.scrollTop*l}while(t!==o&&(t=t.parentNode));return[r,n]}function t0(t,r){for(var n in t)if(t.hasOwnProperty(n)){for(var o in r)if(r.hasOwnProperty(o)&&r[o]===t[n][o])return Number(n)}return-1}function Cr(t,r){if(!t||!t.getBoundingClientRect)return rr();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var a=de(n);if(n.clientWidth<n.scrollWidth&&(a.overflowX=="auto"||a.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(a.overflowY=="auto"||a.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return rr();if(o||r)return n;o=!0}}while(n=n.parentNode);return rr()}function r0(t,r){if(t&&r)for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n]);return t}function yi(t,r){return Math.round(t.top)===Math.round(r.top)&&Math.round(t.left)===Math.round(r.left)&&Math.round(t.height)===Math.round(r.height)&&Math.round(t.width)===Math.round(r.width)}var Un;function Pc(t,r){return function(){if(!Un){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),Un=setTimeout(function(){Un=void 0},r)}}}function n0(){clearTimeout(Un),Un=void 0}function Uc(t,r,n){t.scrollLeft+=r,t.scrollTop+=n}function Wc(t){var r=window.Polymer,n=window.jQuery||window.Zepto;return r&&r.dom?r.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Gc(t,r,n){var o={};return Array.from(t.children).forEach(function(a){var i,l,s,d;if(!(!Ht(a,r.draggable,t,!1)||a.animated||a===n)){var c=Je(a);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,c.left),o.top=Math.min((l=o.top)!==null&&l!==void 0?l:1/0,c.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,c.right),o.bottom=Math.max((d=o.bottom)!==null&&d!==void 0?d:-1/0,c.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var kt="Sortable"+new Date().getTime();function o0(){var t=[],r;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(a){if(!(de(a,"display")==="none"||a===le.ghost)){t.push({target:a,rect:Je(a)});var i=tr({},t[t.length-1].rect);if(a.thisAnimationDuration){var l=an(a,!0);l&&(i.top-=l.f,i.left-=l.e)}a.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(t0(t,{target:o}),1)},animateAll:function(o){var a=this;if(!this.options.animation){clearTimeout(r),typeof o=="function"&&o();return}var i=!1,l=0;t.forEach(function(s){var d=0,c=s.target,f=c.fromRect,u=Je(c),p=c.prevFromRect,h=c.prevToRect,m=s.rect,y=an(c,!0);y&&(u.top-=y.f,u.left-=y.e),c.toRect=u,c.thisAnimationDuration&&yi(p,u)&&!yi(f,u)&&(m.top-u.top)/(m.left-u.left)===(f.top-u.top)/(f.left-u.left)&&(d=i0(m,p,h,a.options)),yi(u,f)||(c.prevFromRect=f,c.prevToRect=u,d||(d=a.options.animation),a.animate(c,m,u,d)),d&&(i=!0,l=Math.max(l,d),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},d),c.thisAnimationDuration=d)}),clearTimeout(r),i?r=setTimeout(function(){typeof o=="function"&&o()},l):typeof o=="function"&&o(),t=[]},animate:function(o,a,i,l){if(l){de(o,"transition",""),de(o,"transform","");var s=an(this.el),d=s&&s.a,c=s&&s.d,f=(a.left-i.left)/(d||1),u=(a.top-i.top)/(c||1);o.animatingX=!!f,o.animatingY=!!u,de(o,"transform","translate3d("+f+"px,"+u+"px,0)"),this.forRepaintDummy=a0(o),de(o,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),de(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){de(o,"transition",""),de(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},l)}}}}function a0(t){return t.offsetWidth}function i0(t,r,n,o){return Math.sqrt(Math.pow(r.top-t.top,2)+Math.pow(r.left-t.left,2))/Math.sqrt(Math.pow(r.top-n.top,2)+Math.pow(r.left-n.left,2))*o.animation}var sn=[],bi={initializeByDefault:!0},Wn={mount:function(r){for(var n in bi)bi.hasOwnProperty(n)&&!(n in r)&&(r[n]=bi[n]);sn.forEach(function(o){if(o.pluginName===r.pluginName)throw"Sortable: Cannot mount plugin ".concat(r.pluginName," more than once")}),sn.push(r)},pluginEvent:function(r,n,o){var a=this;this.eventCanceled=!1,o.cancel=function(){a.eventCanceled=!0};var i=r+"Global";sn.forEach(function(l){n[l.pluginName]&&(n[l.pluginName][i]&&n[l.pluginName][i](tr({sortable:n},o)),n.options[l.pluginName]&&n[l.pluginName][r]&&n[l.pluginName][r](tr({sortable:n},o)))})},initializePlugins:function(r,n,o,a){sn.forEach(function(s){var d=s.pluginName;if(!(!r.options[d]&&!s.initializeByDefault)){var c=new s(r,n,r.options);c.sortable=r,c.options=r.options,r[d]=c,dr(o,c.defaults)}});for(var i in r.options)if(r.options.hasOwnProperty(i)){var l=this.modifyOption(r,i,r.options[i]);typeof l<"u"&&(r.options[i]=l)}},getEventProperties:function(r,n){var o={};return sn.forEach(function(a){typeof a.eventProperties=="function"&&dr(o,a.eventProperties.call(n[a.pluginName],r))}),o},modifyOption:function(r,n,o){var a;return sn.forEach(function(i){r[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(a=i.optionListeners[n].call(r[i.pluginName],o))}),a}};function l0(t){var r=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,i=t.cloneEl,l=t.toEl,s=t.fromEl,d=t.oldIndex,c=t.newIndex,f=t.oldDraggableIndex,u=t.newDraggableIndex,p=t.originalEvent,h=t.putSortable,m=t.extraEventProperties;if(r=r||n&&n[kt],!!r){var y,g=r.options,b="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!ur&&!jn?y=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(o,!0,!0)),y.to=l||n,y.from=s||n,y.item=a||n,y.clone=i,y.oldIndex=d,y.newIndex=c,y.oldDraggableIndex=f,y.newDraggableIndex=u,y.originalEvent=p,y.pullMode=h?h.lastPutMode:void 0;var w=tr(tr({},m),Wn.getEventProperties(o,r));for(var _ in w)y[_]=w[_];n&&n.dispatchEvent(y),g[b]&&g[b].call(r,y)}}var s0=["evt"],bt=function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.evt,i=Zg(o,s0);Wn.pluginEvent.bind(le)(r,n,tr({dragEl:ee,parentEl:He,ghostEl:he,rootEl:Fe,nextEl:Ar,lastDownEl:Wo,cloneEl:Pe,cloneHidden:Sr,dragStarted:Hn,putSortable:ot,activeSortable:le.active,originalEvent:a,oldIndex:cn,oldDraggableIndex:Gn,newIndex:Nt,newDraggableIndex:xr,hideGhostForTarget:Zc,unhideGhostForTarget:Qc,cloneNowHidden:function(){Sr=!0},cloneNowShown:function(){Sr=!1},dispatchSortableEvent:function(s){ct({sortable:n,name:s,originalEvent:a})}},i))};function ct(t){l0(tr({putSortable:ot,cloneEl:Pe,targetEl:ee,rootEl:Fe,oldIndex:cn,oldDraggableIndex:Gn,newIndex:Nt,newDraggableIndex:xr},t))}var ee,He,he,Fe,Ar,Wo,Pe,Sr,cn,Nt,Gn,xr,Go,ot,dn=!1,Ho=!1,Yo=[],Lr,Yt,_i,wi,Hc,Yc,Hn,fn,Yn,Xn=!1,Xo=!1,qo,it,Ci=[],Si=!1,Jo=[],Ko=typeof document<"u",Zo=zc,Xc=jn||ur?"cssFloat":"float",c0=Ko&&!Rc&&!zc&&"draggable"in document.createElement("div"),qc=function(){if(Ko){if(ur)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Jc=function(r,n){var o=de(r),a=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=ln(r,0,n),l=ln(r,1,n),s=i&&de(i),d=l&&de(l),c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Je(i).width,f=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Je(l).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var u=s.float==="left"?"left":"right";return l&&(d.clear==="both"||d.clear===u)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||c>=a&&o[Xc]==="none"||l&&o[Xc]==="none"&&c+f>a)?"vertical":"horizontal"},d0=function(r,n,o){var a=o?r.left:r.top,i=o?r.right:r.bottom,l=o?r.width:r.height,s=o?n.left:n.top,d=o?n.right:n.bottom,c=o?n.width:n.height;return a===s||i===d||a+l/2===s+c/2},f0=function(r,n){var o;return Yo.some(function(a){var i=a[kt].options.emptyInsertThreshold;if(!(!i||gi(a))){var l=Je(a),s=r>=l.left-i&&r<=l.right+i,d=n>=l.top-i&&n<=l.bottom+i;if(s&&d)return o=a}}),o},Kc=function(r){function n(i,l){return function(s,d,c,f){var u=s.options.group.name&&d.options.group.name&&s.options.group.name===d.options.group.name;if(i==null&&(l||u))return!0;if(i==null||i===!1)return!1;if(l&&i==="clone")return i;if(typeof i=="function")return n(i(s,d,c,f),l)(s,d,c,f);var p=(l?s:d).options.group.name;return i===!0||typeof i=="string"&&i===p||i.join&&i.indexOf(p)>-1}}var o={},a=r.group;(!a||Po(a)!="object")&&(a={name:a}),o.name=a.name,o.checkPull=n(a.pull,!0),o.checkPut=n(a.put),o.revertClone=a.revertClone,r.group=o},Zc=function(){!qc&&he&&de(he,"display","none")},Qc=function(){!qc&&he&&de(he,"display","")};Ko&&!Rc&&document.addEventListener("click",function(t){if(Ho)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ho=!1,!1},!0);var Fr=function(r){if(ee){r=r.touches?r.touches[0]:r;var n=f0(r.clientX,r.clientY);if(n){var o={};for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[kt]._onDragOver(o)}}},u0=function(r){ee&&ee.parentNode[kt]._isOutsideThisEl(r.target)};function le(t,r){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=r=dr({},r),t[kt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Jc(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,s){l.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:le.supportPointer!==!1&&"PointerEvent"in window&&!Pn,emptyInsertThreshold:5};Wn.initializePlugins(this,t,n);for(var o in n)!(o in r)&&(r[o]=n[o]);Kc(r);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=r.forceFallback?!1:c0,this.nativeDraggable&&(this.options.touchStartThreshold=1),r.supportPointer?$e(t,"pointerdown",this._onTapStart):($e(t,"mousedown",this._onTapStart),$e(t,"touchstart",this._onTapStart)),this.nativeDraggable&&($e(t,"dragover",this),$e(t,"dragenter",this)),Yo.push(this.el),r.store&&r.store.get&&this.sort(r.store.get(this)||[]),dr(this,o0())}le.prototype={constructor:le,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(fn=null)},_getDirection:function(r,n){return typeof this.options.direction=="function"?this.options.direction.call(this,r,n,ee):this.options.direction},_onTapStart:function(r){if(r.cancelable){var n=this,o=this.el,a=this.options,i=a.preventOnFilter,l=r.type,s=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,d=(s||r).target,c=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||d,f=a.filter;if(w0(o),!ee&&!(/mousedown|pointerdown/.test(l)&&r.button!==0||a.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Pn&&d&&d.tagName.toUpperCase()==="SELECT")&&(d=Ht(d,a.draggable,o,!1),!(d&&d.animated)&&Wo!==d)){if(cn=Mt(d),Gn=Mt(d,a.draggable),typeof f=="function"){if(f.call(this,r,d,this)){ct({sortable:n,rootEl:c,name:"filter",targetEl:d,toEl:o,fromEl:o}),bt("filter",n,{evt:r}),i&&r.cancelable&&r.preventDefault();return}}else if(f&&(f=f.split(",").some(function(u){if(u=Ht(c,u.trim(),o,!1),u)return ct({sortable:n,rootEl:u,name:"filter",targetEl:d,fromEl:o,toEl:o}),bt("filter",n,{evt:r}),!0}),f)){i&&r.cancelable&&r.preventDefault();return}a.handle&&!Ht(c,a.handle,o,!1)||this._prepareDragStart(r,s,d)}}},_prepareDragStart:function(r,n,o){var a=this,i=a.el,l=a.options,s=i.ownerDocument,d;if(o&&!ee&&o.parentNode===i){var c=Je(o);if(Fe=i,ee=o,He=ee.parentNode,Ar=ee.nextSibling,Wo=o,Go=l.group,le.dragged=ee,Lr={target:ee,clientX:(n||r).clientX,clientY:(n||r).clientY},Hc=Lr.clientX-c.left,Yc=Lr.clientY-c.top,this._lastX=(n||r).clientX,this._lastY=(n||r).clientY,ee.style["will-change"]="all",d=function(){if(bt("delayEnded",a,{evt:r}),le.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Ic&&a.nativeDraggable&&(ee.draggable=!0),a._triggerDragStart(r,n),ct({sortable:a,name:"choose",originalEvent:r}),Vt(ee,l.chosenClass,!0)},l.ignore.split(",").forEach(function(f){Lc(ee,f.trim(),xi)}),$e(s,"dragover",Fr),$e(s,"mousemove",Fr),$e(s,"touchmove",Fr),$e(s,"mouseup",a._onDrop),$e(s,"touchend",a._onDrop),$e(s,"touchcancel",a._onDrop),Ic&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ee.draggable=!0),bt("delayStart",this,{evt:r}),l.delay&&(!l.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(jn||ur))){if(le.eventCanceled){this._onDrop();return}$e(s,"mouseup",a._disableDelayedDrag),$e(s,"touchend",a._disableDelayedDrag),$e(s,"touchcancel",a._disableDelayedDrag),$e(s,"mousemove",a._delayedDragTouchMoveHandler),$e(s,"touchmove",a._delayedDragTouchMoveHandler),l.supportPointer&&$e(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(d,l.delay)}else d()}},_delayedDragTouchMoveHandler:function(r){var n=r.touches?r.touches[0]:r;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ee&&xi(ee),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;Se(r,"mouseup",this._disableDelayedDrag),Se(r,"touchend",this._disableDelayedDrag),Se(r,"touchcancel",this._disableDelayedDrag),Se(r,"mousemove",this._delayedDragTouchMoveHandler),Se(r,"touchmove",this._delayedDragTouchMoveHandler),Se(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,n){n=n||r.pointerType=="touch"&&r,!this.nativeDraggable||n?this.options.supportPointer?$e(document,"pointermove",this._onTouchMove):n?$e(document,"touchmove",this._onTouchMove):$e(document,"mousemove",this._onTouchMove):($e(ee,"dragend",this),$e(Fe,"dragstart",this._onDragStart));try{document.selection?ea(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,n){if(dn=!1,Fe&&ee){bt("dragStarted",this,{evt:n}),this.nativeDraggable&&$e(document,"dragover",u0);var o=this.options;!r&&Vt(ee,o.dragClass,!1),Vt(ee,o.ghostClass,!0),le.active=this,r&&this._appendGhost(),ct({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Yt){this._lastX=Yt.clientX,this._lastY=Yt.clientY,Zc();for(var r=document.elementFromPoint(Yt.clientX,Yt.clientY),n=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(Yt.clientX,Yt.clientY),r!==n);)n=r;if(ee.parentNode[kt]._isOutsideThisEl(r),n)do{if(n[kt]){var o=void 0;if(o=n[kt]._onDragOver({clientX:Yt.clientX,clientY:Yt.clientY,target:r,rootEl:n}),o&&!this.options.dragoverBubble)break}r=n}while(n=n.parentNode);Qc()}},_onTouchMove:function(r){if(Lr){var n=this.options,o=n.fallbackTolerance,a=n.fallbackOffset,i=r.touches?r.touches[0]:r,l=he&&an(he,!0),s=he&&l&&l.a,d=he&&l&&l.d,c=Zo&&it&&jc(it),f=(i.clientX-Lr.clientX+a.x)/(s||1)+(c?c[0]-Ci[0]:0)/(s||1),u=(i.clientY-Lr.clientY+a.y)/(d||1)+(c?c[1]-Ci[1]:0)/(d||1);if(!le.active&&!dn){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(r,!0)}if(he){l?(l.e+=f-(_i||0),l.f+=u-(wi||0)):l={a:1,b:0,c:0,d:1,e:f,f:u};var p="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");de(he,"webkitTransform",p),de(he,"mozTransform",p),de(he,"msTransform",p),de(he,"transform",p),_i=f,wi=u,Yt=i}r.cancelable&&r.preventDefault()}},_appendGhost:function(){if(!he){var r=this.options.fallbackOnBody?document.body:Fe,n=Je(ee,!0,Zo,!0,r),o=this.options;if(Zo){for(it=r;de(it,"position")==="static"&&de(it,"transform")==="none"&&it!==document;)it=it.parentNode;it!==document.body&&it!==document.documentElement?(it===document&&(it=rr()),n.top+=it.scrollTop,n.left+=it.scrollLeft):it=rr(),Ci=jc(it)}he=ee.cloneNode(!0),Vt(he,o.ghostClass,!1),Vt(he,o.fallbackClass,!0),Vt(he,o.dragClass,!0),de(he,"transition",""),de(he,"transform",""),de(he,"box-sizing","border-box"),de(he,"margin",0),de(he,"top",n.top),de(he,"left",n.left),de(he,"width",n.width),de(he,"height",n.height),de(he,"opacity","0.8"),de(he,"position",Zo?"absolute":"fixed"),de(he,"zIndex","100000"),de(he,"pointerEvents","none"),le.ghost=he,r.appendChild(he),de(he,"transform-origin",Hc/parseInt(he.style.width)*100+"% "+Yc/parseInt(he.style.height)*100+"%")}},_onDragStart:function(r,n){var o=this,a=r.dataTransfer,i=o.options;if(bt("dragStart",this,{evt:r}),le.eventCanceled){this._onDrop();return}bt("setupClone",this),le.eventCanceled||(Pe=Wc(ee),Pe.removeAttribute("id"),Pe.draggable=!1,Pe.style["will-change"]="",this._hideClone(),Vt(Pe,this.options.chosenClass,!1),le.clone=Pe),o.cloneId=ea(function(){bt("clone",o),!le.eventCanceled&&(o.options.removeCloneOnHide||Fe.insertBefore(Pe,ee),o._hideClone(),ct({sortable:o,name:"clone"}))}),!n&&Vt(ee,i.dragClass,!0),n?(Ho=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Se(document,"mouseup",o._onDrop),Se(document,"touchend",o._onDrop),Se(document,"touchcancel",o._onDrop),a&&(a.effectAllowed="move",i.setData&&i.setData.call(o,a,ee)),$e(document,"drop",o),de(ee,"transform","translateZ(0)")),dn=!0,o._dragStartId=ea(o._dragStarted.bind(o,n,r)),$e(document,"selectstart",o),Hn=!0,Pn&&de(document.body,"user-select","none")},_onDragOver:function(r){var n=this.el,o=r.target,a,i,l,s=this.options,d=s.group,c=le.active,f=Go===d,u=s.sort,p=ot||c,h,m=this,y=!1;if(Si)return;function g(z,M){bt(z,m,tr({evt:r,isOwner:f,axis:h?"vertical":"horizontal",revert:l,dragRect:a,targetRect:i,canSort:u,fromSortable:p,target:o,completed:w,onMove:function(F,G){return Qo(Fe,n,ee,a,F,Je(F),r,G)},changed:_},M))}function b(){g("dragOverAnimationCapture"),m.captureAnimationState(),m!==p&&p.captureAnimationState()}function w(z){return g("dragOverCompleted",{insertion:z}),z&&(f?c._hideClone():c._showClone(m),m!==p&&(Vt(ee,ot?ot.options.ghostClass:c.options.ghostClass,!1),Vt(ee,s.ghostClass,!0)),ot!==m&&m!==le.active?ot=m:m===le.active&&ot&&(ot=null),p===m&&(m._ignoreWhileAnimating=o),m.animateAll(function(){g("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(o===ee&&!ee.animated||o===n&&!o.animated)&&(fn=null),!s.dragoverBubble&&!r.rootEl&&o!==document&&(ee.parentNode[kt]._isOutsideThisEl(r.target),!z&&Fr(r)),!s.dragoverBubble&&r.stopPropagation&&r.stopPropagation(),y=!0}function _(){Nt=Mt(ee),xr=Mt(ee,s.draggable),ct({sortable:m,name:"change",toEl:n,newIndex:Nt,newDraggableIndex:xr,originalEvent:r})}if(r.preventDefault!==void 0&&r.cancelable&&r.preventDefault(),o=Ht(o,s.draggable,n,!0),g("dragOver"),le.eventCanceled)return y;if(ee.contains(r.target)||o.animated&&o.animatingX&&o.animatingY||m._ignoreWhileAnimating===o)return w(!1);if(Ho=!1,c&&!s.disabled&&(f?u||(l=He!==Fe):ot===this||(this.lastPutMode=Go.checkPull(this,c,ee,r))&&d.checkPut(this,c,ee,r))){if(h=this._getDirection(r,o)==="vertical",a=Je(ee),g("dragOverValid"),le.eventCanceled)return y;if(l)return He=Fe,b(),this._hideClone(),g("revert"),le.eventCanceled||(Ar?Fe.insertBefore(ee,Ar):Fe.appendChild(ee)),w(!0);var C=gi(n,s.draggable);if(!C||g0(r,h,this)&&!C.animated){if(C===ee)return w(!1);if(C&&n===r.target&&(o=C),o&&(i=Je(o)),Qo(Fe,n,ee,a,o,i,r,!!o)!==!1)return b(),C&&C.nextSibling?n.insertBefore(ee,C.nextSibling):n.appendChild(ee),He=n,_(),w(!0)}else if(C&&m0(r,h,this)){var S=ln(n,0,s,!0);if(S===ee)return w(!1);if(o=S,i=Je(o),Qo(Fe,n,ee,a,o,i,r,!1)!==!1)return b(),n.insertBefore(ee,S),He=n,_(),w(!0)}else if(o.parentNode===n){i=Je(o);var x=0,v,V=ee.parentNode!==n,$=!d0(ee.animated&&ee.toRect||a,o.animated&&o.toRect||i,h),B=h?"top":"left",R=Fc(o,"top","top")||Fc(ee,"top","top"),T=R?R.scrollTop:void 0;fn!==o&&(v=i[B],Xn=!1,Xo=!$&&s.invertSwap||V),x=y0(r,o,i,h,$?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Xo,fn===o);var k;if(x!==0){var O=Mt(ee);do O-=x,k=He.children[O];while(k&&(de(k,"display")==="none"||k===he))}if(x===0||k===o)return w(!1);fn=o,Yn=x;var N=o.nextElementSibling,D=!1;D=x===1;var I=Qo(Fe,n,ee,a,o,i,r,D);if(I!==!1)return(I===1||I===-1)&&(D=I===1),Si=!0,setTimeout(h0,30),b(),D&&!N?n.appendChild(ee):o.parentNode.insertBefore(ee,D?N:o),R&&Uc(R,0,T-R.scrollTop),He=ee.parentNode,v!==void 0&&!Xo&&(qo=Math.abs(v-Je(o)[B])),_(),w(!0)}if(n.contains(ee))return w(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Se(document,"mousemove",this._onTouchMove),Se(document,"touchmove",this._onTouchMove),Se(document,"pointermove",this._onTouchMove),Se(document,"dragover",Fr),Se(document,"mousemove",Fr),Se(document,"touchmove",Fr)},_offUpEvents:function(){var r=this.el.ownerDocument;Se(r,"mouseup",this._onDrop),Se(r,"touchend",this._onDrop),Se(r,"pointerup",this._onDrop),Se(r,"touchcancel",this._onDrop),Se(document,"selectstart",this)},_onDrop:function(r){var n=this.el,o=this.options;if(Nt=Mt(ee),xr=Mt(ee,o.draggable),bt("drop",this,{evt:r}),He=ee&&ee.parentNode,Nt=Mt(ee),xr=Mt(ee,o.draggable),le.eventCanceled){this._nulling();return}dn=!1,Xo=!1,Xn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),vi(this.cloneId),vi(this._dragStartId),this.nativeDraggable&&(Se(document,"drop",this),Se(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Pn&&de(document.body,"user-select",""),de(ee,"transform",""),r&&(Hn&&(r.cancelable&&r.preventDefault(),!o.dropBubble&&r.stopPropagation()),he&&he.parentNode&&he.parentNode.removeChild(he),(Fe===He||ot&&ot.lastPutMode!=="clone")&&Pe&&Pe.parentNode&&Pe.parentNode.removeChild(Pe),ee&&(this.nativeDraggable&&Se(ee,"dragend",this),xi(ee),ee.style["will-change"]="",Hn&&!dn&&Vt(ee,ot?ot.options.ghostClass:this.options.ghostClass,!1),Vt(ee,this.options.chosenClass,!1),ct({sortable:this,name:"unchoose",toEl:He,newIndex:null,newDraggableIndex:null,originalEvent:r}),Fe!==He?(Nt>=0&&(ct({rootEl:He,name:"add",toEl:He,fromEl:Fe,originalEvent:r}),ct({sortable:this,name:"remove",toEl:He,originalEvent:r}),ct({rootEl:He,name:"sort",toEl:He,fromEl:Fe,originalEvent:r}),ct({sortable:this,name:"sort",toEl:He,originalEvent:r})),ot&&ot.save()):Nt!==cn&&Nt>=0&&(ct({sortable:this,name:"update",toEl:He,originalEvent:r}),ct({sortable:this,name:"sort",toEl:He,originalEvent:r})),le.active&&((Nt==null||Nt===-1)&&(Nt=cn,xr=Gn),ct({sortable:this,name:"end",toEl:He,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){bt("nulling",this),Fe=ee=He=he=Ar=Pe=Wo=Sr=Lr=Yt=Hn=Nt=xr=cn=Gn=fn=Yn=ot=Go=le.dragged=le.ghost=le.clone=le.active=null,Jo.forEach(function(r){r.checked=!0}),Jo.length=_i=wi=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":ee&&(this._onDragOver(r),p0(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],n,o=this.el.children,a=0,i=o.length,l=this.options;a<i;a++)n=o[a],Ht(n,l.draggable,this.el,!1)&&r.push(n.getAttribute(l.dataIdAttr)||_0(n));return r},sort:function(r,n){var o={},a=this.el;this.toArray().forEach(function(i,l){var s=a.children[l];Ht(s,this.options.draggable,a,!1)&&(o[i]=s)},this),n&&this.captureAnimationState(),r.forEach(function(i){o[i]&&(a.removeChild(o[i]),a.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var r=this.options.store;r&&r.set&&r.set(this)},closest:function(r,n){return Ht(r,n||this.options.draggable,this.el,!1)},option:function(r,n){var o=this.options;if(n===void 0)return o[r];var a=Wn.modifyOption(this,r,n);typeof a<"u"?o[r]=a:o[r]=n,r==="group"&&Kc(o)},destroy:function(){bt("destroy",this);var r=this.el;r[kt]=null,Se(r,"mousedown",this._onTapStart),Se(r,"touchstart",this._onTapStart),Se(r,"pointerdown",this._onTapStart),this.nativeDraggable&&(Se(r,"dragover",this),Se(r,"dragenter",this)),Array.prototype.forEach.call(r.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Yo.splice(Yo.indexOf(this.el),1),this.el=r=null},_hideClone:function(){if(!Sr){if(bt("hideClone",this),le.eventCanceled)return;de(Pe,"display","none"),this.options.removeCloneOnHide&&Pe.parentNode&&Pe.parentNode.removeChild(Pe),Sr=!0}},_showClone:function(r){if(r.lastPutMode!=="clone"){this._hideClone();return}if(Sr){if(bt("showClone",this),le.eventCanceled)return;ee.parentNode==Fe&&!this.options.group.revertClone?Fe.insertBefore(Pe,ee):Ar?Fe.insertBefore(Pe,Ar):Fe.appendChild(Pe),this.options.group.revertClone&&this.animate(ee,Pe),de(Pe,"display",""),Sr=!1}}};function p0(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function Qo(t,r,n,o,a,i,l,s){var d,c=t[kt],f=c.options.onMove,u;return window.CustomEvent&&!ur&&!jn?d=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(d=document.createEvent("Event"),d.initEvent("move",!0,!0)),d.to=r,d.from=t,d.dragged=n,d.draggedRect=o,d.related=a||r,d.relatedRect=i||Je(r),d.willInsertAfter=s,d.originalEvent=l,t.dispatchEvent(d),f&&(u=f.call(c,d,l)),u}function xi(t){t.draggable=!1}function h0(){Si=!1}function m0(t,r,n){var o=Je(ln(n.el,0,n.options,!0)),a=Gc(n.el,n.options,he),i=10;return r?t.clientX<a.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<a.top-i||t.clientY<o.bottom&&t.clientX<o.left}function g0(t,r,n){var o=Je(gi(n.el,n.options.draggable)),a=Gc(n.el,n.options,he),i=10;return r?t.clientX>a.right+i||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>a.bottom+i||t.clientX>o.right&&t.clientY>o.top}function y0(t,r,n,o,a,i,l,s){var d=o?t.clientY:t.clientX,c=o?n.height:n.width,f=o?n.top:n.left,u=o?n.bottom:n.right,p=!1;if(!l){if(s&&qo<c*a){if(!Xn&&(Yn===1?d>f+c*i/2:d<u-c*i/2)&&(Xn=!0),Xn)p=!0;else if(Yn===1?d<f+qo:d>u-qo)return-Yn}else if(d>f+c*(1-a)/2&&d<u-c*(1-a)/2)return b0(r)}return p=p||l,p&&(d<f+c*i/2||d>u-c*i/2)?d>f+c/2?1:-1:0}function b0(t){return Mt(ee)<Mt(t)?1:-1}function _0(t){for(var r=t.tagName+t.className+t.src+t.href+t.textContent,n=r.length,o=0;n--;)o+=r.charCodeAt(n);return o.toString(36)}function w0(t){Jo.length=0;for(var r=t.getElementsByTagName("input"),n=r.length;n--;){var o=r[n];o.checked&&Jo.push(o)}}function ea(t){return setTimeout(t,0)}function vi(t){return clearTimeout(t)}Ko&&$e(document,"touchmove",function(t){(le.active||dn)&&t.cancelable&&t.preventDefault()}),le.utils={on:$e,off:Se,css:de,find:Lc,is:function(r,n){return!!Ht(r,n,r,!1)},extend:r0,throttle:Pc,closest:Ht,toggleClass:Vt,clone:Wc,index:Mt,nextTick:ea,cancelNextTick:vi,detectDirection:Jc,getChild:ln},le.get=function(t){return t[kt]},le.mount=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r[0].constructor===Array&&(r=r[0]),r.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(le.utils=tr(tr({},le.utils),o.utils)),Wn.mount(o)})},le.create=function(t,r){return new le(t,r)},le.version=Qg;var Ke=[],qn,Ei,Vi=!1,ki,Ni,ta,Jn;function C0(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?$e(document,"dragover",this._handleAutoScroll):this.options.supportPointer?$e(document,"pointermove",this._handleFallbackAutoScroll):o.touches?$e(document,"touchmove",this._handleFallbackAutoScroll):$e(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Se(document,"dragover",this._handleAutoScroll):(Se(document,"pointermove",this._handleFallbackAutoScroll),Se(document,"touchmove",this._handleFallbackAutoScroll),Se(document,"mousemove",this._handleFallbackAutoScroll)),ed(),ra(),n0()},nulling:function(){ta=Ei=qn=Vi=Jn=ki=Ni=null,Ke.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var a=this,i=(n.touches?n.touches[0]:n).clientX,l=(n.touches?n.touches[0]:n).clientY,s=document.elementFromPoint(i,l);if(ta=n,o||this.options.forceAutoScrollFallback||jn||ur||Pn){$i(n,this.options,s,o);var d=Cr(s,!0);Vi&&(!Jn||i!==ki||l!==Ni)&&(Jn&&ed(),Jn=setInterval(function(){var c=Cr(document.elementFromPoint(i,l),!0);c!==d&&(d=c,ra()),$i(n,a.options,c,o)},10),ki=i,Ni=l)}else{if(!this.options.bubbleScroll||Cr(s,!0)===rr()){ra();return}$i(n,this.options,Cr(s,!1),!1)}}},dr(t,{pluginName:"scroll",initializeByDefault:!0})}function ra(){Ke.forEach(function(t){clearInterval(t.pid)}),Ke=[]}function ed(){clearInterval(Jn)}var $i=Pc(function(t,r,n,o){if(r.scroll){var a=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,l=r.scrollSensitivity,s=r.scrollSpeed,d=rr(),c=!1,f;Ei!==n&&(Ei=n,ra(),qn=r.scroll,f=r.scrollFn,qn===!0&&(qn=Cr(n,!0)));var u=0,p=qn;do{var h=p,m=Je(h),y=m.top,g=m.bottom,b=m.left,w=m.right,_=m.width,C=m.height,S=void 0,x=void 0,v=h.scrollWidth,V=h.scrollHeight,$=de(h),B=h.scrollLeft,R=h.scrollTop;h===d?(S=_<v&&($.overflowX==="auto"||$.overflowX==="scroll"||$.overflowX==="visible"),x=C<V&&($.overflowY==="auto"||$.overflowY==="scroll"||$.overflowY==="visible")):(S=_<v&&($.overflowX==="auto"||$.overflowX==="scroll"),x=C<V&&($.overflowY==="auto"||$.overflowY==="scroll"));var T=S&&(Math.abs(w-a)<=l&&B+_<v)-(Math.abs(b-a)<=l&&!!B),k=x&&(Math.abs(g-i)<=l&&R+C<V)-(Math.abs(y-i)<=l&&!!R);if(!Ke[u])for(var O=0;O<=u;O++)Ke[O]||(Ke[O]={});(Ke[u].vx!=T||Ke[u].vy!=k||Ke[u].el!==h)&&(Ke[u].el=h,Ke[u].vx=T,Ke[u].vy=k,clearInterval(Ke[u].pid),(T!=0||k!=0)&&(c=!0,Ke[u].pid=setInterval((function(){o&&this.layer===0&&le.active._onTouchMove(ta);var N=Ke[this.layer].vy?Ke[this.layer].vy*s:0,D=Ke[this.layer].vx?Ke[this.layer].vx*s:0;typeof f=="function"&&f.call(le.dragged.parentNode[kt],D,N,t,ta,Ke[this.layer].el)!=="continue"||Uc(Ke[this.layer].el,D,N)}).bind({layer:u}),24))),u++}while(r.bubbleScroll&&p!==d&&(p=Cr(p,!1)));Vi=c}},30),td=function(r){var n=r.originalEvent,o=r.putSortable,a=r.dragEl,i=r.activeSortable,l=r.dispatchSortableEvent,s=r.hideGhostForTarget,d=r.unhideGhostForTarget;if(n){var c=o||i;s();var f=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,u=document.elementFromPoint(f.clientX,f.clientY);d(),c&&!c.el.contains(u)&&(l("spill"),this.onSpill({dragEl:a,putSortable:o}))}};function Di(){}Di.prototype={startIndex:null,dragStart:function(r){var n=r.oldDraggableIndex;this.startIndex=n},onSpill:function(r){var n=r.dragEl,o=r.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var a=ln(this.sortable.el,this.startIndex,this.options);a?this.sortable.el.insertBefore(n,a):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:td},dr(Di,{pluginName:"revertOnSpill"});function Bi(){}Bi.prototype={onSpill:function(r){var n=r.dragEl,o=r.putSortable,a=o||this.sortable;a.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),a.animateAll()},drop:td},dr(Bi,{pluginName:"removeOnSpill"}),le.mount(new C0),le.mount(Bi,Di);const na=t=>document.getElementById(t.id),rd=t=>{let r=`translate(${t.x}px, ${t.y}px)`;return{width:t.w+"px",height:t.h+"px",zIndex:t.z,transform:r}},nd=t=>(e.pushScopeId("data-v-dbbe6fca"),t=t(),e.popScopeId(),t),S0=nd(()=>e.createElementVNode("div",{class:"flex h-10 items-center p-2",style:{"background-color":"var(--design-bg-color3)"}},[e.createElementVNode("span",{class:"w-1 h-4 bg-color-primary mr-2 rounded-sm"}),e.createTextVNode(" 图层 ")],-1)),x0={class:"flex-1 overflow-hidden"},v0={id:"sortableLayer"},E0=["onMouseenter","onClick"],V0=nd(()=>e.createElementVNode("i",{class:"ri-drag-move-2-line text-xl mr-2 ml-2 sortable-handle cursor-move"},null,-1)),k0=["title"],N0=e.defineComponent({__name:"layer",setup(t){const r=Re();e.getCurrentInstance();const n=e.ref(null),o=e.computed(()=>r.targetsWidget.map(i=>i.id));e.nextTick(()=>{n.value=new le(document.getElementById("sortableLayer"),{handle:".sortable-handle",preventOnFilter:!0,onEnd({newIndex:i,oldIndex:l}){const s=r.widgetConfg.list,d=s.splice(l,1)[0];s.splice(i,0,d),s.reverse().forEach((c,f)=>{c.z=f}),r.sortWidgetList()}})});const a=i=>{const l=na(i);r.setTargetWidget([l])};return(i,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[S0,e.createElementVNode("div",x0,[e.createVNode(e.unref(E.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",v0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).getWidgetList,s=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item h-10 flex items-center pl-2 pr-2",{active:e.unref(o).includes(s.id),"hover-item":e.unref(r).widgetHoverIds.includes(s.id)}]),key:s.id,onMouseenter:e.withModifiers(d=>e.unref(r).setWidgetHoverIds([s.id]),["stop"]),onMouseleave:l[0]||(l[0]=e.withModifiers(d=>e.unref(r).setWidgetHoverIds([]),["stop"])),onClick:e.withModifiers(d=>a(s),["stop"])},[V0,e.createElementVNode("div",{class:"text-xs whitespace-nowrap overflow-hidden text-ellipsis",title:s.name},e.toDisplayString(s.name),9,k0)],42,E0))),128))])]),_:1})])],64))}}),qI="",$0=Be(N0,[["__scopeId","data-v-dbbe6fca"]]),ke={root:{}},D0={...ke,customize:{decorationColor1:"#1296db",decorationColor2:"#0de7c2"}},B0=Object.freeze(Object.defineProperty({__proto__:null,default:D0},Symbol.toStringTag,{value:"Module"})),T0={...ke,customize:{decorationColor1:"#00c2ff",decorationColor2:"rgba(0, 194, 255, 0.3)"}},O0=Object.freeze(Object.defineProperty({__proto__:null,default:T0},Symbol.toStringTag,{value:"Module"})),I0={...ke,customize:{decorationColor1:"#1a98fc",decorationColor2:"#2cf7fe"}},z0=Object.freeze(Object.defineProperty({__proto__:null,default:I0},Symbol.toStringTag,{value:"Module"})),R0={...ke,customize:{decorationColor1:null,decorationColor2:null,scanDuration:3,haloDuration:2}},M0=Object.freeze(Object.defineProperty({__proto__:null,default:R0},Symbol.toStringTag,{value:"Module"})),A0={...ke,customize:{decorationColor1:"#1296db",decorationColor2:"#0de7c2",duration:6,reverse:!1}},L0=Object.freeze(Object.defineProperty({__proto__:null,default:A0},Symbol.toStringTag,{value:"Module"})),F0={...ke,customize:{decorationColor1:"#7acaec",decorationColor2:"#000"}},j0=Object.freeze(Object.defineProperty({__proto__:null,default:F0},Symbol.toStringTag,{value:"Module"})),P0={...ke,customize:{decorationColor1:"rgba(255, 255, 255, 0.3)",decorationColor2:"rgba(255, 255, 255, 0.3)",duration:3,reverse:!1}},U0=Object.freeze(Object.defineProperty({__proto__:null,default:P0},Symbol.toStringTag,{value:"Module"})),W0={...ke,customize:{decorationColor1:"#3f96a5",decorationColor2:"#3f96a5",duration:1.2}},G0=Object.freeze(Object.defineProperty({__proto__:null,default:W0},Symbol.toStringTag,{value:"Module"})),H0={...ke,customize:{decorationColor1:"#7acaec",decorationColor2:"#7acaec"}},Y0=Object.freeze(Object.defineProperty({__proto__:null,default:H0},Symbol.toStringTag,{value:"Module"})),X0={...ke,customize:{decorationColor1:"#3f96a5",decorationColor2:"#3f96a5",reverse:!1}},q0=Object.freeze(Object.defineProperty({__proto__:null,default:X0},Symbol.toStringTag,{value:"Module"})),J0={...ke,customize:{decorationColor1:"rgba(3, 166, 224, 0.8)",decorationColor2:"rgba(3, 166, 224, 0.5)",duration:3}},K0=Object.assign({"../decoration/decoration1/setting.ts":B0,"../decoration/decoration10/setting.ts":O0,"../decoration/decoration11/setting.ts":z0,"../decoration/decoration12/setting.ts":M0,"../decoration/decoration2/setting.ts":L0,"../decoration/decoration3/setting.ts":j0,"../decoration/decoration4/setting.ts":U0,"../decoration/decoration5/setting.ts":G0,"../decoration/decoration6/setting.ts":Y0,"../decoration/decoration8/setting.ts":q0,"../decoration/decoration9/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:J0},Symbol.toStringTag,{value:"Module"}))}),Ti=[];for(const[t,r]of Object.entries(K0)){const n=t.split("/")[2];let o={};switch(n){case"decoration1":o={name:"装饰一",w:350,h:30};break;case"decoration2":o={name:"装饰二(可旋转)",w:350,h:20};break;case"decoration3":o={name:"装饰三",w:350,h:30};break;case"decoration4":o={name:"装饰四",w:30,h:320};break;case"decoration5":o={name:"装饰五",w:350,h:50};break;case"decoration6":o={name:"装饰六",w:350,h:50};break;case"decoration8":o={name:"装饰七(可旋转)",w:350,h:50};break;case"decoration9":o={name:"装饰八",w:150,h:150};break;case"decoration10":o={name:"装饰九",w:350,h:50};break;case"decoration11":o={name:"装饰十",w:350,h:100};break;case"decoration12":o={name:"装饰十一",w:150,h:150};break}Ti.push({...o,type:n,...r.default})}Ti.sort((t,r)=>Number(t.type.replace("decoration",""))-Number(r.type.replace("decoration","")));const Z0={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},Q0=Object.freeze(Object.defineProperty({__proto__:null,default:Z0},Symbol.toStringTag,{value:"Module"})),ey={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ty=Object.freeze(Object.defineProperty({__proto__:null,default:ey},Symbol.toStringTag,{value:"Module"})),ry={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",titleWidth:250,title:"我是标题"}},ny=Object.freeze(Object.defineProperty({__proto__:null,default:ry},Symbol.toStringTag,{value:"Module"})),oy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ay=Object.freeze(Object.defineProperty({__proto__:null,default:oy},Symbol.toStringTag,{value:"Module"})),iy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},ly=Object.freeze(Object.defineProperty({__proto__:null,default:iy},Symbol.toStringTag,{value:"Module"})),sy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},cy=Object.freeze(Object.defineProperty({__proto__:null,default:sy},Symbol.toStringTag,{value:"Module"})),dy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},fy=Object.freeze(Object.defineProperty({__proto__:null,default:dy},Symbol.toStringTag,{value:"Module"})),uy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",reverse:!1}},py=Object.freeze(Object.defineProperty({__proto__:null,default:uy},Symbol.toStringTag,{value:"Module"})),hy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",reverse:!1}},my=Object.freeze(Object.defineProperty({__proto__:null,default:hy},Symbol.toStringTag,{value:"Module"})),gy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},yy=Object.freeze(Object.defineProperty({__proto__:null,default:gy},Symbol.toStringTag,{value:"Module"})),by={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},_y=Object.freeze(Object.defineProperty({__proto__:null,default:by},Symbol.toStringTag,{value:"Module"})),wy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent",duration:3,reverse:!1}},Cy=Object.freeze(Object.defineProperty({__proto__:null,default:wy},Symbol.toStringTag,{value:"Module"})),Sy={...ke,customize:{borderMainColor:"#83bff6",borderSecondaryColor:"#00CED1",backgroundColor:"transparent"}},xy=Object.assign({"../border/border1/setting.ts":Q0,"../border/border10/setting.ts":ty,"../border/border11/setting.ts":ny,"../border/border12/setting.ts":ay,"../border/border13/setting.ts":ly,"../border/border2/setting.ts":cy,"../border/border3/setting.ts":fy,"../border/border4/setting.ts":py,"../border/border5/setting.ts":my,"../border/border6/setting.ts":yy,"../border/border7/setting.ts":_y,"../border/border8/setting.ts":Cy,"../border/border9/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:Sy},Symbol.toStringTag,{value:"Module"}))}),Oi=[];for(const[t,r]of Object.entries(xy)){const n=t.split("/")[2],a={name:{border1:"边框一",border2:"边框二",border3:"边框三",border4:"边框四(可翻转)",border5:"边框五(可翻转)",border6:"边框六",border7:"边框七",border8:"边框八",border9:"边框九",border10:"边框十",border11:"边框十一",border12:"边框十二",border13:"边框十三"}[n],w:450,h:320,type:n,...r.default};Oi.push({...a})}Oi.sort((t,r)=>Number(t.type.replace("border",""))-Number(r.type.replace("border","")));const vy={...ke,customize:{gradientColor0:"#1296db",gradientColor1:"#1296db",width:2}},Ey=Object.freeze(Object.defineProperty({__proto__:null,default:vy},Symbol.toStringTag,{value:"Module"})),Vy={...ke,customize:{url:"https://cn.bing.com/"}},ky=Object.freeze(Object.defineProperty({__proto__:null,default:Vy},Symbol.toStringTag,{value:"Module"})),Ny={...ke,customize:{fit:"contain",url:"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"}},$y=Object.freeze(Object.defineProperty({__proto__:null,default:Ny},Symbol.toStringTag,{value:"Module"})),Dy={...ke,customize:{title:"1234",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},By=Object.freeze(Object.defineProperty({__proto__:null,default:Dy},Symbol.toStringTag,{value:"Module"})),Ty={...ke,customize:{colorPosition:"bottom",gradientColor0:"#1296db",gradientColor1:"#1296db",borderRadius:0}},Oy=Object.freeze(Object.defineProperty({__proto__:null,default:Ty},Symbol.toStringTag,{value:"Module"})),Iy={...ke,customize:{title:"文本数据",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},zy=Object.freeze(Object.defineProperty({__proto__:null,default:Iy},Symbol.toStringTag,{value:"Module"})),Ry={...ke,customize:{title:"1234",color:"#1296db",fontSize:20,fontWeight:700,textAlign:"center",letterSpacing:1,colorPosition:"top",startColor:"#1296db",endColor:"#1296db"}},My=Object.freeze(Object.defineProperty({__proto__:null,default:Ry},Symbol.toStringTag,{value:"Module"})),Ay={...ke,customize:{gradientColor0:"#1296db",gradientColor1:"#1296db",height:2}},Ly=Object.assign({"../basic/horizontal-line/setting.ts":Ey,"../basic/iframe/setting.ts":ky,"../basic/img/setting.ts":$y,"../basic/number/setting.ts":By,"../basic/square/setting.ts":Oy,"../basic/text/setting.ts":zy,"../basic/time/setting.ts":My,"../basic/vertical-line/setting.ts":Object.freeze(Object.defineProperty({__proto__:null,default:Ay},Symbol.toStringTag,{value:"Module"}))}),Ii=[];for(const[t,r]of Object.entries(Ly)){const n=t.split("/")[2];let o={};switch(n){case"square":o={name:"正方形",w:200,h:200};break;case"img":o={name:"图片",w:200,h:200};break;case"number":o={name:"数字",w:200,h:50};break;case"text":o={name:"文本",w:200,h:50};break;case"time":o={name:"当前时间",w:200,h:50};break;case"horizontal-line":o={name:"竖线",w:10,h:100};break;case"vertical-line":o={name:"横线",w:100,h:10};break;case"iframe":o={name:"iframe",w:1e3,h:500};break}Ii.push({...o,type:n,...r.default})}const od={text:1,number:2,img:3,time:4,"vertical-line":5,"horizontal-line":6,circular:7,square:8,iframe:9};Ii.sort((t,r)=>(od[t.type]??99)-(od[r.type]??99));const Fy=t=>(e.pushScopeId("data-v-6e8b9f81"),t=t(),e.popScopeId(),t),jy={class:"text-xs"},Py={class:"flex h-10 items-center p-2",style:{"background-color":"var(--design-bg-color3)"}},Uy=Fy(()=>e.createElementVNode("span",{class:"w-1 h-4 bg-color-primary mr-2 rounded-sm"},null,-1)),Wy={class:"flex-1 overflow-hidden p-2"},Gy=["onClick"],Hy=["data-type","data-id"],Yy={class:"p-1 text-xs text-ellipsis overflow-hidden whitespace-nowrap",style:{"background-color":"var(--design-bg-color4)"}},Xy={class:"flex justify-center items-center"},qy={key:0,class:"flex items-center justify-center pb-3 mt-2"},Jy=["onClick"],Ky=["data-type","data-ptype"],Zy={class:"p-1 text-xs",style:{"background-color":"var(--design-bg-color4)"}},Qy={class:"flex items-center justify-center pt-1 pb-1",style:{"background-color":"var(--design-bg-color3)"}},eb=e.defineComponent({__name:"leftPannel",setup(t){const{proxy:r}=e.getCurrentInstance(),{echartsTypeList:n}=r.$globalUtils,o=e.ref([{label:"图层",type:"layer",icon:"ri-stack-line"},{label:"基础",type:"base",icon:"ri-supabase-line",list:Ii},{label:"指标",type:"indicators",icon:"ri-database-2-line",list:[]},{label:"边框",type:"border",icon:"ri-body-scan-line",list:Oi},{label:"装饰",type:"decoration",icon:"ri-sparkling-line",list:Ti}]),a=e.ref("layer"),i=l=>{const s=e.unref(o).find(d=>d.type=="indicators");s&&(s.list=s.list.map(d=>({...d,isOpen:d.isOpen?!1:d.id==l.id})))};return e.nextTick(()=>{r.$baseHttp.get("/api/ace-data-center/indicators/loadIndicatorsMenu",{params:{projectId:r.$baseGetCurrentProjectId}}).then(l=>{const s=[],d=e.unref(o).find(c=>c.type=="indicators");d&&(d.list=Object.keys(l.data).map((c,f)=>({name:c,id:c,isOpen:f==0,children:l.data[c].map(u=>{var p;return{...u,echartsType:(p=u.echarts)!=null&&p.length?u.echarts[0].echartsType:""}})})),s.push(...d.list.map(c=>c.children))),e.nextTick(()=>{document.querySelectorAll(".drag-node").forEach(f=>{const{ptype:u,type:p,id:h}=f.dataset;f.addEventListener("dragstart",m=>{var g;let y=(g=e.unref(o).find(b=>b.type==u))==null?void 0:g.list.find(b=>b.type==p);if(p=="MODEL_INDICATORS"){const b=s.flat().find(_=>_.id==h),w=b==null?void 0:b.echarts.find(_=>_.echartsType==b.echartsType);y={name:`${b.name}(${n[w.echartsType].name})`,chartType:b.echartsType,chartId:b.id,indicatorsId:h,w:500,h:500,customize:w.echartsConfig}}m.dataTransfer.setData("dragComponent",JSON.stringify({...y,id:li(),locked:!1}))})}),document.addEventListener("drop",f=>{f.preventDefault()},!1)})})}),(l,s)=>(e.openBlock(),e.createBlock(e.unref(E.ElTabs),{"tab-position":"left",modelValue:e.unref(a),"onUpdate:modelValue":s[0]||(s[0]=d=>e.isRef(a)?a.value=d:null),onKeydownCapture:s[1]||(s[1]=e.withKeys(e.withModifiers(()=>{},["stop","prevent"]),["native"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),d=>(e.openBlock(),e.createBlock(e.unref(E.ElTabPane),{name:d.type,key:d.type},{label:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("i",{class:e.normalizeClass(["text-xl",d.icon])},null,2),e.createElementVNode("div",jy,e.toDisplayString(d.label),1)])]),default:e.withCtx(()=>[d.type=="layer"?(e.openBlock(),e.createBlock($0,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Py,[Uy,e.createTextVNode(" "+e.toDisplayString(d.label),1)]),e.createElementVNode("div",Wy,[e.createVNode(e.unref(E.ElScrollbar),null,{default:e.withCtx(()=>[d.type=="indicators"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(d.list,c=>(e.openBlock(),e.createElementBlock("div",{key:c.label},[e.createElementVNode("div",{class:"mb-2 cursor-pointer text-ellipsis overflow-hidden whitespace-nowrap",onClick:f=>i(c)},[e.createElementVNode("i",{class:e.normalizeClass(["text-base",c.isOpen?"ri-folder-open-line":"ri-folder-line"])},null,2),e.createTextVNode(" "+e.toDisplayString(c.name),1)],8,Gy),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.children,f=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,{key:f.modelId},[f.type=="MODEL_INDICATORS"&&((u=f.echarts)!=null&&u.length)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"drag-node cursor-move mb-2",draggable:!0,"data-type":f.type,"data-id":f.id},[e.createElementVNode("div",Yy,e.toDisplayString(f.name),1),e.createElementVNode("div",Xy,[e.createElementVNode("div",{class:e.normalizeClass([`bg-${f.echartsType}`,"item-img"])},null,2)]),f.echarts.length>1?(e.openBlock(),e.createElementBlock("div",qy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.echarts,p=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass([[e.unref(n)[p.echartsType].icon,p.echartsType==f.echartsType?"activeCode":""],"cursor-pointer chart-item"]),onClick:h=>f.echartsType=p.echartsType,key:p.code},null,10,Jy))),128))])):e.createCommentVNode("",!0)],8,Hy)):e.createCommentVNode("",!0)],64)}),128))],512),[[e.vShow,c.isOpen]])]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(d.list,c=>(e.openBlock(),e.createElementBlock("div",{key:d.type,class:"drag-node cursor-move mb-2",draggable:!0,"data-type":c.type,"data-ptype":d.type},[e.createElementVNode("div",Zy,e.toDisplayString(c.name),1),e.createElementVNode("div",Qy,[e.createElementVNode("div",{class:e.normalizeClass([`bg-${c.type}`,"item-img"])},null,2)])],8,Ky))),128))]),_:2},1024)])],64))]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"]))}}),QI="",tb=Be(eb,[["__scopeId","data-v-6e8b9f81"]]);function rb(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function zi(t){return typeof t=="function"?t():e.unref(t)}const ad=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nb=Object.prototype.toString,ob=t=>nb.call(t)==="[object Object]",ab=()=>{};function ib(t){var r;const n=zi(t);return(r=n==null?void 0:n.$el)!=null?r:n}const id=ad?window:void 0,lb=ad?window.document:void 0;function ld(...t){let r,n,o,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,a]=t,r=id):[r,n,o,a]=t,!r)return ab;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(f=>f()),i.length=0},s=(f,u,p,h)=>(f.addEventListener(u,p,h),()=>f.removeEventListener(u,p,h)),d=e.watch(()=>[ib(r),zi(a)],([f,u])=>{if(l(),!f)return;const p=ob(u)?{...u}:u;i.push(...n.flatMap(h=>o.map(m=>s(f,h,m,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return rb(c),c}function sb(t){return typeof t=="function"?t:typeof t=="string"?r=>r.key===t:Array.isArray(t)?r=>t.includes(r.key):()=>!0}function cb(...t){let r,n,o={};t.length===3?(r=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(r=!0,n=t[0],o=t[1]):(r=t[0],n=t[1]):(r=!0,n=t[0]);const{target:a=id,eventName:i="keydown",passive:l=!1,dedupe:s=!1}=o,d=sb(r);return ld(a,i,f=>{f.repeat&&zi(s)||d(f)&&n(f)},l)}const db=["mousedown","mouseup","keydown","keyup"];function fb(t,r={}){const{events:n=db,document:o=lb,initial:a=null}=r,i=e.ref(a);return o&&n.forEach(l=>{ld(o,l,s=>{typeof s.getModifierState=="function"&&(i.value=s.getModifierState(t))})}),i}var ub=Object.defineProperty,sd=Object.getOwnPropertySymbols,pb=Object.prototype.hasOwnProperty,hb=Object.prototype.propertyIsEnumerable,cd=(t,r,n)=>r in t?ub(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,mb=(t,r)=>{for(var n in r||(r={}))pb.call(r,n)&&cd(t,n,r[n]);if(sd)for(var n of sd(r))hb.call(r,n)&&cd(t,n,r[n]);return t};const gb={scale:Number,thick:Number,palette:Object,index:Number,start:Number,vertical:Boolean,value:Number,isShowReferLine:Boolean};var oa=(t,r)=>{const n=t.__vccOpts||t;for(const[o,a]of r)n[o]=a;return n};const yb=e.defineComponent({name:"LineRuler",props:gb,emits:["onMouseDown","onRelease","onRemove"],setup(t,{emit:r}){const n=e.ref(0),o=e.ref(!0);e.onMounted(()=>{n.value=t.value});const a=f=>{o.value=f>=0},i=e.computed(()=>{const f=(n.value-t.start)*t.scale;a(f);const u=f+"px";return t.vertical?{top:u}:{left:u}}),l=e.computed(()=>{var f;const u=`1px solid ${(f=t.palette)==null?void 0:f.lineColor}`,p=t.vertical?{borderTop:u}:{borderLeft:u},h=t.isShowReferLine?t.vertical?"ns-resize":"ew-resize":"none";return mb({cursor:h},p)}),s=e.computed(()=>t.vertical?{left:t.thick+"px"}:{top:t.thick+"px"});return{startValue:n,showLine:o,offset:i,borderCursor:l,actionStyle:s,handleDown:f=>{const u=t.vertical?f.clientY:f.clientX,p=n.value;r("onMouseDown");const h=y=>{const g=t.vertical?y.clientY:y.clientX,b=Math.round(p+(g-u)/t.scale);n.value=b},m=()=>{r("onRelease",n.value,t.index),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",m)},handleRemove:()=>{r("onRemove",t.index)}}}}),bb={class:"value"};function _b(t,r,n,o,a,i){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"line",style:e.normalizeStyle([t.offset,t.borderCursor]),onMousedown:r[1]||(r[1]=(...l)=>t.handleDown&&t.handleDown(...l))},[e.createElementVNode("div",{class:"action",style:e.normalizeStyle(t.actionStyle)},[e.createElementVNode("span",{class:"del",onClick:r[0]||(r[0]=(...l)=>t.handleRemove&&t.handleRemove(...l))},"×"),e.createElementVNode("span",bb,e.toDisplayString(t.startValue),1)],4)],36)),[[e.vShow,t.showLine]])}var wb=oa(yb,[["render",_b],["__scopeId","data-v-7cc5d020"]]);const Cb=t=>t<=.25?40:t<=.5?20:t<=1?10:t<=2?5:t<=4?2:1,dd=.83,Sb=(t,r,n,o,a,i)=>{const{scale:l,width:s,height:d,ratio:c,palette:f}=a,{bgColor:u,fontColor:p,shadowColor:h,longfgColor:m,shortfgColor:y}=f;if(t.scale(c,c),t.clearRect(0,0,s,d),t.fillStyle=u,t.fillRect(0,0,s,d),o){const $=(n-r)*l,B=o*l;t.fillStyle=h,i?t.fillRect($,0,B,d*3/8):t.fillRect(0,$,s*3/8,B)}const g=Cb(l),b=g*l,w=g*10,_=w*l,C=Math.floor(r/g)*g,S=Math.floor(r/w)*w,x=(C-r)/g*b,v=(S-r)/w*_,V=r+Math.ceil((i?s:d)/l);t.beginPath(),t.fillStyle=p,t.strokeStyle=m;for(let $=S,B=0;$<V;$+=w,B++){const R=v+B*_+.5;i?t.moveTo(R,0):t.moveTo(0,R),t.save(),i?t.translate(R,d*.4):t.translate(s*.4,R),i||t.rotate(-Math.PI/2),t.scale(dd/c,dd/c),t.fillText($.toString(),4*c,7*c),t.restore(),i?t.lineTo(R,d*9/16):t.lineTo(s*9/16,R)}t.stroke(),t.closePath(),t.beginPath(),t.strokeStyle=y;for(let $=C,B=0;$<V;$+=g,B++){const R=x+B*b+.5;i?t.moveTo(R,0):t.moveTo(0,R),$%w!==0&&(i?t.lineTo(R,d*1/4):t.lineTo(s*1/4,R))}t.stroke(),t.closePath(),t.setTransform(1,0,0,1,0,0)},xb=e.defineComponent({name:"CanvasRuler",props:{showIndicator:Boolean,valueNum:Number,scale:Number,ratio:Number,palette:Object,vertical:Boolean,start:Number,width:Number,height:Number,selectStart:Number,selectLength:Number},emits:["onAddLine","update:showIndicator","update:valueNum"],setup(t,{emit:r}){const n=e.reactive({canvasContext:null});let o=1;const a=e.ref(null);e.onMounted(()=>{o=t.ratio||window.devicePixelRatio||1,i(),l(o),s(o)});const i=()=>{n.canvasContext=a.value&&a.value.getContext("2d")},l=c=>{if(a.value){a.value.width=t.width*c,a.value.height=t.height*c;const f=n.canvasContext;f&&(f.font=`${12*c}px -apple-system,
16
16
  "Helvetica Neue", ".SFNSText-Regular",
17
17
  "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB",
18
- "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif`,f.lineWidth=1,f.textBaseline="middle")}},s=c=>{const f={scale:t.scale,width:t.width,height:t.height,palette:t.palette,ratio:c};n.canvasContext&&Sb(n.canvasContext,t.start,t.selectStart,t.selectLength,f,!t.vertical)};return e.watch(()=>t.start,()=>s(o)),e.watch([()=>t.width,()=>t.height],()=>{l(o),s(o)}),{handle:(c,f)=>{const u=(m,y,g)=>Math.round(y+m/g),p=t.vertical?c.offsetY:c.offsetX,h=u(p,t.start,t.scale);switch(f){case"click":r("onAddLine",h);break;case"enter":r("update:valueNum",h),r("update:showIndicator",!0);break;default:r("update:valueNum",h);break}},canvas:a}}});function vb(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("canvas",{ref:"canvas",class:"ruler",onClick:r[0]||(r[0]=l=>t.handle(l,"click")),onMouseenter:r[1]||(r[1]=l=>t.handle(l,"enter")),onMousemove:r[2]||(r[2]=l=>t.handle(l,"move")),onMouseleave:r[3]||(r[3]=l=>t.$emit("update:showIndicator",!1))},null,544)}var Eb=oa(xb,[["render",vb]]);const Vb={scale:Number,ratio:Number,thick:Number,palette:Object,vertical:{type:Boolean,default:!0},width:{type:Number,default:200},height:{type:Number,default:200},start:{type:Number,default:0},lines:{type:Array,default:()=>[]},selectStart:{type:Number},selectLength:{type:Number},isShowReferLine:{type:Boolean}},kb=e.defineComponent({name:"RulerWrapper",components:{CanvasRuler:Eb,RulerLine:wb},props:Vb,setup(t){const r=e.ref(!1),n=e.ref(0),o=e.computed(()=>t.vertical?"v-container":"h-container"),a=e.computed(()=>{const c={width:`calc(100% - ${t.thick}px)`,height:`${t.thick+1}px`,left:`${t.thick}px`},f={width:`${t.thick&&t.thick+1}px`,height:`calc(100% - ${t.thick}px)`,top:`${t.thick}px`};return t.vertical?f:c}),i=e.computed(()=>{var c;const f=(n.value-t.start)*t.scale;let u="top",p="borderLeft";return u=t.vertical?"top":"left",p=t.vertical?"borderBottom":"borderLeft",{[u]:f+"px",[p]:`1px solid ${(c=t.palette)==null?void 0:c.lineColor}`}}),l=c=>{t.lines.push(c)},s=(c,f)=>{const u=c-t.start,p=(t.vertical?t.height:t.width)/t.scale;u<0||u>p?d(f):t.lines[f]=c},d=c=>{t.lines.splice(c,1)};return{showIndicator:r,valueNum:n,rwClassName:o,rwStyle:a,indicatorStyle:i,handleNewLine:l,handleLineRelease:s,handleLineRemove:d}}}),Nb={class:"lines"},$b={class:"value"};function Db(t,r,n,o,a,i){const l=e.resolveComponent("CanvasRuler"),s=e.resolveComponent("RulerLine");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.rwClassName),style:e.normalizeStyle(t.rwStyle)},[e.createVNode(l,{vertical:t.vertical,scale:t.scale,width:t.width,height:t.height,start:t.start,ratio:t.ratio,"select-start":t.selectStart,"select-length":t.selectLength,palette:t.palette,valueNum:t.valueNum,"onUpdate:valueNum":r[0]||(r[0]=d=>t.valueNum=d),showIndicator:t.showIndicator,"onUpdate:showIndicator":r[1]||(r[1]=d=>t.showIndicator=d),onOnAddLine:t.handleNewLine},null,8,["vertical","scale","width","height","start","ratio","select-start","select-length","palette","valueNum","showIndicator","onOnAddLine"]),e.withDirectives(e.createElementVNode("div",Nb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lines,(d,c)=>(e.openBlock(),e.createBlock(s,{key:d+c,index:c,value:d>>0,scale:t.scale,start:t.start,thick:t.thick,palette:t.palette,vertical:t.vertical,"is-show-refer-line":t.isShowReferLine,onOnRemove:t.handleLineRemove,onOnRelease:t.handleLineRelease},null,8,["index","value","scale","start","thick","palette","vertical","is-show-refer-line","onOnRemove","onOnRelease"]))),128))],512),[[e.vShow,t.isShowReferLine]]),e.withDirectives(e.createElementVNode("div",{class:"indicator",style:e.normalizeStyle(t.indicatorStyle)},[e.createElementVNode("div",$b,e.toDisplayString(t.valueNum),1)],4),[[e.vShow,t.showIndicator]])],6)}var Bb=oa(kb,[["render",Db],["__scopeId","data-v-65a7f0f6"]]);const Tb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAopJREFUOE/FlE9IVEEcx7+/N9ouds1Mu0QUSFZYdIgoUqQoKPBQHsKozpXE7jbTO/U8xLJvn6usBHWQ6hBFXupSkQeVbh0KJEPp0sH+eLGTsKs77xcj78m0ax0E8cHjzZv5zef3/c33xxA24KENYGJzoEEQbNNaN4Zh2OQ4znwYhr9c1/39vwrXVDo0NNS0tLR0GYB5D64BmAMwzMyvlFKz1es10Hw+f4mZ7wHYBeA9gNdENFepVOaEEM3M3OI4Thczn41gt6WUgQ3+C+r7/h0AWQD3mXnYqPA8L9nQ0HCemduIaFpKOWoAhUJhT6VSuQXgOjP3K6W8GLwKzeVyp4jonR0QBEErM48w8zFLyayUsjX+z+VyHhHdZebTSqkxM78CHRgYOKS1/ghgVErZY214RkQ7ADyRUj72ff8qgCtmXUrZGcf5vv8CwEUhxOF0Ov1pBRpla5dSdseBhUJhpznH6tIsZb1KqacW+BGArUaUXX63UuplHJTNZjuEEONSyhozfd/n6mQ1RkXZL2itz7mu+80EDA4ONi8vL/8AcM2UbikyR2BU9cSmmTU70YqKIAj2hWFo2uenlHK/BRg3Y2aeNO5GyU8S0ZbFxcUuz/NKEXAGQKPjOCcymcyX1dIi8DSAiWQyeaavr68cbSgCuBknYubnQoj+TCYzUywWE6VS6S2ADsdx2gxw1X3L7SNENMbMnwE8qK+vf5NKpRaMaeVyeW8ikfiaSqW+R7BuZr5BRMe11p2u607U9Gk8kc/ntzPzQwCmExYATDLzVBiGE0KIowAOADDf3QA+aK2VDaxRajto3K+rq+tl5nYAzQBamHmeiOYBTGmtR6ph/1Rqg9c73pz7dD1qN0TpHyNQRCUDJXrAAAAAAElFTkSuQmCC",Ob="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAjtJREFUOE/NlD9oFEEUxn9v9ghC0hpRUogIAUmniGAT/5Q2FrETPSNRJILg7RwimI0ox85eQFCEBGIUO1PYpFM0jSConQoBEZGgGPsgl+w+2eM2bC57SopAFqYZ3v7m+977ZoQt+GQLmGxPaBiGgYiMWWvXBHZUGoZhH3BERPYC+4F+4Keq/urt7b1RLpf/ZEBVHa9Wq0HWyg3QKIoGVPU8cA7wgK/pUtXPQJ8xZk+pVBpuNBqXUoUiEvi+P56fzTpo6+SbwHNg1lo7WzTITGEKXFlZeeB53tVCpa3CK8AFa+1cBgvD8LKIXAQOJkkyICJDeYVBEJS6u7s/qeoLa+1o+l9TqXNuBLhmjDlbqVQ+5ICjInIfOBPH8W9jzGCR5YmJiRNxHM+papgqzqDvgSlr7VTernPuO3An3c9bBt74vv+yrdaKyLDv+/1Sq9UGPc97nY9EVuycU2AQOA7cAm4Dr4D5TvVxHB9rKo2iaEFVp621Ln96FEUngaOqGmSxabVqsh3a2h+x1h5qQjNrae/yE4+iaCwDJkky73neTuBZe129Xk+H+BS4l7ZqLVIZ2BhzuFKpvMsDVXXWGPMxFdAedOfcKeCRqj7MYrUhpz09PfXl5eXrectFWXXODQHpOq2qd/95o/JXr6ura3J1dXU6SZIfwKKIHAD2tVYMPBGRx77vN10UXtO85fTkmZmZHUtLSzUR2QXsBhaAL6r6DXhbrVYXi1yss59GqOgub/bN3Z7v6X/tb9Zmp/q/kN8s+lJb8oEAAAAASUVORK5CYII=",Ib={scale:{type:Number,default:1},ratio:{type:Number},thick:{type:Number,default:16},palette:Object,startX:{type:Number},startY:{type:Number,default:0},width:{type:Number,default:200},height:{type:Number,default:200},shadow:{type:Object,default:()=>({x:0,y:0,width:0,height:0})},lines:{type:Object,default:()=>({h:[],v:[]})},cornerActive:{type:Boolean,default:!1},isShowReferLine:{type:Boolean,default:!0}},zb=e.defineComponent({name:"SketchRule",components:{RulerWrapper:Bb},props:Ib,emits:["onCornerClick","handleLine"],setup(t,{emit:r}){let n=e.ref(!0);n.value=t.isShowReferLine;const o=e.computed(()=>{function s(c,f){return Object.keys(c).forEach(u=>{u&&c.hasOwnProperty(u)&&(typeof f.key=="object"?c[u]=s(c[u],f[u]):f.hasOwnProperty(u)&&(c[u]=f[u]))}),c}return s({bgColor:"rgba(225,225,225, 0)",longfgColor:"#BABBBC",shortfgColor:"#C8CDD0",fontColor:"#7D8694",shadowColor:"#E8E8E8",lineColor:"#EB5648",borderColor:"#DADADC",cornerActiveColor:"rgb(235, 86, 72, 0.6)",menu:{bgColor:"#fff",dividerColor:"#DBDBDB",listItem:{textColor:"#415058",hoverTextColor:"#298DF8",disabledTextColor:"rgba(65, 80, 88, 0.4)",bgColor:"#fff",hoverBgColor:"#F2F2F2"}}},t.palette||{})}),a=e.computed(()=>t.cornerActive?" active":""),i=e.computed(()=>({backgroundImage:n.value?`url(${Tb})`:`url(${Ob})`,width:t.thick+"px",height:t.thick+"px",borderRight:`1px solid ${o.value.borderColor}`,borderBottom:`1px solid ${o.value.borderColor}`}));return{isShowReferLine:n,paletteCpu:o,cornerActiveClass:a,cornerStyle:i,onCornerClick:s=>{n.value=!n.value,r("onCornerClick",s)}}}}),Rb={id:"mb-ruler",class:"style-ruler mb-ruler"};function Mb(t,r,n,o,a,i){const l=e.resolveComponent("RulerWrapper");return e.openBlock(),e.createElementBlock("div",Rb,[e.createVNode(l,{vertical:!1,width:t.width,height:t.thick,"is-show-refer-line":t.isShowReferLine,thick:t.thick,ratio:t.ratio,start:t.startX,lines:t.lines.h,"select-start":t.shadow.x,"select-length":t.shadow.width,scale:t.scale,palette:t.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),e.createVNode(l,{vertical:!0,width:t.thick,height:t.height,"is-show-refer-line":t.isShowReferLine,thick:t.thick,ratio:t.ratio,start:t.startY,lines:t.lines.v,"select-start":t.shadow.y,"select-length":t.shadow.height,scale:t.scale,palette:t.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),e.createElementVNode("a",{class:e.normalizeClass(["corner",t.cornerActiveClass]),style:e.normalizeStyle(t.cornerStyle),onClick:r[0]||(r[0]=(...s)=>t.onCornerClick&&t.onCornerClick(...s))},null,6)])}var Ab=oa(zb,[["render",Mb]]);const ez="",Lb=e.defineComponent({__name:"sketchRule",setup(t){const r=Re(),{proxy:n}=e.getCurrentInstance(),{stageWidth:o,stageHeight:a}=r.getStage,i={bgColor:"rgba(225,225,225, 0)",longfgColor:"#BABBBC",shortfgColor:"#C8CDD0",fontColor:"#7D8694",shadowColor:"transparent",lineColor:"#0089d0",borderColor:"#transparent",cornerActiveColor:"rgb(235, 86, 72, 0.6)"},l=e.reactive({innerWidth:0,innerHeight:0,thick:20,width:3e3,height:3e3,startX:0,startY:0}),s=e.ref({});e.watch(()=>r.scale,()=>{f()});const d=()=>{e.nextTick(()=>{var _;const u=(_=document.querySelector("#design-container"))==null?void 0:_.getBoundingClientRect();if(!u)return;l.innerWidth=u.width,l.innerHeight=u.height;const{width:p,height:h,thick:m,innerWidth:y,innerHeight:g}=l,b=p-y,w=h-g;s.value={width:b>0?p+b+m+30+"px":e.unref(p)+"px",height:w>0?h+w+m+30+"px":e.unref(h)+"px"},c()})},c=()=>{const u=l.innerWidth/(o+120),p=l.innerHeight/(a+120),h=Math.floor(Math.min(u*100,p*100));r.setSacle(h<100?h:100)},f=()=>{e.nextTick(()=>{const u=document.querySelector("#screens").getBoundingClientRect(),p=document.querySelector("#canvas").getBoundingClientRect(),h=(u.left+l.thick-p.left)/r.getScale,m=(u.top+l.thick-p.top)/r.getScale;l.startX=h>>0,l.startY=m>>0})};return n.$baseEventBus.on("auto-scale",()=>{c()}),d(),f(),window.addEventListener("resize",d),e.onUnmounted(()=>{window.removeEventListener("resize",d)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute left-0 top-0 grid-bg",style:e.normalizeStyle({width:e.unref(l).width+e.unref(l).thick+"px",height:e.unref(l).height+e.unref(l).thick+"px"})},[(e.openBlock(),e.createBlock(e.unref(Ab),{key:e.unref(r).getScale,thick:e.unref(l).thick,scale:e.unref(r).getScale,width:e.unref(l).width,height:e.unref(l).height,startX:e.unref(l).startX,startY:e.unref(l).startY,palette:i,lines:e.unref(r).getSketchRuleLine},null,8,["thick","scale","width","height","startX","startY","lines"])),e.createElementVNode("div",{id:"screens",class:"absolute overflow-scroll",style:e.normalizeStyle({width:e.unref(l).innerWidth+"px",height:e.unref(l).innerHeight+"px"}),onScroll:f},[e.createElementVNode("div",{class:"absolute left-0 top-0",style:e.normalizeStyle(e.unref(s))},[e.createElementVNode("div",{id:"canvas",style:e.normalizeStyle({transform:`scale(${e.unref(r).getScale})`,transformOrigin:"0 0 0",background:"var(--design-bg-color2)"})},[e.createElementVNode("div",{class:"render",style:e.normalizeStyle({width:e.unref(o)+"px",height:e.unref(a)+"px",backgroundColor:e.unref(r).getWidgetConfig.backgroundColor=="transparent"?"var(--design-bg-color2)":e.unref(r).getWidgetConfig.backgroundColor,backgroundImage:`url(${e.unref(r).getWidgetConfig.backgroundImage})`,backgroundSize:"cover"})},[e.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4)],4)],36)],4))}}),tz="",Fb=Be(Lb,[["__scopeId","data-v-e3d33b6d"]]);function jb(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.map(function(o){return o.split(" ").map(function(a){return a?""+t+a:""}).join(" ")}).join(" ")}function Pb(t,r){return r.replace(/([^}{]*){/gm,function(n,o){return o.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"})}function pr(t,r){return function(n){n&&(t[r]=n)}}function fd(t,r,n){return function(o){o&&(t[r][n]=o)}}function Ri(t,r){return function(n){var o=n.prototype;t.forEach(function(a){r(o,a)})}}function Ub(t,r){return r===void 0&&(r={}),function(n,o){t.forEach(function(a){var i=r[a]||a;i in n||(n[i]=function(){for(var l,s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];var c=(l=this[o])[a].apply(l,s);return c===this[o]?this:c})})}}var Wb="function",Gb="object",Hb="string",Yb="number",Mi="undefined",ud=typeof window!==Mi,Xb=typeof document!==Mi&&document,qb=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],Ke=1e-7,aa={cm:function(t){return t*96/2.54},mm:function(t){return t*96/254},in:function(t){return t*96},pt:function(t){return t*96/72},pc:function(t){return t*96/6},"%":function(t,r){return t*r/100},vw:function(t,r){return r===void 0&&(r=window.innerWidth),t/100*r},vh:function(t,r){return r===void 0&&(r=window.innerHeight),t/100*r},vmax:function(t,r){return r===void 0&&(r=Math.max(window.innerWidth,window.innerHeight)),t/100*r},vmin:function(t,r){return r===void 0&&(r=Math.min(window.innerWidth,window.innerHeight)),t/100*r}};/*! *****************************************************************************
18
+ "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif`,f.lineWidth=1,f.textBaseline="middle")}},s=c=>{const f={scale:t.scale,width:t.width,height:t.height,palette:t.palette,ratio:c};n.canvasContext&&Sb(n.canvasContext,t.start,t.selectStart,t.selectLength,f,!t.vertical)};return e.watch(()=>t.start,()=>s(o)),e.watch([()=>t.width,()=>t.height],()=>{l(o),s(o)}),{handle:(c,f)=>{const u=(m,y,g)=>Math.round(y+m/g),p=t.vertical?c.offsetY:c.offsetX,h=u(p,t.start,t.scale);switch(f){case"click":r("onAddLine",h);break;case"enter":r("update:valueNum",h),r("update:showIndicator",!0);break;default:r("update:valueNum",h);break}},canvas:a}}});function vb(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("canvas",{ref:"canvas",class:"ruler",onClick:r[0]||(r[0]=l=>t.handle(l,"click")),onMouseenter:r[1]||(r[1]=l=>t.handle(l,"enter")),onMousemove:r[2]||(r[2]=l=>t.handle(l,"move")),onMouseleave:r[3]||(r[3]=l=>t.$emit("update:showIndicator",!1))},null,544)}var Eb=oa(xb,[["render",vb]]);const Vb={scale:Number,ratio:Number,thick:Number,palette:Object,vertical:{type:Boolean,default:!0},width:{type:Number,default:200},height:{type:Number,default:200},start:{type:Number,default:0},lines:{type:Array,default:()=>[]},selectStart:{type:Number},selectLength:{type:Number},isShowReferLine:{type:Boolean}},kb=e.defineComponent({name:"RulerWrapper",components:{CanvasRuler:Eb,RulerLine:wb},props:Vb,setup(t){const r=e.ref(!1),n=e.ref(0),o=e.computed(()=>t.vertical?"v-container":"h-container"),a=e.computed(()=>{const c={width:`calc(100% - ${t.thick}px)`,height:`${t.thick+1}px`,left:`${t.thick}px`},f={width:`${t.thick&&t.thick+1}px`,height:`calc(100% - ${t.thick}px)`,top:`${t.thick}px`};return t.vertical?f:c}),i=e.computed(()=>{var c;const f=(n.value-t.start)*t.scale;let u="top",p="borderLeft";return u=t.vertical?"top":"left",p=t.vertical?"borderBottom":"borderLeft",{[u]:f+"px",[p]:`1px solid ${(c=t.palette)==null?void 0:c.lineColor}`}}),l=c=>{t.lines.push(c)},s=(c,f)=>{const u=c-t.start,p=(t.vertical?t.height:t.width)/t.scale;u<0||u>p?d(f):t.lines[f]=c},d=c=>{t.lines.splice(c,1)};return{showIndicator:r,valueNum:n,rwClassName:o,rwStyle:a,indicatorStyle:i,handleNewLine:l,handleLineRelease:s,handleLineRemove:d}}}),Nb={class:"lines"},$b={class:"value"};function Db(t,r,n,o,a,i){const l=e.resolveComponent("CanvasRuler"),s=e.resolveComponent("RulerLine");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.rwClassName),style:e.normalizeStyle(t.rwStyle)},[e.createVNode(l,{vertical:t.vertical,scale:t.scale,width:t.width,height:t.height,start:t.start,ratio:t.ratio,"select-start":t.selectStart,"select-length":t.selectLength,palette:t.palette,valueNum:t.valueNum,"onUpdate:valueNum":r[0]||(r[0]=d=>t.valueNum=d),showIndicator:t.showIndicator,"onUpdate:showIndicator":r[1]||(r[1]=d=>t.showIndicator=d),onOnAddLine:t.handleNewLine},null,8,["vertical","scale","width","height","start","ratio","select-start","select-length","palette","valueNum","showIndicator","onOnAddLine"]),e.withDirectives(e.createElementVNode("div",Nb,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lines,(d,c)=>(e.openBlock(),e.createBlock(s,{key:d+c,index:c,value:d>>0,scale:t.scale,start:t.start,thick:t.thick,palette:t.palette,vertical:t.vertical,"is-show-refer-line":t.isShowReferLine,onOnRemove:t.handleLineRemove,onOnRelease:t.handleLineRelease},null,8,["index","value","scale","start","thick","palette","vertical","is-show-refer-line","onOnRemove","onOnRelease"]))),128))],512),[[e.vShow,t.isShowReferLine]]),e.withDirectives(e.createElementVNode("div",{class:"indicator",style:e.normalizeStyle(t.indicatorStyle)},[e.createElementVNode("div",$b,e.toDisplayString(t.valueNum),1)],4),[[e.vShow,t.showIndicator]])],6)}var Bb=oa(kb,[["render",Db],["__scopeId","data-v-65a7f0f6"]]);const Tb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAopJREFUOE/FlE9IVEEcx7+/N9ouds1Mu0QUSFZYdIgoUqQoKPBQHsKozpXE7jbTO/U8xLJvn6usBHWQ6hBFXupSkQeVbh0KJEPp0sH+eLGTsKs77xcj78m0ax0E8cHjzZv5zef3/c33xxA24KENYGJzoEEQbNNaN4Zh2OQ4znwYhr9c1/39vwrXVDo0NNS0tLR0GYB5D64BmAMwzMyvlFKz1es10Hw+f4mZ7wHYBeA9gNdENFepVOaEEM3M3OI4Thczn41gt6WUgQ3+C+r7/h0AWQD3mXnYqPA8L9nQ0HCemduIaFpKOWoAhUJhT6VSuQXgOjP3K6W8GLwKzeVyp4jonR0QBEErM48w8zFLyayUsjX+z+VyHhHdZebTSqkxM78CHRgYOKS1/ghgVErZY214RkQ7ADyRUj72ff8qgCtmXUrZGcf5vv8CwEUhxOF0Ov1pBRpla5dSdseBhUJhpznH6tIsZb1KqacW+BGArUaUXX63UuplHJTNZjuEEONSyhozfd/n6mQ1RkXZL2itz7mu+80EDA4ONi8vL/8AcM2UbikyR2BU9cSmmTU70YqKIAj2hWFo2uenlHK/BRg3Y2aeNO5GyU8S0ZbFxcUuz/NKEXAGQKPjOCcymcyX1dIi8DSAiWQyeaavr68cbSgCuBknYubnQoj+TCYzUywWE6VS6S2ADsdx2gxw1X3L7SNENMbMnwE8qK+vf5NKpRaMaeVyeW8ikfiaSqW+R7BuZr5BRMe11p2u607U9Gk8kc/ntzPzQwCmExYATDLzVBiGE0KIowAOADDf3QA+aK2VDaxRajto3K+rq+tl5nYAzQBamHmeiOYBTGmtR6ph/1Rqg9c73pz7dD1qN0TpHyNQRCUDJXrAAAAAAElFTkSuQmCC",Ob="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAjtJREFUOE/NlD9oFEEUxn9v9ghC0hpRUogIAUmniGAT/5Q2FrETPSNRJILg7RwimI0ox85eQFCEBGIUO1PYpFM0jSConQoBEZGgGPsgl+w+2eM2bC57SopAFqYZ3v7m+977ZoQt+GQLmGxPaBiGgYiMWWvXBHZUGoZhH3BERPYC+4F+4Keq/urt7b1RLpf/ZEBVHa9Wq0HWyg3QKIoGVPU8cA7wgK/pUtXPQJ8xZk+pVBpuNBqXUoUiEvi+P56fzTpo6+SbwHNg1lo7WzTITGEKXFlZeeB53tVCpa3CK8AFa+1cBgvD8LKIXAQOJkkyICJDeYVBEJS6u7s/qeoLa+1o+l9TqXNuBLhmjDlbqVQ+5ICjInIfOBPH8W9jzGCR5YmJiRNxHM+papgqzqDvgSlr7VTernPuO3An3c9bBt74vv+yrdaKyLDv+/1Sq9UGPc97nY9EVuycU2AQOA7cAm4Dr4D5TvVxHB9rKo2iaEFVp621Ln96FEUngaOqGmSxabVqsh3a2h+x1h5qQjNrae/yE4+iaCwDJkky73neTuBZe129Xk+H+BS4l7ZqLVIZ2BhzuFKpvMsDVXXWGPMxFdAedOfcKeCRqj7MYrUhpz09PfXl5eXrectFWXXODQHpOq2qd/95o/JXr6ura3J1dXU6SZIfwKKIHAD2tVYMPBGRx77vN10UXtO85fTkmZmZHUtLSzUR2QXsBhaAL6r6DXhbrVYXi1yss59GqOgub/bN3Z7v6X/tb9Zmp/q/kN8s+lJb8oEAAAAASUVORK5CYII=",Ib={scale:{type:Number,default:1},ratio:{type:Number},thick:{type:Number,default:16},palette:Object,startX:{type:Number},startY:{type:Number,default:0},width:{type:Number,default:200},height:{type:Number,default:200},shadow:{type:Object,default:()=>({x:0,y:0,width:0,height:0})},lines:{type:Object,default:()=>({h:[],v:[]})},cornerActive:{type:Boolean,default:!1},isShowReferLine:{type:Boolean,default:!0}},zb=e.defineComponent({name:"SketchRule",components:{RulerWrapper:Bb},props:Ib,emits:["onCornerClick","handleLine"],setup(t,{emit:r}){let n=e.ref(!0);n.value=t.isShowReferLine;const o=e.computed(()=>{function s(c,f){return Object.keys(c).forEach(u=>{u&&c.hasOwnProperty(u)&&(typeof f.key=="object"?c[u]=s(c[u],f[u]):f.hasOwnProperty(u)&&(c[u]=f[u]))}),c}return s({bgColor:"rgba(225,225,225, 0)",longfgColor:"#BABBBC",shortfgColor:"#C8CDD0",fontColor:"#7D8694",shadowColor:"#E8E8E8",lineColor:"#EB5648",borderColor:"#DADADC",cornerActiveColor:"rgb(235, 86, 72, 0.6)",menu:{bgColor:"#fff",dividerColor:"#DBDBDB",listItem:{textColor:"#415058",hoverTextColor:"#298DF8",disabledTextColor:"rgba(65, 80, 88, 0.4)",bgColor:"#fff",hoverBgColor:"#F2F2F2"}}},t.palette||{})}),a=e.computed(()=>t.cornerActive?" active":""),i=e.computed(()=>({backgroundImage:n.value?`url(${Tb})`:`url(${Ob})`,width:t.thick+"px",height:t.thick+"px",borderRight:`1px solid ${o.value.borderColor}`,borderBottom:`1px solid ${o.value.borderColor}`}));return{isShowReferLine:n,paletteCpu:o,cornerActiveClass:a,cornerStyle:i,onCornerClick:s=>{n.value=!n.value,r("onCornerClick",s)}}}}),Rb={id:"mb-ruler",class:"style-ruler mb-ruler"};function Mb(t,r,n,o,a,i){const l=e.resolveComponent("RulerWrapper");return e.openBlock(),e.createElementBlock("div",Rb,[e.createVNode(l,{vertical:!1,width:t.width,height:t.thick,"is-show-refer-line":t.isShowReferLine,thick:t.thick,ratio:t.ratio,start:t.startX,lines:t.lines.h,"select-start":t.shadow.x,"select-length":t.shadow.width,scale:t.scale,palette:t.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),e.createVNode(l,{vertical:!0,width:t.thick,height:t.height,"is-show-refer-line":t.isShowReferLine,thick:t.thick,ratio:t.ratio,start:t.startY,lines:t.lines.v,"select-start":t.shadow.y,"select-length":t.shadow.height,scale:t.scale,palette:t.paletteCpu},null,8,["width","height","is-show-refer-line","thick","ratio","start","lines","select-start","select-length","scale","palette"]),e.createElementVNode("a",{class:e.normalizeClass(["corner",t.cornerActiveClass]),style:e.normalizeStyle(t.cornerStyle),onClick:r[0]||(r[0]=(...s)=>t.onCornerClick&&t.onCornerClick(...s))},null,6)])}var Ab=oa(zb,[["render",Mb]]);const ez="",Lb=e.defineComponent({__name:"sketchRule",setup(t){const r=Re(),{proxy:n}=e.getCurrentInstance(),{stageWidth:o,stageHeight:a}=r.getStage,i={bgColor:"rgba(225,225,225, 0)",longfgColor:"#BABBBC",shortfgColor:"#C8CDD0",fontColor:"#7D8694",shadowColor:"transparent",lineColor:"#0089d0",borderColor:"#transparent",cornerActiveColor:"rgb(235, 86, 72, 0.6)"},l=e.reactive({innerWidth:0,innerHeight:0,thick:20,width:3e3,height:3e3,startX:0,startY:0}),s=e.ref({});e.watch(()=>r.scale,()=>{f()});const d=()=>{e.nextTick(()=>{var _;const u=(_=document.querySelector("#design-container"))==null?void 0:_.getBoundingClientRect();if(!u)return;l.innerWidth=u.width,l.innerHeight=u.height;const{width:p,height:h,thick:m,innerWidth:y,innerHeight:g}=l,b=p-y,w=h-g;s.value={width:b>0?p+b+m+30+"px":e.unref(p)+"px",height:w>0?h+w+m+30+"px":e.unref(h)+"px"},c()})},c=()=>{const u=l.innerWidth/(o+120),p=l.innerHeight/(a+120),h=Math.floor(Math.min(u*100,p*100));r.setSacle(h<100?h:100)},f=()=>{e.nextTick(()=>{const u=document.querySelector("#screens").getBoundingClientRect(),p=document.querySelector("#canvas").getBoundingClientRect(),h=(u.left+l.thick-p.left)/r.getScale,m=(u.top+l.thick-p.top)/r.getScale;l.startX=h>>0,l.startY=m>>0})};return n.$baseEventBus.on("auto-scale",()=>{c()}),d(),f(),window.addEventListener("resize",d),e.onUnmounted(()=>{window.removeEventListener("resize",d)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute left-0 top-0 grid-bg",style:e.normalizeStyle({width:e.unref(l).width+e.unref(l).thick+"px",height:e.unref(l).height+e.unref(l).thick+"px"})},[(e.openBlock(),e.createBlock(e.unref(Ab),{key:e.unref(r).getScale,thick:e.unref(l).thick,scale:e.unref(r).getScale,width:e.unref(l).width,height:e.unref(l).height,startX:e.unref(l).startX,startY:e.unref(l).startY,palette:i,lines:e.unref(r).getSketchRuleLine},null,8,["thick","scale","width","height","startX","startY","lines"])),e.createElementVNode("div",{id:"screens",class:"absolute overflow-scroll",style:e.normalizeStyle({width:e.unref(l).innerWidth+"px",height:e.unref(l).innerHeight+"px"}),onScroll:f},[e.createElementVNode("div",{class:"absolute left-0 top-0",style:e.normalizeStyle(e.unref(s))},[e.createElementVNode("div",{id:"canvas",style:e.normalizeStyle({transform:`scale(${e.unref(r).getScale})`,transformOrigin:"0 0 0",background:"var(--design-bg-color2)"})},[e.createElementVNode("div",{class:"render",style:e.normalizeStyle({width:e.unref(o)+"px",height:e.unref(a)+"px",backgroundColor:e.unref(r).getWidgetConfig.backgroundColor=="transparent"?"var(--design-bg-color2)":e.unref(r).getWidgetConfig.backgroundColor,backgroundImage:`url(${e.unref(r).getWidgetConfig.backgroundImage})`,backgroundSize:"cover"})},[e.renderSlot(u.$slots,"default",{},void 0,!0)],4)],4)],4)],36)],4))}}),tz="",Fb=Be(Lb,[["__scopeId","data-v-e3d33b6d"]]);function jb(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return r.map(function(o){return o.split(" ").map(function(a){return a?""+t+a:""}).join(" ")}).join(" ")}function Pb(t,r){return r.replace(/([^}{]*){/gm,function(n,o){return o.replace(/\.([^{,\s\d.]+)/g,"."+t+"$1")+"{"})}function pr(t,r){return function(n){n&&(t[r]=n)}}function fd(t,r,n){return function(o){o&&(t[r][n]=o)}}function Ri(t,r){return function(n){var o=n.prototype;t.forEach(function(a){r(o,a)})}}function Ub(t,r){return r===void 0&&(r={}),function(n,o){t.forEach(function(a){var i=r[a]||a;i in n||(n[i]=function(){for(var l,s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];var c=(l=this[o])[a].apply(l,s);return c===this[o]?this:c})})}}var Wb="function",Gb="object",Hb="string",Yb="number",Mi="undefined",ud=typeof window!==Mi,Xb=typeof document!==Mi&&document,qb=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],Ze=1e-7,aa={cm:function(t){return t*96/2.54},mm:function(t){return t*96/254},in:function(t){return t*96},pt:function(t){return t*96/72},pc:function(t){return t*96/6},"%":function(t,r){return t*r/100},vw:function(t,r){return r===void 0&&(r=window.innerWidth),t/100*r},vh:function(t,r){return r===void 0&&(r=window.innerHeight),t/100*r},vmax:function(t,r){return r===void 0&&(r=Math.max(window.innerWidth,window.innerHeight)),t/100*r},vmin:function(t,r){return r===void 0&&(r=Math.min(window.innerWidth,window.innerHeight)),t/100*r}};/*! *****************************************************************************
19
19
  Copyright (c) Microsoft Corporation.
20
20
 
21
21
  Permission to use, copy, modify, and/or distribute this software for any
@@ -28,7 +28,7 @@
28
28
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
29
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
30
  PERFORMANCE OF THIS SOFTWARE.
31
- ***************************************************************************** */function Jb(){for(var t=0,r=0,n=arguments.length;r<n;r++)t+=arguments[r].length;for(var o=Array(t),a=0,r=0;r<n;r++)for(var i=arguments[r],l=0,s=i.length;l<s;l++,a++)o[a]=i[l];return o}function ia(t,r,n,o){return(t*o+r*n)/(n+o)}function Kn(t){return typeof t===Mi}function $t(t){return t&&typeof t===Gb}function Ue(t){return Array.isArray(t)}function at(t){return typeof t===Hb}function un(t){return typeof t===Yb}function la(t){return typeof t===Wb}function Kb(t,r){var n=t===""||t==" ",o=r===""||r==" ";return o&&n||t===r}function pd(t,r,n,o,a){var i=Ai(t,r,n);return i?n:Zb(t,r,n+1,o,a)}function Ai(t,r,n){if(!t.ignore)return null;var o=r.slice(Math.max(n-3,0),n+3).join("");return new RegExp(t.ignore).exec(o)}function Zb(t,r,n,o,a){for(var i=function(c){var f=r[c].trim();if(f===t.close&&!Ai(t,r,c))return{value:c};var u=c,p=_t(a,function(h){var m=h.open;return m===f});if(p&&(u=pd(p,r,c,o,a)),u===-1)return l=c,"break";c=u,l=c},l,s=n;s<o;++s){var d=i(s);if(s=l,typeof d=="object")return d.value;if(d==="break")break}return-1}function Li(t,r){var n=at(r)?{separator:r}:r,o=n.separator,a=o===void 0?",":o,i=n.isSeparateFirst,l=n.isSeparateOnlyOpenClose,s=n.isSeparateOpenClose,d=s===void 0?l:s,c=n.openCloseCharacters,f=c===void 0?qb:c,u=f.map(function(v){var V=v.open,$=v.close;return V===$?V:V+"|"+$}).join("|"),p="(\\s*"+a+"\\s*|"+u+"|\\s+)",h=new RegExp(p,"g"),m=t.split(h).filter(function(v){return v&&v!=="undefined"}),y=m.length,g=[],b=[];function w(){return b.length?(g.push(b.join("")),b=[],!0):!1}for(var _=function(v){var V=m[v].trim(),$=v,B=_t(f,function(k){var O=k.open;return O===V}),R=_t(f,function(k){var O=k.close;return O===V});if(B){if($=pd(B,m,v,y,f),$!==-1&&d)return w()&&i||(g.push(m.slice(v,$+1).join("")),v=$,i)?(C=v,"break"):(C=v,"continue")}else if(R&&!Ai(R,m,v)){var T=Jb(f);return T.splice(f.indexOf(R),1),{value:Li(t,{separator:a,isSeparateFirst:i,isSeparateOnlyOpenClose:l,isSeparateOpenClose:d,openCloseCharacters:T})}}else if(Kb(V,a)&&!l)return w(),i?(C=v,"break"):(C=v,"continue");$===-1&&($=y-1),b.push(m.slice(v,$+1).join("")),v=$,C=v},C,S=0;S<y;++S){var x=_(S);if(S=C,typeof x=="object")return x.value;if(x==="break")break}return b.length&&g.push(b.join("")),g}function vr(t){return Li(t,"")}function jr(t){return Li(t,",")}function hd(t){var r=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t);return!r||r.length<4?{}:{prefix:r[1],value:r[2],suffix:r[3]}}function Pr(t){var r=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!r)return{prefix:"",unit:"",value:NaN};var n=r[1],o=r[2],a=r[3];return{prefix:n,unit:a,value:parseFloat(o)}}function Fi(t){return t.replace(/[\s-_]+([^\s-_])/g,function(r,n){return n.toUpperCase()})}function sa(t,r){return r===void 0&&(r="-"),t.replace(/([a-z])([A-Z])/g,function(n,o,a){return""+o+r+a.toLowerCase()})}function Zn(){return Date.now?Date.now():new Date().getTime()}function hr(t,r,n){n===void 0&&(n=-1);for(var o=t.length,a=0;a<o;++a)if(r(t[a],a,t))return a;return n}function _t(t,r,n){var o=hr(t,r);return o>-1?t[o]:n}var md=function(){var t=Zn(),r=ud&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return r?r.bind(window):function(n){var o=Zn(),a=setTimeout(function(){n(o-t)},1e3/60);return a}}(),Qb=function(){var t=ud&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(r){clearTimeout(r)}}();function mr(t){return Object.keys(t)}function e1(t){var r=mr(t);return r.map(function(n){return t[n]})}function Te(t,r){var n=Pr(t),o=n.value,a=n.unit;if($t(r)){var i=r[a];if(i){if(la(i))return i(o);if(aa[a])return aa[a](o,i)}}else if(a==="%")return o*r/100;return aa[a]?aa[a](o):o}function ca(t,r,n){return Math.max(r,Math.min(t,n))}function gd(t,r,n,o){return o===void 0&&(o=t[0]/t[1]),[[pe(r[0],Ke),pe(r[0]/o,Ke)],[pe(r[1]*o,Ke),pe(r[1],Ke)]].filter(function(a){return a.every(function(i,l){var s=r[l],d=pe(s,Ke);return n?i<=s||i<=d:i>=s||i>=d})})[0]||t}function ji(t,r,n,o){if(!o)return t.map(function(h,m){return ca(h,r[m],n[m])});var a=t[0],i=t[1],l=o===!0?a/i:o,s=gd(t,r,!1,l),d=s[0],c=s[1],f=gd(t,n,!0,l),u=f[0],p=f[1];return a<d||i<c?(a=d,i=c):(a>u||i>p)&&(a=u,i=p),[a,i]}function t1(t){for(var r=t.length,n=0,o=r-1;o>=0;--o)n+=t[o];return n}function Pi(t){for(var r=t.length,n=0,o=r-1;o>=0;--o)n+=t[o];return r?n/r:0}function Ye(t,r){var n=r[0]-t[0],o=r[1]-t[1],a=Math.atan2(o,n);return a>=0?a:a+Math.PI*2}function r1(t){return[0,1].map(function(r){return Pi(t.map(function(n){return n[r]}))})}function yd(t){var r=r1(t),n=Ye(r,t[0]),o=Ye(r,t[1]);return n<o&&o-n<Math.PI||n>o&&o-n<-Math.PI?1:-1}function nr(t,r){return Math.sqrt(Math.pow((r?r[0]:0)-t[0],2)+Math.pow((r?r[1]:0)-t[1],2))}function pe(t,r){if(!r)return t;var n=1/r;return Math.round(t/r)/n}function bd(t,r){return t.forEach(function(n,o){t[o]=pe(t[o],r)}),t}function n1(t){for(var r=[],n=0;n<t;++n)r.push(n);return r}function _d(t){return t.reduce(function(r,n){return r.concat(n)},[])}function wd(t,r){t.indexOf(r)===-1&&t.push(r)}function Ze(t,r){return t.classList?t.classList.contains(r):!!t.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))}function Ui(t,r){t.classList?t.classList.add(r):t.className+=" "+r}function Cd(t,r){if(t.classList)t.classList.remove(r);else{var n=new RegExp("(\\s|^)"+r+"(\\s|$)");t.className=t.className.replace(n," ")}}function Xe(t,r,n,o){t.addEventListener(r,n,o)}function We(t,r,n,o){t.removeEventListener(r,n,o)}function wt(t){return(t==null?void 0:t.ownerDocument)||Xb}function Wi(t){return wt(t).documentElement}function Er(t){return wt(t).body}function At(t){var r;return((r=t==null?void 0:t.ownerDocument)===null||r===void 0?void 0:r.defaultView)||window}function Sd(t){return t&&"postMessage"in t&&"blur"in t&&"self"in t}function Vr(t){return $t(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}var o1=function(){function t(){this.keys=[],this.values=[]}var r=t.prototype;return r.get=function(n){return this.values[this.keys.indexOf(n)]},r.set=function(n,o){var a=this.keys,i=this.values,l=a.indexOf(n),s=l===-1?a.length:l;a[s]=n,i[s]=o},t}(),a1=function(){function t(){this.object={}}var r=t.prototype;return r.get=function(n){return this.object[n]},r.set=function(n,o){this.object[n]=o},t}(),i1=typeof Map=="function",l1=function(){function t(){}var r=t.prototype;return r.connect=function(n,o){this.prev=n,this.next=o,n&&(n.next=this),o&&(o.prev=this)},r.disconnect=function(){var n=this.prev,o=this.next;n&&(n.next=o),o&&(o.prev=n)},r.getIndex=function(){for(var n=this,o=-1;n;)n=n.prev,++o;return o},t}();function s1(t,r){var n=[],o=[];return t.forEach(function(a){var i=a[0],l=a[1],s=new l1;n[i]=s,o[l]=s}),n.forEach(function(a,i){a.connect(n[i-1])}),t.filter(function(a,i){return!r[i]}).map(function(a,i){var l=a[0],s=a[1];if(l===s)return[0,0];var d=n[l],c=o[s-1],f=d.getIndex();d.disconnect(),c?d.connect(c,c.next):d.connect(void 0,n[0]);var u=d.getIndex();return[f,u]})}var c1=function(){function t(n,o,a,i,l,s,d,c){this.prevList=n,this.list=o,this.added=a,this.removed=i,this.changed=l,this.maintained=s,this.changedBeforeAdded=d,this.fixed=c}var r=t.prototype;return Object.defineProperty(r,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(r,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),r.caculateOrdered=function(){var n=s1(this.changedBeforeAdded,this.fixed),o=this.changed,a=[];this.cacheOrdered=n.filter(function(i,l){var s=i[0],d=i[1],c=o[l],f=c[0],u=c[1];if(s!==d)return a.push([f,u]),!0}),this.cachePureChanged=a},t}();function Qn(t,r,n){var o=i1?Map:n?a1:o1,a=n||function(w){return w},i=[],l=[],s=[],d=t.map(a),c=r.map(a),f=new o,u=new o,p=[],h=[],m={},y=[],g=0,b=0;return d.forEach(function(w,_){f.set(w,_)}),c.forEach(function(w,_){u.set(w,_)}),d.forEach(function(w,_){var C=u.get(w);typeof C>"u"?(++b,l.push(_)):m[C]=b}),c.forEach(function(w,_){var C=f.get(w);typeof C>"u"?(i.push(_),++g):(s.push([C,_]),b=m[_]||0,p.push([C-b,_-g]),h.push(_===C),C!==_&&y.push([C,_]))}),l.reverse(),new c1(t,r,i,l,y,s,p,h)}var d1=function(){function t(n,o){n===void 0&&(n=[]),this.findKeyCallback=o,this.list=[].slice.call(n)}var r=t.prototype;return r.update=function(n){var o=[].slice.call(n),a=Qn(this.list,o,this.findKeyCallback);return this.list=o,a},t}(),Gi=function(t,r){return Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},Gi(t,r)};function eo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");Gi(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var or=function(){return or=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},or.apply(this,arguments)};function xd(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function vd(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function Ed(t){var r=0;return t.map(function(n){return n==null?"$compat".concat(++r):"".concat(n)})}function Vd(t){var r=[];return t.forEach(function(n){r=r.concat(Ue(n)?Vd(n):n)}),r}function Hi(t,r){if(!r)return t;for(var n in r)Kn(t[n])&&(t[n]=r[n]);return t}function da(t,r){if(t===r)return!1;for(var n in t)if(!(n in r))return!0;for(var n in r)if(t[n]!==r[n])return!0;return!1}function kd(t){var r=t.className,n=xd(t,["className"]);return r!=null&&(n.class=r),delete n.style,delete n.children,n}function Nd(t){var r={},n={};for(var o in t)o.indexOf("on")===0?n[o]=t[o]:r[o]=t[o];return[r,n]}function fa(t){if(!t)return null;var r=t.b;return Vr(r)?r:fa(t.c)}function $d(t){var r=t.parentNode;r&&r.removeChild(t)}function Dd(t){t.forEach(function(r){r()})}function f1(){return this.constructor(this.props,this.context)}var Yi=0,ua=function(){function t(n,o,a,i,l,s,d){d===void 0&&(d={}),this.t=n,this.d=o,this.k=a,this.i=i,this.c=l,this.ref=s,this.ps=d,this.typ="prov",this._ps=[],this._cs={},this._hyd=null,this._sel=!1}var r=t.prototype;return r.s=function(){return!0},r.u=function(n,o,a,i,l){var s=this,d=s.d,c=e1(o).filter(function(m){return m.$_req}),f=Vd(c.map(function(m){return m.$_subs})),u=_t(f,function(m){return m.d===d});if(s.b&&!at(a)&&!l&&!s.s(a.props,i)&&!u){var p=f.reduce(function(m,y){var g=y.d;return m[0]?m[0].d===g&&m.push(y):g>d&&m.push(y),m},[]);return p.forEach(function(m){ro(m,m._ps,[m.o],n,o,!0)}),!1}s.o=a,s.ss(i);var h=s.ps;return at(a)||(s.ps=a.props,s.ref=a.ref),Xi(this),s.r(n,o,s.b?h:{},i),!0},r.md=function(){this.rr()},r.ss=function(){},r.ud=function(){this.rr()},r.rr=function(){var n=this,o=n.ref,a=n.fr;o&&o(a?a.current:n.b)},t}();function Bd(){return Object.__CROACT_CURRENT_INSTNACE__}function u1(){return Yi}function p1(t){Yi=t}function Xi(t){return Object.__CROACT_CURRENT_INSTNACE__=t,Yi=0,t}var qi=function(){function t(n,o){n===void 0&&(n={}),this.props=n,this.context=o,this.state={},this.$_timer=0,this.$_state={},this.$_subs=[],this.$_cs={}}var r=t.prototype;return r.render=function(){return null},r.shouldComponentUpdate=function(n,o){return this.props!==n||this.state!==o},r.setState=function(n,o,a){var i=this;i.$_timer||(i.$_state={}),clearTimeout(i.$_timer),i.$_timer=0,i.$_state=or(or({},i.$_state),n),a?i.$_setState(o,a):i.$_timer=window.setTimeout(function(){i.$_timer=0,i.$_setState(o,a)})},r.forceUpdate=function(n){this.setState({},n,!0)},r.componentDidMount=function(){},r.componentDidUpdate=function(n,o){},r.componentWillUnmount=function(){},r.$_setState=function(n,o){var a=[],i=this.$_p,l=ro(i.c,[i],[i.o],a,i._cs,or(or({},this.state),this.$_state),o);l&&(n&&a.push(n),Dd(a),Xi(null))},t}(),Td=function(t){eo(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}var n=r.prototype;return n.shouldComponentUpdate=function(o,a){return da(this.props,o)||da(this.state,a)},r}(qi);function Od(t){var r=function(n){r.current=n};return r.current=t,r}function h1(t){return t._fr=!0,t}function m1(t,r,n,o){var a,i;return!((a=t==null?void 0:t.prototype)===null||a===void 0)&&a.render?i=new t(r,n):(i=new qi(r,n),i.constructor=t,t._fr?(o.fr=Od(),i.render=function(){return this.constructor(this.props,o.fr)}):i.render=f1),i.$_p=o,i}var g1=function(t){eo(r,t);function r(o,a,i,l,s,d,c){c===void 0&&(c={});var f=t.call(this,o,a,i,l,s,d,Hi(c,o.defaultProps))||this;return f.typ="comp",f._usefs=[],f._uefs=[],f._defs=[],f}var n=r.prototype;return n.s=function(o,a){var i=this.b;return i.shouldComponentUpdate(Hi(o,this.t.defaultProps),a||i.state)!==!1},n.r=function(o,a,i){var l,s,d=this,c=d.t;d.ps=Hi(d.ps,d.t.defaultProps);var f=d.ps,u=!d.b,p=c.contextType,h=d.b,m=p==null?void 0:p.get(d);d._cs=a,u?(h=m1(c,f,m,d),d.b=h):(h.props=f,h.context=m);var y=h.state;d._usefs=[],d._uefs=[];var g=h.render();((s=(l=g==null?void 0:g.props)===null||l===void 0?void 0:l.children)===null||s===void 0?void 0:s.length)===0&&(g.props.children=d.ps.children);var b=or(or({},a),h.$_cs);ro(d,d._ps,g?[g]:[],o,b),u?d._uefs.push(function(){p==null||p.register(d),h.componentDidMount()}):d._uefs.push(function(){h.componentDidUpdate(i,y)}),o.push(function(){d._usefs.forEach(function(w){w()}),u?d.md():d.ud(),d._defs=d._uefs.map(function(w){return w()})})},n.ss=function(o){var a=this.b;!a||!o||(a.state=o)},n.un=function(){var o,a=this;a._ps.forEach(function(l){l.un()});var i=a.t;(o=i.contextType)===null||o===void 0||o.unregister(a),clearTimeout(a.b.$_timer),a._defs.forEach(function(l){l&&l()}),a.b.componentWillUnmount()},r}(ua);function y1(t,r,n){var o=Ji(kd(t),kd(r)),a=o.added,i=o.removed,l=o.changed;for(var s in a)n.setAttribute(s,a[s]);for(var d in l)n.setAttribute(d,l[d][1]);for(var c in i)n.removeAttribute(c)}function b1(t,r,n){var o=Ji(t,r),a=o.added,i=o.removed;for(var l in i)n.e(l,!0);for(var s in a)n.e(s)}function Ji(t,r){var n=mr(t),o=mr(r),a=Qn(n,o,function(d){return d}),i={},l={},s={};return a.added.forEach(function(d){var c=o[d];i[c]=r[c]}),a.removed.forEach(function(d){var c=n[d];l[c]=t[c]}),a.maintained.forEach(function(d){var c=d[0],f=n[c],u=[t[f],r[f]];t[f]!==r[f]&&(s[f]=u)}),{added:i,removed:l,changed:s}}function _1(t,r,n){var o=n.style,a=Ji(t,r),i=a.added,l=a.removed,s=a.changed;for(var d in i){var c=sa(d,"-");o.setProperty(c,i[d])}for(var d in s){var f=sa(d,"-");o.setProperty(f,s[d][1])}for(var d in l){var u=sa(d,"-");o.removeProperty(u)}}function w1(t){return t.replace(/^on/g,"").toLowerCase()}var C1=function(t){eo(r,t);function r(){var o=t!==null&&t.apply(this,arguments)||this;return o.typ="elem",o._es={},o._svg=!1,o}var n=r.prototype;return n.e=function(o,a){var i=this,l=i._es,s=i.b,d=w1(o);a?(We(s,d,l[o]),delete l[o]):(l[o]=function(c){var f,u;(u=(f=i.ps)[o])===null||u===void 0||u.call(f,c)},Xe(s,d,l[o]))},n.s=function(o){return da(this.ps,o)},n.r=function(o,a,i){var l,s=this,d=!s.b,c=s.ps;if(d){var f=fa(s.c),u=!1;s._svg||s.t==="svg"?u=!0:u=f&&f.ownerSVGElement,s._svg=u;var p=(l=s._hyd)===null||l===void 0?void 0:l.splice(0,1)[0],h=s.t;if(p)s._hyd=[].slice.call(p.children||[]);else{var m=wt(f);u?p=m.createElementNS("http://www.w3.org/2000/svg",h):p=m.createElement(h)}s.b=p}ro(s,s._ps,c.children,o,a);var y=s.b,g=Nd(i),b=g[0],w=g[1],_=Nd(c),C=_[0],S=_[1];return y1(b,C,y),b1(w,S,s),_1(i.style||{},c.style||{},y),o.push(function(){d?s.md():s.ud()}),!0},n.un=function(){var o=this,a=o._es,i=o.b;for(var l in a)We(i,l,a[l]);o._ps.forEach(function(s){s.un()}),o._es={},o._sel||$d(i)},r}(ua);function to(t){if(!t||Vr(t))return t;var r=t.$_p._ps;return r.length?to(r[0].b):null}function Id(t){if(t){if(t.b&&Vr(t.b))return t;var r=t._ps;return r.length?Id(r[0]):null}}function Xt(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=r||{},i=a.key,l=a.ref,s=xd(a,["key","ref"]);return{type:t,key:i,ref:l,props:or(or({},s),{children:_d(n).filter(function(d){return d!=null&&d!==!1})})}}var zd=function(t){eo(r,t);function r(o,a){a===void 0&&(a=0);var i=t.call(this,"container",a,"container",0,null)||this;return i.typ="container",i.b=o,i}var n=r.prototype;return n.r=function(){return!0},n.un=function(){},r}(ua),S1=function(t){eo(r,t);function r(){var o=t!==null&&t.apply(this,arguments)||this;return o.typ="text",o}var n=r.prototype;return n.r=function(o){var a,i=this,l=!i.b;if(l){var s=fa(i.c),d=(a=i._hyd)===null||a===void 0?void 0:a.splice(0,1)[0];i.b=d||wt(s).createTextNode(i.t.replace("text_",""))}return o.push(function(){l?i.md():i.ud()}),!0},n.un=function(){$d(this.b)},r}(ua);function x1(t,r,n){var o=n.map(function(d){return at(d)?null:d.key}),a=Ed(r.map(function(d){return d.k})),i=Ed(o),l=Qn(a,i,function(d){return d});l.removed.forEach(function(d){r.splice(d,1)[0].un()}),l.ordered.forEach(function(d){var c=d[0],f=d[1],u=r.splice(c,1)[0];r.splice(f,0,u);var p=to(u.b),h=to(r[f+1]&&r[f+1].b);p&&p.parentNode.insertBefore(p,h)}),l.added.forEach(function(d){r.splice(d,0,Rd(n[d],o[d],d,t))});var s=l.maintained.filter(function(d){d[0];var c=d[1],f=n[c],u=r[c],p=at(f)?"text_".concat(f):f.type;return p!==u.t?(u.un(),r.splice(c,1,Rd(f,o[c],c,t)),!0):(u.i=c,!1)});return vd(vd([],l.added,!0),s.map(function(d){d[0];var c=d[1];return c}),!0)}function v1(t,r){for(var n=t._ps,o=n.length,a=r.i+1;a<o;++a){var i=to(n[a].b);if(i)return i}return null}function Rd(t,r,n,o){var a=o.d+1;if(at(t)||un(t))return new S1("text_".concat(t),a,r,n,o,null,{});var i=t.type,l=typeof i=="string"?C1:g1;return new l(i,a,r,n,o,t.ref,t.props)}function ro(t,r,n,o,a,i,l){var s=x1(t,r,n),d=t._hyd,c=r.filter(function(u,p){return u._hyd=d,u.u(o,a,n[p],i,l)});t.typ==="container"&&t._sel&&r.forEach(function(u){var p=Id(u);p&&(p._sel=!0)}),t._hyd=null;var f=fa(t);return f&&s.reverse().forEach(function(u){var p=r[u],h=to(p.b);if(h&&f!==h&&!h.parentNode){var m=v1(t,p);f.insertBefore(h,m)}}),c.length>0}function E1(t,r,n,o){n===void 0&&(n=r.__CROACT__),o===void 0&&(o={});var a=!!n;n||(n=new zd(r));var i=[];return ro(n,n._ps,t?[t]:[],i,o,void 0,void 0),Dd(i),Xi(null),a||(r.__CROACT__=n),n}function Md(t,r,n){return!n&&t&&(n=new zd(r.parentElement),n._hyd=[r],n._sel=!0),E1(t,r,n),n}function Ad(t){var r=Bd(),n=r._hs||(r._hs=[]),o=u1(),a=n[o];if(p1(o+1),a){if(!da(a.deps,t.deps))return a.updated=!1,a;n[o]=t}else n.push(t);return t.value=t.func(),t.updated=!0,t}function V1(t,r){var n=Ad({func:t,deps:r});return n.value}function k1(t){return V1(function(){return Od(t)},[])}function Ld(t,r,n){var o=Bd(),a=Ad({func:function(){return t},deps:r}),i=n?o._usefs:o._uefs;a.updated?i.push(function(){return a.effect&&a.effect(),a.effect=t(),a.effect}):i.push(function(){return a.effect})}function N1(t,r,n){Ld(function(){t==null||t(r())},n,!0)}function Ki(t,r){for(var n=t.length,o=0;o<n;++o)if(r(t[o],o))return!0;return!1}function Fd(t,r){for(var n=t.length,o=0;o<n;++o)if(r(t[o],o))return t[o];return null}function jd(t){var r=t;if(typeof r>"u"){if(typeof navigator>"u"||!navigator)return"";r=navigator.userAgent||""}return r.toLowerCase()}function Zi(t,r){try{return new RegExp(t,"g").exec(r)}catch{return null}}function $1(){if(typeof navigator>"u"||!navigator||!navigator.userAgentData)return!1;var t=navigator.userAgentData,r=t.brands||t.uaList;return!!(r&&r.length)}function D1(t,r){var n=Zi("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))",r);return n?n[3]:""}function Qi(t){return t.replace(/_/g,".")}function no(t,r){var n=null,o="-1";return Ki(t,function(a){var i=Zi("("+a.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return!i||a.brand?!1:(n=a,o=i[3]||"-1",a.versionAlias?o=a.versionAlias:a.versionTest&&(o=D1(a.versionTest.toLowerCase(),r)||o),o=Qi(o),!0)}),{preset:n,version:o}}function oo(t,r){var n={brand:"",version:"-1"};return Ki(t,function(o){var a=Pd(r,o);return a?(n.brand=o.id,n.version=o.versionAlias||a.version,n.version!=="-1"):!1}),n}function Pd(t,r){return Fd(t,function(n){var o=n.brand;return Zi(""+r.test,o.toLowerCase())})}var el=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],Ud=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],tl=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],Wd=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],Gd=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Hd(t){return!!no(Wd,t).preset}function B1(t){var r=jd(t),n=!!/mobi/g.exec(r),o={name:"unknown",version:"-1",majorVersion:-1,webview:Hd(r),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},a={name:"unknown",version:"-1",majorVersion:-1},i=no(el,r),l=i.preset,s=i.version,d=no(Gd,r),c=d.preset,f=d.version,u=no(Ud,r);if(o.chromium=!!u.preset,o.chromiumVersion=u.version,!o.chromium){var p=no(tl,r);o.webkit=!!p.preset,o.webkitVersion=p.version}return c&&(a.name=c.id,a.version=f,a.majorVersion=parseInt(f,10)),l&&(o.name=l.id,o.version=s,o.webview&&a.name==="ios"&&o.name!=="safari"&&(o.webview=!1)),o.majorVersion=parseInt(o.version,10),{browser:o,os:a,isMobile:n,isHints:!1}}function T1(t){var r=navigator.userAgentData,n=(r.uaList||r.brands).slice(),o=t&&t.fullVersionList,a=r.mobile||!1,i=n[0],l=(t&&t.platform||r.platform||navigator.platform).toLowerCase(),s={name:i.brand,version:i.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!oo(Wd,n).brand||Hd(jd())},d={name:"unknown",version:"-1",majorVersion:-1};s.webkit=!s.chromium&&Ki(tl,function(m){return Pd(n,m)});var c=oo(Ud,n);if(s.chromium=!!c.brand,s.chromiumVersion=c.version,!s.chromium){var f=oo(tl,n);s.webkit=!!f.brand,s.webkitVersion=f.version}var u=Fd(Gd,function(m){return new RegExp(""+m.test,"g").exec(l)});if(d.name=u?u.id:"",t&&(d.version=t.platformVersion),o&&o.length){var p=oo(el,o);s.name=p.brand||s.name,s.version=p.version||s.version}else{var h=oo(el,n);s.name=h.brand||s.name,s.version=h.brand&&t?t.uaFullVersion:h.version}return s.webkit&&(d.name=a?"ios":"mac"),d.name==="ios"&&s.webview&&(s.version="-1"),d.version=Qi(d.version),s.version=Qi(s.version),d.majorVersion=parseInt(d.version,10),s.majorVersion=parseInt(s.version,10),{browser:s,os:d,isMobile:a,isHints:!0}}function O1(t){return typeof t>"u"&&$1()?T1():B1(t)}function I1(t,r,n,o,a,i){for(var l=0;l<a;++l){var s=n+l*a,d=o+l*a;t[s]+=t[d]*i,r[s]+=r[d]*i}}function z1(t,r,n,o,a){for(var i=0;i<a;++i){var l=n+i*a,s=o+i*a,d=t[l],c=r[l];t[l]=t[s],t[s]=d,r[l]=r[s],r[s]=c}}function R1(t,r,n,o,a){for(var i=0;i<o;++i){var l=n+i*o;t[l]/=a,r[l]/=a}}function Yd(t,r,n){n===void 0&&(n=Math.sqrt(t.length));for(var o=t.slice(),a=0;a<n;++a)o[a*n+r-1]=0,o[(r-1)*n+a]=0;return o[(r-1)*(n+1)]=1,o}function qt(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=t.slice(),o=Me(r),a=0;a<r;++a){var i=r*a+a;if(!pe(n[i],Ke)){for(var l=a+1;l<r;++l)if(n[r*a+l]){z1(n,o,a,l,r);break}}if(!pe(n[i],Ke))return[];R1(n,o,a,r,n[i]);for(var l=0;l<r;++l){var s=l,d=l+a*r,c=n[d];!pe(c,Ke)||a===l||I1(n,o,s,a,r,-c)}}return o}function M1(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=[],o=0;o<r;++o)for(var a=0;a<r;++a)n[a*r+o]=t[r*o+a];return n}function Xd(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=[],o=t[r*r-1],a=0;a<r-1;++a)n[a]=t[r*(r-1)+a]/o;return n[r-1]=0,n}function A1(t,r){for(var n=Me(r),o=0;o<r-1;++o)n[r*(r-1)+o]=t[o]||0;return n}function Ur(t,r){for(var n=t.slice(),o=t.length;o<r-1;++o)n[o]=0;return n[r-1]=1,n}function Jt(t,r,n){if(r===void 0&&(r=Math.sqrt(t.length)),r===n)return t;for(var o=Me(n),a=Math.min(r,n),i=0;i<a-1;++i){for(var l=0;l<a-1;++l)o[i*n+l]=t[i*r+l];o[(i+1)*n-1]=t[(i+1)*r-1],o[(n-1)*n+i]=t[(r-1)*r+i]}return o[n*n-1]=t[r*r-1],o}function pa(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=Me(t);return r.forEach(function(a){o=Oe(o,a,t)}),o}function Oe(t,r,n){n===void 0&&(n=Math.sqrt(t.length));var o=[],a=t.length/n,i=r.length/a;if(a){if(!i)return t}else return r;for(var l=0;l<n;++l)for(var s=0;s<i;++s){o[s*n+l]=0;for(var d=0;d<a;++d)o[s*n+l]+=t[d*n+l]*r[s*a+d]}return o}function xe(t,r){for(var n=Math.min(t.length,r.length),o=t.slice(),a=0;a<n;++a)o[a]=o[a]+r[a];return o}function se(t,r){for(var n=Math.min(t.length,r.length),o=t.slice(),a=0;a<n;++a)o[a]=o[a]-r[a];return o}function L1(t,r){return r===void 0&&(r=t.length===6),r?[t[0],t[1],0,t[2],t[3],0,t[4],t[5],1]:t}function qd(t,r){return r===void 0&&(r=t.length===9),r?[t[0],t[1],t[3],t[4],t[6],t[7]]:t}function lt(t,r,n){n===void 0&&(n=r.length);var o=Oe(t,r,n),a=o[n-1];return o.map(function(i){return i/a})}function F1(t,r){return Oe(t,[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1],4)}function j1(t,r){return Oe(t,[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1],4)}function P1(t,r){return Oe(t,io(r,4))}function ha(t,r){var n=r[0],o=n===void 0?1:n,a=r[1],i=a===void 0?1:a,l=r[2],s=l===void 0?1:l;return Oe(t,[o,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1],4)}function ao(t,r){return lt(io(r,3),Ur(t,3))}function rl(t,r){var n=r[0],o=n===void 0?0:n,a=r[1],i=a===void 0?0:a,l=r[2],s=l===void 0?0:l;return Oe(t,[1,0,0,0,0,1,0,0,0,0,1,0,o,i,s,1],4)}function nl(t,r){return Oe(t,r,4)}function io(t,r){var n=Math.cos(t),o=Math.sin(t),a=Me(r);return a[0]=n,a[1]=o,a[r]=-o,a[r+1]=n,a}function Me(t){for(var r=t*t,n=[],o=0;o<r;++o)n[o]=o%(t+1)?0:1;return n}function ol(t,r){for(var n=Me(r),o=Math.min(t.length,r-1),a=0;a<o;++a)n[(r+1)*a]=t[a];return n}function Wr(t,r){for(var n=Me(r),o=Math.min(t.length,r-1),a=0;a<o;++a)n[r*(r-1)+a]=t[a];return n}function al(t,r,n,o,a,i,l,s){var d=t[0],c=t[1],f=r[0],u=r[1],p=n[0],h=n[1],m=o[0],y=o[1],g=a[0],b=a[1],w=i[0],_=i[1],C=l[0],S=l[1],x=s[0],v=s[1],V=[d,0,f,0,p,0,m,0,c,0,u,0,h,0,y,0,1,0,1,0,1,0,1,0,0,d,0,f,0,p,0,m,0,c,0,u,0,h,0,y,0,1,0,1,0,1,0,1,-g*d,-b*d,-w*f,-_*f,-C*p,-S*p,-x*m,-v*m,-g*c,-b*c,-w*u,-_*u,-C*h,-S*h,-x*y,-v*y],$=qt(V,8);if(!$.length)return[];var B=Oe($,[g,b,w,_,C,S,x,v],8);return B[8]=1,Jt(M1(B),3,4)}var lo=function(){return lo=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},lo.apply(this,arguments)};function il(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pn(t,r){return r===void 0&&(r=0),hn(mn(t,r))}function ma(t,r){var n=lt(t,[r[0],r[1]||0,r[2]||0,1],4),o=n[3]||1;return[n[0]/o,n[1]/o,n[2]/o]}function U1(t,r){r===void 0&&(r=document.body);for(var n=t,o=il();n;){var a=getComputedStyle(n).transform;if(o=nl(pn(a),o),n===r)break;n=n.parentElement}return o=qt(o,4),o[12]=0,o[13]=0,o[14]=0,o}function hn(t){var r=il();return t.forEach(function(n){var o=n.matrixFunction,a=n.functionValue;o&&(r=o(r,a))}),r}function mn(t,r){r===void 0&&(r=0);var n=Ue(t)?t:vr(t);return n.map(function(o){var a=hd(o),i=a.prefix,l=a.value,s=null,d=i,c="";if(i==="translate"||i==="translateX"||i==="translate3d"){var f=$t(r)?lo(lo({},r),{"o%":r["%"]}):{"%":r,"o%":r},u=jr(l).map(function(k,O){return O===0&&"x%"in f?f["%"]=r["x%"]:O===1&&"y%"in f?f["%"]=r["y%"]:f["%"]=r["o%"],Te(k,f)}),p=u[0],h=u[1],m=h===void 0?0:h,y=u[2],g=y===void 0?0:y;s=rl,c=[p,m,g]}else if(i==="translateY"){var b=$t(r)?lo({"%":r["y%"]},r):{"%":r},m=Te(l,b);s=rl,c=[0,m,0]}else if(i==="translateZ"){var g=parseFloat(l);s=rl,c=[0,0,g]}else if(i==="scale"||i==="scale3d"){var w=jr(l).map(function(k){return parseFloat(k)}),_=w[0],C=w[1],S=C===void 0?_:C,x=w[2],v=x===void 0?1:x;s=ha,c=[_,S,v]}else if(i==="scaleX"){var _=parseFloat(l);s=ha,c=[_,1,1]}else if(i==="scaleY"){var S=parseFloat(l);s=ha,c=[1,S,1]}else if(i==="scaleZ"){var v=parseFloat(l);s=ha,c=[1,1,v]}else if(i==="rotate"||i==="rotateZ"||i==="rotateX"||i==="rotateY"){var V=Pr(l),$=V.unit,B=V.value,R=$==="rad"?B:B*Math.PI/180;i==="rotate"||i==="rotateZ"?(d="rotateZ",s=P1):i==="rotateX"?s=F1:i==="rotateY"&&(s=j1),c=R}else if(i==="matrix3d")s=nl,c=jr(l).map(function(k){return parseFloat(k)});else if(i==="matrix"){var T=jr(l).map(function(k){return parseFloat(k)});s=nl,c=[T[0],T[1],0,0,T[2],T[3],0,0,0,0,1,0,T[4],T[5],0,1]}else d="";return{name:i,functionName:d,value:l,matrixFunction:s,functionValue:c}})}/*! *****************************************************************************
31
+ ***************************************************************************** */function Jb(){for(var t=0,r=0,n=arguments.length;r<n;r++)t+=arguments[r].length;for(var o=Array(t),a=0,r=0;r<n;r++)for(var i=arguments[r],l=0,s=i.length;l<s;l++,a++)o[a]=i[l];return o}function ia(t,r,n,o){return(t*o+r*n)/(n+o)}function Kn(t){return typeof t===Mi}function $t(t){return t&&typeof t===Gb}function Ue(t){return Array.isArray(t)}function at(t){return typeof t===Hb}function un(t){return typeof t===Yb}function la(t){return typeof t===Wb}function Kb(t,r){var n=t===""||t==" ",o=r===""||r==" ";return o&&n||t===r}function pd(t,r,n,o,a){var i=Ai(t,r,n);return i?n:Zb(t,r,n+1,o,a)}function Ai(t,r,n){if(!t.ignore)return null;var o=r.slice(Math.max(n-3,0),n+3).join("");return new RegExp(t.ignore).exec(o)}function Zb(t,r,n,o,a){for(var i=function(c){var f=r[c].trim();if(f===t.close&&!Ai(t,r,c))return{value:c};var u=c,p=_t(a,function(h){var m=h.open;return m===f});if(p&&(u=pd(p,r,c,o,a)),u===-1)return l=c,"break";c=u,l=c},l,s=n;s<o;++s){var d=i(s);if(s=l,typeof d=="object")return d.value;if(d==="break")break}return-1}function Li(t,r){var n=at(r)?{separator:r}:r,o=n.separator,a=o===void 0?",":o,i=n.isSeparateFirst,l=n.isSeparateOnlyOpenClose,s=n.isSeparateOpenClose,d=s===void 0?l:s,c=n.openCloseCharacters,f=c===void 0?qb:c,u=f.map(function(v){var V=v.open,$=v.close;return V===$?V:V+"|"+$}).join("|"),p="(\\s*"+a+"\\s*|"+u+"|\\s+)",h=new RegExp(p,"g"),m=t.split(h).filter(function(v){return v&&v!=="undefined"}),y=m.length,g=[],b=[];function w(){return b.length?(g.push(b.join("")),b=[],!0):!1}for(var _=function(v){var V=m[v].trim(),$=v,B=_t(f,function(k){var O=k.open;return O===V}),R=_t(f,function(k){var O=k.close;return O===V});if(B){if($=pd(B,m,v,y,f),$!==-1&&d)return w()&&i||(g.push(m.slice(v,$+1).join("")),v=$,i)?(C=v,"break"):(C=v,"continue")}else if(R&&!Ai(R,m,v)){var T=Jb(f);return T.splice(f.indexOf(R),1),{value:Li(t,{separator:a,isSeparateFirst:i,isSeparateOnlyOpenClose:l,isSeparateOpenClose:d,openCloseCharacters:T})}}else if(Kb(V,a)&&!l)return w(),i?(C=v,"break"):(C=v,"continue");$===-1&&($=y-1),b.push(m.slice(v,$+1).join("")),v=$,C=v},C,S=0;S<y;++S){var x=_(S);if(S=C,typeof x=="object")return x.value;if(x==="break")break}return b.length&&g.push(b.join("")),g}function vr(t){return Li(t,"")}function jr(t){return Li(t,",")}function hd(t){var r=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(t);return!r||r.length<4?{}:{prefix:r[1],value:r[2],suffix:r[3]}}function Pr(t){var r=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(t);if(!r)return{prefix:"",unit:"",value:NaN};var n=r[1],o=r[2],a=r[3];return{prefix:n,unit:a,value:parseFloat(o)}}function Fi(t){return t.replace(/[\s-_]+([^\s-_])/g,function(r,n){return n.toUpperCase()})}function sa(t,r){return r===void 0&&(r="-"),t.replace(/([a-z])([A-Z])/g,function(n,o,a){return""+o+r+a.toLowerCase()})}function Zn(){return Date.now?Date.now():new Date().getTime()}function hr(t,r,n){n===void 0&&(n=-1);for(var o=t.length,a=0;a<o;++a)if(r(t[a],a,t))return a;return n}function _t(t,r,n){var o=hr(t,r);return o>-1?t[o]:n}var md=function(){var t=Zn(),r=ud&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return r?r.bind(window):function(n){var o=Zn(),a=setTimeout(function(){n(o-t)},1e3/60);return a}}(),Qb=function(){var t=ud&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return t?t.bind(window):function(r){clearTimeout(r)}}();function mr(t){return Object.keys(t)}function e1(t){var r=mr(t);return r.map(function(n){return t[n]})}function Te(t,r){var n=Pr(t),o=n.value,a=n.unit;if($t(r)){var i=r[a];if(i){if(la(i))return i(o);if(aa[a])return aa[a](o,i)}}else if(a==="%")return o*r/100;return aa[a]?aa[a](o):o}function ca(t,r,n){return Math.max(r,Math.min(t,n))}function gd(t,r,n,o){return o===void 0&&(o=t[0]/t[1]),[[pe(r[0],Ze),pe(r[0]/o,Ze)],[pe(r[1]*o,Ze),pe(r[1],Ze)]].filter(function(a){return a.every(function(i,l){var s=r[l],d=pe(s,Ze);return n?i<=s||i<=d:i>=s||i>=d})})[0]||t}function ji(t,r,n,o){if(!o)return t.map(function(h,m){return ca(h,r[m],n[m])});var a=t[0],i=t[1],l=o===!0?a/i:o,s=gd(t,r,!1,l),d=s[0],c=s[1],f=gd(t,n,!0,l),u=f[0],p=f[1];return a<d||i<c?(a=d,i=c):(a>u||i>p)&&(a=u,i=p),[a,i]}function t1(t){for(var r=t.length,n=0,o=r-1;o>=0;--o)n+=t[o];return n}function Pi(t){for(var r=t.length,n=0,o=r-1;o>=0;--o)n+=t[o];return r?n/r:0}function Ye(t,r){var n=r[0]-t[0],o=r[1]-t[1],a=Math.atan2(o,n);return a>=0?a:a+Math.PI*2}function r1(t){return[0,1].map(function(r){return Pi(t.map(function(n){return n[r]}))})}function yd(t){var r=r1(t),n=Ye(r,t[0]),o=Ye(r,t[1]);return n<o&&o-n<Math.PI||n>o&&o-n<-Math.PI?1:-1}function nr(t,r){return Math.sqrt(Math.pow((r?r[0]:0)-t[0],2)+Math.pow((r?r[1]:0)-t[1],2))}function pe(t,r){if(!r)return t;var n=1/r;return Math.round(t/r)/n}function bd(t,r){return t.forEach(function(n,o){t[o]=pe(t[o],r)}),t}function n1(t){for(var r=[],n=0;n<t;++n)r.push(n);return r}function _d(t){return t.reduce(function(r,n){return r.concat(n)},[])}function wd(t,r){t.indexOf(r)===-1&&t.push(r)}function Qe(t,r){return t.classList?t.classList.contains(r):!!t.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))}function Ui(t,r){t.classList?t.classList.add(r):t.className+=" "+r}function Cd(t,r){if(t.classList)t.classList.remove(r);else{var n=new RegExp("(\\s|^)"+r+"(\\s|$)");t.className=t.className.replace(n," ")}}function Xe(t,r,n,o){t.addEventListener(r,n,o)}function We(t,r,n,o){t.removeEventListener(r,n,o)}function wt(t){return(t==null?void 0:t.ownerDocument)||Xb}function Wi(t){return wt(t).documentElement}function Er(t){return wt(t).body}function At(t){var r;return((r=t==null?void 0:t.ownerDocument)===null||r===void 0?void 0:r.defaultView)||window}function Sd(t){return t&&"postMessage"in t&&"blur"in t&&"self"in t}function Vr(t){return $t(t)&&t.nodeName&&t.nodeType&&"ownerDocument"in t}var o1=function(){function t(){this.keys=[],this.values=[]}var r=t.prototype;return r.get=function(n){return this.values[this.keys.indexOf(n)]},r.set=function(n,o){var a=this.keys,i=this.values,l=a.indexOf(n),s=l===-1?a.length:l;a[s]=n,i[s]=o},t}(),a1=function(){function t(){this.object={}}var r=t.prototype;return r.get=function(n){return this.object[n]},r.set=function(n,o){this.object[n]=o},t}(),i1=typeof Map=="function",l1=function(){function t(){}var r=t.prototype;return r.connect=function(n,o){this.prev=n,this.next=o,n&&(n.next=this),o&&(o.prev=this)},r.disconnect=function(){var n=this.prev,o=this.next;n&&(n.next=o),o&&(o.prev=n)},r.getIndex=function(){for(var n=this,o=-1;n;)n=n.prev,++o;return o},t}();function s1(t,r){var n=[],o=[];return t.forEach(function(a){var i=a[0],l=a[1],s=new l1;n[i]=s,o[l]=s}),n.forEach(function(a,i){a.connect(n[i-1])}),t.filter(function(a,i){return!r[i]}).map(function(a,i){var l=a[0],s=a[1];if(l===s)return[0,0];var d=n[l],c=o[s-1],f=d.getIndex();d.disconnect(),c?d.connect(c,c.next):d.connect(void 0,n[0]);var u=d.getIndex();return[f,u]})}var c1=function(){function t(n,o,a,i,l,s,d,c){this.prevList=n,this.list=o,this.added=a,this.removed=i,this.changed=l,this.maintained=s,this.changedBeforeAdded=d,this.fixed=c}var r=t.prototype;return Object.defineProperty(r,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(r,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),r.caculateOrdered=function(){var n=s1(this.changedBeforeAdded,this.fixed),o=this.changed,a=[];this.cacheOrdered=n.filter(function(i,l){var s=i[0],d=i[1],c=o[l],f=c[0],u=c[1];if(s!==d)return a.push([f,u]),!0}),this.cachePureChanged=a},t}();function Qn(t,r,n){var o=i1?Map:n?a1:o1,a=n||function(w){return w},i=[],l=[],s=[],d=t.map(a),c=r.map(a),f=new o,u=new o,p=[],h=[],m={},y=[],g=0,b=0;return d.forEach(function(w,_){f.set(w,_)}),c.forEach(function(w,_){u.set(w,_)}),d.forEach(function(w,_){var C=u.get(w);typeof C>"u"?(++b,l.push(_)):m[C]=b}),c.forEach(function(w,_){var C=f.get(w);typeof C>"u"?(i.push(_),++g):(s.push([C,_]),b=m[_]||0,p.push([C-b,_-g]),h.push(_===C),C!==_&&y.push([C,_]))}),l.reverse(),new c1(t,r,i,l,y,s,p,h)}var d1=function(){function t(n,o){n===void 0&&(n=[]),this.findKeyCallback=o,this.list=[].slice.call(n)}var r=t.prototype;return r.update=function(n){var o=[].slice.call(n),a=Qn(this.list,o,this.findKeyCallback);return this.list=o,a},t}(),Gi=function(t,r){return Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},Gi(t,r)};function eo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");Gi(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var or=function(){return or=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},or.apply(this,arguments)};function xd(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function vd(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function Ed(t){var r=0;return t.map(function(n){return n==null?"$compat".concat(++r):"".concat(n)})}function Vd(t){var r=[];return t.forEach(function(n){r=r.concat(Ue(n)?Vd(n):n)}),r}function Hi(t,r){if(!r)return t;for(var n in r)Kn(t[n])&&(t[n]=r[n]);return t}function da(t,r){if(t===r)return!1;for(var n in t)if(!(n in r))return!0;for(var n in r)if(t[n]!==r[n])return!0;return!1}function kd(t){var r=t.className,n=xd(t,["className"]);return r!=null&&(n.class=r),delete n.style,delete n.children,n}function Nd(t){var r={},n={};for(var o in t)o.indexOf("on")===0?n[o]=t[o]:r[o]=t[o];return[r,n]}function fa(t){if(!t)return null;var r=t.b;return Vr(r)?r:fa(t.c)}function $d(t){var r=t.parentNode;r&&r.removeChild(t)}function Dd(t){t.forEach(function(r){r()})}function f1(){return this.constructor(this.props,this.context)}var Yi=0,ua=function(){function t(n,o,a,i,l,s,d){d===void 0&&(d={}),this.t=n,this.d=o,this.k=a,this.i=i,this.c=l,this.ref=s,this.ps=d,this.typ="prov",this._ps=[],this._cs={},this._hyd=null,this._sel=!1}var r=t.prototype;return r.s=function(){return!0},r.u=function(n,o,a,i,l){var s=this,d=s.d,c=e1(o).filter(function(m){return m.$_req}),f=Vd(c.map(function(m){return m.$_subs})),u=_t(f,function(m){return m.d===d});if(s.b&&!at(a)&&!l&&!s.s(a.props,i)&&!u){var p=f.reduce(function(m,y){var g=y.d;return m[0]?m[0].d===g&&m.push(y):g>d&&m.push(y),m},[]);return p.forEach(function(m){ro(m,m._ps,[m.o],n,o,!0)}),!1}s.o=a,s.ss(i);var h=s.ps;return at(a)||(s.ps=a.props,s.ref=a.ref),Xi(this),s.r(n,o,s.b?h:{},i),!0},r.md=function(){this.rr()},r.ss=function(){},r.ud=function(){this.rr()},r.rr=function(){var n=this,o=n.ref,a=n.fr;o&&o(a?a.current:n.b)},t}();function Bd(){return Object.__CROACT_CURRENT_INSTNACE__}function u1(){return Yi}function p1(t){Yi=t}function Xi(t){return Object.__CROACT_CURRENT_INSTNACE__=t,Yi=0,t}var qi=function(){function t(n,o){n===void 0&&(n={}),this.props=n,this.context=o,this.state={},this.$_timer=0,this.$_state={},this.$_subs=[],this.$_cs={}}var r=t.prototype;return r.render=function(){return null},r.shouldComponentUpdate=function(n,o){return this.props!==n||this.state!==o},r.setState=function(n,o,a){var i=this;i.$_timer||(i.$_state={}),clearTimeout(i.$_timer),i.$_timer=0,i.$_state=or(or({},i.$_state),n),a?i.$_setState(o,a):i.$_timer=window.setTimeout(function(){i.$_timer=0,i.$_setState(o,a)})},r.forceUpdate=function(n){this.setState({},n,!0)},r.componentDidMount=function(){},r.componentDidUpdate=function(n,o){},r.componentWillUnmount=function(){},r.$_setState=function(n,o){var a=[],i=this.$_p,l=ro(i.c,[i],[i.o],a,i._cs,or(or({},this.state),this.$_state),o);l&&(n&&a.push(n),Dd(a),Xi(null))},t}(),Td=function(t){eo(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}var n=r.prototype;return n.shouldComponentUpdate=function(o,a){return da(this.props,o)||da(this.state,a)},r}(qi);function Od(t){var r=function(n){r.current=n};return r.current=t,r}function h1(t){return t._fr=!0,t}function m1(t,r,n,o){var a,i;return!((a=t==null?void 0:t.prototype)===null||a===void 0)&&a.render?i=new t(r,n):(i=new qi(r,n),i.constructor=t,t._fr?(o.fr=Od(),i.render=function(){return this.constructor(this.props,o.fr)}):i.render=f1),i.$_p=o,i}var g1=function(t){eo(r,t);function r(o,a,i,l,s,d,c){c===void 0&&(c={});var f=t.call(this,o,a,i,l,s,d,Hi(c,o.defaultProps))||this;return f.typ="comp",f._usefs=[],f._uefs=[],f._defs=[],f}var n=r.prototype;return n.s=function(o,a){var i=this.b;return i.shouldComponentUpdate(Hi(o,this.t.defaultProps),a||i.state)!==!1},n.r=function(o,a,i){var l,s,d=this,c=d.t;d.ps=Hi(d.ps,d.t.defaultProps);var f=d.ps,u=!d.b,p=c.contextType,h=d.b,m=p==null?void 0:p.get(d);d._cs=a,u?(h=m1(c,f,m,d),d.b=h):(h.props=f,h.context=m);var y=h.state;d._usefs=[],d._uefs=[];var g=h.render();((s=(l=g==null?void 0:g.props)===null||l===void 0?void 0:l.children)===null||s===void 0?void 0:s.length)===0&&(g.props.children=d.ps.children);var b=or(or({},a),h.$_cs);ro(d,d._ps,g?[g]:[],o,b),u?d._uefs.push(function(){p==null||p.register(d),h.componentDidMount()}):d._uefs.push(function(){h.componentDidUpdate(i,y)}),o.push(function(){d._usefs.forEach(function(w){w()}),u?d.md():d.ud(),d._defs=d._uefs.map(function(w){return w()})})},n.ss=function(o){var a=this.b;!a||!o||(a.state=o)},n.un=function(){var o,a=this;a._ps.forEach(function(l){l.un()});var i=a.t;(o=i.contextType)===null||o===void 0||o.unregister(a),clearTimeout(a.b.$_timer),a._defs.forEach(function(l){l&&l()}),a.b.componentWillUnmount()},r}(ua);function y1(t,r,n){var o=Ji(kd(t),kd(r)),a=o.added,i=o.removed,l=o.changed;for(var s in a)n.setAttribute(s,a[s]);for(var d in l)n.setAttribute(d,l[d][1]);for(var c in i)n.removeAttribute(c)}function b1(t,r,n){var o=Ji(t,r),a=o.added,i=o.removed;for(var l in i)n.e(l,!0);for(var s in a)n.e(s)}function Ji(t,r){var n=mr(t),o=mr(r),a=Qn(n,o,function(d){return d}),i={},l={},s={};return a.added.forEach(function(d){var c=o[d];i[c]=r[c]}),a.removed.forEach(function(d){var c=n[d];l[c]=t[c]}),a.maintained.forEach(function(d){var c=d[0],f=n[c],u=[t[f],r[f]];t[f]!==r[f]&&(s[f]=u)}),{added:i,removed:l,changed:s}}function _1(t,r,n){var o=n.style,a=Ji(t,r),i=a.added,l=a.removed,s=a.changed;for(var d in i){var c=sa(d,"-");o.setProperty(c,i[d])}for(var d in s){var f=sa(d,"-");o.setProperty(f,s[d][1])}for(var d in l){var u=sa(d,"-");o.removeProperty(u)}}function w1(t){return t.replace(/^on/g,"").toLowerCase()}var C1=function(t){eo(r,t);function r(){var o=t!==null&&t.apply(this,arguments)||this;return o.typ="elem",o._es={},o._svg=!1,o}var n=r.prototype;return n.e=function(o,a){var i=this,l=i._es,s=i.b,d=w1(o);a?(We(s,d,l[o]),delete l[o]):(l[o]=function(c){var f,u;(u=(f=i.ps)[o])===null||u===void 0||u.call(f,c)},Xe(s,d,l[o]))},n.s=function(o){return da(this.ps,o)},n.r=function(o,a,i){var l,s=this,d=!s.b,c=s.ps;if(d){var f=fa(s.c),u=!1;s._svg||s.t==="svg"?u=!0:u=f&&f.ownerSVGElement,s._svg=u;var p=(l=s._hyd)===null||l===void 0?void 0:l.splice(0,1)[0],h=s.t;if(p)s._hyd=[].slice.call(p.children||[]);else{var m=wt(f);u?p=m.createElementNS("http://www.w3.org/2000/svg",h):p=m.createElement(h)}s.b=p}ro(s,s._ps,c.children,o,a);var y=s.b,g=Nd(i),b=g[0],w=g[1],_=Nd(c),C=_[0],S=_[1];return y1(b,C,y),b1(w,S,s),_1(i.style||{},c.style||{},y),o.push(function(){d?s.md():s.ud()}),!0},n.un=function(){var o=this,a=o._es,i=o.b;for(var l in a)We(i,l,a[l]);o._ps.forEach(function(s){s.un()}),o._es={},o._sel||$d(i)},r}(ua);function to(t){if(!t||Vr(t))return t;var r=t.$_p._ps;return r.length?to(r[0].b):null}function Id(t){if(t){if(t.b&&Vr(t.b))return t;var r=t._ps;return r.length?Id(r[0]):null}}function Xt(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=r||{},i=a.key,l=a.ref,s=xd(a,["key","ref"]);return{type:t,key:i,ref:l,props:or(or({},s),{children:_d(n).filter(function(d){return d!=null&&d!==!1})})}}var zd=function(t){eo(r,t);function r(o,a){a===void 0&&(a=0);var i=t.call(this,"container",a,"container",0,null)||this;return i.typ="container",i.b=o,i}var n=r.prototype;return n.r=function(){return!0},n.un=function(){},r}(ua),S1=function(t){eo(r,t);function r(){var o=t!==null&&t.apply(this,arguments)||this;return o.typ="text",o}var n=r.prototype;return n.r=function(o){var a,i=this,l=!i.b;if(l){var s=fa(i.c),d=(a=i._hyd)===null||a===void 0?void 0:a.splice(0,1)[0];i.b=d||wt(s).createTextNode(i.t.replace("text_",""))}return o.push(function(){l?i.md():i.ud()}),!0},n.un=function(){$d(this.b)},r}(ua);function x1(t,r,n){var o=n.map(function(d){return at(d)?null:d.key}),a=Ed(r.map(function(d){return d.k})),i=Ed(o),l=Qn(a,i,function(d){return d});l.removed.forEach(function(d){r.splice(d,1)[0].un()}),l.ordered.forEach(function(d){var c=d[0],f=d[1],u=r.splice(c,1)[0];r.splice(f,0,u);var p=to(u.b),h=to(r[f+1]&&r[f+1].b);p&&p.parentNode.insertBefore(p,h)}),l.added.forEach(function(d){r.splice(d,0,Rd(n[d],o[d],d,t))});var s=l.maintained.filter(function(d){d[0];var c=d[1],f=n[c],u=r[c],p=at(f)?"text_".concat(f):f.type;return p!==u.t?(u.un(),r.splice(c,1,Rd(f,o[c],c,t)),!0):(u.i=c,!1)});return vd(vd([],l.added,!0),s.map(function(d){d[0];var c=d[1];return c}),!0)}function v1(t,r){for(var n=t._ps,o=n.length,a=r.i+1;a<o;++a){var i=to(n[a].b);if(i)return i}return null}function Rd(t,r,n,o){var a=o.d+1;if(at(t)||un(t))return new S1("text_".concat(t),a,r,n,o,null,{});var i=t.type,l=typeof i=="string"?C1:g1;return new l(i,a,r,n,o,t.ref,t.props)}function ro(t,r,n,o,a,i,l){var s=x1(t,r,n),d=t._hyd,c=r.filter(function(u,p){return u._hyd=d,u.u(o,a,n[p],i,l)});t.typ==="container"&&t._sel&&r.forEach(function(u){var p=Id(u);p&&(p._sel=!0)}),t._hyd=null;var f=fa(t);return f&&s.reverse().forEach(function(u){var p=r[u],h=to(p.b);if(h&&f!==h&&!h.parentNode){var m=v1(t,p);f.insertBefore(h,m)}}),c.length>0}function E1(t,r,n,o){n===void 0&&(n=r.__CROACT__),o===void 0&&(o={});var a=!!n;n||(n=new zd(r));var i=[];return ro(n,n._ps,t?[t]:[],i,o,void 0,void 0),Dd(i),Xi(null),a||(r.__CROACT__=n),n}function Md(t,r,n){return!n&&t&&(n=new zd(r.parentElement),n._hyd=[r],n._sel=!0),E1(t,r,n),n}function Ad(t){var r=Bd(),n=r._hs||(r._hs=[]),o=u1(),a=n[o];if(p1(o+1),a){if(!da(a.deps,t.deps))return a.updated=!1,a;n[o]=t}else n.push(t);return t.value=t.func(),t.updated=!0,t}function V1(t,r){var n=Ad({func:t,deps:r});return n.value}function k1(t){return V1(function(){return Od(t)},[])}function Ld(t,r,n){var o=Bd(),a=Ad({func:function(){return t},deps:r}),i=n?o._usefs:o._uefs;a.updated?i.push(function(){return a.effect&&a.effect(),a.effect=t(),a.effect}):i.push(function(){return a.effect})}function N1(t,r,n){Ld(function(){t==null||t(r())},n,!0)}function Ki(t,r){for(var n=t.length,o=0;o<n;++o)if(r(t[o],o))return!0;return!1}function Fd(t,r){for(var n=t.length,o=0;o<n;++o)if(r(t[o],o))return t[o];return null}function jd(t){var r=t;if(typeof r>"u"){if(typeof navigator>"u"||!navigator)return"";r=navigator.userAgent||""}return r.toLowerCase()}function Zi(t,r){try{return new RegExp(t,"g").exec(r)}catch{return null}}function $1(){if(typeof navigator>"u"||!navigator||!navigator.userAgentData)return!1;var t=navigator.userAgentData,r=t.brands||t.uaList;return!!(r&&r.length)}function D1(t,r){var n=Zi("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))",r);return n?n[3]:""}function Qi(t){return t.replace(/_/g,".")}function no(t,r){var n=null,o="-1";return Ki(t,function(a){var i=Zi("("+a.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return!i||a.brand?!1:(n=a,o=i[3]||"-1",a.versionAlias?o=a.versionAlias:a.versionTest&&(o=D1(a.versionTest.toLowerCase(),r)||o),o=Qi(o),!0)}),{preset:n,version:o}}function oo(t,r){var n={brand:"",version:"-1"};return Ki(t,function(o){var a=Pd(r,o);return a?(n.brand=o.id,n.version=o.versionAlias||a.version,n.version!=="-1"):!1}),n}function Pd(t,r){return Fd(t,function(n){var o=n.brand;return Zi(""+r.test,o.toLowerCase())})}var el=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],Ud=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],tl=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],Wd=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],Gd=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Hd(t){return!!no(Wd,t).preset}function B1(t){var r=jd(t),n=!!/mobi/g.exec(r),o={name:"unknown",version:"-1",majorVersion:-1,webview:Hd(r),chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},a={name:"unknown",version:"-1",majorVersion:-1},i=no(el,r),l=i.preset,s=i.version,d=no(Gd,r),c=d.preset,f=d.version,u=no(Ud,r);if(o.chromium=!!u.preset,o.chromiumVersion=u.version,!o.chromium){var p=no(tl,r);o.webkit=!!p.preset,o.webkitVersion=p.version}return c&&(a.name=c.id,a.version=f,a.majorVersion=parseInt(f,10)),l&&(o.name=l.id,o.version=s,o.webview&&a.name==="ios"&&o.name!=="safari"&&(o.webview=!1)),o.majorVersion=parseInt(o.version,10),{browser:o,os:a,isMobile:n,isHints:!1}}function T1(t){var r=navigator.userAgentData,n=(r.uaList||r.brands).slice(),o=t&&t.fullVersionList,a=r.mobile||!1,i=n[0],l=(t&&t.platform||r.platform||navigator.platform).toLowerCase(),s={name:i.brand,version:i.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!oo(Wd,n).brand||Hd(jd())},d={name:"unknown",version:"-1",majorVersion:-1};s.webkit=!s.chromium&&Ki(tl,function(m){return Pd(n,m)});var c=oo(Ud,n);if(s.chromium=!!c.brand,s.chromiumVersion=c.version,!s.chromium){var f=oo(tl,n);s.webkit=!!f.brand,s.webkitVersion=f.version}var u=Fd(Gd,function(m){return new RegExp(""+m.test,"g").exec(l)});if(d.name=u?u.id:"",t&&(d.version=t.platformVersion),o&&o.length){var p=oo(el,o);s.name=p.brand||s.name,s.version=p.version||s.version}else{var h=oo(el,n);s.name=h.brand||s.name,s.version=h.brand&&t?t.uaFullVersion:h.version}return s.webkit&&(d.name=a?"ios":"mac"),d.name==="ios"&&s.webview&&(s.version="-1"),d.version=Qi(d.version),s.version=Qi(s.version),d.majorVersion=parseInt(d.version,10),s.majorVersion=parseInt(s.version,10),{browser:s,os:d,isMobile:a,isHints:!0}}function O1(t){return typeof t>"u"&&$1()?T1():B1(t)}function I1(t,r,n,o,a,i){for(var l=0;l<a;++l){var s=n+l*a,d=o+l*a;t[s]+=t[d]*i,r[s]+=r[d]*i}}function z1(t,r,n,o,a){for(var i=0;i<a;++i){var l=n+i*a,s=o+i*a,d=t[l],c=r[l];t[l]=t[s],t[s]=d,r[l]=r[s],r[s]=c}}function R1(t,r,n,o,a){for(var i=0;i<o;++i){var l=n+i*o;t[l]/=a,r[l]/=a}}function Yd(t,r,n){n===void 0&&(n=Math.sqrt(t.length));for(var o=t.slice(),a=0;a<n;++a)o[a*n+r-1]=0,o[(r-1)*n+a]=0;return o[(r-1)*(n+1)]=1,o}function qt(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=t.slice(),o=Me(r),a=0;a<r;++a){var i=r*a+a;if(!pe(n[i],Ze)){for(var l=a+1;l<r;++l)if(n[r*a+l]){z1(n,o,a,l,r);break}}if(!pe(n[i],Ze))return[];R1(n,o,a,r,n[i]);for(var l=0;l<r;++l){var s=l,d=l+a*r,c=n[d];!pe(c,Ze)||a===l||I1(n,o,s,a,r,-c)}}return o}function M1(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=[],o=0;o<r;++o)for(var a=0;a<r;++a)n[a*r+o]=t[r*o+a];return n}function Xd(t,r){r===void 0&&(r=Math.sqrt(t.length));for(var n=[],o=t[r*r-1],a=0;a<r-1;++a)n[a]=t[r*(r-1)+a]/o;return n[r-1]=0,n}function A1(t,r){for(var n=Me(r),o=0;o<r-1;++o)n[r*(r-1)+o]=t[o]||0;return n}function Ur(t,r){for(var n=t.slice(),o=t.length;o<r-1;++o)n[o]=0;return n[r-1]=1,n}function Jt(t,r,n){if(r===void 0&&(r=Math.sqrt(t.length)),r===n)return t;for(var o=Me(n),a=Math.min(r,n),i=0;i<a-1;++i){for(var l=0;l<a-1;++l)o[i*n+l]=t[i*r+l];o[(i+1)*n-1]=t[(i+1)*r-1],o[(n-1)*n+i]=t[(r-1)*r+i]}return o[n*n-1]=t[r*r-1],o}function pa(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var o=Me(t);return r.forEach(function(a){o=Oe(o,a,t)}),o}function Oe(t,r,n){n===void 0&&(n=Math.sqrt(t.length));var o=[],a=t.length/n,i=r.length/a;if(a){if(!i)return t}else return r;for(var l=0;l<n;++l)for(var s=0;s<i;++s){o[s*n+l]=0;for(var d=0;d<a;++d)o[s*n+l]+=t[d*n+l]*r[s*a+d]}return o}function xe(t,r){for(var n=Math.min(t.length,r.length),o=t.slice(),a=0;a<n;++a)o[a]=o[a]+r[a];return o}function se(t,r){for(var n=Math.min(t.length,r.length),o=t.slice(),a=0;a<n;++a)o[a]=o[a]-r[a];return o}function L1(t,r){return r===void 0&&(r=t.length===6),r?[t[0],t[1],0,t[2],t[3],0,t[4],t[5],1]:t}function qd(t,r){return r===void 0&&(r=t.length===9),r?[t[0],t[1],t[3],t[4],t[6],t[7]]:t}function lt(t,r,n){n===void 0&&(n=r.length);var o=Oe(t,r,n),a=o[n-1];return o.map(function(i){return i/a})}function F1(t,r){return Oe(t,[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1],4)}function j1(t,r){return Oe(t,[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1],4)}function P1(t,r){return Oe(t,io(r,4))}function ha(t,r){var n=r[0],o=n===void 0?1:n,a=r[1],i=a===void 0?1:a,l=r[2],s=l===void 0?1:l;return Oe(t,[o,0,0,0,0,i,0,0,0,0,s,0,0,0,0,1],4)}function ao(t,r){return lt(io(r,3),Ur(t,3))}function rl(t,r){var n=r[0],o=n===void 0?0:n,a=r[1],i=a===void 0?0:a,l=r[2],s=l===void 0?0:l;return Oe(t,[1,0,0,0,0,1,0,0,0,0,1,0,o,i,s,1],4)}function nl(t,r){return Oe(t,r,4)}function io(t,r){var n=Math.cos(t),o=Math.sin(t),a=Me(r);return a[0]=n,a[1]=o,a[r]=-o,a[r+1]=n,a}function Me(t){for(var r=t*t,n=[],o=0;o<r;++o)n[o]=o%(t+1)?0:1;return n}function ol(t,r){for(var n=Me(r),o=Math.min(t.length,r-1),a=0;a<o;++a)n[(r+1)*a]=t[a];return n}function Wr(t,r){for(var n=Me(r),o=Math.min(t.length,r-1),a=0;a<o;++a)n[r*(r-1)+a]=t[a];return n}function al(t,r,n,o,a,i,l,s){var d=t[0],c=t[1],f=r[0],u=r[1],p=n[0],h=n[1],m=o[0],y=o[1],g=a[0],b=a[1],w=i[0],_=i[1],C=l[0],S=l[1],x=s[0],v=s[1],V=[d,0,f,0,p,0,m,0,c,0,u,0,h,0,y,0,1,0,1,0,1,0,1,0,0,d,0,f,0,p,0,m,0,c,0,u,0,h,0,y,0,1,0,1,0,1,0,1,-g*d,-b*d,-w*f,-_*f,-C*p,-S*p,-x*m,-v*m,-g*c,-b*c,-w*u,-_*u,-C*h,-S*h,-x*y,-v*y],$=qt(V,8);if(!$.length)return[];var B=Oe($,[g,b,w,_,C,S,x,v],8);return B[8]=1,Jt(M1(B),3,4)}var lo=function(){return lo=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},lo.apply(this,arguments)};function il(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pn(t,r){return r===void 0&&(r=0),hn(mn(t,r))}function ma(t,r){var n=lt(t,[r[0],r[1]||0,r[2]||0,1],4),o=n[3]||1;return[n[0]/o,n[1]/o,n[2]/o]}function U1(t,r){r===void 0&&(r=document.body);for(var n=t,o=il();n;){var a=getComputedStyle(n).transform;if(o=nl(pn(a),o),n===r)break;n=n.parentElement}return o=qt(o,4),o[12]=0,o[13]=0,o[14]=0,o}function hn(t){var r=il();return t.forEach(function(n){var o=n.matrixFunction,a=n.functionValue;o&&(r=o(r,a))}),r}function mn(t,r){r===void 0&&(r=0);var n=Ue(t)?t:vr(t);return n.map(function(o){var a=hd(o),i=a.prefix,l=a.value,s=null,d=i,c="";if(i==="translate"||i==="translateX"||i==="translate3d"){var f=$t(r)?lo(lo({},r),{"o%":r["%"]}):{"%":r,"o%":r},u=jr(l).map(function(k,O){return O===0&&"x%"in f?f["%"]=r["x%"]:O===1&&"y%"in f?f["%"]=r["y%"]:f["%"]=r["o%"],Te(k,f)}),p=u[0],h=u[1],m=h===void 0?0:h,y=u[2],g=y===void 0?0:y;s=rl,c=[p,m,g]}else if(i==="translateY"){var b=$t(r)?lo({"%":r["y%"]},r):{"%":r},m=Te(l,b);s=rl,c=[0,m,0]}else if(i==="translateZ"){var g=parseFloat(l);s=rl,c=[0,0,g]}else if(i==="scale"||i==="scale3d"){var w=jr(l).map(function(k){return parseFloat(k)}),_=w[0],C=w[1],S=C===void 0?_:C,x=w[2],v=x===void 0?1:x;s=ha,c=[_,S,v]}else if(i==="scaleX"){var _=parseFloat(l);s=ha,c=[_,1,1]}else if(i==="scaleY"){var S=parseFloat(l);s=ha,c=[1,S,1]}else if(i==="scaleZ"){var v=parseFloat(l);s=ha,c=[1,1,v]}else if(i==="rotate"||i==="rotateZ"||i==="rotateX"||i==="rotateY"){var V=Pr(l),$=V.unit,B=V.value,R=$==="rad"?B:B*Math.PI/180;i==="rotate"||i==="rotateZ"?(d="rotateZ",s=P1):i==="rotateX"?s=F1:i==="rotateY"&&(s=j1),c=R}else if(i==="matrix3d")s=nl,c=jr(l).map(function(k){return parseFloat(k)});else if(i==="matrix"){var T=jr(l).map(function(k){return parseFloat(k)});s=nl,c=[T[0],T[1],0,0,T[2],T[3],0,0,0,0,1,0,T[4],T[5],0,1]}else d="";return{name:i,functionName:d,value:l,matrixFunction:s,functionValue:c}})}/*! *****************************************************************************
32
32
  Copyright (c) Microsoft Corporation. All rights reserved.
33
33
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
34
34
  this file except in compliance with the License. You may obtain a copy of the
@@ -80,7 +80,7 @@
80
80
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
81
81
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
82
82
  PERFORMANCE OF THIS SOFTWARE.
83
- ***************************************************************************** */function J1(){for(var t=0,r=0,n=arguments.length;r<n;r++)t+=arguments[r].length;for(var o=Array(t),a=0,r=0;r<n;r++)for(var i=arguments[r],l=0,s=i.length;l<s;l++,a++)o[a]=i[l];return o}function Ct(t){return pe(t,Ke)}function K1(t,r){return t.every(function(n,o){return Ct(n-r[o])===0})}function Z1(t,r){return!Ct(t[0]-r[0])&&!Ct(t[1]-r[1])}function so(t){return t.length<3?0:Math.abs(t1(t.map(function(r,n){var o=t[n+1]||t[0];return r[0]*o[1]-o[0]*r[1]})))/2}function dl(t,r){var n=r.width,o=r.height,a=r.left,i=r.top,l=Gr(t),s=l.minX,d=l.minY,c=l.maxX,f=l.maxY,u=n/(c-s),p=o/(f-d);return t.map(function(h){return[a+(h[0]-s)*u,i+(h[1]-d)*p]})}function Gr(t){var r=t.map(function(o){return o[0]}),n=t.map(function(o){return o[1]});return{minX:Math.min.apply(Math,r),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,r),maxY:Math.max.apply(Math,n)}}function ya(t,r,n){var o=t[0],a=t[1],i=Gr(r),l=i.minX,s=i.maxX,d=[[l,a],[s,a]],c=ba(d[0],d[1]),f=ul(r),u=[];if(f.forEach(function(m){var y=ba(m[0],m[1]),g=m[0];if(K1(c,y))u.push({pos:t,line:m,type:"line"});else{var b=ef(fl(c,y),[d,m]);b.forEach(function(w){m.some(function(_){return Z1(_,w)})?u.push({pos:w,line:m,type:"point"}):Ct(g[1]-a)!==0&&u.push({pos:w,line:m,type:"intersection"})})}}),!n&&_t(u,function(m){return m[0]===o}))return!0;var p=0,h={};return u.forEach(function(m){var y=m.pos,g=m.type,b=m.line;if(!(y[0]>o))if(g==="intersection")++p;else{if(g==="line")return;if(g==="point"){var w=_t(b,function(S){return S[1]!==a}),_=h[y[0]],C=w[1]>a?1:-1;_?_!==C&&++p:h[y[0]]=C}}}),p%2===1}function ba(t,r){var n=t[0],o=t[1],a=r[0],i=r[1],l=a-n,s=i-o;Math.abs(l)<Ke&&(l=0),Math.abs(s)<Ke&&(s=0);var d=0,c=0,f=0;return l?s?(d=-s/l,c=1,f=-d*n-o):(c=1,f=-o):s&&(d=-1,f=n),[d,c,f]}function fl(t,r){var n=t[0],o=t[1],a=t[2],i=r[0],l=r[1],s=r[2],d=n===0&&i===0,c=o===0&&l===0,f=[];if(d&&c)return[];if(d){var u=-a/o,p=-s/l;return u!==p?[]:[[-1/0,u],[1/0,u]]}else if(c){var h=-a/n,m=-s/i;return h!==m?[]:[[h,-1/0],[h,1/0]]}else if(n===0){var y=-a/o,g=-(l*y+s)/i;f=[[g,y]]}else if(i===0){var y=-s/l,g=-(o*y+a)/n;f=[[g,y]]}else if(o===0){var g=-a/n,y=-(i*g+s)/l;f=[[g,y]]}else if(l===0){var g=-s/i,y=-(n*g+a)/o;f=[[g,y]]}else{var g=(o*s-l*a)/(l*n-o*i),y=-(n*g+a)/o;f=[[g,y]]}return f.map(function(b){return[b[0],b[1]]})}function ef(t,r){var n=r.map(function(u){return[0,1].map(function(p){return[Math.min(u[0][p],u[1][p]),Math.max(u[0][p],u[1][p])]})}),o=[];if(t.length===2){var a=t[0],i=a[0],l=a[1];if(Ct(i-t[1][0])){if(!Ct(l-t[1][1])){var c=Math.max.apply(Math,n.map(function(u){return u[0][0]})),f=Math.min.apply(Math,n.map(function(u){return u[0][1]}));if(Ct(c-f)>0)return[];o=[[c,l],[f,l]]}}else{var s=Math.max.apply(Math,n.map(function(u){return u[1][0]})),d=Math.min.apply(Math,n.map(function(u){return u[1][1]}));if(Ct(s-d)>0)return[];o=[[i,s],[i,d]]}}return o.length||(o=t.filter(function(u){var p=u[0],h=u[1];return n.every(function(m){return 0<=Ct(p-m[0][0])&&0<=Ct(m[0][1]-p)&&0<=Ct(h-m[1][0])&&0<=Ct(m[1][1]-h)})})),o.map(function(u){return[Ct(u[0]),Ct(u[1])]})}function ul(t){return J1(t.slice(1),[t[0]]).map(function(r,n){return[t[n],r]})}function Q1(t,r){var n=t.slice(),o=r.slice();yd(n)===-1&&n.reverse(),yd(o)===-1&&o.reverse();var a=ul(n),i=ul(o),l=a.map(function(f){return ba(f[0],f[1])}),s=i.map(function(f){return ba(f[0],f[1])}),d=[];l.forEach(function(f,u){var p=a[u],h=[];s.forEach(function(m,y){var g=fl(f,m),b=ef(g,[p,i[y]]);h.push.apply(h,b.map(function(w){return{index1:u,index2:y,pos:w,type:"intersection"}}))}),h.sort(function(m,y){return nr(p[0],m.pos)-nr(p[0],y.pos)}),d.push.apply(d,h),ya(p[1],o)&&d.push({index1:u,index2:-1,pos:p[1],type:"inside"})}),i.forEach(function(f,u){if(ya(f[1],n)){var p=!1,h=hr(d,function(m){var y=m.index2;return y===u?(p=!0,!1):!!p});h===-1&&(p=!1,h=hr(d,function(m){var y=m.index1,g=m.index2;return y===-1&&g+1===u?(p=!0,!1):!!p})),h===-1?d.push({index1:-1,index2:u,pos:f[1],type:"inside"}):d.splice(h,0,{index1:-1,index2:u,pos:f[1],type:"inside"})}});var c={};return d.filter(function(f){var u=f.pos,p=u[0]+"x"+u[1];return c[p]?!1:(c[p]=!0,!0)})}function pl(t,r){var n=Q1(t,r);return n.map(function(o){var a=o.pos;return a})}function e_(t,r){var n=pl(t,r);return so(n)}/*! *****************************************************************************
83
+ ***************************************************************************** */function J1(){for(var t=0,r=0,n=arguments.length;r<n;r++)t+=arguments[r].length;for(var o=Array(t),a=0,r=0;r<n;r++)for(var i=arguments[r],l=0,s=i.length;l<s;l++,a++)o[a]=i[l];return o}function Ct(t){return pe(t,Ze)}function K1(t,r){return t.every(function(n,o){return Ct(n-r[o])===0})}function Z1(t,r){return!Ct(t[0]-r[0])&&!Ct(t[1]-r[1])}function so(t){return t.length<3?0:Math.abs(t1(t.map(function(r,n){var o=t[n+1]||t[0];return r[0]*o[1]-o[0]*r[1]})))/2}function dl(t,r){var n=r.width,o=r.height,a=r.left,i=r.top,l=Gr(t),s=l.minX,d=l.minY,c=l.maxX,f=l.maxY,u=n/(c-s),p=o/(f-d);return t.map(function(h){return[a+(h[0]-s)*u,i+(h[1]-d)*p]})}function Gr(t){var r=t.map(function(o){return o[0]}),n=t.map(function(o){return o[1]});return{minX:Math.min.apply(Math,r),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,r),maxY:Math.max.apply(Math,n)}}function ya(t,r,n){var o=t[0],a=t[1],i=Gr(r),l=i.minX,s=i.maxX,d=[[l,a],[s,a]],c=ba(d[0],d[1]),f=ul(r),u=[];if(f.forEach(function(m){var y=ba(m[0],m[1]),g=m[0];if(K1(c,y))u.push({pos:t,line:m,type:"line"});else{var b=ef(fl(c,y),[d,m]);b.forEach(function(w){m.some(function(_){return Z1(_,w)})?u.push({pos:w,line:m,type:"point"}):Ct(g[1]-a)!==0&&u.push({pos:w,line:m,type:"intersection"})})}}),!n&&_t(u,function(m){return m[0]===o}))return!0;var p=0,h={};return u.forEach(function(m){var y=m.pos,g=m.type,b=m.line;if(!(y[0]>o))if(g==="intersection")++p;else{if(g==="line")return;if(g==="point"){var w=_t(b,function(S){return S[1]!==a}),_=h[y[0]],C=w[1]>a?1:-1;_?_!==C&&++p:h[y[0]]=C}}}),p%2===1}function ba(t,r){var n=t[0],o=t[1],a=r[0],i=r[1],l=a-n,s=i-o;Math.abs(l)<Ze&&(l=0),Math.abs(s)<Ze&&(s=0);var d=0,c=0,f=0;return l?s?(d=-s/l,c=1,f=-d*n-o):(c=1,f=-o):s&&(d=-1,f=n),[d,c,f]}function fl(t,r){var n=t[0],o=t[1],a=t[2],i=r[0],l=r[1],s=r[2],d=n===0&&i===0,c=o===0&&l===0,f=[];if(d&&c)return[];if(d){var u=-a/o,p=-s/l;return u!==p?[]:[[-1/0,u],[1/0,u]]}else if(c){var h=-a/n,m=-s/i;return h!==m?[]:[[h,-1/0],[h,1/0]]}else if(n===0){var y=-a/o,g=-(l*y+s)/i;f=[[g,y]]}else if(i===0){var y=-s/l,g=-(o*y+a)/n;f=[[g,y]]}else if(o===0){var g=-a/n,y=-(i*g+s)/l;f=[[g,y]]}else if(l===0){var g=-s/i,y=-(n*g+a)/o;f=[[g,y]]}else{var g=(o*s-l*a)/(l*n-o*i),y=-(n*g+a)/o;f=[[g,y]]}return f.map(function(b){return[b[0],b[1]]})}function ef(t,r){var n=r.map(function(u){return[0,1].map(function(p){return[Math.min(u[0][p],u[1][p]),Math.max(u[0][p],u[1][p])]})}),o=[];if(t.length===2){var a=t[0],i=a[0],l=a[1];if(Ct(i-t[1][0])){if(!Ct(l-t[1][1])){var c=Math.max.apply(Math,n.map(function(u){return u[0][0]})),f=Math.min.apply(Math,n.map(function(u){return u[0][1]}));if(Ct(c-f)>0)return[];o=[[c,l],[f,l]]}}else{var s=Math.max.apply(Math,n.map(function(u){return u[1][0]})),d=Math.min.apply(Math,n.map(function(u){return u[1][1]}));if(Ct(s-d)>0)return[];o=[[i,s],[i,d]]}}return o.length||(o=t.filter(function(u){var p=u[0],h=u[1];return n.every(function(m){return 0<=Ct(p-m[0][0])&&0<=Ct(m[0][1]-p)&&0<=Ct(h-m[1][0])&&0<=Ct(m[1][1]-h)})})),o.map(function(u){return[Ct(u[0]),Ct(u[1])]})}function ul(t){return J1(t.slice(1),[t[0]]).map(function(r,n){return[t[n],r]})}function Q1(t,r){var n=t.slice(),o=r.slice();yd(n)===-1&&n.reverse(),yd(o)===-1&&o.reverse();var a=ul(n),i=ul(o),l=a.map(function(f){return ba(f[0],f[1])}),s=i.map(function(f){return ba(f[0],f[1])}),d=[];l.forEach(function(f,u){var p=a[u],h=[];s.forEach(function(m,y){var g=fl(f,m),b=ef(g,[p,i[y]]);h.push.apply(h,b.map(function(w){return{index1:u,index2:y,pos:w,type:"intersection"}}))}),h.sort(function(m,y){return nr(p[0],m.pos)-nr(p[0],y.pos)}),d.push.apply(d,h),ya(p[1],o)&&d.push({index1:u,index2:-1,pos:p[1],type:"inside"})}),i.forEach(function(f,u){if(ya(f[1],n)){var p=!1,h=hr(d,function(m){var y=m.index2;return y===u?(p=!0,!1):!!p});h===-1&&(p=!1,h=hr(d,function(m){var y=m.index1,g=m.index2;return y===-1&&g+1===u?(p=!0,!1):!!p})),h===-1?d.push({index1:-1,index2:u,pos:f[1],type:"inside"}):d.splice(h,0,{index1:-1,index2:u,pos:f[1],type:"inside"})}});var c={};return d.filter(function(f){var u=f.pos,p=u[0]+"x"+u[1];return c[p]?!1:(c[p]=!0,!0)})}function pl(t,r){var n=Q1(t,r);return n.map(function(o){var a=o.pos;return a})}function e_(t,r){var n=pl(t,r);return so(n)}/*! *****************************************************************************
84
84
  Copyright (c) Microsoft Corporation.
85
85
 
86
86
  Permission to use, copy, modify, and/or distribute this software for any
@@ -93,7 +93,7 @@
93
93
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
94
94
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
95
95
  PERFORMANCE OF THIS SOFTWARE.
96
- ***************************************************************************** */var hl=function(t,r){return hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},hl(t,r)};function t_(t,r){hl(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Qe=function(){return Qe=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},Qe.apply(this,arguments)};function r_(t,r){var n=r[0]-t[0],o=r[1]-t[1],a=Math.atan2(o,n);return a>=0?a:a+Math.PI*2}function ml(t){return r_([t[0].clientX,t[0].clientY],[t[1].clientX,t[1].clientY])/Math.PI*180}function n_(t){return t.touches&&t.touches.length>=2}function _a(t){return t?t.touches?a_(t.touches):[rf(t)]:[]}function o_(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}function tf(t,r,n){var o=n.length,a=co(t,o),i=a.clientX,l=a.clientY,s=a.originalClientX,d=a.originalClientY,c=co(r,o),f=c.clientX,u=c.clientY,p=co(n,o),h=p.clientX,m=p.clientY,y=i-f,g=l-u,b=i-h,w=l-m;return{clientX:s,clientY:d,deltaX:y,deltaY:g,distX:b,distY:w}}function gl(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function a_(t){for(var r=Math.min(t.length,2),n=[],o=0;o<r;++o)n.push(rf(t[o]));return n}function rf(t){return{clientX:t.clientX,clientY:t.clientY}}function co(t,r){r===void 0&&(r=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},o=Math.min(t.length,r),a=0;a<o;++a){var i=t[a];n.originalClientX+="originalClientX"in i?i.originalClientX:i.clientX,n.originalClientY+="originalClientY"in i?i.originalClientY:i.clientY,n.clientX+=i.clientX,n.clientY+=i.clientY}return r?{clientX:n.clientX/r,clientY:n.clientY/r,originalClientX:n.originalClientX/r,originalClientY:n.originalClientY/r}:n}var yl=function(){function t(r){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=r,this.prevClients=r,this.length=r.length}return t.prototype.getAngle=function(r){return r===void 0&&(r=this.prevClients),ml(r)},t.prototype.getRotation=function(r){return r===void 0&&(r=this.prevClients),ml(r)-ml(this.startClients)},t.prototype.getPosition=function(r,n){r===void 0&&(r=this.prevClients);var o=tf(r||this.prevClients,this.prevClients,this.startClients),a=o.deltaX,i=o.deltaY;return this.movement+=Math.sqrt(a*a+i*i),this.prevClients=r,o},t.prototype.getPositions=function(r){r===void 0&&(r=this.prevClients);for(var n=this.prevClients,o=this.startClients,a=Math.min(this.length,n.length),i=[],l=0;l<a;++l)i[l]=tf([r[l]],[n[l]],[o[l]]);return i},t.prototype.getMovement=function(r){var n=this.movement;if(!r)return n;var o=co(r,this.length),a=co(this.prevClients,this.length),i=o.clientX-a.clientX,l=o.clientY-a.clientY;return Math.sqrt(i*i+l*l)+n},t.prototype.getDistance=function(r){return r===void 0&&(r=this.prevClients),gl(r)},t.prototype.getScale=function(r){return r===void 0&&(r=this.prevClients),gl(r)/gl(this.startClients)},t.prototype.move=function(r,n){this.startClients.forEach(function(o){o.clientX-=r,o.clientY-=n}),this.prevClients.forEach(function(o){o.clientX-=r,o.clientY-=n})},t}(),nf=["textarea","input"],of=function(t){t_(r,t);function r(n,o){o===void 0&&(o={});var a=t.call(this)||this;a.options={},a.flag=!1,a.pinchFlag=!1,a.data={},a.isDrag=!1,a.isPinch=!1,a.clientStores=[],a.targets=[],a.prevTime=0,a.doubleFlag=!1,a._useMouse=!1,a._useTouch=!1,a._useDrag=!1,a._dragFlag=!1,a._isTrusted=!1,a._isMouseEvent=!1,a._isSecondaryButton=!1,a._preventMouseEvent=!1,a._prevInputEvent=null,a._isDragAPI=!1,a._isIdle=!0,a._preventMouseEventId=0,a._window=window,a.onDragStart=function(p,h){if(h===void 0&&(h=!0),!(!a.flag&&p.cancelable===!1)){var m=p.type.indexOf("drag")>=-1;if(!(a.flag&&m)){a._isDragAPI=!0;var y=a.options,g=y.container,b=y.pinchOutside,w=y.preventWheelClick,_=y.preventRightClick,C=y.preventDefault,S=y.checkInput,x=y.dragFocusedInput,v=y.preventClickEventOnDragStart,V=y.preventClickEventOnDrag,$=y.preventClickEventByCondition,B=a._useTouch,R=!a.flag;if(a._isSecondaryButton=p.which===3||p.button===2,w&&(p.which===2||p.button===1)||_&&(p.which===3||p.button===2))return a.stop(),!1;if(R){var T=a._window.document.activeElement,k=p.target;if(k){var O=k.tagName.toLowerCase(),N=nf.indexOf(O)>-1,D=k.isContentEditable;if(N||D){if(S||!x&&T===k)return!1;if(T&&(T===k||D&&T.isContentEditable&&T.contains(k)))if(x)k.blur();else return!1}else if((C||p.type==="touchstart")&&T){var I=T.tagName.toLowerCase();(T.isContentEditable||nf.indexOf(I)>-1)&&T.blur()}(v||V||$)&&Xe(a._window,"click",a._onClick,!0)}a.clientStores=[new yl(_a(p))],a._isIdle=!1,a.flag=!0,a.isDrag=!1,a._isTrusted=h,a._dragFlag=!0,a._prevInputEvent=p,a.data={},a.doubleFlag=Zn()-a.prevTime<200,a._isMouseEvent=o_(p),!a._isMouseEvent&&a._preventMouseEvent&&a._allowMouseEvent();var z=a._preventMouseEvent||a.emit("dragStart",Qe(Qe({data:a.data,datas:a.data,inputEvent:p,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,isTrusted:h,isDouble:a.doubleFlag},a.getCurrentStore().getPosition()),{preventDefault:function(){p.preventDefault()},preventDrag:function(){a._dragFlag=!1}}));z===!1&&a.stop(),a._isMouseEvent&&a.flag&&C&&p.preventDefault()}if(!a.flag)return!1;var M=0;if(R?(a._attchDragEvent(),B&&b&&(M=setTimeout(function(){Xe(g,"touchstart",a.onDragStart,{passive:!1})}))):B&&b&&We(g,"touchstart",a.onDragStart),a.flag&&n_(p)){if(clearTimeout(M),R&&p.touches.length!==p.changedTouches.length)return;a.pinchFlag||a.onPinchStart(p)}}}},a.onDrag=function(p,h){if(a.flag){var m=a.options.preventDefault;!a._isMouseEvent&&m&&p.preventDefault(),a._prevInputEvent=p;var y=_a(p),g=a.moveClients(y,p,!1);if(a._dragFlag){if(a.pinchFlag||g.deltaX||g.deltaY){var b=a._preventMouseEvent||a.emit("drag",Qe(Qe({},g),{isScroll:!!h,inputEvent:p}));if(b===!1){a.stop();return}}a.pinchFlag&&a.onPinch(p,y)}a.getCurrentStore().getPosition(y,!0)}},a.onDragEnd=function(p){if(a.flag){var h=a.options,m=h.pinchOutside,y=h.container,g=h.preventClickEventOnDrag,b=h.preventClickEventOnDragStart,w=h.preventClickEventByCondition,_=a.isDrag;(g||b||w)&&requestAnimationFrame(function(){a._allowClickEvent()}),!w&&!b&&g&&!_&&a._allowClickEvent(),a._useTouch&&m&&We(y,"touchstart",a.onDragStart),a.pinchFlag&&a.onPinchEnd(p);var C=p!=null&&p.touches?_a(p):[],S=C.length;S===0||!a.options.keepDragging?a.flag=!1:a._addStore(new yl(C));var x=a._getPosition(),v=Zn(),V=!_&&a.doubleFlag;a._prevInputEvent=null,a.prevTime=_||V?0:v,a.flag||(a._dettachDragEvent(),a._preventMouseEvent||a.emit("dragEnd",Qe({data:a.data,datas:a.data,isDouble:V,isDrag:_,isClick:!_,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,inputEvent:p,isTrusted:a._isTrusted},x)),a.clientStores=[],a._isMouseEvent||(a._preventMouseEvent=!0,clearTimeout(a._preventMouseEventId),a._preventMouseEventId=setTimeout(function(){a._preventMouseEvent=!1},200)),a._isIdle=!0)}},a.onBlur=function(){a.onDragEnd()},a._allowClickEvent=function(){We(a._window,"click",a._onClick,!0)},a._onClick=function(p){a._allowClickEvent(),a._allowMouseEvent();var h=a.options.preventClickEventByCondition;h!=null&&h(p)||(p.stopPropagation(),p.preventDefault())},a._onContextMenu=function(p){var h=a.options;h.preventRightClick?a.onDragEnd(p):p.preventDefault()},a._passCallback=function(){};var i=[].concat(n),l=i[0];a._window=Sd(l)?l:At(l),a.options=Qe({checkInput:!1,container:l&&!("document"in l)?At(l):l,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},o);var s=a.options,d=s.container,c=s.events,f=s.checkWindowBlur;if(a._useDrag=c.indexOf("drag")>-1,a._useTouch=c.indexOf("touch")>-1,a._useMouse=c.indexOf("mouse")>-1,a.targets=i,a._useDrag&&i.forEach(function(p){Xe(p,"dragstart",a.onDragStart)}),a._useMouse&&(i.forEach(function(p){Xe(p,"mousedown",a.onDragStart),Xe(p,"mousemove",a._passCallback)}),Xe(d,"contextmenu",a._onContextMenu)),f&&Xe(At(),"blur",a.onBlur),a._useTouch){var u={passive:!1};i.forEach(function(p){Xe(p,"touchstart",a.onDragStart,u),Xe(p,"touchmove",a._passCallback,u)})}return a}return r.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},r.prototype.getMovement=function(n){return this.getCurrentStore().getMovement(n)+this.clientStores.slice(1).reduce(function(o,a){return o+a.movement},0)},r.prototype.isDragging=function(){return this.isDrag},r.prototype.isIdle=function(){return this._isIdle},r.prototype.isFlag=function(){return this.flag},r.prototype.isPinchFlag=function(){return this.pinchFlag},r.prototype.isDoubleFlag=function(){return this.doubleFlag},r.prototype.isPinching=function(){return this.isPinch},r.prototype.scrollBy=function(n,o,a,i){i===void 0&&(i=!0),this.flag&&(this.clientStores[0].move(n,o),i&&this.onDrag(a,!0))},r.prototype.move=function(n,o){var a=n[0],i=n[1],l=this.getCurrentStore(),s=l.prevClients;return this.moveClients(s.map(function(d){var c=d.clientX,f=d.clientY;return{clientX:c+a,clientY:f+i,originalClientX:c,originalClientY:f}}),o,!0)},r.prototype.triggerDragStart=function(n){this.onDragStart(n,!1)},r.prototype.setEventData=function(n){var o=this.data;for(var a in n)o[a]=n[a];return this},r.prototype.setEventDatas=function(n){return this.setEventData(n)},r.prototype.getCurrentEvent=function(n){return n===void 0&&(n=this._prevInputEvent),Qe(Qe({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:n})},r.prototype.getEventData=function(){return this.data},r.prototype.getEventDatas=function(){return this.data},r.prototype.unset=function(){var n=this,o=this.targets,a=this.options.container;this.off(),We(this._window,"blur",this.onBlur),this._useDrag&&o.forEach(function(i){We(i,"dragstart",n.onDragStart)}),this._useMouse&&(o.forEach(function(i){We(i,"mousedown",n.onDragStart)}),We(a,"contextmenu",this._onContextMenu)),this._useTouch&&(o.forEach(function(i){We(i,"touchstart",n.onDragStart)}),We(a,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},r.prototype.onPinchStart=function(n){var o=this,a=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>a)){var i=new yl(_a(n));this.pinchFlag=!0,this._addStore(i);var l=this.emit("pinchStart",Qe(Qe({data:this.data,datas:this.data,angle:i.getAngle(),touches:this.getCurrentStore().getPositions()},i.getPosition()),{inputEvent:n,isTrusted:this._isTrusted,preventDefault:function(){n.preventDefault()},preventDrag:function(){o._dragFlag=!1}}));l===!1&&(this.pinchFlag=!1)}},r.prototype.onPinch=function(n,o){if(!(!this.flag||!this.pinchFlag||o.length<2)){var a=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",Qe(Qe({data:this.data,datas:this.data,movement:this.getMovement(o),angle:a.getAngle(o),rotation:a.getRotation(o),touches:a.getPositions(o),scale:a.getScale(o),distance:a.getDistance(o)},a.getPosition(o)),{inputEvent:n,isTrusted:this._isTrusted}))}},r.prototype.onPinchEnd=function(n){if(this.pinchFlag){var o=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var a=this.getCurrentStore();this.emit("pinchEnd",Qe(Qe({data:this.data,datas:this.data,isPinch:o,touches:a.getPositions()},a.getPosition()),{inputEvent:n}))}},r.prototype.getCurrentStore=function(){return this.clientStores[0]},r.prototype.moveClients=function(n,o,a){var i=this._getPosition(n,a),l=this.isDrag;(i.deltaX||i.deltaY)&&(this.isDrag=!0);var s=!1;return!l&&this.isDrag&&(s=!0),Qe(Qe({data:this.data,datas:this.data},i),{movement:this.getMovement(n),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:o,isTrusted:this._isTrusted,isFirstDrag:s})},r.prototype._addStore=function(n){this.clientStores.splice(0,0,n)},r.prototype._getPosition=function(n,o){var a=this.getCurrentStore(),i=a.getPosition(n,o),l=this.clientStores.slice(1).reduce(function(c,f){var u=f.getPosition();return c.distX+=u.distX,c.distY+=u.distY,c},i),s=l.distX,d=l.distY;return Qe(Qe({},i),{distX:s,distY:d})},r.prototype._attchDragEvent=function(){var n=this._window,o=this.options.container,a={passive:!1};this._isDragAPI&&(Xe(o,"dragover",this.onDrag,a),Xe(n,"dragend",this.onDragEnd)),this._useMouse&&(Xe(o,"mousemove",this.onDrag),Xe(n,"mouseup",this.onDragEnd)),this._useTouch&&(Xe(o,"touchmove",this.onDrag,a),Xe(n,"touchend",this.onDragEnd,a),Xe(n,"touchcancel",this.onDragEnd,a))},r.prototype._dettachDragEvent=function(){var n=this._window,o=this.options.container;this._isDragAPI&&(We(o,"dragover",this.onDrag),We(n,"dragend",this.onDragEnd)),this._useMouse&&(We(o,"mousemove",this.onDrag),We(n,"mouseup",this.onDragEnd)),this._useTouch&&(We(o,"touchstart",this.onDragStart),We(o,"touchmove",this.onDrag),We(n,"touchend",this.onDragEnd),We(n,"touchcancel",this.onDragEnd))},r.prototype._allowMouseEvent=function(){this._preventMouseEvent=!1,clearTimeout(this._preventMouseEventId)},r}(yn);function i_(t){for(var r=5381,n=t.length;n;)r=r*33^t.charCodeAt(--n);return r>>>0}var l_=i_;function s_(t){return l_(t).toString(36)}function c_(t){if(t&&t.getRootNode){var r=t.getRootNode();if(r.nodeType===11)return r}}function d_(t,r,n){return n.original?r:r.replace(/([^};{\s}][^};{]*|^\s*){/mg,function(o,a){var i=a.trim();return(i?jr(i):[""]).map(function(l){var s=l.trim();return s.indexOf("@")===0?s:s.indexOf(":global")>-1?s.replace(/\:global/g,""):s.indexOf(":host")>-1?"".concat(s.replace(/\:host/g,".".concat(t))):s?".".concat(t," ").concat(s):".".concat(t)}).join(", ")+" {"})}function f_(t,r,n,o,a){var i=wt(o),l=i.createElement("style");return l.setAttribute("type","text/css"),l.setAttribute("data-styled-id",t),l.setAttribute("data-styled-count","1"),n.nonce&&l.setAttribute("nonce",n.nonce),l.innerHTML=d_(t,r,n),(a||i.head||i.body).appendChild(l),l}function af(t){var r="rCS"+s_(t);return{className:r,inject:function(n,o){o===void 0&&(o={});var a=c_(n),i=(a||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(r,'"]'));if(!i)i=f_(r,t,o,n,a);else{var l=parseFloat(i.getAttribute("data-styled-count"))||0;i.setAttribute("data-styled-count","".concat(l+1))}return{destroy:function(){var s,d=parseFloat(i.getAttribute("data-styled-count"))||0;d<=1?(i.remove?i.remove():(s=i.parentNode)===null||s===void 0||s.removeChild(i),i=null):i.setAttribute("data-styled-count","".concat(d-1))}}}}}var bl=function(){return bl=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},bl.apply(this,arguments)};function u_(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function lf(t,r){var n=af(r),o=n.className;return h1(function(a,i){var l=a.className,s=l===void 0?"":l;a.cspNonce;var d=u_(a,["className","cspNonce"]),c=k1();return N1(i,function(){return c.current},[]),Ld(function(){var f=n.inject(c.current,{nonce:a.cspNonce});return function(){f.destroy()}},[]),Xt(t,bl({ref:c,"data-styled-id":o,className:"".concat(s," ").concat(o)},d))})}var _l=function(t,r){return _l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},_l(t,r)};function fo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");_l(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var A=function(){return A=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},A.apply(this,arguments)};function p_(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function h_(t,r,n,o){var a=arguments.length,i=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,r,n,o);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(i=(a<3?l(i):a>3?l(r,n,i):l(r,n))||i);return a>3&&i&&Object.defineProperty(r,n,i),i}function m_(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function L(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),a,i=[],l;try{for(;(r===void 0||r-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(s){l={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(l)throw l.error}}return i}function K(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function uo(t,r){return A({events:[],props:[],name:t},r)}var g_=["n","w","s","e"],wl=["n","w","s","e","nw","ne","sw","se"];function y_(t,r){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate(').concat(r,'deg);transform-origin: 16px 16px"></path></svg>')}function b_(t){var r=y_(1,t),n=Math.round(t/45)*45%180,o="ns-resize";return n===135?o="nwse-resize":n===45?o="nesw-resize":n===90&&(o="ew-resize"),"cursor:".concat(o,";cursor: url('").concat(r,"') 16 16, ").concat(o,";")}var _n=O1(),sf=_n.browser.webkit,cf=sf&&function(){var t=typeof window>"u"?{userAgent:""}:window.navigator,r=/applewebkit\/([^\s]+)/g.exec(t.userAgent.toLowerCase());return r?parseFloat(r[1])<605:!1}(),df=_n.browser.name,ff=parseInt(_n.browser.version,10),__=df==="chrome",w_=_n.browser.chromium,C_=parseInt(_n.browser.chromiumVersion,10)||0,S_=__&&ff>=109||w_&&C_>=109,x_=df==="firefox",v_=parseInt(_n.browser.webkitVersion,10)>=612||ff>=15,Cl="moveable-",E_=wl.map(function(t){var r="",n="",o="center",a="center",i="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(r="top: ".concat(i,";"),a="bottom"),t.indexOf("s")>-1&&(r="top: 0px;",a="top"),t.indexOf("w")>-1&&(n="left: ".concat(i,";"),o="right"),t.indexOf("e")>-1&&(n="left: 0px;",o="left"),'.around-control[data-direction*="'.concat(t,`"] {
96
+ ***************************************************************************** */var hl=function(t,r){return hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},hl(t,r)};function t_(t,r){hl(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var et=function(){return et=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},et.apply(this,arguments)};function r_(t,r){var n=r[0]-t[0],o=r[1]-t[1],a=Math.atan2(o,n);return a>=0?a:a+Math.PI*2}function ml(t){return r_([t[0].clientX,t[0].clientY],[t[1].clientX,t[1].clientY])/Math.PI*180}function n_(t){return t.touches&&t.touches.length>=2}function _a(t){return t?t.touches?a_(t.touches):[rf(t)]:[]}function o_(t){return t&&(t.type.indexOf("mouse")>-1||"button"in t)}function tf(t,r,n){var o=n.length,a=co(t,o),i=a.clientX,l=a.clientY,s=a.originalClientX,d=a.originalClientY,c=co(r,o),f=c.clientX,u=c.clientY,p=co(n,o),h=p.clientX,m=p.clientY,y=i-f,g=l-u,b=i-h,w=l-m;return{clientX:s,clientY:d,deltaX:y,deltaY:g,distX:b,distY:w}}function gl(t){return Math.sqrt(Math.pow(t[0].clientX-t[1].clientX,2)+Math.pow(t[0].clientY-t[1].clientY,2))}function a_(t){for(var r=Math.min(t.length,2),n=[],o=0;o<r;++o)n.push(rf(t[o]));return n}function rf(t){return{clientX:t.clientX,clientY:t.clientY}}function co(t,r){r===void 0&&(r=t.length);for(var n={clientX:0,clientY:0,originalClientX:0,originalClientY:0},o=Math.min(t.length,r),a=0;a<o;++a){var i=t[a];n.originalClientX+="originalClientX"in i?i.originalClientX:i.clientX,n.originalClientY+="originalClientY"in i?i.originalClientY:i.clientY,n.clientX+=i.clientX,n.clientY+=i.clientY}return r?{clientX:n.clientX/r,clientY:n.clientY/r,originalClientX:n.originalClientX/r,originalClientY:n.originalClientY/r}:n}var yl=function(){function t(r){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=r,this.prevClients=r,this.length=r.length}return t.prototype.getAngle=function(r){return r===void 0&&(r=this.prevClients),ml(r)},t.prototype.getRotation=function(r){return r===void 0&&(r=this.prevClients),ml(r)-ml(this.startClients)},t.prototype.getPosition=function(r,n){r===void 0&&(r=this.prevClients);var o=tf(r||this.prevClients,this.prevClients,this.startClients),a=o.deltaX,i=o.deltaY;return this.movement+=Math.sqrt(a*a+i*i),this.prevClients=r,o},t.prototype.getPositions=function(r){r===void 0&&(r=this.prevClients);for(var n=this.prevClients,o=this.startClients,a=Math.min(this.length,n.length),i=[],l=0;l<a;++l)i[l]=tf([r[l]],[n[l]],[o[l]]);return i},t.prototype.getMovement=function(r){var n=this.movement;if(!r)return n;var o=co(r,this.length),a=co(this.prevClients,this.length),i=o.clientX-a.clientX,l=o.clientY-a.clientY;return Math.sqrt(i*i+l*l)+n},t.prototype.getDistance=function(r){return r===void 0&&(r=this.prevClients),gl(r)},t.prototype.getScale=function(r){return r===void 0&&(r=this.prevClients),gl(r)/gl(this.startClients)},t.prototype.move=function(r,n){this.startClients.forEach(function(o){o.clientX-=r,o.clientY-=n}),this.prevClients.forEach(function(o){o.clientX-=r,o.clientY-=n})},t}(),nf=["textarea","input"],of=function(t){t_(r,t);function r(n,o){o===void 0&&(o={});var a=t.call(this)||this;a.options={},a.flag=!1,a.pinchFlag=!1,a.data={},a.isDrag=!1,a.isPinch=!1,a.clientStores=[],a.targets=[],a.prevTime=0,a.doubleFlag=!1,a._useMouse=!1,a._useTouch=!1,a._useDrag=!1,a._dragFlag=!1,a._isTrusted=!1,a._isMouseEvent=!1,a._isSecondaryButton=!1,a._preventMouseEvent=!1,a._prevInputEvent=null,a._isDragAPI=!1,a._isIdle=!0,a._preventMouseEventId=0,a._window=window,a.onDragStart=function(p,h){if(h===void 0&&(h=!0),!(!a.flag&&p.cancelable===!1)){var m=p.type.indexOf("drag")>=-1;if(!(a.flag&&m)){a._isDragAPI=!0;var y=a.options,g=y.container,b=y.pinchOutside,w=y.preventWheelClick,_=y.preventRightClick,C=y.preventDefault,S=y.checkInput,x=y.dragFocusedInput,v=y.preventClickEventOnDragStart,V=y.preventClickEventOnDrag,$=y.preventClickEventByCondition,B=a._useTouch,R=!a.flag;if(a._isSecondaryButton=p.which===3||p.button===2,w&&(p.which===2||p.button===1)||_&&(p.which===3||p.button===2))return a.stop(),!1;if(R){var T=a._window.document.activeElement,k=p.target;if(k){var O=k.tagName.toLowerCase(),N=nf.indexOf(O)>-1,D=k.isContentEditable;if(N||D){if(S||!x&&T===k)return!1;if(T&&(T===k||D&&T.isContentEditable&&T.contains(k)))if(x)k.blur();else return!1}else if((C||p.type==="touchstart")&&T){var I=T.tagName.toLowerCase();(T.isContentEditable||nf.indexOf(I)>-1)&&T.blur()}(v||V||$)&&Xe(a._window,"click",a._onClick,!0)}a.clientStores=[new yl(_a(p))],a._isIdle=!1,a.flag=!0,a.isDrag=!1,a._isTrusted=h,a._dragFlag=!0,a._prevInputEvent=p,a.data={},a.doubleFlag=Zn()-a.prevTime<200,a._isMouseEvent=o_(p),!a._isMouseEvent&&a._preventMouseEvent&&a._allowMouseEvent();var z=a._preventMouseEvent||a.emit("dragStart",et(et({data:a.data,datas:a.data,inputEvent:p,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,isTrusted:h,isDouble:a.doubleFlag},a.getCurrentStore().getPosition()),{preventDefault:function(){p.preventDefault()},preventDrag:function(){a._dragFlag=!1}}));z===!1&&a.stop(),a._isMouseEvent&&a.flag&&C&&p.preventDefault()}if(!a.flag)return!1;var M=0;if(R?(a._attchDragEvent(),B&&b&&(M=setTimeout(function(){Xe(g,"touchstart",a.onDragStart,{passive:!1})}))):B&&b&&We(g,"touchstart",a.onDragStart),a.flag&&n_(p)){if(clearTimeout(M),R&&p.touches.length!==p.changedTouches.length)return;a.pinchFlag||a.onPinchStart(p)}}}},a.onDrag=function(p,h){if(a.flag){var m=a.options.preventDefault;!a._isMouseEvent&&m&&p.preventDefault(),a._prevInputEvent=p;var y=_a(p),g=a.moveClients(y,p,!1);if(a._dragFlag){if(a.pinchFlag||g.deltaX||g.deltaY){var b=a._preventMouseEvent||a.emit("drag",et(et({},g),{isScroll:!!h,inputEvent:p}));if(b===!1){a.stop();return}}a.pinchFlag&&a.onPinch(p,y)}a.getCurrentStore().getPosition(y,!0)}},a.onDragEnd=function(p){if(a.flag){var h=a.options,m=h.pinchOutside,y=h.container,g=h.preventClickEventOnDrag,b=h.preventClickEventOnDragStart,w=h.preventClickEventByCondition,_=a.isDrag;(g||b||w)&&requestAnimationFrame(function(){a._allowClickEvent()}),!w&&!b&&g&&!_&&a._allowClickEvent(),a._useTouch&&m&&We(y,"touchstart",a.onDragStart),a.pinchFlag&&a.onPinchEnd(p);var C=p!=null&&p.touches?_a(p):[],S=C.length;S===0||!a.options.keepDragging?a.flag=!1:a._addStore(new yl(C));var x=a._getPosition(),v=Zn(),V=!_&&a.doubleFlag;a._prevInputEvent=null,a.prevTime=_||V?0:v,a.flag||(a._dettachDragEvent(),a._preventMouseEvent||a.emit("dragEnd",et({data:a.data,datas:a.data,isDouble:V,isDrag:_,isClick:!_,isMouseEvent:a._isMouseEvent,isSecondaryButton:a._isSecondaryButton,inputEvent:p,isTrusted:a._isTrusted},x)),a.clientStores=[],a._isMouseEvent||(a._preventMouseEvent=!0,clearTimeout(a._preventMouseEventId),a._preventMouseEventId=setTimeout(function(){a._preventMouseEvent=!1},200)),a._isIdle=!0)}},a.onBlur=function(){a.onDragEnd()},a._allowClickEvent=function(){We(a._window,"click",a._onClick,!0)},a._onClick=function(p){a._allowClickEvent(),a._allowMouseEvent();var h=a.options.preventClickEventByCondition;h!=null&&h(p)||(p.stopPropagation(),p.preventDefault())},a._onContextMenu=function(p){var h=a.options;h.preventRightClick?a.onDragEnd(p):p.preventDefault()},a._passCallback=function(){};var i=[].concat(n),l=i[0];a._window=Sd(l)?l:At(l),a.options=et({checkInput:!1,container:l&&!("document"in l)?At(l):l,preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},o);var s=a.options,d=s.container,c=s.events,f=s.checkWindowBlur;if(a._useDrag=c.indexOf("drag")>-1,a._useTouch=c.indexOf("touch")>-1,a._useMouse=c.indexOf("mouse")>-1,a.targets=i,a._useDrag&&i.forEach(function(p){Xe(p,"dragstart",a.onDragStart)}),a._useMouse&&(i.forEach(function(p){Xe(p,"mousedown",a.onDragStart),Xe(p,"mousemove",a._passCallback)}),Xe(d,"contextmenu",a._onContextMenu)),f&&Xe(At(),"blur",a.onBlur),a._useTouch){var u={passive:!1};i.forEach(function(p){Xe(p,"touchstart",a.onDragStart,u),Xe(p,"touchmove",a._passCallback,u)})}return a}return r.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},r.prototype.getMovement=function(n){return this.getCurrentStore().getMovement(n)+this.clientStores.slice(1).reduce(function(o,a){return o+a.movement},0)},r.prototype.isDragging=function(){return this.isDrag},r.prototype.isIdle=function(){return this._isIdle},r.prototype.isFlag=function(){return this.flag},r.prototype.isPinchFlag=function(){return this.pinchFlag},r.prototype.isDoubleFlag=function(){return this.doubleFlag},r.prototype.isPinching=function(){return this.isPinch},r.prototype.scrollBy=function(n,o,a,i){i===void 0&&(i=!0),this.flag&&(this.clientStores[0].move(n,o),i&&this.onDrag(a,!0))},r.prototype.move=function(n,o){var a=n[0],i=n[1],l=this.getCurrentStore(),s=l.prevClients;return this.moveClients(s.map(function(d){var c=d.clientX,f=d.clientY;return{clientX:c+a,clientY:f+i,originalClientX:c,originalClientY:f}}),o,!0)},r.prototype.triggerDragStart=function(n){this.onDragStart(n,!1)},r.prototype.setEventData=function(n){var o=this.data;for(var a in n)o[a]=n[a];return this},r.prototype.setEventDatas=function(n){return this.setEventData(n)},r.prototype.getCurrentEvent=function(n){return n===void 0&&(n=this._prevInputEvent),et(et({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:n})},r.prototype.getEventData=function(){return this.data},r.prototype.getEventDatas=function(){return this.data},r.prototype.unset=function(){var n=this,o=this.targets,a=this.options.container;this.off(),We(this._window,"blur",this.onBlur),this._useDrag&&o.forEach(function(i){We(i,"dragstart",n.onDragStart)}),this._useMouse&&(o.forEach(function(i){We(i,"mousedown",n.onDragStart)}),We(a,"contextmenu",this._onContextMenu)),this._useTouch&&(o.forEach(function(i){We(i,"touchstart",n.onDragStart)}),We(a,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},r.prototype.onPinchStart=function(n){var o=this,a=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>a)){var i=new yl(_a(n));this.pinchFlag=!0,this._addStore(i);var l=this.emit("pinchStart",et(et({data:this.data,datas:this.data,angle:i.getAngle(),touches:this.getCurrentStore().getPositions()},i.getPosition()),{inputEvent:n,isTrusted:this._isTrusted,preventDefault:function(){n.preventDefault()},preventDrag:function(){o._dragFlag=!1}}));l===!1&&(this.pinchFlag=!1)}},r.prototype.onPinch=function(n,o){if(!(!this.flag||!this.pinchFlag||o.length<2)){var a=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",et(et({data:this.data,datas:this.data,movement:this.getMovement(o),angle:a.getAngle(o),rotation:a.getRotation(o),touches:a.getPositions(o),scale:a.getScale(o),distance:a.getDistance(o)},a.getPosition(o)),{inputEvent:n,isTrusted:this._isTrusted}))}},r.prototype.onPinchEnd=function(n){if(this.pinchFlag){var o=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var a=this.getCurrentStore();this.emit("pinchEnd",et(et({data:this.data,datas:this.data,isPinch:o,touches:a.getPositions()},a.getPosition()),{inputEvent:n}))}},r.prototype.getCurrentStore=function(){return this.clientStores[0]},r.prototype.moveClients=function(n,o,a){var i=this._getPosition(n,a),l=this.isDrag;(i.deltaX||i.deltaY)&&(this.isDrag=!0);var s=!1;return!l&&this.isDrag&&(s=!0),et(et({data:this.data,datas:this.data},i),{movement:this.getMovement(n),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:o,isTrusted:this._isTrusted,isFirstDrag:s})},r.prototype._addStore=function(n){this.clientStores.splice(0,0,n)},r.prototype._getPosition=function(n,o){var a=this.getCurrentStore(),i=a.getPosition(n,o),l=this.clientStores.slice(1).reduce(function(c,f){var u=f.getPosition();return c.distX+=u.distX,c.distY+=u.distY,c},i),s=l.distX,d=l.distY;return et(et({},i),{distX:s,distY:d})},r.prototype._attchDragEvent=function(){var n=this._window,o=this.options.container,a={passive:!1};this._isDragAPI&&(Xe(o,"dragover",this.onDrag,a),Xe(n,"dragend",this.onDragEnd)),this._useMouse&&(Xe(o,"mousemove",this.onDrag),Xe(n,"mouseup",this.onDragEnd)),this._useTouch&&(Xe(o,"touchmove",this.onDrag,a),Xe(n,"touchend",this.onDragEnd,a),Xe(n,"touchcancel",this.onDragEnd,a))},r.prototype._dettachDragEvent=function(){var n=this._window,o=this.options.container;this._isDragAPI&&(We(o,"dragover",this.onDrag),We(n,"dragend",this.onDragEnd)),this._useMouse&&(We(o,"mousemove",this.onDrag),We(n,"mouseup",this.onDragEnd)),this._useTouch&&(We(o,"touchstart",this.onDragStart),We(o,"touchmove",this.onDrag),We(n,"touchend",this.onDragEnd),We(n,"touchcancel",this.onDragEnd))},r.prototype._allowMouseEvent=function(){this._preventMouseEvent=!1,clearTimeout(this._preventMouseEventId)},r}(yn);function i_(t){for(var r=5381,n=t.length;n;)r=r*33^t.charCodeAt(--n);return r>>>0}var l_=i_;function s_(t){return l_(t).toString(36)}function c_(t){if(t&&t.getRootNode){var r=t.getRootNode();if(r.nodeType===11)return r}}function d_(t,r,n){return n.original?r:r.replace(/([^};{\s}][^};{]*|^\s*){/mg,function(o,a){var i=a.trim();return(i?jr(i):[""]).map(function(l){var s=l.trim();return s.indexOf("@")===0?s:s.indexOf(":global")>-1?s.replace(/\:global/g,""):s.indexOf(":host")>-1?"".concat(s.replace(/\:host/g,".".concat(t))):s?".".concat(t," ").concat(s):".".concat(t)}).join(", ")+" {"})}function f_(t,r,n,o,a){var i=wt(o),l=i.createElement("style");return l.setAttribute("type","text/css"),l.setAttribute("data-styled-id",t),l.setAttribute("data-styled-count","1"),n.nonce&&l.setAttribute("nonce",n.nonce),l.innerHTML=d_(t,r,n),(a||i.head||i.body).appendChild(l),l}function af(t){var r="rCS"+s_(t);return{className:r,inject:function(n,o){o===void 0&&(o={});var a=c_(n),i=(a||n.ownerDocument||document).querySelector('style[data-styled-id="'.concat(r,'"]'));if(!i)i=f_(r,t,o,n,a);else{var l=parseFloat(i.getAttribute("data-styled-count"))||0;i.setAttribute("data-styled-count","".concat(l+1))}return{destroy:function(){var s,d=parseFloat(i.getAttribute("data-styled-count"))||0;d<=1?(i.remove?i.remove():(s=i.parentNode)===null||s===void 0||s.removeChild(i),i=null):i.setAttribute("data-styled-count","".concat(d-1))}}}}}var bl=function(){return bl=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},bl.apply(this,arguments)};function u_(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function lf(t,r){var n=af(r),o=n.className;return h1(function(a,i){var l=a.className,s=l===void 0?"":l;a.cspNonce;var d=u_(a,["className","cspNonce"]),c=k1();return N1(i,function(){return c.current},[]),Ld(function(){var f=n.inject(c.current,{nonce:a.cspNonce});return function(){f.destroy()}},[]),Xt(t,bl({ref:c,"data-styled-id":o,className:"".concat(s," ").concat(o)},d))})}var _l=function(t,r){return _l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},_l(t,r)};function fo(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");_l(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var A=function(){return A=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},A.apply(this,arguments)};function p_(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function h_(t,r,n,o){var a=arguments.length,i=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,r,n,o);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(i=(a<3?l(i):a>3?l(r,n,i):l(r,n))||i);return a>3&&i&&Object.defineProperty(r,n,i),i}function m_(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function L(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),a,i=[],l;try{for(;(r===void 0||r-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(s){l={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(l)throw l.error}}return i}function K(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function uo(t,r){return A({events:[],props:[],name:t},r)}var g_=["n","w","s","e"],wl=["n","w","s","e","nw","ne","sw","se"];function y_(t,r){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate(').concat(r,'deg);transform-origin: 16px 16px"></path></svg>')}function b_(t){var r=y_(1,t),n=Math.round(t/45)*45%180,o="ns-resize";return n===135?o="nwse-resize":n===45?o="nesw-resize":n===90&&(o="ew-resize"),"cursor:".concat(o,";cursor: url('").concat(r,"') 16 16, ").concat(o,";")}var _n=O1(),sf=_n.browser.webkit,cf=sf&&function(){var t=typeof window>"u"?{userAgent:""}:window.navigator,r=/applewebkit\/([^\s]+)/g.exec(t.userAgent.toLowerCase());return r?parseFloat(r[1])<605:!1}(),df=_n.browser.name,ff=parseInt(_n.browser.version,10),__=df==="chrome",w_=_n.browser.chromium,C_=parseInt(_n.browser.chromiumVersion,10)||0,S_=__&&ff>=109||w_&&C_>=109,x_=df==="firefox",v_=parseInt(_n.browser.webkitVersion,10)>=612||ff>=15,Cl="moveable-",E_=wl.map(function(t){var r="",n="",o="center",a="center",i="calc(var(--moveable-control-padding, 20) * -1px)";return t.indexOf("n")>-1&&(r="top: ".concat(i,";"),a="bottom"),t.indexOf("s")>-1&&(r="top: 0px;",a="top"),t.indexOf("w")>-1&&(n="left: ".concat(i,";"),o="right"),t.indexOf("e")>-1&&(n="left: 0px;",o="left"),'.around-control[data-direction*="'.concat(t,`"] {
97
97
  `).concat(n).concat(r,`
98
98
  transform-origin: `).concat(o," ").concat(a,`;
99
99
  }`)}).join(`
@@ -245,7 +245,7 @@ position: absolute;
245
245
  content:"";
246
246
  transform-origin: inherit;
247
247
  }`:"",`
248
- `),k_=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Sl=1e-4,dt=1e-7,wa=1e-9,xl=Math.pow(10,10),uf=-xl,N_={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},vl={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},pf={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},hf=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function po(t,r,n,o,a,i){var l,s;i===void 0&&(i="draggable");var d=(s=(l=r.gestos[i])===null||l===void 0?void 0:l.move(n,t.inputEvent))!==null&&s!==void 0?s:{},c=d.originalDatas||d.datas,f=c[i]||(c[i]={});return A(A({},a?wu(r,d):d),{isPinch:!!o,parentEvent:!0,datas:f,originalDatas:t.originalDatas})}var wn=function(){function t(r){var n;r===void 0&&(r="draggable"),this.ableName=r,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=(n={},n[r]={},n)}return t.prototype.dragStart=function(r,n){this.isDrag=!1,this.isFlag=!1;var o=n.originalDatas;return this.datas=o,o[this.ableName]||(o[this.ableName]={}),A(A({},this.move(r,n.inputEvent)),{type:"dragstart"})},t.prototype.drag=function(r,n){return this.move([r[0]-this.prevX,r[1]-this.prevY],n)},t.prototype.move=function(r,n){var o,a,i=!1;if(!this.isFlag)this.prevX=r[0],this.prevY=r[1],this.startX=r[0],this.startY=r[1],o=r[0],a=r[1],this.isFlag=!0;else{var l=this.isDrag;o=this.prevX+r[0],a=this.prevY+r[1],(r[0]||r[1])&&(this.isDrag=!0),!l&&this.isDrag&&(i=!0)}return this.prevX=o,this.prevY=a,{type:"drag",clientX:o,clientY:a,inputEvent:n,isFirstDrag:i,isDrag:this.isDrag,distX:o-this.startX,distY:a-this.startY,deltaX:r[0],deltaY:r[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function Cn(t,r,n,o){var a=t.length===16,i=a?4:3,l=qr(t,n,o,i),s=L(l,4),d=L(s[0],2),c=d[0],f=d[1],u=L(s[1],2),p=u[0],h=u[1],m=L(s[2],2),y=m[0],g=m[1],b=L(s[3],2),w=b[0],_=b[1],C=L(Ge(t,r,i),2),S=C[0],x=C[1],v=Math.min(c,p,y,w),V=Math.min(f,h,g,_),$=Math.max(c,p,y,w),B=Math.max(f,h,g,_);c=c-v||0,p=p-v||0,y=y-v||0,w=w-v||0,f=f-V||0,h=h-V||0,g=g-V||0,_=_-V||0,S=S-v||0,x=x-V||0;var R=t[0],T=t[i+1],k=pt(R*T);return{left:v,top:V,right:$,bottom:B,origin:[S,x],pos1:[c,f],pos2:[p,h],pos3:[y,g],pos4:[w,_],direction:k}}function mf(t,r){var n=r.clientX,o=r.clientY,a=r.datas,i=t.state,l=i.moveableClientRect,s=i.rootMatrix,d=i.is3d,c=i.pos1,f=l.left,u=l.top,p=d?4:3,h=L(se($n(s,[n-f,o-u],p),c),2),m=h[0],y=h[1],g=L(ar({datas:a,distX:m,distY:y}),2),b=g[0],w=g[1];return[b,w]}function Hr(t,r){var n=r.datas,o=t.state,a=o.allMatrix,i=o.beforeMatrix,l=o.is3d,s=o.left,d=o.top,c=o.origin,f=o.offsetMatrix,u=o.targetMatrix,p=o.transformOrigin,h=l?4:3;n.is3d=l,n.matrix=a,n.targetMatrix=u,n.beforeMatrix=i,n.offsetMatrix=f,n.transformOrigin=p,n.inverseMatrix=qt(a,h),n.inverseBeforeMatrix=qt(i,h),n.absoluteOrigin=Ur(xe([s,d],c),h),n.startDragBeforeDist=lt(n.inverseBeforeMatrix,n.absoluteOrigin,h),n.startDragDist=lt(n.inverseMatrix,n.absoluteOrigin,h)}function $_(t){return Cn(t.datas.beforeTransform,[50,50],100,100).direction}function Ca(t,r,n){var o=r.datas,a=r.originalDatas.beforeRenderable,i=o.transformIndex,l=a.nextTransforms,s=l.length,d=a.nextTransformAppendedIndexes,c=-1;i===-1?(n==="translate"?c=0:n==="rotate"&&(c=hr(l,function(h){return h.match(/scale\(/g)})),c===-1&&(c=l.length),o.transformIndex=c):_t(d,function(h){return h.index===i&&h.functionName===n})?c=i:c=i+d.filter(function(h){return h.index<i}).length;var f=eC(l,t.state,c),u=f.targetFunction,p=n==="rotate"?"rotateZ":n;o.beforeFunctionTexts=f.beforeFunctionTexts,o.afterFunctionTexts=f.afterFunctionTexts,o.beforeTransform=f.beforeFunctionMatrix,o.beforeTransform2=f.beforeFunctionMatrix2,o.targetTansform=f.targetFunctionMatrix,o.afterTransform=f.afterFunctionMatrix,o.afterTransform2=f.afterFunctionMatrix2,o.targetAllTransform=f.allFunctionMatrix,u.functionName===p?(o.afterFunctionTexts.splice(0,1),o.isAppendTransform=!1):s>c&&(o.isAppendTransform=!0,a.nextTransformAppendedIndexes=K(K([],L(d),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function Sa(t,r,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:r," ").concat(t.afterFunctionTexts.join(" "))}function D_(t){var r=t.datas,n=t.distX,o=t.distY,a=L(yf({datas:r,distX:n,distY:o}),2),i=a[0],l=a[1],s=gf(r,A1([i,l],4));return lt(s,Ur([0,0,0],4),4)}function gf(t,r,n){var o=t.beforeTransform,a=t.afterTransform,i=t.beforeTransform2,l=t.afterTransform2,s=t.targetAllTransform,d=n?Oe(s,r,4):Oe(r,s,4),c=Oe(qt(n?i:o,4),d,4),f=Oe(c,qt(n?l:a,4),4);return f}function yf(t){var r=t.datas,n=t.distX,o=t.distY,a=r.inverseBeforeMatrix,i=r.is3d,l=r.startDragBeforeDist,s=r.absoluteOrigin,d=i?4:3;return se(lt(a,xe(s,[n,o]),d),l)}function ar(t,r){var n=t.datas,o=t.distX,a=t.distY,i=n.inverseBeforeMatrix,l=n.inverseMatrix,s=n.is3d,d=n.startDragBeforeDist,c=n.startDragDist,f=n.absoluteOrigin,u=s?4:3;return se(lt(r?i:l,xe(f,[o,a]),u),r?d:c)}function B_(t,r){var n=t.datas,o=t.distX,a=t.distY,i=n.beforeMatrix,l=n.matrix,s=n.is3d,d=n.startDragBeforeDist,c=n.startDragDist,f=n.absoluteOrigin,u=s?4:3;return se(lt(r?i:l,xe(r?d:c,[o,a]),u),f)}function T_(t,r,n,o,a,i){return o===void 0&&(o=r),a===void 0&&(a=n),i===void 0&&(i=[0,0]),t?t.map(function(l,s){var d=Pr(l),c=d.value,f=d.unit,u=s?a:o,p=s?n:r;if(l==="%"||isNaN(c)){var h=u?i[s]/u:0;return p*h}else if(f!=="%")return c;return p*c/100}):i}function bf(t){var r=[];return t[1]>=0&&(t[0]>=0&&r.push(3),t[0]<=0&&r.push(2)),t[1]<=0&&(t[0]>=0&&r.push(1),t[0]<=0&&r.push(0)),r}function O_(t,r){return bf(r).map(function(n){return t[n]})}function El(t,r){var n=(r+1)/2;return[ia(t[0][0],t[1][0],n,1-n),ia(t[0][1],t[1][1],n,1-n)]}function rt(t,r){var n=El([t[0],t[1]],r[0]),o=El([t[2],t[3]],r[0]);return El([n,o],r[1])}function I_(t,r,n,o,a,i){var l=qr(r,n,o,a),s=rt(l,i),d=t[0]-s[0],c=t[1]-s[1];return[d,c]}function ho(t,r,n,o){return Oe(t,bo(r,o,n),o)}function z_(t,r,n,o){var a=t.transformOrigin,i=t.offsetMatrix,l=t.is3d,s=l?4:3,d;if(at(n)){var c=r.beforeTransform,f=r.afterTransform;o?d=Jt(pn(n),4,s):d=Jt(Oe(Oe(c,pn([n]),4),f,4),4,s)}else d=n;return ho(i,d,a,s)}function R_(t,r){var n=t.transformOrigin,o=t.offsetMatrix,a=t.is3d,i=t.targetMatrix,l=t.targetAllTransform,s=a?4:3;return ho(o,Oe(l||i,ol(r,s),s),n,s)}function xa(t,r){var n=Sn(r);return{setTransform:function(o,a){a===void 0&&(a=-1),n.startTransforms=Ue(o)?o:vr(o),Vl(t,r,a)},setTransformIndex:function(o){Vl(t,r,o)}}}function va(t,r,n){var o=Sn(r),a=o.startTransforms;Vl(t,r,hr(a,function(i){return i.indexOf("".concat(n,"("))===0}))}function Vl(t,r,n){var o=Sn(r),a=r.datas;if(a.transformIndex=n,n!==-1){var i=o.startTransforms[n];if(i){var l=t.state,s=mn([i],{"x%":function(d){return d/100*l.offsetWidth},"y%":function(d){return d/100*l.offsetHeight}});a.startValue=s[0].functionValue}}}function kl(t,r){var n=Sn(t);n.nextTransforms=vr(r)}function Sn(t){return t.originalDatas.beforeRenderable}function Ea(t){var r=t.originalDatas.beforeRenderable;return r.nextTransforms}function Va(t){return(Ea(t)||[]).join(" ")}function ka(t){return Sn(t).nextStyle}function _f(t,r,n,o,a){kl(a,r);var i=ft.drag(t,po(a,t.state,n,o,!1)),l=i?i.transform:r;return A(A({transform:r,drag:i},ut({transform:l},a)),{afterTransform:l})}function Nl(t,r,n,o,a,i){var l=z_(t.state,a,r,i),s=L_(t,n,o,l);return s}function wf(t,r,n,o,a,i,l){var s=Nl(t,r,n,a,i,l),d=t.state,c=d.left,f=d.top,u=t.props.groupable,p=u?c:0,h=u?f:0,m=se(o,s);return se(m,[p,h])}function M_(t,r,n,o,a,i,l){var s=wf(t,r,n,o,a,i,l);return s}function A_(t,r,n){return[r?-1+t[0]/(r/2):0,n?-1+t[1]/(n/2):0]}function L_(t,r,n,o){o===void 0&&(o=t.state.allMatrix);var a=t.state,i=a.width,l=a.height,s=a.is3d,d=s?4:3,c=[i/2*(1+r[0])+n[0],l/2*(1+r[1])+n[1]];return Ge(o,c,d)}function F_(t,r,n){var o=n.fixedDirection,a=n.fixedPosition,i=n.fixedOffset;return wf(t,"rotate(".concat(r,"deg)"),o,a,i,n)}function j_(t,r,n,o,a,i){var l=t.props.groupable,s=t.state,d=s.transformOrigin,c=s.offsetMatrix,f=s.is3d,u=s.width,p=s.height,h=s.left,m=s.top,y=i.fixedDirection,g=i.nextTargetMatrix||s.targetMatrix,b=f?4:3,w=T_(a,r,n,u,p,d),_=l?h:0,C=l?m:0,S=ho(c,g,w,b),x=I_(o,S,r,n,b,y);return se(x,[_,C])}function P_(t,r){return rt(jt(t.state),r)}function U_(t,r){var n=t.targetGesto,o=t.controlGesto,a;return n!=null&&n.isFlag()&&(a=n.getEventData()[r]),!a&&(o!=null&&o.isFlag())&&(a=o.getEventData()[r]),a||{}}function W_(t){if(t&&t.getRootNode){var r=t.getRootNode();if(r.nodeType===11)return r}}function G_(t){var r=t("scale"),n=t("rotate"),o=t("translate"),a=[];return o&&o!=="0px"&&o!=="none"&&a.push("translate(".concat(o.split(/\s+/).join(","),")")),n&&n!=="1"&&n!=="none"&&a.push("rotate(".concat(n,")")),r&&r!=="1"&&r!=="none"&&a.push("scale(".concat(r.split(/\s+/).join(","),")")),a}function Cf(t,r,n){for(var o=t,a=[],i=Wi(t)||Er(t),l=!n&&t===r||t===i,s=l,d=!1,c=3,f,u,p,h=!1,m=_o(r,r,!0).offsetParent,y=1;o&&!s;){s=l;var g=St(o),b=g("position"),w=lu(o),_=b==="fixed",C=G_(g),S=L1(Pw(w)),x=void 0,v=!1,V=!1,$=0,B=0,R=0,T=0,k={hasTransform:!1,fixedContainer:null};_&&(h=!0,k=Yw(o),m=k.fixedContainer);var O=S.length;!d&&(O===16||C.length)&&(d=!0,c=4,Gl(a),p&&(p=Jt(p,3,4))),d&&O===9&&(S=Jt(S,3,4));var N=Hw(o,t),D=N.tagName,I=N.hasOffset,z=N.isSVG,M=N.origin,j=N.targetOrigin,F=N.offset,G=L(F,2),H=G[0],X=G[1];D==="svg"&&!o.ownerSVGElement&&p&&(a.push({type:"target",target:o,matrix:Xw(o,c)}),a.push({type:"offset",target:o,matrix:Me(c)}));var J=parseFloat(g("zoom"))||1;if(_)x=k.fixedContainer,v=!0;else{var P=_o(o,r,!1,!0,g),W=P.offsetZoom;if(x=P.offsetParent,v=P.isEnd,V=P.isStatic,y*=W,(P.isCustomElement||W!==1)&&V)H-=x.offsetLeft,X-=x.offsetTop;else if(x_||S_){var Q=P.parentSlotElement;if(Q){for(var re=x,ne=0,Y=0;re&&W_(re);)ne+=re.offsetLeft,Y+=re.offsetTop,re=re.offsetParent;H-=ne,X-=Y}}}if(sf&&!v_&&I&&!z&&V&&(b==="relative"||b==="static")&&(H-=x.offsetLeft,X-=x.offsetTop,l=l||v),_)I&&k.hasTransform&&(R=x.clientLeft,T=x.clientTop);else if(I&&m!==x&&($=x.clientLeft,B=x.clientTop),I&&x===i){var Z=su(o,!1);H+=Z[0],X+=Z[1]}if(a.push({type:"target",target:o,matrix:bo(S,c,M)}),C.length&&(a.push({type:"offset",target:o,matrix:Me(c)}),a.push({type:"target",target:o,matrix:bo(pn(C),c,M)})),I){var ye=o===t,ie=ye?0:o.scrollLeft,ce=ye?0:o.scrollTop;a.push({type:"offset",target:o,matrix:Wr([H-ie+$-R,X-ce+B-T],c)})}else a.push({type:"offset",target:o,origin:M});if(J!==1&&a.push({type:"zoom",target:o,matrix:bo(ol([J,J],c),c,[0,0])}),p||(p=S),f||(f=M),u||(u=j),s||_)break;o=x,l=v,(!n||o===i)&&(s=l)}return p||(p=Me(c)),f||(f=[0,0]),u||(u=[0,0]),{zoom:y,offsetContainer:m,matrixes:a,targetMatrix:p,transformOrigin:f,targetOrigin:u,is3d:d,hasFixed:h}}var Yr=null,Xr=null,xn=null;function vn(t){t?(window.Map&&(Yr=new Map,Xr=new Map),xn=[]):(Yr=null,xn=null,Xr=null)}function H_(t){var r=Xr==null?void 0:Xr.get(t);if(r)return r;var n=Co(t,!0);return Xr&&Xr.set(t,n),n}function Y_(t,r){if(xn){var n=_t(xn,function(a){return a[0][0]==t&&a[0][1]==r});if(n)return n[1]}var o=Cf(t,r,!0);return xn&&xn.push([[t,r],o]),o}function St(t){var r=Yr==null?void 0:Yr.get(t);if(!r){var n=At(t).getComputedStyle(t);if(!Yr)return function(i){return n[i]};r={style:n,cached:{}},Yr.set(t,r)}var o=r.cached,a=r.style;return function(i){return i in o||(o[i]=a[i]),o[i]}}function Kt(t,r,n){var o=n.originalDatas;o.groupable=o.groupable||{};var a=o.groupable;a.childDatas=a.childDatas||[];var i=a.childDatas;return t.moveables.map(function(l,s){return i[s]=i[s]||{},i[s][r]=i[s][r]||{},A(A({},n),{isRequestChild:!0,datas:i[s][r],originalDatas:i[s]})})}function $l(t,r,n,o,a,i,l){var s=!!n.match(/Start$/g),d=!!n.match(/End$/g),c=a.isPinch,f=a.datas,u=Kt(t,r.name,a),p=t.moveables,h=[],m=u.map(function(y,g){var b=p[g],w=b.state,_=w.gestos,C=y;if(s)C=new wn(l).dragStart(o,y),h.push(C);else{if(_[l]||(_[l]=f.childGestos[g]),!_[l])return;C=po(y,w,o,c,i,l),h.push(C)}var S=r[n](b,A(A({},C),{parentFlag:!0}));return d&&(_[l]=null),S});return s&&(f.childGestos=p.map(function(y){return y.state.gestos[l]})),{eventParams:m,childEvents:h}}function gr(t,r,n,o,a,i){a===void 0&&(a=function(f,u){return u});var l=!!n.match(/End$/g),s=Kt(t,r.name,o),d=t.moveables,c=s.map(function(f,u){var p=d[u],h=f;h=a(p,f);var m=r[n](p,A(A({},h),{parentFlag:!0}));return m&&i&&i(p,f,m,u),l&&(p.state.gestos={}),m});return c}function Na(t,r,n,o){var a=n.fixedDirection,i=n.fixedPosition,l=o.datas.startPositions||jt(r.state),s=rt(l,a),d=L(lt(io(-t.rotation/180*Math.PI,3),[s[0]-i[0],s[1]-i[1],1],3),2),c=d[0],f=d[1];return o.datas.originalX=c,o.datas.originalY=f,o}function Sf(t,r,n,o){var a=t.getState(),i=a.renderPoses,l=a.rotation,s=a.direction,d=Jr(t.props,r).zoom,c=yo(l/Math.PI*180),f={},u=t.renderState;u.renderDirectionMap||(u.renderDirectionMap={});var p=u.renderDirectionMap;n.forEach(function(m){var y=m.dir;f[y]=!0});var h=pt(s);return n.map(function(m){var y=m.data,g=m.classNames,b=m.dir,w=vl[b];if(!w||!f[b])return null;p[b]=!0;var _=(pe(c,15)+h*pf[b]+720)%180,C={};return mr(y).forEach(function(S){C["data-".concat(S)]=y[S]}),o.createElement("div",A({className:ae.apply(void 0,K(["control","direction",b,r],L(g),!1)),"data-rotation":_,"data-direction":b},C,{key:"direction-".concat(b),style:Aa.apply(void 0,K([l,d],L(w.map(function(S){return i[S]})),!1))}))})}function xf(t,r,n,o){var a=Jr(t.props,n),i=a.renderDirections,l=i===void 0?r:i,s=a.displayAroundControls;if(!l)return[];var d=l===!0?wl:l;return K(K([],L(s?kf(t,o,n,d):[]),!1),L(Sf(t,n,d.map(function(c){return{data:{},classNames:[],dir:c}}),o)),!1)}function mo(t,r,n,o,a,i){for(var l=[],s=6;s<arguments.length;s++)l[s-6]=arguments[s];var d=Ye(n,o),c=r?pe(d/Math.PI*180,15)%180:-1;return t.createElement("div",{key:"line-".concat(i),className:ae.apply(void 0,K(["line","direction",r?"edge":"",r],L(l),!1)),"data-rotation":c,"data-line-key":i,"data-direction":r,style:wo(n,o,a,d)})}function vf(t,r,n,o,a){var i=n===!0?g_:n;return i.map(function(l,s){var d=L(vl[l],2),c=d[0],f=d[1];if(f!=null)return mo(t,l,o[c],o[f],a,"".concat(r,"Edge").concat(s),r)}).filter(Boolean)}function Ef(t){return function(r,n){var o=Jr(r.props,t).edge;return o&&(o===!0||o.length)?K(K([],L(vf(n,t,o,r.getState().renderPoses,r.props.zoom)),!1),L(X_(r,t,n)),!1):Vf(r,t,n)}}function Vf(t,r,n){return xf(t,wl,r,n)}function X_(t,r,n){return xf(t,["nw","ne","sw","se"],r,n)}function kf(t,r,n,o){var a=t.renderState;a.renderDirectionMap||(a.renderDirectionMap={});var i=t.getState(),l=i.renderPoses,s=i.rotation,d=i.direction,c=a.renderDirectionMap,f=t.props.zoom,u=pt(d),p=s/Math.PI*180;return(o||mr(c)).map(function(h){var m=vl[h];if(!m)return null;var y=(pe(p,15)+u*pf[h]+720)%180,g=["around-control"];return n&&g.push("direction",n),r.createElement("div",{className:ae.apply(void 0,K([],L(g),!1)),"data-rotation":y,"data-direction":h,key:"direction-around-".concat(h),style:Aa.apply(void 0,K([s,f],L(m.map(function(b){return l[b]})),!1))})})}function Dl(t,r,n){var o=t||{},a=o.position,i=a===void 0?"client":a,l=o.left,s=l===void 0?-1/0:l,d=o.top,c=d===void 0?-1/0:d,f=o.right,u=f===void 0?1/0:f,p=o.bottom,h=p===void 0?1/0:p,m={position:i,left:s,top:c,right:u,bottom:h};return{vertical:Nf(m,r,!0),horizontal:Nf(m,n,!1)}}function $a(t,r){var n=t.state,o=n.containerClientRect,a=o.clientHeight,i=o.clientWidth,l=o.clientLeft,s=o.clientTop,d=n.snapOffset,c=d.left,f=d.top,u=d.right,p=d.bottom,h=r||t.props.bounds||{},m=h.position||"client",y=m==="css",g=h.left,b=g===void 0?-1/0:g,w=h.top,_=w===void 0?-1/0:w,C=h.right,S=C===void 0?y?-1/0:1/0:C,x=h.bottom,v=x===void 0?y?-1/0:1/0:x;return y&&(S=i+u-c-S,v=a+p-f-v),{left:b+c-l,right:S+c-l,top:_+f-s,bottom:v+f-s}}function q_(t,r,n){var o=$a(t),a=o.left,i=o.top,l=o.right,s=o.bottom,d=L(n,2),c=d[0],f=d[1],u=L(se(n,r),2),p=u[0],h=u[1];q(p)<dt&&(p=0),q(h)<dt&&(h=0);var m=h>0,y=p>0,g={isBound:!1,offset:0,pos:0},b={isBound:!1,offset:0,pos:0};if(p===0&&h===0)return{vertical:g,horizontal:b};if(p===0)m?s<f&&(b.pos=s,b.offset=f-s):i>f&&(b.pos=i,b.offset=f-i);else if(h===0)y?l<c&&(g.pos=l,g.offset=c-l):a>c&&(g.pos=a,g.offset=c-a);else{var w=h/p,_=n[1]-w*c,C=0,S=0,x=!1;y&&l<=c?(C=w*l+_,S=l,x=!0):!y&&c<=a&&(C=w*a+_,S=a,x=!0),x&&(C<i||C>s)&&(x=!1),x||(m&&s<=f?(C=s,S=(C-_)/w,x=!0):!m&&f<=i&&(C=i,S=(C-_)/w,x=!0)),x&&(g.isBound=!0,g.pos=S,g.offset=c-S,b.isBound=!0,b.pos=C,b.offset=f-C)}return{vertical:g,horizontal:b}}function Nf(t,r,n){var o=t[n?"left":"top"],a=t[n?"right":"bottom"],i=Math.min.apply(Math,K([],L(r),!1)),l=Math.max.apply(Math,K([],L(r),!1)),s=[];return o+1>i&&s.push({direction:"start",isBound:!0,offset:i-o,pos:o}),a-1<l&&s.push({direction:"end",isBound:!0,offset:l-a,pos:a}),s.length||s.push({isBound:!1,offset:0,pos:0}),s.sort(function(d,c){return q(c.offset)-q(d.offset)})}function $f(t,r,n){var o=n?t.map(function(a){return ao(a,n)}):t;return o.some(function(a){return a[0]<r.left&&q(a[0]-r.left)>.1||a[0]>r.right&&q(a[0]-r.right)>.1||a[1]<r.top&&q(a[1]-r.top)>.1||a[1]>r.bottom&&q(a[1]-r.bottom)>.1})}function J_(t,r,n){var o=Ft(t),a=Math.sqrt(o*o-r*r)||0;return[a,-a].sort(function(i,l){return q(i-t[n?0:1])-q(l-t[n?0:1])}).map(function(i){return Ye([0,0],n?[i,r]:[r,i])})}function K_(t,r,n,o,a){if(!t.props.bounds)return[];var i=a*Math.PI/180,l=$a(t),s=l.left,d=l.top,c=l.right,f=l.bottom,u=s-o[0],p=c-o[0],h=d-o[1],m=f-o[1],y={left:u,top:h,right:p,bottom:m};if(!$f(n,y,0))return[];var g=[];return[[u,0],[p,0],[h,1],[m,1]].forEach(function(b){var w=L(b,2),_=w[0],C=w[1];n.forEach(function(S){var x=Ye([0,0],S);g.push.apply(g,K([],L(J_(S,_,C).map(function(v){return i+v-x}).filter(function(v){return!$f(r,y,v)}).map(function(v){return pe(v*180/Math.PI,dt)})),!1))})}),g}var Z_=["left","right","center"],Q_=["top","bottom","middle"],Df={left:"start",right:"end",center:"center",top:"start",bottom:"end",middle:"center"},kr={start:"left",end:"right",center:"center"},Nr={start:"top",end:"bottom",center:"middle"};function En(){return{left:!1,top:!1,right:!1,bottom:!1}}function Vn(t,r){var n=t.props,o=n.snappable,a=n.bounds,i=n.innerBounds,l=n.verticalGuidelines,s=n.horizontalGuidelines,d=n.snapGridWidth,c=n.snapGridHeight,f=t.state,u=f.guidelines,p=f.enableSnap;return!o||!p||r&&o!==!0&&o.indexOf(r)<0?!1:!!(d||c||a||i||u&&u.length||l&&l.length||s&&s.length)}function Bl(t){return t===!1?{}:t===!0||!t?{left:!0,right:!0,top:!0,bottom:!0}:t}function ew(t,r){var n=Bl(t),o={};for(var a in n)a in r&&n[a]&&(o[a]=r[a]);return o}function Tl(t,r){var n=ew(t,r),o=Q_.filter(function(i){return i in n}),a=Z_.filter(function(i){return i in n});return{horizontalNames:o,verticalNames:a,horizontal:o.map(function(i){return n[i]}),vertical:a.map(function(i){return n[i]})}}function tw(t,r,n){var o=Ge(t,[r.clientLeft,r.clientTop],n);return[r.left+o[0],r.top+o[1]]}function rw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];Math.abs(a)<Ke&&(a=0),Math.abs(i)<Ke&&(i=0);var l=0,s=0,d=0;return a?i?(l=-i/a,s=1,d=l*n[0]-n[1]):(s=1,d=-n[1]):(l=-1,d=n[0]),[l,s,d].map(function(c){return pe(c,Ke)})}var Bf="snapRotationThreshold",Tf="snapRotationDegrees",Of="snapHorizontalThreshold",If="snapVerticalThreshold";function Da(t,r,n,o,a,i,l){var s;o===void 0&&(o=[]),a===void 0&&(a=[]);var d=t.props,c=((s=t.state.snapThresholdInfo)===null||s===void 0?void 0:s.multiples)||[1,1],f=yu(l,d[Of],5),u=yu(i,d[If],5);return zf(t.state.guidelines,r,n,o,a,f,u,c)}function zf(t,r,n,o,a,i,l,s){return{vertical:Mf(t,"vertical",r,l*s[0],o),horizontal:Mf(t,"horizontal",n,i*s[1],a)}}function nw(t,r,n){var o=L(n,2),a=o[0],i=o[1],l=L(r,2),s=l[0],d=l[1],c=L(se(n,r),2),f=c[0],u=c[1],p=u>0,h=f>0;f=Pa(f),u=Pa(u);var m={isSnap:!1,offset:0,pos:0},y={isSnap:!1,offset:0,pos:0};if(f===0&&u===0)return{vertical:m,horizontal:y};var g=Da(t,f?[a]:[],u?[i]:[],[],[],void 0,void 0),b=g.vertical,w=g.horizontal;b.posInfos.filter(function(D){var I=D.pos;return h?I>=s:I<=s}),w.posInfos.filter(function(D){var I=D.pos;return p?I>=d:I<=d}),b.isSnap=b.posInfos.length>0,w.isSnap=w.posInfos.length>0;var _=Ol(b),C=_.isSnap,S=_.guideline,x=Ol(w),v=x.isSnap,V=x.guideline,$=v?V.pos[1]:0,B=C?S.pos[0]:0;if(f===0)v&&(y.isSnap=!0,y.pos=V.pos[1],y.offset=i-y.pos);else if(u===0)C&&(m.isSnap=!0,m.pos=B,m.offset=a-B);else{var R=u/f,T=n[1]-R*a,k=0,O=0,N=!1;C?(O=B,k=R*O+T,N=!0):v&&(k=$,O=(k-T)/R,N=!0),N&&(m.isSnap=!0,m.pos=O,m.offset=a-O,y.isSnap=!0,y.pos=k,y.offset=i-k)}return{vertical:m,horizontal:y}}function $r(t){var r="";return t===-1||t==="top"||t==="left"?r="start":t===0||t==="center"||t==="middle"?r="center":(t===1||t==="right"||t==="bottom")&&(r="end"),r}function Rf(t,r,n,o){var a=Tl(t.props.snapDirections,r),i=Da(t,a.vertical,a.horizontal,a.verticalNames.map(function(d){return $r(d)}),a.horizontalNames.map(function(d){return $r(d)}),n,o),l=$r(a.horizontalNames[i.horizontal.index]),s=$r(a.verticalNames[i.vertical.index]);return{vertical:A(A({},i.vertical),{direction:s}),horizontal:A(A({},i.horizontal),{direction:l})}}function Ol(t){var r=t.isSnap;if(!r)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var n=t.posInfos[0],o=n.guidelineInfos[0],a=o.offset,i=o.dist,l=o.guideline;return{isSnap:r,offset:a,dist:i,pos:n.pos,guideline:l}}function Mf(t,r,n,o,a){var i,l;if(a===void 0&&(a=[]),!t||!t.length)return{isSnap:!1,index:-1,direction:"",posInfos:[]};var s=r==="vertical",d=s?0:1,c=n.map(function(u,p){var h=a[p]||"",m=t.map(function(y){var g=y.pos,b=u-g[d];return{offset:b,dist:q(b),guideline:y,direction:h}}).filter(function(y){var g=y.guideline,b=y.dist,w=g.type;return!(w!==r||b>o)}).sort(function(y,g){return y.dist-g.dist});return{pos:u,index:p,guidelineInfos:m,direction:h}}).filter(function(u){return u.guidelineInfos.length>0}).sort(function(u,p){return u.guidelineInfos[0].dist-p.guidelineInfos[0].dist}),f=c.length>0;return{isSnap:f,index:f?c[0].index:-1,direction:(l=(i=c[0])===null||i===void 0?void 0:i.direction)!==null&&l!==void 0?l:"",posInfos:c}}function ow(t,r,n,o,a){var i=[];n[0]&&n[1]?i=[n,[-n[0],n[1]],[n[0],-n[1]]]:!n[0]&&!n[1]?[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(function(p,h,m){var y=m[h+1]||m[0];i.push(p),i.push([(p[0]+y[0])/2,(p[1]+y[1])/2])}):t.props.keepRatio?i.push([-1,-1],[-1,1],[1,-1],[1,1],n):(i.push.apply(i,K([],L(O_([[-1,-1],[1,-1],[-1,-1],[1,1]],n)),!1)),i.length>1&&i.push([(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]));var l=i.map(function(p){return rt(r,p)}),s=l.map(function(p){return p[0]}),d=l.map(function(p){return p[1]}),c=Da(t,s,d,i.map(function(p){return $r(p[0])}),i.map(function(p){return $r(p[1])}),o,a),f=$r(i.map(function(p){return p[0]})[c.vertical.index]),u=$r(i.map(function(p){return p[1]})[c.horizontal.index]);return{vertical:A(A({},c.vertical),{direction:f}),horizontal:A(A({},c.horizontal),{direction:u})}}function Af(t,r){var n=q(t.offset),o=q(r.offset);return t.isBound&&r.isBound?o-n:t.isBound?-1:r.isBound?1:t.isSnap&&r.isSnap?o-n:t.isSnap?-1:r.isSnap||n<dt?1:o<dt?-1:n-o}function Ba(t,r){return t.slice().sort(function(n,o){var a=n.sign[r],i=o.sign[r],l=n.offset[r],s=o.offset[r];if(a){if(!i)return-1}else return 1;return Af({isBound:n.isBound,isSnap:n.isSnap,offset:l},{isBound:o.isBound,isSnap:o.isSnap,offset:s})})[0]}function aw(t,r,n){var o=[];if(n)q(r[0])!==1||q(r[1])!==1?o.push([r,[-1,-1]],[r,[-1,1]],[r,[1,-1]],[r,[1,1]]):o.push([r,[t[0],-t[1]]],[r,[-t[0],t[1]]]),o.push([r,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var a=t[0]?t:[1,1];[1,-1].forEach(function(l){[1,-1].forEach(function(s){var d=[l*a[0],s*a[1]];r[0]===d[0]&&r[1]===d[1]||o.push([r,d])})})}else if(t[0]){var i=q(r[0])===1?[1]:[1,-1];i.forEach(function(l){o.push([[r[0],-1],[l*t[0],-1]],[[r[0],0],[l*t[0],0]],[[r[0],1],[l*t[0],1]])})}else if(t[1]){var i=q(r[1])===1?[1]:[1,-1];i.forEach(function(s){o.push([[-1,r[1]],[-1,s*t[1]]],[[0,r[1]],[0,s*t[1]]],[[1,r[1]],[1,s*t[1]]])})}return o}function Lf(t,r){var n=Pi([r[0][0],r[1][0]]),o=Pi([r[0][1],r[1][1]]);return{vertical:n<=t[0],horizontal:o<=t[1]}}function Il(t,r){var n=L(r,2),o=n[0],a=n[1],i=a[0]-o[0],l=a[1]-o[1];q(i)<dt&&(i=0),q(l)<dt&&(l=0);var s,d;if(!i)s=o[0],d=t[0];else if(!l)s=o[1],d=t[1];else{var c=l/i;s=c*(t[0]-o[0])+o[1],d=t[1]}return s-d}function Ff(t,r,n,o){return o===void 0&&(o=dt),t.every(function(a){var i=Il(a,r),l=i<=0;return l===n||q(i)<=o})}function jf(t,r,n,o,a){return a===void 0&&(a=0),o&&r-a<=t||!o&&t<=n+a?{isBound:!0,offset:o?r-t:n-t}:{isBound:!1,offset:0}}function iw(t,r){var n=r.line,o=r.centerSign,a=r.verticalSign,i=r.horizontalSign,l=r.lineConstants,s=t.props.innerBounds;if(!s)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var d=s.left,c=s.top,f=s.width,u=s.height,p=[[d,c],[d,c+u]],h=[[d,c],[d+f,c]],m=[[d+f,c],[d+f,c+u]],y=[[d,c+u],[d+f,c+u]];if(Ff([[d,c],[d+f,c],[d,c+u],[d+f,c+u]],n,o))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var g=Dr(n,l,h,a),b=Dr(n,l,y,a),w=Dr(n,l,p,i),_=Dr(n,l,m,i),C=g.isBound&&b.isBound,S=g.isBound||b.isBound,x=w.isBound&&_.isBound,v=w.isBound||_.isBound,V=Nn(g.offset,b.offset),$=Nn(w.offset,_.offset),B=[0,0],R=!1,T=!1;return q($)<q(V)?(B=[V,0],R=S,T=C):(B=[0,$],R=v,T=x),{isAllBound:T,isVerticalBound:S,isHorizontalBound:v,isBound:R,offset:B}}function Dr(t,r,n,o,a,i){var l=L(r,2),s=l[0],d=l[1],c=t[0],f=n[0],u=n[1],p=Pa(u[1]-f[1]),h=Pa(u[0]-f[0]),m=d,y=s,g=-s/d;if(h){if(!p){if(i&&!m)return{isBound:!1,offset:0};if(y){var C=(f[1]-c[1])/g+c[0];return jf(C,f[0],u[0],o,a)}else{var w=f[1]-c[1],_=q(w)<=(a||0);return{isBound:_,offset:_?w:0}}}}else{if(i&&!y)return{isBound:!1,offset:0};if(m){var b=g*(f[0]-c[0])+c[1];return jf(b,f[1],u[1],o,a)}else{var w=f[0]-c[0],_=q(w)<=(a||0);return{isBound:_,offset:_?w:0}}}return{isBound:!1,offset:0}}function Pf(t,r,n){return r.map(function(o){var a=iw(t,o),i=a.isBound,l=a.offset,s=a.isVerticalBound,d=a.isHorizontalBound,c=o.multiple,f=ar({datas:n,distX:l[0],distY:l[1]}).map(function(u,p){return u*(c[p]?2/c[p]:0)});return{sign:c,isBound:i,isVerticalBound:s,isHorizontalBound:d,isSnap:!1,offset:f}})}function lw(t,r,n){var o,a=zl(t,r,[0,0],!1).map(function(p){return A(A({},p),{multiple:p.multiple.map(function(h){return q(h)*2})})}),i=Pf(t,a,n),l=Ba(i,0),s=Ba(i,1),d=0,c=0,f=l.isVerticalBound||s.isVerticalBound,u=l.isHorizontalBound||s.isHorizontalBound;return(f||u)&&(o=L(B_({datas:n,distX:-l.offset[0],distY:-s.offset[1]}),2),d=o[0],c=o[1]),{vertical:{isBound:f,offset:d},horizontal:{isBound:u,offset:c}}}function sw(t,r){var n=[],o=t[0],a=t[1];return o&&a?n.push([[0,a*2],t,[-o,a]],[[o*2,0],t,[o,-a]]):o?(n.push([[o*2,0],[o,1],[o,-1]]),r&&n.push([[0,-1],[o,-1],[-o,-1]],[[0,1],[o,1],[-o,1]])):a?(n.push([[0,a*2],[1,a],[-1,a]]),r&&n.push([[-1,0],[-1,a],[-1,-a]],[[1,0],[1,a],[1,-a]])):n.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),n}function zl(t,r,n,o){var a=t.state,i=a.allMatrix,l=a.is3d,s=qr(i,100,100,l?4:3),d=rt(s,[0,0]);return sw(n,o).map(function(c){var f=L(c,3),u=f[0],p=f[1],h=f[2],m=[rt(s,p),rt(s,h)],y=rw(m),g=Lf(d,m),b=g.vertical,w=g.horizontal,_=Il(d,m)<=0;return{multiple:u,centerSign:_,verticalSign:b,horizontalSign:w,lineConstants:y,line:[rt(r,p),rt(r,h)]}})}function Uf(t,r,n,o){var a=o?t.map(function(i){return ao(i,o)}):t;return[[a[0],a[1]],[a[1],a[3]],[a[3],a[2]],[a[2],a[0]]].some(function(i){var l=Il(n,i)<=0;return!Ff(r,i,l)})}function cw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];if(!a)return q(n[0]);if(!i)return q(n[1]);var l=i/a;return q((-l*n[0]+n[1])/Math.sqrt(Math.pow(l,2)+1))}function dw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];if(!a)return[n[0],0];if(!i)return[0,n[1]];var l=i/a,s=-l*n[0]+n[1];return[-s/(l+1/l),s/(l*l+1)]}function fw(t,r,n,o,a){var i=t.props.innerBounds,l=a*Math.PI/180;if(!i)return[];var s=i.left,d=i.top,c=i.width,f=i.height,u=s-o[0],p=s+c-o[0],h=d-o[1],m=d+f-o[1],y=[[u,h],[p,h],[u,m],[p,m]],g=rt(n,[0,0]);if(!Uf(n,y,g,0))return[];var b=[],w=y.map(function(_){return[Ft(_),Ye([0,0],_)]});return[[n[0],n[1]],[n[1],n[3]],[n[3],n[2]],[n[2],n[0]]].forEach(function(_){var C=Ye([0,0],dw(_)),S=cw(_);b.push.apply(b,K([],L(w.filter(function(x){var v=L(x,1),V=v[0];return V&&S<=V}).map(function(x){var v=L(x,2),V=v[0],$=v[1],B=Math.acos(V?S/V:0),R=$+B,T=$-B;return[l+R-C,l+T-C]}).reduce(function(x,v){return x.push.apply(x,K([],L(v),!1)),x},[]).filter(function(x){return!Uf(r,y,g,x)}).map(function(x){return pe(x*180/Math.PI,dt)})),!1))}),b}function uw(t){var r=t.props.innerBounds,n=En();if(!r)return{boundMap:n,vertical:[],horizontal:[]};var o=t.getRect(),a=o.pos1,i=o.pos2,l=o.pos3,s=o.pos4,d=[a,i,l,s],c=rt(d,[0,0]),f=r.left,u=r.top,p=r.width,h=r.height,m=[[f,u],[f,u+h]],y=[[f,u],[f+p,u]],g=[[f+p,u],[f+p,u+h]],b=[[f,u+h],[f+p,u+h]],w=zl(t,d,[0,0],!1),_=[],C=[];return w.forEach(function(S){var x=S.line,v=S.lineConstants,V=Lf(c,x),$=V.horizontal,B=V.vertical,R=Dr(x,v,y,B,1,!0),T=Dr(x,v,b,B,1,!0),k=Dr(x,v,m,$,1,!0),O=Dr(x,v,g,$,1,!0);R.isBound&&!n.top&&(_.push(u),n.top=!0),T.isBound&&!n.bottom&&(_.push(u+h),n.bottom=!0),k.isBound&&!n.left&&(C.push(f),n.left=!0),O.isBound&&!n.right&&(C.push(f+p),n.right=!0)}),{boundMap:n,horizontal:_,vertical:C}}function pw(t,r,n,o){var a=r[0]-t[0],i=r[1]-t[1];if(q(a)<Ke&&(a=0),q(i)<Ke&&(i=0),!a)return o?[0,0]:[0,n];if(!i)return o?[n,0]:[0,0];var l=i/a,s=t[1]-l*t[0];if(o){var d=l*(r[0]+n)+s;return[n,d-r[1]]}else{var c=(r[1]+n-s)/l;return[c-r[0],n]}}function Rl(t,r,n,o,a){var i=pw(t,r,n,o);if(!i)return{isOutside:!1,offset:[0,0]};var l=nr(t,r),s=nr(i,t),d=nr(i,r),c=s>l||d>l,f=L(ar({datas:a,distX:i[0],distY:i[1]}),2),u=f[0],p=f[1];return{offset:[u,p],isOutside:c}}function Ta(t,r){return t.isBound?t.offset:r.isSnap?Ol(r).offset:0}function hw(t,r,n,o,a){var i=L(r,2),l=i[0],s=i[1],d=L(n,2),c=d[0],f=d[1],u=L(o,2),p=u[0],h=u[1],m=L(a,2),y=m[0],g=m[1],b=-y,w=-g;if(t&&l&&s){b=0,w=0;var _=[];if(c&&f?_.push([0,g],[y,0]):c?_.push([y,0]):f?_.push([0,g]):p&&h?_.push([0,g],[y,0]):p?_.push([y,0]):h&&_.push([0,g]),_.length){_.sort(function(v,V){return Ft(se([l,s],v))-Ft(se([l,s],V))});var C=_[0];if(C[0]&&q(l)>Ke)b=-C[0],w=s*q(l+b)/q(l)-s;else if(C[1]&&q(s)>Ke){var S=s;w=-C[1],b=l*q(s+w)/q(S)-l}if(t&&f&&c)if(q(b)>Ke&&q(b)<q(y)){var x=q(y)/q(b);b*=x,w*=x}else if(q(w)>Ke&&q(w)<q(g)){var x=q(g)/q(w);b*=x,w*=x}else b=Nn(-y,b),w=Nn(-g,w)}}else b=l||c?-y:0,w=s||f?-g:0;return[b,w]}function mw(t,r,n,o,a,i){if(!Vn(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var l=Xl(i.absolutePoses,[r,n]),s=Lt(l),d=s.left,c=s.right,f=s.top,u=s.bottom,p={horizontal:l.map(function(O){return O[1]}),vertical:l.map(function(O){return O[0]})},h=Bl(t.props.snapDirections),m=Tl(h,{left:d,right:c,top:f,bottom:u,center:(d+c)/2,middle:(f+u)/2}),y=Oa(t,a,m,p),g=y.vertical,b=y.horizontal,w=lw(t,l,i),_=w.vertical,C=w.horizontal,S=g.isSnap,x=b.isSnap,v=g.isBound||_.isBound,V=b.isBound||C.isBound,$=Nn(g.offset,_.offset),B=Nn(b.offset,C.offset),R=L(hw(o,[r,n],[v,V],[S,x],[$,B]),2),T=R[0],k=R[1];return[{isBound:v,isSnap:S,offset:T},{isBound:V,isSnap:x,offset:k}]}function Oa(t,r,n,o){o===void 0&&(o=n);var a=Dl($a(t),o.vertical,o.horizontal),i=a.horizontal,l=a.vertical,s=r?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Da(t,n.vertical,n.horizontal,void 0,void 0,void 0,void 0),d=s.horizontal,c=s.vertical,f=Ta(i[0],d),u=Ta(l[0],c),p=q(f),h=q(u);return{horizontal:{isBound:i[0].isBound,isSnap:d.isSnap,snapIndex:d.index,offset:f,dist:p,bounds:i,snap:d},vertical:{isBound:l[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:u,dist:h,bounds:l,snap:c}}}function Wf(t,r,n,o,a,i,l){l===void 0&&(l=[1,1]);var s=Dl(r,n,o),d=s.horizontal,c=s.vertical,f=zf(t,n,o,[],[],a,i,l),u=f.horizontal,p=f.vertical,h=Ta(d[0],u),m=Ta(c[0],p),y=q(h),g=q(m);return{horizontal:{isBound:d[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:h,dist:y,bounds:d,snap:u},vertical:{isBound:c[0].isBound,isSnap:p.isSnap,snapIndex:p.index,offset:m,dist:g,bounds:c,snap:p}}}function gw(t,r,n,o){var a=Ye(t,r)/Math.PI*180,i=n.vertical,l=i.isBound,s=i.isSnap,d=i.dist,c=n.horizontal,f=c.isBound,u=c.isSnap,p=c.dist,h=a%180,m=h<3||h>177,y=h>87&&h<93;return p<d&&(l||s&&!y&&(!o||!m))?"vertical":f||u&&!m&&(!o||!y)?"horizontal":""}function yw(t,r,n,o,a,i){return n.map(function(l){var s=L(l,2),d=s[0],c=s[1],f=rt(r,d),u=rt(r,c),p=o?bw(t,f,u,a):Oa(t,a,{vertical:[u[0]],horizontal:[u[1]]}),h=p.horizontal,m=h.offset,y=h.isBound,g=h.isSnap,b=p.vertical,w=b.offset,_=b.isBound,C=b.isSnap,S=se(c,d);if(!w&&!m)return{isBound:_||y,isSnap:C||g,sign:S,offset:[0,0]};var x=gw(f,u,p,o);if(!x)return{sign:S,isBound:!1,isSnap:!1,offset:[0,0]};var v=x==="vertical",V=[0,0];return!o&&q(c[0])===1&&q(c[1])===1&&d[0]!==c[0]&&d[1]!==c[1]?V=ar({datas:i,distX:-w,distY:-m}):V=Rl(f,u,-(v?w:m),v,i).offset,V=V.map(function($,B){return $*(S[B]?2/S[B]:0)}),{sign:S,isBound:v?_:y,isSnap:v?C:g,offset:V}})}function Gf(t,r){return t.isBound?t.offset:r.isSnap?r.offset:0}function bw(t,r,n,o){var a=q_(t,r,n),i=a.horizontal,l=a.vertical,s=o?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:nw(t,r,n),d=s.horizontal,c=s.vertical,f=Gf(i,d),u=Gf(l,c),p=q(f),h=q(u);return{horizontal:{isBound:i.isBound,isSnap:d.isSnap,offset:f,dist:p},vertical:{isBound:l.isBound,isSnap:c.isSnap,offset:u,dist:h}}}function _w(t,r,n,o,a){var i=[-n[0],-n[1]],l=t.state,s=l.width,d=l.height,c=t.props.bounds,f=1/0,u=1/0;if(c){var p=[[n[0],-n[1]],[-n[0],n[1]]],h=c.left,m=h===void 0?-1/0:h,y=c.top,g=y===void 0?-1/0:y,b=c.right,w=b===void 0?1/0:b,_=c.bottom,C=_===void 0?1/0:_;p.forEach(function(S){var x=S[0]!==i[0],v=S[1]!==i[1],V=rt(r,S),$=Ye(o,V)*360/Math.PI;if(v){var B=V.slice();(q($-360)<2||q($-180)<2)&&(B[1]=o[1]);var R=Rl(o,B,(o[1]<V[1]?C:g)-V[1],!1,a),T=L(R.offset,2),k=T[1],O=R.isOutside;isNaN(k)||(u=d+(O?1:-1)*q(k))}if(x){var B=V.slice();(q($-90)<2||q($-270)<2)&&(B[0]=o[0]);var N=Rl(o,B,(o[0]<V[0]?w:m)-V[0],!0,a),D=L(N.offset,1),I=D[0],z=N.isOutside;isNaN(I)||(f=s+(z?1:-1)*q(I))}})}return{maxWidth:f,maxHeight:u}}var ft={name:"draggable",props:["draggable","throttleDrag","throttleDragRotate","hideThrottleDragRotateLine","startDragRotate","edgeDraggable"],events:["dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd"],requestStyle:function(){return["left","top","right","bottom"]},requestChildStyle:function(){return["left","top","right","bottom"]},render:function(t,r){var n=t.props,o=n.hideThrottleDragRotateLine,a=n.throttleDragRotate,i=n.zoom,l=t.getState(),s=l.dragInfo,d=l.beforeOrigin;if(o||!a||!s)return[];var c=s.dist;if(!c[0]&&!c[1])return[];var f=Ft(c),u=Ye(c,[0,0]);return[r.createElement("div",{className:ae("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:"".concat(f,"px"),transform:"translate(".concat(d[0],"px, ").concat(d[1],"px) rotate(").concat(u,"rad) scaleY(").concat(i,")")}})]},dragStart:function(t,r){var n=r.datas,o=r.parentEvent,a=r.parentGesto,i=t.state,l=i.gestos,s=i.style;if(l.draggable)return!1;l.draggable=a||t.targetGesto,n.datas={},n.left=parseFloat(s.left||"")||0,n.top=parseFloat(s.top||"")||0,n.bottom=parseFloat(s.bottom||"")||0,n.right=parseFloat(s.right||"")||0,n.startValue=[0,0],Hr(t,r),va(t,r,"translate"),Aw(t,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1,n.deltaOffset=[0,0];var d=ge(t,r,A({set:function(f){n.startValue=f}},xa(t,r))),c=o||te(t,"onDragStart",d);return c!==!1?(n.isDrag=!0,t.state.dragInfo={startRect:t.getRect(),dist:[0,0]}):(l.draggable=null,n.isPinch=!1),n.isDrag?d:!1},drag:function(t,r){if(r){Ca(t,r,"translate");var n=r.datas,o=r.parentEvent,a=r.parentFlag,i=r.isPinch,l=r.deltaOffset,s=r.useSnap,d=r.isRequest,c=r.isGroup,f=r.parentThrottleDrag,u=r.distX,p=r.distY,h=n.isDrag,m=n.prevDist,y=n.prevBeforeDist,g=n.startValue;if(h){l&&(u+=l[0],p+=l[1]);var b=t.props,w=b.parentMoveable,_=c?0:b.throttleDrag||f||0,C=o?0:b.throttleDragRotate||0,S=0,x=!1,v=!1,V=!1,$=!1;if(!o&&C>0&&(u||p)){var B=b.startDragRotate||0,R=pe(B+Ye([0,0],[u,p])*180/Math.PI,C)-B,T=p*Math.abs(Math.cos((R-90)/180*Math.PI)),k=u*Math.abs(Math.cos(R/180*Math.PI)),O=Ft([k,T]);S=R*Math.PI/180,u=O*Math.cos(S),p=O*Math.sin(S)}if(!i&&!o&&!a){var N=L(mw(t,u,p,C,!s&&d||l,n),2),D=N[0],I=N[1];x=D.isSnap,v=D.isBound,V=I.isSnap,$=I.isBound;var z=D.offset,M=I.offset;u+=z,p+=M}var j=xe(yf({datas:n,distX:u,distY:p}),g),F=xe(D_({datas:n,distX:u,distY:p}),g);bd(F,dt),bd(j,dt),C||(!x&&!v&&(F[0]=pe(F[0],_),j[0]=pe(j[0],_)),!V&&!$&&(F[1]=pe(F[1],_),j[1]=pe(j[1],_)));var G=se(j,g),H=se(F,g),X=se(H,m),J=se(G,y);n.prevDist=H,n.prevBeforeDist=G,n.passDelta=X,n.passDist=H;var P=n.left+G[0],W=n.top+G[1],Q=n.right-G[0],re=n.bottom-G[1],ne=Sa(n,"translate(".concat(F[0],"px, ").concat(F[1],"px)"),"translate(".concat(H[0],"px, ").concat(H[1],"px)"));if(kl(r,ne),t.state.dragInfo.dist=o?[0,0]:H,!(!o&&!w&&X.every(function(ce){return!ce})&&J.some(function(ce){return!ce}))){var Y=t.state,Z=Y.width,ye=Y.height,ie=ge(t,r,A({transform:ne,dist:H,delta:X,translate:F,beforeDist:G,beforeDelta:J,beforeTranslate:j,left:P,top:W,right:Q,bottom:re,width:Z,height:ye,isPinch:i},ut({transform:ne},r)));return!o&&te(t,"onDrag",ie),ie}}}},dragAfter:function(t,r){var n=r.datas,o=n.deltaOffset;return o[0]||o[1]?(n.deltaOffset=[0,0],this.drag(t,A(A({},r),{deltaOffset:o}))):!1},dragEnd:function(t,r){var n=r.parentEvent,o=r.datas;if(t.state.dragInfo=null,!!o.isDrag){o.isDrag=!1;var a=Dt(t,r,{});return!n&&te(t,"onDragEnd",a),a}},dragGroupStart:function(t,r){var n,o,a=r.datas,i=r.clientX,l=r.clientY,s=this.dragStart(t,r);if(!s)return!1;var d=$l(t,this,"dragStart",[i||0,l||0],r,!1,"draggable"),c=d.childEvents,f=d.eventParams,u=A(A({},s),{targets:t.props.targets,events:f}),p=te(t,"onDragGroupStart",u);a.isDrag=p!==!1;var h=(o=(n=c[0])===null||n===void 0?void 0:n.datas.startValue)!==null&&o!==void 0?o:[0,0];return a.throttleOffset=[h[0]%1,h[1]%1],a.isDrag?s:!1},dragGroup:function(t,r){var n=r.datas;if(n.isDrag){var o=this.drag(t,A(A({},r),{parentThrottleDrag:t.props.throttleDrag})),a=r.datas.passDelta,i=$l(t,this,"drag",a,r,!1,"draggable").eventParams;if(o){var l=A({targets:t.props.targets,events:i},o);return te(t,"onDragGroup",l),l}}},dragGroupEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isDrag){this.dragEnd(t,r);var a=$l(t,this,"dragEnd",[0,0],r,!1,"draggable").eventParams;return te(t,"onDragGroupEnd",Dt(t,r,{targets:t.props.targets,events:a})),n}},request:function(t){var r={},n=t.getRect(),o=0,a=0,i=!1;return{isControl:!1,requestStart:function(l){return i=l.useSnap,{datas:r,useSnap:i}},request:function(l){return"x"in l?o=l.x-n.left:"deltaX"in l&&(o+=l.deltaX),"y"in l?a=l.y-n.top:"deltaY"in l&&(a+=l.deltaY),{datas:r,distX:o,distY:a,useSnap:i}},requestEnd:function(){return{datas:r,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}};function Hf(t,r){var n=rt(t,r),o=[0,0];return{fixedPosition:n,fixedDirection:r,fixedOffset:o}}function ww(t,r){var n=t.allMatrix,o=t.is3d,a=t.width,i=t.height,l=o?4:3,s=[a/2*(1+r[0]),i/2*(1+r[1])],d=Ge(n,s,l),c=[0,0];return{fixedPosition:d,fixedDirection:r,fixedOffset:c}}function Yf(t,r){var n=t.allMatrix,o=t.is3d,a=t.width,i=t.height,l=o?4:3,s=A_(r,a,i),d=Ge(n,r,l),c=[a?0:r[0],i?0:r[1]];return{fixedPosition:d,fixedDirection:s,fixedOffset:c}}var Xf=Ql("resizable"),Ml={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Ef("resizable"),dragControlCondition:Xf,viewClassName:Zl("resizable"),dragControlStart:function(t,r){var n,o=r.inputEvent,a=r.isPinch,i=r.isGroup,l=r.parentDirection,s=r.parentGesto,d=r.datas,c=r.parentFixedDirection,f=r.parentEvent,u=hu(l,a,o,d),p=t.state,h=p.target,m=p.width,y=p.height,g=p.gestos;if(!u||!h||g.resizable)return!1;g.resizable=s||t.controlGesto,!a&&Hr(t,r),d.datas={},d.direction=u,d.startOffsetWidth=m,d.startOffsetHeight=y,d.prevWidth=0,d.prevHeight=0,d.minSize=[0,0],d.startWidth=p.inlineCSSWidth||p.cssWidth,d.startHeight=p.inlineCSSHeight||p.cssHeight,d.maxSize=[1/0,1/0],i||(d.minSize=[p.minOffsetWidth,p.minOffsetHeight],d.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var b=t.props.transformOrigin||"% %";d.transformOrigin=b&&at(b)?b.split(" "):b,d.startOffsetMatrix=p.offsetMatrix,d.startTransformOrigin=p.transformOrigin,d.isWidth=(n=r==null?void 0:r.parentIsWidth)!==null&&n!==void 0?n:!u[0]&&!u[1]||u[0]||!u[1];function w($){d.ratio=$&&isFinite($)?$:0}d.startPositions=jt(t.state);function _($){var B=Hf(d.startPositions,$);d.fixedDirection=B.fixedDirection,d.fixedPosition=B.fixedPosition,d.fixedOffset=B.fixedOffset}function C($){var B=Yf(t.state,$);d.fixedDirection=B.fixedDirection,d.fixedPosition=B.fixedPosition,d.fixedOffset=B.fixedOffset}function S($){d.minSize=[Te("".concat($[0]),0)||0,Te("".concat($[1]),0)||0]}function x($){var B=[$[0]||1/0,$[1]||1/0];(!un(B[0])||isFinite(B[0]))&&(B[0]=Te("".concat(B[0]),0)||1/0),(!un(B[1])||isFinite(B[1]))&&(B[1]=Te("".concat(B[1]),0)||1/0),d.maxSize=B}w(m/y),_(c||[-u[0],-u[1]]),d.setFixedDirection=_,d.setFixedPosition=C,d.setMin=S,d.setMax=x;var v=ge(t,r,{direction:u,startRatio:d.ratio,set:function($){var B=L($,2),R=B[0],T=B[1];d.startWidth=R,d.startHeight=T},setMin:S,setMax:x,setRatio:w,setFixedDirection:_,setFixedPosition:C,setOrigin:function($){d.transformOrigin=$},dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))}),V=f||te(t,"onResizeStart",v);return d.startFixedDirection=d.fixedDirection,d.startFixedPosition=d.fixedPosition,V!==!1&&(d.isResize=!0,t.state.snapRenderInfo={request:r.isRequest,direction:u}),d.isResize?v:!1},dragControl:function(t,r){var n,o=r.datas,a=r.parentFlag,i=r.isPinch,l=r.parentKeepRatio,s=r.dragClient,d=r.parentDist,c=r.useSnap,f=r.isRequest,u=r.isGroup,p=r.parentEvent,h=r.resolveMatrix,m=o.isResize,y=o.transformOrigin,g=o.startWidth,b=o.startHeight,w=o.prevWidth,_=o.prevHeight,C=o.minSize,S=o.maxSize,x=o.ratio,v=o.startOffsetWidth,V=o.startOffsetHeight,$=o.isWidth;if(!m)return;if(h){var B=t.state.is3d,R=o.startOffsetMatrix,T=o.startTransformOrigin,k=B?4:3,O=pn(Ea(r)),N=Math.sqrt(O.length);k!==N&&(O=Jt(O,N,k));var D=ho(R,O,T,k),I=qr(D,v,V,k);o.startPositions=I,o.nextTargetMatrix=O,o.nextAllMatrix=D}var z=Jr(t.props,"resizable"),M=z.resizeFormat,j=z.throttleResize,F=j===void 0?a?0:1:j,G=z.parentMoveable,H=z.keepRatioFinally,X=o.direction,J=X,P=0,W=0;!X[0]&&!X[1]&&(J=[1,1]);var Q=x&&(l??z.keepRatio)||!1;function re(){var we=o.fixedDirection,nt=xu(J,Q,o,r);P=nt.distWidth,W=nt.distHeight;var Ir=J[0]-we[0]||Q?Math.max(v+P,dt):v,zr=J[1]-we[1]||Q?Math.max(V+W,dt):V;return Q&&v&&V&&($?zr=Ir/x:Ir=zr*x),[Ir,zr]}var ne=L(re(),2),Y=ne[0],Z=ne[1];p||(o.setFixedDirection(o.fixedDirection),te(t,"onBeforeResize",ge(t,r,{startFixedDirection:o.startFixedDirection,startFixedPosition:o.startFixedPosition,setFixedDirection:function(we){var nt;return o.setFixedDirection(we),nt=L(re(),2),Y=nt[0],Z=nt[1],[Y,Z]},setFixedPosition:function(we){var nt;return o.setFixedPosition(we),nt=L(re(),2),Y=nt[0],Z=nt[1],[Y,Z]},boundingWidth:Y,boundingHeight:Z,setSize:function(we){var nt;nt=L(we,2),Y=nt[0],Z=nt[1]}},!0)));var ye=s;s||(!a&&i?ye=P_(t,[0,0]):ye=o.fixedPosition);var ie=[0,0];i||(ie=Rw(t,Y,Z,X,ye,!c&&f,o)),d&&(!d[0]&&(ie[0]=0),!d[1]&&(ie[1]=0));function ce(){var we;M&&(we=L(M([Y,Z]),2),Y=we[0],Z=we[1]),Y=pe(Y,F),Z=pe(Z,F)}if(Q){J[0]&&J[1]&&ie[0]&&ie[1]&&(q(ie[0])>q(ie[1])?ie[1]=0:ie[0]=0);var oe=!ie[0]&&!ie[1];oe&&ce(),J[0]&&!J[1]||ie[0]&&!ie[1]||oe&&$?(Y+=ie[0],Z=Y/x):(!J[0]&&J[1]||!ie[0]&&ie[1]||oe&&!$)&&(Z+=ie[1],Y=Z*x)}else Y+=ie[0],Z+=ie[1],Y=Math.max(0,Y),Z=Math.max(0,Z);n=L(ji([Y,Z],C,S,Q?x:!1),2),Y=n[0],Z=n[1],ce(),Q&&(u||H)&&($?Z=Y/x:Y=Z*x),P=Y-v,W=Z-V;var _e=[P-w,W-_];o.prevWidth=P,o.prevHeight=W;var Ce=j_(t,Y,Z,ye,y,o);if(!(!G&&_e.every(function(we){return!we})&&Ce.every(function(we){return!we}))){var ue=ft.drag(t,po(r,t.state,Ce,!!i,!1,"draggable")),Ee=ue.transform,be=g+P,Ve=b+W,Ne=ge(t,r,A({width:be,height:Ve,offsetWidth:Math.round(Y),offsetHeight:Math.round(Z),startRatio:x,boundingWidth:Y,boundingHeight:Z,direction:X,dist:[P,W],delta:_e,isPinch:!!i,drag:ue},gu({style:{width:"".concat(be,"px"),height:"".concat(Ve,"px")},transform:Ee},ue,r)));return!p&&te(t,"onResize",Ne),Ne}},dragControlAfter:function(t,r){var n=r.datas,o=n.isResize,a=n.startOffsetWidth,i=n.startOffsetHeight,l=n.prevWidth,s=n.prevHeight;if(!(!o||t.props.checkResizableError===!1)){var d=t.state,c=d.width,f=d.height,u=c-(a+l),p=f-(i+s),h=q(u)>3,m=q(p)>3;if(h&&(n.startWidth+=u,n.startOffsetWidth+=u,n.prevWidth+=u),m&&(n.startHeight+=p,n.startOffsetHeight+=p,n.prevHeight+=p),h||m)return this.dragControl(t,r)}},dragControlEnd:function(t,r){var n=r.datas,o=r.parentEvent;if(n.isResize){n.isResize=!1;var a=Dt(t,r,{});return!o&&te(t,"onResizeEnd",a),a}},dragGroupControlCondition:Xf,dragGroupControlStart:function(t,r){var n=r.datas,o=this.dragControlStart(t,A(A({},r),{isGroup:!0}));if(!o)return!1;var a=Kt(t,"resizable",r),i=n.startOffsetWidth,l=n.startOffsetHeight;function s(){var h=n.minSize;a.forEach(function(m){var y=m.datas,g=y.minSize,b=y.startOffsetWidth,w=y.startOffsetHeight,_=i*(b?g[0]/b:0),C=l*(w?g[1]/w:0);h[0]=Math.max(h[0],_),h[1]=Math.max(h[1],C)})}function d(){var h=n.maxSize;a.forEach(function(m){var y=m.datas,g=y.maxSize,b=y.startOffsetWidth,w=y.startOffsetHeight,_=i*(b?g[0]/b:0),C=l*(w?g[1]/w:0);h[0]=Math.min(h[0],_),h[1]=Math.min(h[1],C)})}var c=gr(t,this,"dragControlStart",r,function(h,m){return Na(t,h,n,m)});s(),d();var f=function(h){o.setFixedDirection(h),c.forEach(function(m,y){m.setFixedDirection(h),Na(t,m.moveable,n,a[y])})};n.setFixedDirection=f;var u=A(A({},o),{targets:t.props.targets,events:c.map(function(h){return A(A({},h),{setMin:function(m){h.setMin(m),s()},setMax:function(m){h.setMax(m),d()}})}),setFixedDirection:f,setMin:function(h){o.setMin(h),s()},setMax:function(h){o.setMax(h),d()}}),p=te(t,"onResizeGroupStart",u);return n.isResize=p!==!1,n.isResize?o:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isResize){var o=Jr(t.props,"resizable");Fa(t,"onBeforeResize",function(h){te(t,"onBeforeResizeGroup",ge(t,r,A(A({},h),{targets:o.targets}),!0))});var a=this.dragControl(t,A(A({},r),{isGroup:!0}));if(a){var i=a.boundingWidth,l=a.boundingHeight,s=a.dist,d=o.keepRatio,c=[i/(i-s[0]),l/(l-s[1])],f=n.fixedPosition,u=gr(t,this,"dragControl",r,function(h,m){var y=L(lt(io(t.rotation/180*Math.PI,3),[m.datas.originalX*c[0],m.datas.originalY*c[1],1],3),2),g=y[0],b=y[1];return A(A({},m),{parentDist:null,parentScale:c,dragClient:xe(f,[g,b]),parentKeepRatio:d})}),p=A({targets:o.targets,events:u},a);return te(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isResize){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onResizeGroupEnd",i),n}},request:function(t){var r={},n=0,o=0,a=!1,i=t.getRect();return{isControl:!0,requestStart:function(l){var s;return a=l.useSnap,{datas:r,parentDirection:l.direction||[1,1],parentIsWidth:(s=l==null?void 0:l.horizontal)!==null&&s!==void 0?s:!0,useSnap:a}},request:function(l){return"offsetWidth"in l?n=l.offsetWidth-i.offsetWidth:"deltaWidth"in l&&(n+=l.deltaWidth),"offsetHeight"in l?o=l.offsetHeight-i.offsetHeight:"deltaHeight"in l&&(o+=l.deltaHeight),{datas:r,parentDist:[n,o],parentKeepRatio:l.keepRatio,useSnap:a}},requestEnd:function(){return{datas:r,isDrag:!0,useSnap:a}}}},unset:function(t){t.state.gestos.resizable=null}};function Al(t,r,n,o,a){var i=t.props.groupable,l=t.state,s=l.is3d?4:3,d=r.origin,c=Ge(t.state.rootMatrix,se([d[0],d[1]],i?[0,0]:[l.left,l.top]),s),f=xe([a.left,a.top],c);r.startAbsoluteOrigin=f,r.prevDeg=Ye(f,[n,o])/Math.PI*180,r.defaultDeg=r.prevDeg,r.prevSnapDeg=0,r.loop=0,r.startDist=nr(f,[n,o])}function Ia(t,r,n){var o=n.defaultDeg,a=n.prevDeg,i=a%360,l=Math.floor(a/360);i<0&&(i+=360),i>t&&i>270&&t<90?++l:i<t&&i<90&&t>270&&--l;var s=r*(l*360+t-o);return n.prevDeg=o+s,s}function Ll(t,r,n,o){return Ia(Ye(o.startAbsoluteOrigin,[t,r])/Math.PI*180,n,o)}function Fl(t,r,n,o,a,i){var l=t.props.throttleRotate,s=l===void 0?0:l,d=n.prevSnapDeg,c=0,f=!1;if(i){var u=zw(t,r,o,a+o);f=u.isSnap,c=a+u.dist}f||(c=pe(a+o,s));var p=c-a;return n.prevSnapDeg=p,[p-d,p,c]}function qf(t,r,n){var o=L(r,4),a=o[0],i=o[1],l=o[2],s=o[3];if(t==="none")return[];if(Ue(t))return t.map(function(g){return qf(g,[a,i,l,s],n)[0]});var d=L((t||"top").split("-"),2),c=d[0],f=d[1],u=[a,i];c==="left"?u=[l,a]:c==="right"?u=[i,s]:c==="bottom"&&(u=[s,l]);var p=[(u[0][0]+u[1][0])/2,(u[0][1]+u[1][1])/2],h=uu(u,n);if(f){var m=f==="top"||f==="left",y=c==="bottom"||c==="left";p=u[m&&!y||!m&&y?0:1]}return[[p,h]]}function jl(t,r){if(r.isRequest)return r.requestAble==="rotatable";var n=r.inputEvent.target;if(Ze(n,ae("rotation-control"))||t.props.rotateAroundControls&&Ze(n,ae("around-control"))||Ze(n,ae("control"))&&Ze(n,ae("rotatable")))return!0;var o=t.props.rotationTarget;return o?es(o,!0).some(function(a){return a?n===a||n.contains(a):!1}):!1}var Cw=`.rotation {
248
+ `),k_=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],Sl=1e-4,dt=1e-7,wa=1e-9,xl=Math.pow(10,10),uf=-xl,N_={n:[0,-1],e:[1,0],s:[0,1],w:[-1,0],nw:[-1,-1],ne:[1,-1],sw:[-1,1],se:[1,1]},vl={n:[0,1],e:[1,3],s:[3,2],w:[2,0],nw:[0],ne:[1],sw:[2],se:[3]},pf={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},hf=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate","waitToChangeTarget","updateSelectors","getTargets","stopDrag","getControlBoxElement","getMoveables","getDragElement"];function po(t,r,n,o,a,i){var l,s;i===void 0&&(i="draggable");var d=(s=(l=r.gestos[i])===null||l===void 0?void 0:l.move(n,t.inputEvent))!==null&&s!==void 0?s:{},c=d.originalDatas||d.datas,f=c[i]||(c[i]={});return A(A({},a?wu(r,d):d),{isPinch:!!o,parentEvent:!0,datas:f,originalDatas:t.originalDatas})}var wn=function(){function t(r){var n;r===void 0&&(r="draggable"),this.ableName=r,this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}},this.datas=(n={},n[r]={},n)}return t.prototype.dragStart=function(r,n){this.isDrag=!1,this.isFlag=!1;var o=n.originalDatas;return this.datas=o,o[this.ableName]||(o[this.ableName]={}),A(A({},this.move(r,n.inputEvent)),{type:"dragstart"})},t.prototype.drag=function(r,n){return this.move([r[0]-this.prevX,r[1]-this.prevY],n)},t.prototype.move=function(r,n){var o,a,i=!1;if(!this.isFlag)this.prevX=r[0],this.prevY=r[1],this.startX=r[0],this.startY=r[1],o=r[0],a=r[1],this.isFlag=!0;else{var l=this.isDrag;o=this.prevX+r[0],a=this.prevY+r[1],(r[0]||r[1])&&(this.isDrag=!0),!l&&this.isDrag&&(i=!0)}return this.prevX=o,this.prevY=a,{type:"drag",clientX:o,clientY:a,inputEvent:n,isFirstDrag:i,isDrag:this.isDrag,distX:o-this.startX,distY:a-this.startY,deltaX:r[0],deltaY:r[1],datas:this.datas[this.ableName],originalDatas:this.datas,parentEvent:!0,parentGesto:this}},t}();function Cn(t,r,n,o){var a=t.length===16,i=a?4:3,l=qr(t,n,o,i),s=L(l,4),d=L(s[0],2),c=d[0],f=d[1],u=L(s[1],2),p=u[0],h=u[1],m=L(s[2],2),y=m[0],g=m[1],b=L(s[3],2),w=b[0],_=b[1],C=L(Ge(t,r,i),2),S=C[0],x=C[1],v=Math.min(c,p,y,w),V=Math.min(f,h,g,_),$=Math.max(c,p,y,w),B=Math.max(f,h,g,_);c=c-v||0,p=p-v||0,y=y-v||0,w=w-v||0,f=f-V||0,h=h-V||0,g=g-V||0,_=_-V||0,S=S-v||0,x=x-V||0;var R=t[0],T=t[i+1],k=pt(R*T);return{left:v,top:V,right:$,bottom:B,origin:[S,x],pos1:[c,f],pos2:[p,h],pos3:[y,g],pos4:[w,_],direction:k}}function mf(t,r){var n=r.clientX,o=r.clientY,a=r.datas,i=t.state,l=i.moveableClientRect,s=i.rootMatrix,d=i.is3d,c=i.pos1,f=l.left,u=l.top,p=d?4:3,h=L(se($n(s,[n-f,o-u],p),c),2),m=h[0],y=h[1],g=L(ar({datas:a,distX:m,distY:y}),2),b=g[0],w=g[1];return[b,w]}function Hr(t,r){var n=r.datas,o=t.state,a=o.allMatrix,i=o.beforeMatrix,l=o.is3d,s=o.left,d=o.top,c=o.origin,f=o.offsetMatrix,u=o.targetMatrix,p=o.transformOrigin,h=l?4:3;n.is3d=l,n.matrix=a,n.targetMatrix=u,n.beforeMatrix=i,n.offsetMatrix=f,n.transformOrigin=p,n.inverseMatrix=qt(a,h),n.inverseBeforeMatrix=qt(i,h),n.absoluteOrigin=Ur(xe([s,d],c),h),n.startDragBeforeDist=lt(n.inverseBeforeMatrix,n.absoluteOrigin,h),n.startDragDist=lt(n.inverseMatrix,n.absoluteOrigin,h)}function $_(t){return Cn(t.datas.beforeTransform,[50,50],100,100).direction}function Ca(t,r,n){var o=r.datas,a=r.originalDatas.beforeRenderable,i=o.transformIndex,l=a.nextTransforms,s=l.length,d=a.nextTransformAppendedIndexes,c=-1;i===-1?(n==="translate"?c=0:n==="rotate"&&(c=hr(l,function(h){return h.match(/scale\(/g)})),c===-1&&(c=l.length),o.transformIndex=c):_t(d,function(h){return h.index===i&&h.functionName===n})?c=i:c=i+d.filter(function(h){return h.index<i}).length;var f=eC(l,t.state,c),u=f.targetFunction,p=n==="rotate"?"rotateZ":n;o.beforeFunctionTexts=f.beforeFunctionTexts,o.afterFunctionTexts=f.afterFunctionTexts,o.beforeTransform=f.beforeFunctionMatrix,o.beforeTransform2=f.beforeFunctionMatrix2,o.targetTansform=f.targetFunctionMatrix,o.afterTransform=f.afterFunctionMatrix,o.afterTransform2=f.afterFunctionMatrix2,o.targetAllTransform=f.allFunctionMatrix,u.functionName===p?(o.afterFunctionTexts.splice(0,1),o.isAppendTransform=!1):s>c&&(o.isAppendTransform=!0,a.nextTransformAppendedIndexes=K(K([],L(d),!1),[{functionName:n,index:c,isAppend:!0}],!1))}function Sa(t,r,n){return"".concat(t.beforeFunctionTexts.join(" ")," ").concat(t.isAppendTransform?n:r," ").concat(t.afterFunctionTexts.join(" "))}function D_(t){var r=t.datas,n=t.distX,o=t.distY,a=L(yf({datas:r,distX:n,distY:o}),2),i=a[0],l=a[1],s=gf(r,A1([i,l],4));return lt(s,Ur([0,0,0],4),4)}function gf(t,r,n){var o=t.beforeTransform,a=t.afterTransform,i=t.beforeTransform2,l=t.afterTransform2,s=t.targetAllTransform,d=n?Oe(s,r,4):Oe(r,s,4),c=Oe(qt(n?i:o,4),d,4),f=Oe(c,qt(n?l:a,4),4);return f}function yf(t){var r=t.datas,n=t.distX,o=t.distY,a=r.inverseBeforeMatrix,i=r.is3d,l=r.startDragBeforeDist,s=r.absoluteOrigin,d=i?4:3;return se(lt(a,xe(s,[n,o]),d),l)}function ar(t,r){var n=t.datas,o=t.distX,a=t.distY,i=n.inverseBeforeMatrix,l=n.inverseMatrix,s=n.is3d,d=n.startDragBeforeDist,c=n.startDragDist,f=n.absoluteOrigin,u=s?4:3;return se(lt(r?i:l,xe(f,[o,a]),u),r?d:c)}function B_(t,r){var n=t.datas,o=t.distX,a=t.distY,i=n.beforeMatrix,l=n.matrix,s=n.is3d,d=n.startDragBeforeDist,c=n.startDragDist,f=n.absoluteOrigin,u=s?4:3;return se(lt(r?i:l,xe(r?d:c,[o,a]),u),f)}function T_(t,r,n,o,a,i){return o===void 0&&(o=r),a===void 0&&(a=n),i===void 0&&(i=[0,0]),t?t.map(function(l,s){var d=Pr(l),c=d.value,f=d.unit,u=s?a:o,p=s?n:r;if(l==="%"||isNaN(c)){var h=u?i[s]/u:0;return p*h}else if(f!=="%")return c;return p*c/100}):i}function bf(t){var r=[];return t[1]>=0&&(t[0]>=0&&r.push(3),t[0]<=0&&r.push(2)),t[1]<=0&&(t[0]>=0&&r.push(1),t[0]<=0&&r.push(0)),r}function O_(t,r){return bf(r).map(function(n){return t[n]})}function El(t,r){var n=(r+1)/2;return[ia(t[0][0],t[1][0],n,1-n),ia(t[0][1],t[1][1],n,1-n)]}function rt(t,r){var n=El([t[0],t[1]],r[0]),o=El([t[2],t[3]],r[0]);return El([n,o],r[1])}function I_(t,r,n,o,a,i){var l=qr(r,n,o,a),s=rt(l,i),d=t[0]-s[0],c=t[1]-s[1];return[d,c]}function ho(t,r,n,o){return Oe(t,bo(r,o,n),o)}function z_(t,r,n,o){var a=t.transformOrigin,i=t.offsetMatrix,l=t.is3d,s=l?4:3,d;if(at(n)){var c=r.beforeTransform,f=r.afterTransform;o?d=Jt(pn(n),4,s):d=Jt(Oe(Oe(c,pn([n]),4),f,4),4,s)}else d=n;return ho(i,d,a,s)}function R_(t,r){var n=t.transformOrigin,o=t.offsetMatrix,a=t.is3d,i=t.targetMatrix,l=t.targetAllTransform,s=a?4:3;return ho(o,Oe(l||i,ol(r,s),s),n,s)}function xa(t,r){var n=Sn(r);return{setTransform:function(o,a){a===void 0&&(a=-1),n.startTransforms=Ue(o)?o:vr(o),Vl(t,r,a)},setTransformIndex:function(o){Vl(t,r,o)}}}function va(t,r,n){var o=Sn(r),a=o.startTransforms;Vl(t,r,hr(a,function(i){return i.indexOf("".concat(n,"("))===0}))}function Vl(t,r,n){var o=Sn(r),a=r.datas;if(a.transformIndex=n,n!==-1){var i=o.startTransforms[n];if(i){var l=t.state,s=mn([i],{"x%":function(d){return d/100*l.offsetWidth},"y%":function(d){return d/100*l.offsetHeight}});a.startValue=s[0].functionValue}}}function kl(t,r){var n=Sn(t);n.nextTransforms=vr(r)}function Sn(t){return t.originalDatas.beforeRenderable}function Ea(t){var r=t.originalDatas.beforeRenderable;return r.nextTransforms}function Va(t){return(Ea(t)||[]).join(" ")}function ka(t){return Sn(t).nextStyle}function _f(t,r,n,o,a){kl(a,r);var i=ft.drag(t,po(a,t.state,n,o,!1)),l=i?i.transform:r;return A(A({transform:r,drag:i},ut({transform:l},a)),{afterTransform:l})}function Nl(t,r,n,o,a,i){var l=z_(t.state,a,r,i),s=L_(t,n,o,l);return s}function wf(t,r,n,o,a,i,l){var s=Nl(t,r,n,a,i,l),d=t.state,c=d.left,f=d.top,u=t.props.groupable,p=u?c:0,h=u?f:0,m=se(o,s);return se(m,[p,h])}function M_(t,r,n,o,a,i,l){var s=wf(t,r,n,o,a,i,l);return s}function A_(t,r,n){return[r?-1+t[0]/(r/2):0,n?-1+t[1]/(n/2):0]}function L_(t,r,n,o){o===void 0&&(o=t.state.allMatrix);var a=t.state,i=a.width,l=a.height,s=a.is3d,d=s?4:3,c=[i/2*(1+r[0])+n[0],l/2*(1+r[1])+n[1]];return Ge(o,c,d)}function F_(t,r,n){var o=n.fixedDirection,a=n.fixedPosition,i=n.fixedOffset;return wf(t,"rotate(".concat(r,"deg)"),o,a,i,n)}function j_(t,r,n,o,a,i){var l=t.props.groupable,s=t.state,d=s.transformOrigin,c=s.offsetMatrix,f=s.is3d,u=s.width,p=s.height,h=s.left,m=s.top,y=i.fixedDirection,g=i.nextTargetMatrix||s.targetMatrix,b=f?4:3,w=T_(a,r,n,u,p,d),_=l?h:0,C=l?m:0,S=ho(c,g,w,b),x=I_(o,S,r,n,b,y);return se(x,[_,C])}function P_(t,r){return rt(jt(t.state),r)}function U_(t,r){var n=t.targetGesto,o=t.controlGesto,a;return n!=null&&n.isFlag()&&(a=n.getEventData()[r]),!a&&(o!=null&&o.isFlag())&&(a=o.getEventData()[r]),a||{}}function W_(t){if(t&&t.getRootNode){var r=t.getRootNode();if(r.nodeType===11)return r}}function G_(t){var r=t("scale"),n=t("rotate"),o=t("translate"),a=[];return o&&o!=="0px"&&o!=="none"&&a.push("translate(".concat(o.split(/\s+/).join(","),")")),n&&n!=="1"&&n!=="none"&&a.push("rotate(".concat(n,")")),r&&r!=="1"&&r!=="none"&&a.push("scale(".concat(r.split(/\s+/).join(","),")")),a}function Cf(t,r,n){for(var o=t,a=[],i=Wi(t)||Er(t),l=!n&&t===r||t===i,s=l,d=!1,c=3,f,u,p,h=!1,m=_o(r,r,!0).offsetParent,y=1;o&&!s;){s=l;var g=St(o),b=g("position"),w=lu(o),_=b==="fixed",C=G_(g),S=L1(Pw(w)),x=void 0,v=!1,V=!1,$=0,B=0,R=0,T=0,k={hasTransform:!1,fixedContainer:null};_&&(h=!0,k=Yw(o),m=k.fixedContainer);var O=S.length;!d&&(O===16||C.length)&&(d=!0,c=4,Gl(a),p&&(p=Jt(p,3,4))),d&&O===9&&(S=Jt(S,3,4));var N=Hw(o,t),D=N.tagName,I=N.hasOffset,z=N.isSVG,M=N.origin,j=N.targetOrigin,F=N.offset,G=L(F,2),H=G[0],X=G[1];D==="svg"&&!o.ownerSVGElement&&p&&(a.push({type:"target",target:o,matrix:Xw(o,c)}),a.push({type:"offset",target:o,matrix:Me(c)}));var J=parseFloat(g("zoom"))||1;if(_)x=k.fixedContainer,v=!0;else{var P=_o(o,r,!1,!0,g),W=P.offsetZoom;if(x=P.offsetParent,v=P.isEnd,V=P.isStatic,y*=W,(P.isCustomElement||W!==1)&&V)H-=x.offsetLeft,X-=x.offsetTop;else if(x_||S_){var Q=P.parentSlotElement;if(Q){for(var re=x,ne=0,Y=0;re&&W_(re);)ne+=re.offsetLeft,Y+=re.offsetTop,re=re.offsetParent;H-=ne,X-=Y}}}if(sf&&!v_&&I&&!z&&V&&(b==="relative"||b==="static")&&(H-=x.offsetLeft,X-=x.offsetTop,l=l||v),_)I&&k.hasTransform&&(R=x.clientLeft,T=x.clientTop);else if(I&&m!==x&&($=x.clientLeft,B=x.clientTop),I&&x===i){var Z=su(o,!1);H+=Z[0],X+=Z[1]}if(a.push({type:"target",target:o,matrix:bo(S,c,M)}),C.length&&(a.push({type:"offset",target:o,matrix:Me(c)}),a.push({type:"target",target:o,matrix:bo(pn(C),c,M)})),I){var ye=o===t,ie=ye?0:o.scrollLeft,ce=ye?0:o.scrollTop;a.push({type:"offset",target:o,matrix:Wr([H-ie+$-R,X-ce+B-T],c)})}else a.push({type:"offset",target:o,origin:M});if(J!==1&&a.push({type:"zoom",target:o,matrix:bo(ol([J,J],c),c,[0,0])}),p||(p=S),f||(f=M),u||(u=j),s||_)break;o=x,l=v,(!n||o===i)&&(s=l)}return p||(p=Me(c)),f||(f=[0,0]),u||(u=[0,0]),{zoom:y,offsetContainer:m,matrixes:a,targetMatrix:p,transformOrigin:f,targetOrigin:u,is3d:d,hasFixed:h}}var Yr=null,Xr=null,xn=null;function vn(t){t?(window.Map&&(Yr=new Map,Xr=new Map),xn=[]):(Yr=null,xn=null,Xr=null)}function H_(t){var r=Xr==null?void 0:Xr.get(t);if(r)return r;var n=Co(t,!0);return Xr&&Xr.set(t,n),n}function Y_(t,r){if(xn){var n=_t(xn,function(a){return a[0][0]==t&&a[0][1]==r});if(n)return n[1]}var o=Cf(t,r,!0);return xn&&xn.push([[t,r],o]),o}function St(t){var r=Yr==null?void 0:Yr.get(t);if(!r){var n=At(t).getComputedStyle(t);if(!Yr)return function(i){return n[i]};r={style:n,cached:{}},Yr.set(t,r)}var o=r.cached,a=r.style;return function(i){return i in o||(o[i]=a[i]),o[i]}}function Kt(t,r,n){var o=n.originalDatas;o.groupable=o.groupable||{};var a=o.groupable;a.childDatas=a.childDatas||[];var i=a.childDatas;return t.moveables.map(function(l,s){return i[s]=i[s]||{},i[s][r]=i[s][r]||{},A(A({},n),{isRequestChild:!0,datas:i[s][r],originalDatas:i[s]})})}function $l(t,r,n,o,a,i,l){var s=!!n.match(/Start$/g),d=!!n.match(/End$/g),c=a.isPinch,f=a.datas,u=Kt(t,r.name,a),p=t.moveables,h=[],m=u.map(function(y,g){var b=p[g],w=b.state,_=w.gestos,C=y;if(s)C=new wn(l).dragStart(o,y),h.push(C);else{if(_[l]||(_[l]=f.childGestos[g]),!_[l])return;C=po(y,w,o,c,i,l),h.push(C)}var S=r[n](b,A(A({},C),{parentFlag:!0}));return d&&(_[l]=null),S});return s&&(f.childGestos=p.map(function(y){return y.state.gestos[l]})),{eventParams:m,childEvents:h}}function gr(t,r,n,o,a,i){a===void 0&&(a=function(f,u){return u});var l=!!n.match(/End$/g),s=Kt(t,r.name,o),d=t.moveables,c=s.map(function(f,u){var p=d[u],h=f;h=a(p,f);var m=r[n](p,A(A({},h),{parentFlag:!0}));return m&&i&&i(p,f,m,u),l&&(p.state.gestos={}),m});return c}function Na(t,r,n,o){var a=n.fixedDirection,i=n.fixedPosition,l=o.datas.startPositions||jt(r.state),s=rt(l,a),d=L(lt(io(-t.rotation/180*Math.PI,3),[s[0]-i[0],s[1]-i[1],1],3),2),c=d[0],f=d[1];return o.datas.originalX=c,o.datas.originalY=f,o}function Sf(t,r,n,o){var a=t.getState(),i=a.renderPoses,l=a.rotation,s=a.direction,d=Jr(t.props,r).zoom,c=yo(l/Math.PI*180),f={},u=t.renderState;u.renderDirectionMap||(u.renderDirectionMap={});var p=u.renderDirectionMap;n.forEach(function(m){var y=m.dir;f[y]=!0});var h=pt(s);return n.map(function(m){var y=m.data,g=m.classNames,b=m.dir,w=vl[b];if(!w||!f[b])return null;p[b]=!0;var _=(pe(c,15)+h*pf[b]+720)%180,C={};return mr(y).forEach(function(S){C["data-".concat(S)]=y[S]}),o.createElement("div",A({className:ae.apply(void 0,K(["control","direction",b,r],L(g),!1)),"data-rotation":_,"data-direction":b},C,{key:"direction-".concat(b),style:Aa.apply(void 0,K([l,d],L(w.map(function(S){return i[S]})),!1))}))})}function xf(t,r,n,o){var a=Jr(t.props,n),i=a.renderDirections,l=i===void 0?r:i,s=a.displayAroundControls;if(!l)return[];var d=l===!0?wl:l;return K(K([],L(s?kf(t,o,n,d):[]),!1),L(Sf(t,n,d.map(function(c){return{data:{},classNames:[],dir:c}}),o)),!1)}function mo(t,r,n,o,a,i){for(var l=[],s=6;s<arguments.length;s++)l[s-6]=arguments[s];var d=Ye(n,o),c=r?pe(d/Math.PI*180,15)%180:-1;return t.createElement("div",{key:"line-".concat(i),className:ae.apply(void 0,K(["line","direction",r?"edge":"",r],L(l),!1)),"data-rotation":c,"data-line-key":i,"data-direction":r,style:wo(n,o,a,d)})}function vf(t,r,n,o,a){var i=n===!0?g_:n;return i.map(function(l,s){var d=L(vl[l],2),c=d[0],f=d[1];if(f!=null)return mo(t,l,o[c],o[f],a,"".concat(r,"Edge").concat(s),r)}).filter(Boolean)}function Ef(t){return function(r,n){var o=Jr(r.props,t).edge;return o&&(o===!0||o.length)?K(K([],L(vf(n,t,o,r.getState().renderPoses,r.props.zoom)),!1),L(X_(r,t,n)),!1):Vf(r,t,n)}}function Vf(t,r,n){return xf(t,wl,r,n)}function X_(t,r,n){return xf(t,["nw","ne","sw","se"],r,n)}function kf(t,r,n,o){var a=t.renderState;a.renderDirectionMap||(a.renderDirectionMap={});var i=t.getState(),l=i.renderPoses,s=i.rotation,d=i.direction,c=a.renderDirectionMap,f=t.props.zoom,u=pt(d),p=s/Math.PI*180;return(o||mr(c)).map(function(h){var m=vl[h];if(!m)return null;var y=(pe(p,15)+u*pf[h]+720)%180,g=["around-control"];return n&&g.push("direction",n),r.createElement("div",{className:ae.apply(void 0,K([],L(g),!1)),"data-rotation":y,"data-direction":h,key:"direction-around-".concat(h),style:Aa.apply(void 0,K([s,f],L(m.map(function(b){return l[b]})),!1))})})}function Dl(t,r,n){var o=t||{},a=o.position,i=a===void 0?"client":a,l=o.left,s=l===void 0?-1/0:l,d=o.top,c=d===void 0?-1/0:d,f=o.right,u=f===void 0?1/0:f,p=o.bottom,h=p===void 0?1/0:p,m={position:i,left:s,top:c,right:u,bottom:h};return{vertical:Nf(m,r,!0),horizontal:Nf(m,n,!1)}}function $a(t,r){var n=t.state,o=n.containerClientRect,a=o.clientHeight,i=o.clientWidth,l=o.clientLeft,s=o.clientTop,d=n.snapOffset,c=d.left,f=d.top,u=d.right,p=d.bottom,h=r||t.props.bounds||{},m=h.position||"client",y=m==="css",g=h.left,b=g===void 0?-1/0:g,w=h.top,_=w===void 0?-1/0:w,C=h.right,S=C===void 0?y?-1/0:1/0:C,x=h.bottom,v=x===void 0?y?-1/0:1/0:x;return y&&(S=i+u-c-S,v=a+p-f-v),{left:b+c-l,right:S+c-l,top:_+f-s,bottom:v+f-s}}function q_(t,r,n){var o=$a(t),a=o.left,i=o.top,l=o.right,s=o.bottom,d=L(n,2),c=d[0],f=d[1],u=L(se(n,r),2),p=u[0],h=u[1];q(p)<dt&&(p=0),q(h)<dt&&(h=0);var m=h>0,y=p>0,g={isBound:!1,offset:0,pos:0},b={isBound:!1,offset:0,pos:0};if(p===0&&h===0)return{vertical:g,horizontal:b};if(p===0)m?s<f&&(b.pos=s,b.offset=f-s):i>f&&(b.pos=i,b.offset=f-i);else if(h===0)y?l<c&&(g.pos=l,g.offset=c-l):a>c&&(g.pos=a,g.offset=c-a);else{var w=h/p,_=n[1]-w*c,C=0,S=0,x=!1;y&&l<=c?(C=w*l+_,S=l,x=!0):!y&&c<=a&&(C=w*a+_,S=a,x=!0),x&&(C<i||C>s)&&(x=!1),x||(m&&s<=f?(C=s,S=(C-_)/w,x=!0):!m&&f<=i&&(C=i,S=(C-_)/w,x=!0)),x&&(g.isBound=!0,g.pos=S,g.offset=c-S,b.isBound=!0,b.pos=C,b.offset=f-C)}return{vertical:g,horizontal:b}}function Nf(t,r,n){var o=t[n?"left":"top"],a=t[n?"right":"bottom"],i=Math.min.apply(Math,K([],L(r),!1)),l=Math.max.apply(Math,K([],L(r),!1)),s=[];return o+1>i&&s.push({direction:"start",isBound:!0,offset:i-o,pos:o}),a-1<l&&s.push({direction:"end",isBound:!0,offset:l-a,pos:a}),s.length||s.push({isBound:!1,offset:0,pos:0}),s.sort(function(d,c){return q(c.offset)-q(d.offset)})}function $f(t,r,n){var o=n?t.map(function(a){return ao(a,n)}):t;return o.some(function(a){return a[0]<r.left&&q(a[0]-r.left)>.1||a[0]>r.right&&q(a[0]-r.right)>.1||a[1]<r.top&&q(a[1]-r.top)>.1||a[1]>r.bottom&&q(a[1]-r.bottom)>.1})}function J_(t,r,n){var o=Ft(t),a=Math.sqrt(o*o-r*r)||0;return[a,-a].sort(function(i,l){return q(i-t[n?0:1])-q(l-t[n?0:1])}).map(function(i){return Ye([0,0],n?[i,r]:[r,i])})}function K_(t,r,n,o,a){if(!t.props.bounds)return[];var i=a*Math.PI/180,l=$a(t),s=l.left,d=l.top,c=l.right,f=l.bottom,u=s-o[0],p=c-o[0],h=d-o[1],m=f-o[1],y={left:u,top:h,right:p,bottom:m};if(!$f(n,y,0))return[];var g=[];return[[u,0],[p,0],[h,1],[m,1]].forEach(function(b){var w=L(b,2),_=w[0],C=w[1];n.forEach(function(S){var x=Ye([0,0],S);g.push.apply(g,K([],L(J_(S,_,C).map(function(v){return i+v-x}).filter(function(v){return!$f(r,y,v)}).map(function(v){return pe(v*180/Math.PI,dt)})),!1))})}),g}var Z_=["left","right","center"],Q_=["top","bottom","middle"],Df={left:"start",right:"end",center:"center",top:"start",bottom:"end",middle:"center"},kr={start:"left",end:"right",center:"center"},Nr={start:"top",end:"bottom",center:"middle"};function En(){return{left:!1,top:!1,right:!1,bottom:!1}}function Vn(t,r){var n=t.props,o=n.snappable,a=n.bounds,i=n.innerBounds,l=n.verticalGuidelines,s=n.horizontalGuidelines,d=n.snapGridWidth,c=n.snapGridHeight,f=t.state,u=f.guidelines,p=f.enableSnap;return!o||!p||r&&o!==!0&&o.indexOf(r)<0?!1:!!(d||c||a||i||u&&u.length||l&&l.length||s&&s.length)}function Bl(t){return t===!1?{}:t===!0||!t?{left:!0,right:!0,top:!0,bottom:!0}:t}function ew(t,r){var n=Bl(t),o={};for(var a in n)a in r&&n[a]&&(o[a]=r[a]);return o}function Tl(t,r){var n=ew(t,r),o=Q_.filter(function(i){return i in n}),a=Z_.filter(function(i){return i in n});return{horizontalNames:o,verticalNames:a,horizontal:o.map(function(i){return n[i]}),vertical:a.map(function(i){return n[i]})}}function tw(t,r,n){var o=Ge(t,[r.clientLeft,r.clientTop],n);return[r.left+o[0],r.top+o[1]]}function rw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];Math.abs(a)<Ze&&(a=0),Math.abs(i)<Ze&&(i=0);var l=0,s=0,d=0;return a?i?(l=-i/a,s=1,d=l*n[0]-n[1]):(s=1,d=-n[1]):(l=-1,d=n[0]),[l,s,d].map(function(c){return pe(c,Ze)})}var Bf="snapRotationThreshold",Tf="snapRotationDegrees",Of="snapHorizontalThreshold",If="snapVerticalThreshold";function Da(t,r,n,o,a,i,l){var s;o===void 0&&(o=[]),a===void 0&&(a=[]);var d=t.props,c=((s=t.state.snapThresholdInfo)===null||s===void 0?void 0:s.multiples)||[1,1],f=yu(l,d[Of],5),u=yu(i,d[If],5);return zf(t.state.guidelines,r,n,o,a,f,u,c)}function zf(t,r,n,o,a,i,l,s){return{vertical:Mf(t,"vertical",r,l*s[0],o),horizontal:Mf(t,"horizontal",n,i*s[1],a)}}function nw(t,r,n){var o=L(n,2),a=o[0],i=o[1],l=L(r,2),s=l[0],d=l[1],c=L(se(n,r),2),f=c[0],u=c[1],p=u>0,h=f>0;f=Pa(f),u=Pa(u);var m={isSnap:!1,offset:0,pos:0},y={isSnap:!1,offset:0,pos:0};if(f===0&&u===0)return{vertical:m,horizontal:y};var g=Da(t,f?[a]:[],u?[i]:[],[],[],void 0,void 0),b=g.vertical,w=g.horizontal;b.posInfos.filter(function(D){var I=D.pos;return h?I>=s:I<=s}),w.posInfos.filter(function(D){var I=D.pos;return p?I>=d:I<=d}),b.isSnap=b.posInfos.length>0,w.isSnap=w.posInfos.length>0;var _=Ol(b),C=_.isSnap,S=_.guideline,x=Ol(w),v=x.isSnap,V=x.guideline,$=v?V.pos[1]:0,B=C?S.pos[0]:0;if(f===0)v&&(y.isSnap=!0,y.pos=V.pos[1],y.offset=i-y.pos);else if(u===0)C&&(m.isSnap=!0,m.pos=B,m.offset=a-B);else{var R=u/f,T=n[1]-R*a,k=0,O=0,N=!1;C?(O=B,k=R*O+T,N=!0):v&&(k=$,O=(k-T)/R,N=!0),N&&(m.isSnap=!0,m.pos=O,m.offset=a-O,y.isSnap=!0,y.pos=k,y.offset=i-k)}return{vertical:m,horizontal:y}}function $r(t){var r="";return t===-1||t==="top"||t==="left"?r="start":t===0||t==="center"||t==="middle"?r="center":(t===1||t==="right"||t==="bottom")&&(r="end"),r}function Rf(t,r,n,o){var a=Tl(t.props.snapDirections,r),i=Da(t,a.vertical,a.horizontal,a.verticalNames.map(function(d){return $r(d)}),a.horizontalNames.map(function(d){return $r(d)}),n,o),l=$r(a.horizontalNames[i.horizontal.index]),s=$r(a.verticalNames[i.vertical.index]);return{vertical:A(A({},i.vertical),{direction:s}),horizontal:A(A({},i.horizontal),{direction:l})}}function Ol(t){var r=t.isSnap;if(!r)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var n=t.posInfos[0],o=n.guidelineInfos[0],a=o.offset,i=o.dist,l=o.guideline;return{isSnap:r,offset:a,dist:i,pos:n.pos,guideline:l}}function Mf(t,r,n,o,a){var i,l;if(a===void 0&&(a=[]),!t||!t.length)return{isSnap:!1,index:-1,direction:"",posInfos:[]};var s=r==="vertical",d=s?0:1,c=n.map(function(u,p){var h=a[p]||"",m=t.map(function(y){var g=y.pos,b=u-g[d];return{offset:b,dist:q(b),guideline:y,direction:h}}).filter(function(y){var g=y.guideline,b=y.dist,w=g.type;return!(w!==r||b>o)}).sort(function(y,g){return y.dist-g.dist});return{pos:u,index:p,guidelineInfos:m,direction:h}}).filter(function(u){return u.guidelineInfos.length>0}).sort(function(u,p){return u.guidelineInfos[0].dist-p.guidelineInfos[0].dist}),f=c.length>0;return{isSnap:f,index:f?c[0].index:-1,direction:(l=(i=c[0])===null||i===void 0?void 0:i.direction)!==null&&l!==void 0?l:"",posInfos:c}}function ow(t,r,n,o,a){var i=[];n[0]&&n[1]?i=[n,[-n[0],n[1]],[n[0],-n[1]]]:!n[0]&&!n[1]?[[-1,-1],[1,-1],[1,1],[-1,1]].forEach(function(p,h,m){var y=m[h+1]||m[0];i.push(p),i.push([(p[0]+y[0])/2,(p[1]+y[1])/2])}):t.props.keepRatio?i.push([-1,-1],[-1,1],[1,-1],[1,1],n):(i.push.apply(i,K([],L(O_([[-1,-1],[1,-1],[-1,-1],[1,1]],n)),!1)),i.length>1&&i.push([(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]));var l=i.map(function(p){return rt(r,p)}),s=l.map(function(p){return p[0]}),d=l.map(function(p){return p[1]}),c=Da(t,s,d,i.map(function(p){return $r(p[0])}),i.map(function(p){return $r(p[1])}),o,a),f=$r(i.map(function(p){return p[0]})[c.vertical.index]),u=$r(i.map(function(p){return p[1]})[c.horizontal.index]);return{vertical:A(A({},c.vertical),{direction:f}),horizontal:A(A({},c.horizontal),{direction:u})}}function Af(t,r){var n=q(t.offset),o=q(r.offset);return t.isBound&&r.isBound?o-n:t.isBound?-1:r.isBound?1:t.isSnap&&r.isSnap?o-n:t.isSnap?-1:r.isSnap||n<dt?1:o<dt?-1:n-o}function Ba(t,r){return t.slice().sort(function(n,o){var a=n.sign[r],i=o.sign[r],l=n.offset[r],s=o.offset[r];if(a){if(!i)return-1}else return 1;return Af({isBound:n.isBound,isSnap:n.isSnap,offset:l},{isBound:o.isBound,isSnap:o.isSnap,offset:s})})[0]}function aw(t,r,n){var o=[];if(n)q(r[0])!==1||q(r[1])!==1?o.push([r,[-1,-1]],[r,[-1,1]],[r,[1,-1]],[r,[1,1]]):o.push([r,[t[0],-t[1]]],[r,[-t[0],t[1]]]),o.push([r,t]);else if(t[0]&&t[1]||!t[0]&&!t[1]){var a=t[0]?t:[1,1];[1,-1].forEach(function(l){[1,-1].forEach(function(s){var d=[l*a[0],s*a[1]];r[0]===d[0]&&r[1]===d[1]||o.push([r,d])})})}else if(t[0]){var i=q(r[0])===1?[1]:[1,-1];i.forEach(function(l){o.push([[r[0],-1],[l*t[0],-1]],[[r[0],0],[l*t[0],0]],[[r[0],1],[l*t[0],1]])})}else if(t[1]){var i=q(r[1])===1?[1]:[1,-1];i.forEach(function(s){o.push([[-1,r[1]],[-1,s*t[1]]],[[0,r[1]],[0,s*t[1]]],[[1,r[1]],[1,s*t[1]]])})}return o}function Lf(t,r){var n=Pi([r[0][0],r[1][0]]),o=Pi([r[0][1],r[1][1]]);return{vertical:n<=t[0],horizontal:o<=t[1]}}function Il(t,r){var n=L(r,2),o=n[0],a=n[1],i=a[0]-o[0],l=a[1]-o[1];q(i)<dt&&(i=0),q(l)<dt&&(l=0);var s,d;if(!i)s=o[0],d=t[0];else if(!l)s=o[1],d=t[1];else{var c=l/i;s=c*(t[0]-o[0])+o[1],d=t[1]}return s-d}function Ff(t,r,n,o){return o===void 0&&(o=dt),t.every(function(a){var i=Il(a,r),l=i<=0;return l===n||q(i)<=o})}function jf(t,r,n,o,a){return a===void 0&&(a=0),o&&r-a<=t||!o&&t<=n+a?{isBound:!0,offset:o?r-t:n-t}:{isBound:!1,offset:0}}function iw(t,r){var n=r.line,o=r.centerSign,a=r.verticalSign,i=r.horizontalSign,l=r.lineConstants,s=t.props.innerBounds;if(!s)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var d=s.left,c=s.top,f=s.width,u=s.height,p=[[d,c],[d,c+u]],h=[[d,c],[d+f,c]],m=[[d+f,c],[d+f,c+u]],y=[[d,c+u],[d+f,c+u]];if(Ff([[d,c],[d+f,c],[d,c+u],[d+f,c+u]],n,o))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var g=Dr(n,l,h,a),b=Dr(n,l,y,a),w=Dr(n,l,p,i),_=Dr(n,l,m,i),C=g.isBound&&b.isBound,S=g.isBound||b.isBound,x=w.isBound&&_.isBound,v=w.isBound||_.isBound,V=Nn(g.offset,b.offset),$=Nn(w.offset,_.offset),B=[0,0],R=!1,T=!1;return q($)<q(V)?(B=[V,0],R=S,T=C):(B=[0,$],R=v,T=x),{isAllBound:T,isVerticalBound:S,isHorizontalBound:v,isBound:R,offset:B}}function Dr(t,r,n,o,a,i){var l=L(r,2),s=l[0],d=l[1],c=t[0],f=n[0],u=n[1],p=Pa(u[1]-f[1]),h=Pa(u[0]-f[0]),m=d,y=s,g=-s/d;if(h){if(!p){if(i&&!m)return{isBound:!1,offset:0};if(y){var C=(f[1]-c[1])/g+c[0];return jf(C,f[0],u[0],o,a)}else{var w=f[1]-c[1],_=q(w)<=(a||0);return{isBound:_,offset:_?w:0}}}}else{if(i&&!y)return{isBound:!1,offset:0};if(m){var b=g*(f[0]-c[0])+c[1];return jf(b,f[1],u[1],o,a)}else{var w=f[0]-c[0],_=q(w)<=(a||0);return{isBound:_,offset:_?w:0}}}return{isBound:!1,offset:0}}function Pf(t,r,n){return r.map(function(o){var a=iw(t,o),i=a.isBound,l=a.offset,s=a.isVerticalBound,d=a.isHorizontalBound,c=o.multiple,f=ar({datas:n,distX:l[0],distY:l[1]}).map(function(u,p){return u*(c[p]?2/c[p]:0)});return{sign:c,isBound:i,isVerticalBound:s,isHorizontalBound:d,isSnap:!1,offset:f}})}function lw(t,r,n){var o,a=zl(t,r,[0,0],!1).map(function(p){return A(A({},p),{multiple:p.multiple.map(function(h){return q(h)*2})})}),i=Pf(t,a,n),l=Ba(i,0),s=Ba(i,1),d=0,c=0,f=l.isVerticalBound||s.isVerticalBound,u=l.isHorizontalBound||s.isHorizontalBound;return(f||u)&&(o=L(B_({datas:n,distX:-l.offset[0],distY:-s.offset[1]}),2),d=o[0],c=o[1]),{vertical:{isBound:f,offset:d},horizontal:{isBound:u,offset:c}}}function sw(t,r){var n=[],o=t[0],a=t[1];return o&&a?n.push([[0,a*2],t,[-o,a]],[[o*2,0],t,[o,-a]]):o?(n.push([[o*2,0],[o,1],[o,-1]]),r&&n.push([[0,-1],[o,-1],[-o,-1]],[[0,1],[o,1],[-o,1]])):a?(n.push([[0,a*2],[1,a],[-1,a]]),r&&n.push([[-1,0],[-1,a],[-1,-a]],[[1,0],[1,a],[1,-a]])):n.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),n}function zl(t,r,n,o){var a=t.state,i=a.allMatrix,l=a.is3d,s=qr(i,100,100,l?4:3),d=rt(s,[0,0]);return sw(n,o).map(function(c){var f=L(c,3),u=f[0],p=f[1],h=f[2],m=[rt(s,p),rt(s,h)],y=rw(m),g=Lf(d,m),b=g.vertical,w=g.horizontal,_=Il(d,m)<=0;return{multiple:u,centerSign:_,verticalSign:b,horizontalSign:w,lineConstants:y,line:[rt(r,p),rt(r,h)]}})}function Uf(t,r,n,o){var a=o?t.map(function(i){return ao(i,o)}):t;return[[a[0],a[1]],[a[1],a[3]],[a[3],a[2]],[a[2],a[0]]].some(function(i){var l=Il(n,i)<=0;return!Ff(r,i,l)})}function cw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];if(!a)return q(n[0]);if(!i)return q(n[1]);var l=i/a;return q((-l*n[0]+n[1])/Math.sqrt(Math.pow(l,2)+1))}function dw(t){var r=L(t,2),n=r[0],o=r[1],a=o[0]-n[0],i=o[1]-n[1];if(!a)return[n[0],0];if(!i)return[0,n[1]];var l=i/a,s=-l*n[0]+n[1];return[-s/(l+1/l),s/(l*l+1)]}function fw(t,r,n,o,a){var i=t.props.innerBounds,l=a*Math.PI/180;if(!i)return[];var s=i.left,d=i.top,c=i.width,f=i.height,u=s-o[0],p=s+c-o[0],h=d-o[1],m=d+f-o[1],y=[[u,h],[p,h],[u,m],[p,m]],g=rt(n,[0,0]);if(!Uf(n,y,g,0))return[];var b=[],w=y.map(function(_){return[Ft(_),Ye([0,0],_)]});return[[n[0],n[1]],[n[1],n[3]],[n[3],n[2]],[n[2],n[0]]].forEach(function(_){var C=Ye([0,0],dw(_)),S=cw(_);b.push.apply(b,K([],L(w.filter(function(x){var v=L(x,1),V=v[0];return V&&S<=V}).map(function(x){var v=L(x,2),V=v[0],$=v[1],B=Math.acos(V?S/V:0),R=$+B,T=$-B;return[l+R-C,l+T-C]}).reduce(function(x,v){return x.push.apply(x,K([],L(v),!1)),x},[]).filter(function(x){return!Uf(r,y,g,x)}).map(function(x){return pe(x*180/Math.PI,dt)})),!1))}),b}function uw(t){var r=t.props.innerBounds,n=En();if(!r)return{boundMap:n,vertical:[],horizontal:[]};var o=t.getRect(),a=o.pos1,i=o.pos2,l=o.pos3,s=o.pos4,d=[a,i,l,s],c=rt(d,[0,0]),f=r.left,u=r.top,p=r.width,h=r.height,m=[[f,u],[f,u+h]],y=[[f,u],[f+p,u]],g=[[f+p,u],[f+p,u+h]],b=[[f,u+h],[f+p,u+h]],w=zl(t,d,[0,0],!1),_=[],C=[];return w.forEach(function(S){var x=S.line,v=S.lineConstants,V=Lf(c,x),$=V.horizontal,B=V.vertical,R=Dr(x,v,y,B,1,!0),T=Dr(x,v,b,B,1,!0),k=Dr(x,v,m,$,1,!0),O=Dr(x,v,g,$,1,!0);R.isBound&&!n.top&&(_.push(u),n.top=!0),T.isBound&&!n.bottom&&(_.push(u+h),n.bottom=!0),k.isBound&&!n.left&&(C.push(f),n.left=!0),O.isBound&&!n.right&&(C.push(f+p),n.right=!0)}),{boundMap:n,horizontal:_,vertical:C}}function pw(t,r,n,o){var a=r[0]-t[0],i=r[1]-t[1];if(q(a)<Ze&&(a=0),q(i)<Ze&&(i=0),!a)return o?[0,0]:[0,n];if(!i)return o?[n,0]:[0,0];var l=i/a,s=t[1]-l*t[0];if(o){var d=l*(r[0]+n)+s;return[n,d-r[1]]}else{var c=(r[1]+n-s)/l;return[c-r[0],n]}}function Rl(t,r,n,o,a){var i=pw(t,r,n,o);if(!i)return{isOutside:!1,offset:[0,0]};var l=nr(t,r),s=nr(i,t),d=nr(i,r),c=s>l||d>l,f=L(ar({datas:a,distX:i[0],distY:i[1]}),2),u=f[0],p=f[1];return{offset:[u,p],isOutside:c}}function Ta(t,r){return t.isBound?t.offset:r.isSnap?Ol(r).offset:0}function hw(t,r,n,o,a){var i=L(r,2),l=i[0],s=i[1],d=L(n,2),c=d[0],f=d[1],u=L(o,2),p=u[0],h=u[1],m=L(a,2),y=m[0],g=m[1],b=-y,w=-g;if(t&&l&&s){b=0,w=0;var _=[];if(c&&f?_.push([0,g],[y,0]):c?_.push([y,0]):f?_.push([0,g]):p&&h?_.push([0,g],[y,0]):p?_.push([y,0]):h&&_.push([0,g]),_.length){_.sort(function(v,V){return Ft(se([l,s],v))-Ft(se([l,s],V))});var C=_[0];if(C[0]&&q(l)>Ze)b=-C[0],w=s*q(l+b)/q(l)-s;else if(C[1]&&q(s)>Ze){var S=s;w=-C[1],b=l*q(s+w)/q(S)-l}if(t&&f&&c)if(q(b)>Ze&&q(b)<q(y)){var x=q(y)/q(b);b*=x,w*=x}else if(q(w)>Ze&&q(w)<q(g)){var x=q(g)/q(w);b*=x,w*=x}else b=Nn(-y,b),w=Nn(-g,w)}}else b=l||c?-y:0,w=s||f?-g:0;return[b,w]}function mw(t,r,n,o,a,i){if(!Vn(t,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var l=Xl(i.absolutePoses,[r,n]),s=Lt(l),d=s.left,c=s.right,f=s.top,u=s.bottom,p={horizontal:l.map(function(O){return O[1]}),vertical:l.map(function(O){return O[0]})},h=Bl(t.props.snapDirections),m=Tl(h,{left:d,right:c,top:f,bottom:u,center:(d+c)/2,middle:(f+u)/2}),y=Oa(t,a,m,p),g=y.vertical,b=y.horizontal,w=lw(t,l,i),_=w.vertical,C=w.horizontal,S=g.isSnap,x=b.isSnap,v=g.isBound||_.isBound,V=b.isBound||C.isBound,$=Nn(g.offset,_.offset),B=Nn(b.offset,C.offset),R=L(hw(o,[r,n],[v,V],[S,x],[$,B]),2),T=R[0],k=R[1];return[{isBound:v,isSnap:S,offset:T},{isBound:V,isSnap:x,offset:k}]}function Oa(t,r,n,o){o===void 0&&(o=n);var a=Dl($a(t),o.vertical,o.horizontal),i=a.horizontal,l=a.vertical,s=r?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Da(t,n.vertical,n.horizontal,void 0,void 0,void 0,void 0),d=s.horizontal,c=s.vertical,f=Ta(i[0],d),u=Ta(l[0],c),p=q(f),h=q(u);return{horizontal:{isBound:i[0].isBound,isSnap:d.isSnap,snapIndex:d.index,offset:f,dist:p,bounds:i,snap:d},vertical:{isBound:l[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:u,dist:h,bounds:l,snap:c}}}function Wf(t,r,n,o,a,i,l){l===void 0&&(l=[1,1]);var s=Dl(r,n,o),d=s.horizontal,c=s.vertical,f=zf(t,n,o,[],[],a,i,l),u=f.horizontal,p=f.vertical,h=Ta(d[0],u),m=Ta(c[0],p),y=q(h),g=q(m);return{horizontal:{isBound:d[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:h,dist:y,bounds:d,snap:u},vertical:{isBound:c[0].isBound,isSnap:p.isSnap,snapIndex:p.index,offset:m,dist:g,bounds:c,snap:p}}}function gw(t,r,n,o){var a=Ye(t,r)/Math.PI*180,i=n.vertical,l=i.isBound,s=i.isSnap,d=i.dist,c=n.horizontal,f=c.isBound,u=c.isSnap,p=c.dist,h=a%180,m=h<3||h>177,y=h>87&&h<93;return p<d&&(l||s&&!y&&(!o||!m))?"vertical":f||u&&!m&&(!o||!y)?"horizontal":""}function yw(t,r,n,o,a,i){return n.map(function(l){var s=L(l,2),d=s[0],c=s[1],f=rt(r,d),u=rt(r,c),p=o?bw(t,f,u,a):Oa(t,a,{vertical:[u[0]],horizontal:[u[1]]}),h=p.horizontal,m=h.offset,y=h.isBound,g=h.isSnap,b=p.vertical,w=b.offset,_=b.isBound,C=b.isSnap,S=se(c,d);if(!w&&!m)return{isBound:_||y,isSnap:C||g,sign:S,offset:[0,0]};var x=gw(f,u,p,o);if(!x)return{sign:S,isBound:!1,isSnap:!1,offset:[0,0]};var v=x==="vertical",V=[0,0];return!o&&q(c[0])===1&&q(c[1])===1&&d[0]!==c[0]&&d[1]!==c[1]?V=ar({datas:i,distX:-w,distY:-m}):V=Rl(f,u,-(v?w:m),v,i).offset,V=V.map(function($,B){return $*(S[B]?2/S[B]:0)}),{sign:S,isBound:v?_:y,isSnap:v?C:g,offset:V}})}function Gf(t,r){return t.isBound?t.offset:r.isSnap?r.offset:0}function bw(t,r,n,o){var a=q_(t,r,n),i=a.horizontal,l=a.vertical,s=o?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:nw(t,r,n),d=s.horizontal,c=s.vertical,f=Gf(i,d),u=Gf(l,c),p=q(f),h=q(u);return{horizontal:{isBound:i.isBound,isSnap:d.isSnap,offset:f,dist:p},vertical:{isBound:l.isBound,isSnap:c.isSnap,offset:u,dist:h}}}function _w(t,r,n,o,a){var i=[-n[0],-n[1]],l=t.state,s=l.width,d=l.height,c=t.props.bounds,f=1/0,u=1/0;if(c){var p=[[n[0],-n[1]],[-n[0],n[1]]],h=c.left,m=h===void 0?-1/0:h,y=c.top,g=y===void 0?-1/0:y,b=c.right,w=b===void 0?1/0:b,_=c.bottom,C=_===void 0?1/0:_;p.forEach(function(S){var x=S[0]!==i[0],v=S[1]!==i[1],V=rt(r,S),$=Ye(o,V)*360/Math.PI;if(v){var B=V.slice();(q($-360)<2||q($-180)<2)&&(B[1]=o[1]);var R=Rl(o,B,(o[1]<V[1]?C:g)-V[1],!1,a),T=L(R.offset,2),k=T[1],O=R.isOutside;isNaN(k)||(u=d+(O?1:-1)*q(k))}if(x){var B=V.slice();(q($-90)<2||q($-270)<2)&&(B[0]=o[0]);var N=Rl(o,B,(o[0]<V[0]?w:m)-V[0],!0,a),D=L(N.offset,1),I=D[0],z=N.isOutside;isNaN(I)||(f=s+(z?1:-1)*q(I))}})}return{maxWidth:f,maxHeight:u}}var ft={name:"draggable",props:["draggable","throttleDrag","throttleDragRotate","hideThrottleDragRotateLine","startDragRotate","edgeDraggable"],events:["dragStart","drag","dragEnd","dragGroupStart","dragGroup","dragGroupEnd"],requestStyle:function(){return["left","top","right","bottom"]},requestChildStyle:function(){return["left","top","right","bottom"]},render:function(t,r){var n=t.props,o=n.hideThrottleDragRotateLine,a=n.throttleDragRotate,i=n.zoom,l=t.getState(),s=l.dragInfo,d=l.beforeOrigin;if(o||!a||!s)return[];var c=s.dist;if(!c[0]&&!c[1])return[];var f=Ft(c),u=Ye(c,[0,0]);return[r.createElement("div",{className:ae("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:"".concat(f,"px"),transform:"translate(".concat(d[0],"px, ").concat(d[1],"px) rotate(").concat(u,"rad) scaleY(").concat(i,")")}})]},dragStart:function(t,r){var n=r.datas,o=r.parentEvent,a=r.parentGesto,i=t.state,l=i.gestos,s=i.style;if(l.draggable)return!1;l.draggable=a||t.targetGesto,n.datas={},n.left=parseFloat(s.left||"")||0,n.top=parseFloat(s.top||"")||0,n.bottom=parseFloat(s.bottom||"")||0,n.right=parseFloat(s.right||"")||0,n.startValue=[0,0],Hr(t,r),va(t,r,"translate"),Aw(t,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1,n.deltaOffset=[0,0];var d=ge(t,r,A({set:function(f){n.startValue=f}},xa(t,r))),c=o||te(t,"onDragStart",d);return c!==!1?(n.isDrag=!0,t.state.dragInfo={startRect:t.getRect(),dist:[0,0]}):(l.draggable=null,n.isPinch=!1),n.isDrag?d:!1},drag:function(t,r){if(r){Ca(t,r,"translate");var n=r.datas,o=r.parentEvent,a=r.parentFlag,i=r.isPinch,l=r.deltaOffset,s=r.useSnap,d=r.isRequest,c=r.isGroup,f=r.parentThrottleDrag,u=r.distX,p=r.distY,h=n.isDrag,m=n.prevDist,y=n.prevBeforeDist,g=n.startValue;if(h){l&&(u+=l[0],p+=l[1]);var b=t.props,w=b.parentMoveable,_=c?0:b.throttleDrag||f||0,C=o?0:b.throttleDragRotate||0,S=0,x=!1,v=!1,V=!1,$=!1;if(!o&&C>0&&(u||p)){var B=b.startDragRotate||0,R=pe(B+Ye([0,0],[u,p])*180/Math.PI,C)-B,T=p*Math.abs(Math.cos((R-90)/180*Math.PI)),k=u*Math.abs(Math.cos(R/180*Math.PI)),O=Ft([k,T]);S=R*Math.PI/180,u=O*Math.cos(S),p=O*Math.sin(S)}if(!i&&!o&&!a){var N=L(mw(t,u,p,C,!s&&d||l,n),2),D=N[0],I=N[1];x=D.isSnap,v=D.isBound,V=I.isSnap,$=I.isBound;var z=D.offset,M=I.offset;u+=z,p+=M}var j=xe(yf({datas:n,distX:u,distY:p}),g),F=xe(D_({datas:n,distX:u,distY:p}),g);bd(F,dt),bd(j,dt),C||(!x&&!v&&(F[0]=pe(F[0],_),j[0]=pe(j[0],_)),!V&&!$&&(F[1]=pe(F[1],_),j[1]=pe(j[1],_)));var G=se(j,g),H=se(F,g),X=se(H,m),J=se(G,y);n.prevDist=H,n.prevBeforeDist=G,n.passDelta=X,n.passDist=H;var P=n.left+G[0],W=n.top+G[1],Q=n.right-G[0],re=n.bottom-G[1],ne=Sa(n,"translate(".concat(F[0],"px, ").concat(F[1],"px)"),"translate(".concat(H[0],"px, ").concat(H[1],"px)"));if(kl(r,ne),t.state.dragInfo.dist=o?[0,0]:H,!(!o&&!w&&X.every(function(ce){return!ce})&&J.some(function(ce){return!ce}))){var Y=t.state,Z=Y.width,ye=Y.height,ie=ge(t,r,A({transform:ne,dist:H,delta:X,translate:F,beforeDist:G,beforeDelta:J,beforeTranslate:j,left:P,top:W,right:Q,bottom:re,width:Z,height:ye,isPinch:i},ut({transform:ne},r)));return!o&&te(t,"onDrag",ie),ie}}}},dragAfter:function(t,r){var n=r.datas,o=n.deltaOffset;return o[0]||o[1]?(n.deltaOffset=[0,0],this.drag(t,A(A({},r),{deltaOffset:o}))):!1},dragEnd:function(t,r){var n=r.parentEvent,o=r.datas;if(t.state.dragInfo=null,!!o.isDrag){o.isDrag=!1;var a=Dt(t,r,{});return!n&&te(t,"onDragEnd",a),a}},dragGroupStart:function(t,r){var n,o,a=r.datas,i=r.clientX,l=r.clientY,s=this.dragStart(t,r);if(!s)return!1;var d=$l(t,this,"dragStart",[i||0,l||0],r,!1,"draggable"),c=d.childEvents,f=d.eventParams,u=A(A({},s),{targets:t.props.targets,events:f}),p=te(t,"onDragGroupStart",u);a.isDrag=p!==!1;var h=(o=(n=c[0])===null||n===void 0?void 0:n.datas.startValue)!==null&&o!==void 0?o:[0,0];return a.throttleOffset=[h[0]%1,h[1]%1],a.isDrag?s:!1},dragGroup:function(t,r){var n=r.datas;if(n.isDrag){var o=this.drag(t,A(A({},r),{parentThrottleDrag:t.props.throttleDrag})),a=r.datas.passDelta,i=$l(t,this,"drag",a,r,!1,"draggable").eventParams;if(o){var l=A({targets:t.props.targets,events:i},o);return te(t,"onDragGroup",l),l}}},dragGroupEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isDrag){this.dragEnd(t,r);var a=$l(t,this,"dragEnd",[0,0],r,!1,"draggable").eventParams;return te(t,"onDragGroupEnd",Dt(t,r,{targets:t.props.targets,events:a})),n}},request:function(t){var r={},n=t.getRect(),o=0,a=0,i=!1;return{isControl:!1,requestStart:function(l){return i=l.useSnap,{datas:r,useSnap:i}},request:function(l){return"x"in l?o=l.x-n.left:"deltaX"in l&&(o+=l.deltaX),"y"in l?a=l.y-n.top:"deltaY"in l&&(a+=l.deltaY),{datas:r,distX:o,distY:a,useSnap:i}},requestEnd:function(){return{datas:r,isDrag:!0,useSnap:i}}}},unset:function(t){t.state.gestos.draggable=null,t.state.dragInfo=null}};function Hf(t,r){var n=rt(t,r),o=[0,0];return{fixedPosition:n,fixedDirection:r,fixedOffset:o}}function ww(t,r){var n=t.allMatrix,o=t.is3d,a=t.width,i=t.height,l=o?4:3,s=[a/2*(1+r[0]),i/2*(1+r[1])],d=Ge(n,s,l),c=[0,0];return{fixedPosition:d,fixedDirection:r,fixedOffset:c}}function Yf(t,r){var n=t.allMatrix,o=t.is3d,a=t.width,i=t.height,l=o?4:3,s=A_(r,a,i),d=Ge(n,r,l),c=[a?0:r[0],i?0:r[1]];return{fixedPosition:d,fixedDirection:s,fixedOffset:c}}var Xf=Ql("resizable"),Ml={name:"resizable",ableGroup:"size",canPinch:!0,props:["resizable","throttleResize","renderDirections","displayAroundControls","keepRatio","resizeFormat","keepRatioFinally","edge","checkResizableError"],events:["resizeStart","beforeResize","resize","resizeEnd","resizeGroupStart","beforeResizeGroup","resizeGroup","resizeGroupEnd"],render:Ef("resizable"),dragControlCondition:Xf,viewClassName:Zl("resizable"),dragControlStart:function(t,r){var n,o=r.inputEvent,a=r.isPinch,i=r.isGroup,l=r.parentDirection,s=r.parentGesto,d=r.datas,c=r.parentFixedDirection,f=r.parentEvent,u=hu(l,a,o,d),p=t.state,h=p.target,m=p.width,y=p.height,g=p.gestos;if(!u||!h||g.resizable)return!1;g.resizable=s||t.controlGesto,!a&&Hr(t,r),d.datas={},d.direction=u,d.startOffsetWidth=m,d.startOffsetHeight=y,d.prevWidth=0,d.prevHeight=0,d.minSize=[0,0],d.startWidth=p.inlineCSSWidth||p.cssWidth,d.startHeight=p.inlineCSSHeight||p.cssHeight,d.maxSize=[1/0,1/0],i||(d.minSize=[p.minOffsetWidth,p.minOffsetHeight],d.maxSize=[p.maxOffsetWidth,p.maxOffsetHeight]);var b=t.props.transformOrigin||"% %";d.transformOrigin=b&&at(b)?b.split(" "):b,d.startOffsetMatrix=p.offsetMatrix,d.startTransformOrigin=p.transformOrigin,d.isWidth=(n=r==null?void 0:r.parentIsWidth)!==null&&n!==void 0?n:!u[0]&&!u[1]||u[0]||!u[1];function w($){d.ratio=$&&isFinite($)?$:0}d.startPositions=jt(t.state);function _($){var B=Hf(d.startPositions,$);d.fixedDirection=B.fixedDirection,d.fixedPosition=B.fixedPosition,d.fixedOffset=B.fixedOffset}function C($){var B=Yf(t.state,$);d.fixedDirection=B.fixedDirection,d.fixedPosition=B.fixedPosition,d.fixedOffset=B.fixedOffset}function S($){d.minSize=[Te("".concat($[0]),0)||0,Te("".concat($[1]),0)||0]}function x($){var B=[$[0]||1/0,$[1]||1/0];(!un(B[0])||isFinite(B[0]))&&(B[0]=Te("".concat(B[0]),0)||1/0),(!un(B[1])||isFinite(B[1]))&&(B[1]=Te("".concat(B[1]),0)||1/0),d.maxSize=B}w(m/y),_(c||[-u[0],-u[1]]),d.setFixedDirection=_,d.setFixedPosition=C,d.setMin=S,d.setMax=x;var v=ge(t,r,{direction:u,startRatio:d.ratio,set:function($){var B=L($,2),R=B[0],T=B[1];d.startWidth=R,d.startHeight=T},setMin:S,setMax:x,setRatio:w,setFixedDirection:_,setFixedPosition:C,setOrigin:function($){d.transformOrigin=$},dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))}),V=f||te(t,"onResizeStart",v);return d.startFixedDirection=d.fixedDirection,d.startFixedPosition=d.fixedPosition,V!==!1&&(d.isResize=!0,t.state.snapRenderInfo={request:r.isRequest,direction:u}),d.isResize?v:!1},dragControl:function(t,r){var n,o=r.datas,a=r.parentFlag,i=r.isPinch,l=r.parentKeepRatio,s=r.dragClient,d=r.parentDist,c=r.useSnap,f=r.isRequest,u=r.isGroup,p=r.parentEvent,h=r.resolveMatrix,m=o.isResize,y=o.transformOrigin,g=o.startWidth,b=o.startHeight,w=o.prevWidth,_=o.prevHeight,C=o.minSize,S=o.maxSize,x=o.ratio,v=o.startOffsetWidth,V=o.startOffsetHeight,$=o.isWidth;if(!m)return;if(h){var B=t.state.is3d,R=o.startOffsetMatrix,T=o.startTransformOrigin,k=B?4:3,O=pn(Ea(r)),N=Math.sqrt(O.length);k!==N&&(O=Jt(O,N,k));var D=ho(R,O,T,k),I=qr(D,v,V,k);o.startPositions=I,o.nextTargetMatrix=O,o.nextAllMatrix=D}var z=Jr(t.props,"resizable"),M=z.resizeFormat,j=z.throttleResize,F=j===void 0?a?0:1:j,G=z.parentMoveable,H=z.keepRatioFinally,X=o.direction,J=X,P=0,W=0;!X[0]&&!X[1]&&(J=[1,1]);var Q=x&&(l??z.keepRatio)||!1;function re(){var we=o.fixedDirection,nt=xu(J,Q,o,r);P=nt.distWidth,W=nt.distHeight;var Ir=J[0]-we[0]||Q?Math.max(v+P,dt):v,zr=J[1]-we[1]||Q?Math.max(V+W,dt):V;return Q&&v&&V&&($?zr=Ir/x:Ir=zr*x),[Ir,zr]}var ne=L(re(),2),Y=ne[0],Z=ne[1];p||(o.setFixedDirection(o.fixedDirection),te(t,"onBeforeResize",ge(t,r,{startFixedDirection:o.startFixedDirection,startFixedPosition:o.startFixedPosition,setFixedDirection:function(we){var nt;return o.setFixedDirection(we),nt=L(re(),2),Y=nt[0],Z=nt[1],[Y,Z]},setFixedPosition:function(we){var nt;return o.setFixedPosition(we),nt=L(re(),2),Y=nt[0],Z=nt[1],[Y,Z]},boundingWidth:Y,boundingHeight:Z,setSize:function(we){var nt;nt=L(we,2),Y=nt[0],Z=nt[1]}},!0)));var ye=s;s||(!a&&i?ye=P_(t,[0,0]):ye=o.fixedPosition);var ie=[0,0];i||(ie=Rw(t,Y,Z,X,ye,!c&&f,o)),d&&(!d[0]&&(ie[0]=0),!d[1]&&(ie[1]=0));function ce(){var we;M&&(we=L(M([Y,Z]),2),Y=we[0],Z=we[1]),Y=pe(Y,F),Z=pe(Z,F)}if(Q){J[0]&&J[1]&&ie[0]&&ie[1]&&(q(ie[0])>q(ie[1])?ie[1]=0:ie[0]=0);var oe=!ie[0]&&!ie[1];oe&&ce(),J[0]&&!J[1]||ie[0]&&!ie[1]||oe&&$?(Y+=ie[0],Z=Y/x):(!J[0]&&J[1]||!ie[0]&&ie[1]||oe&&!$)&&(Z+=ie[1],Y=Z*x)}else Y+=ie[0],Z+=ie[1],Y=Math.max(0,Y),Z=Math.max(0,Z);n=L(ji([Y,Z],C,S,Q?x:!1),2),Y=n[0],Z=n[1],ce(),Q&&(u||H)&&($?Z=Y/x:Y=Z*x),P=Y-v,W=Z-V;var _e=[P-w,W-_];o.prevWidth=P,o.prevHeight=W;var Ce=j_(t,Y,Z,ye,y,o);if(!(!G&&_e.every(function(we){return!we})&&Ce.every(function(we){return!we}))){var ue=ft.drag(t,po(r,t.state,Ce,!!i,!1,"draggable")),Ee=ue.transform,be=g+P,Ve=b+W,Ne=ge(t,r,A({width:be,height:Ve,offsetWidth:Math.round(Y),offsetHeight:Math.round(Z),startRatio:x,boundingWidth:Y,boundingHeight:Z,direction:X,dist:[P,W],delta:_e,isPinch:!!i,drag:ue},gu({style:{width:"".concat(be,"px"),height:"".concat(Ve,"px")},transform:Ee},ue,r)));return!p&&te(t,"onResize",Ne),Ne}},dragControlAfter:function(t,r){var n=r.datas,o=n.isResize,a=n.startOffsetWidth,i=n.startOffsetHeight,l=n.prevWidth,s=n.prevHeight;if(!(!o||t.props.checkResizableError===!1)){var d=t.state,c=d.width,f=d.height,u=c-(a+l),p=f-(i+s),h=q(u)>3,m=q(p)>3;if(h&&(n.startWidth+=u,n.startOffsetWidth+=u,n.prevWidth+=u),m&&(n.startHeight+=p,n.startOffsetHeight+=p,n.prevHeight+=p),h||m)return this.dragControl(t,r)}},dragControlEnd:function(t,r){var n=r.datas,o=r.parentEvent;if(n.isResize){n.isResize=!1;var a=Dt(t,r,{});return!o&&te(t,"onResizeEnd",a),a}},dragGroupControlCondition:Xf,dragGroupControlStart:function(t,r){var n=r.datas,o=this.dragControlStart(t,A(A({},r),{isGroup:!0}));if(!o)return!1;var a=Kt(t,"resizable",r),i=n.startOffsetWidth,l=n.startOffsetHeight;function s(){var h=n.minSize;a.forEach(function(m){var y=m.datas,g=y.minSize,b=y.startOffsetWidth,w=y.startOffsetHeight,_=i*(b?g[0]/b:0),C=l*(w?g[1]/w:0);h[0]=Math.max(h[0],_),h[1]=Math.max(h[1],C)})}function d(){var h=n.maxSize;a.forEach(function(m){var y=m.datas,g=y.maxSize,b=y.startOffsetWidth,w=y.startOffsetHeight,_=i*(b?g[0]/b:0),C=l*(w?g[1]/w:0);h[0]=Math.min(h[0],_),h[1]=Math.min(h[1],C)})}var c=gr(t,this,"dragControlStart",r,function(h,m){return Na(t,h,n,m)});s(),d();var f=function(h){o.setFixedDirection(h),c.forEach(function(m,y){m.setFixedDirection(h),Na(t,m.moveable,n,a[y])})};n.setFixedDirection=f;var u=A(A({},o),{targets:t.props.targets,events:c.map(function(h){return A(A({},h),{setMin:function(m){h.setMin(m),s()},setMax:function(m){h.setMax(m),d()}})}),setFixedDirection:f,setMin:function(h){o.setMin(h),s()},setMax:function(h){o.setMax(h),d()}}),p=te(t,"onResizeGroupStart",u);return n.isResize=p!==!1,n.isResize?o:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isResize){var o=Jr(t.props,"resizable");Fa(t,"onBeforeResize",function(h){te(t,"onBeforeResizeGroup",ge(t,r,A(A({},h),{targets:o.targets}),!0))});var a=this.dragControl(t,A(A({},r),{isGroup:!0}));if(a){var i=a.boundingWidth,l=a.boundingHeight,s=a.dist,d=o.keepRatio,c=[i/(i-s[0]),l/(l-s[1])],f=n.fixedPosition,u=gr(t,this,"dragControl",r,function(h,m){var y=L(lt(io(t.rotation/180*Math.PI,3),[m.datas.originalX*c[0],m.datas.originalY*c[1],1],3),2),g=y[0],b=y[1];return A(A({},m),{parentDist:null,parentScale:c,dragClient:xe(f,[g,b]),parentKeepRatio:d})}),p=A({targets:o.targets,events:u},a);return te(t,"onResizeGroup",p),p}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isResize){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onResizeGroupEnd",i),n}},request:function(t){var r={},n=0,o=0,a=!1,i=t.getRect();return{isControl:!0,requestStart:function(l){var s;return a=l.useSnap,{datas:r,parentDirection:l.direction||[1,1],parentIsWidth:(s=l==null?void 0:l.horizontal)!==null&&s!==void 0?s:!0,useSnap:a}},request:function(l){return"offsetWidth"in l?n=l.offsetWidth-i.offsetWidth:"deltaWidth"in l&&(n+=l.deltaWidth),"offsetHeight"in l?o=l.offsetHeight-i.offsetHeight:"deltaHeight"in l&&(o+=l.deltaHeight),{datas:r,parentDist:[n,o],parentKeepRatio:l.keepRatio,useSnap:a}},requestEnd:function(){return{datas:r,isDrag:!0,useSnap:a}}}},unset:function(t){t.state.gestos.resizable=null}};function Al(t,r,n,o,a){var i=t.props.groupable,l=t.state,s=l.is3d?4:3,d=r.origin,c=Ge(t.state.rootMatrix,se([d[0],d[1]],i?[0,0]:[l.left,l.top]),s),f=xe([a.left,a.top],c);r.startAbsoluteOrigin=f,r.prevDeg=Ye(f,[n,o])/Math.PI*180,r.defaultDeg=r.prevDeg,r.prevSnapDeg=0,r.loop=0,r.startDist=nr(f,[n,o])}function Ia(t,r,n){var o=n.defaultDeg,a=n.prevDeg,i=a%360,l=Math.floor(a/360);i<0&&(i+=360),i>t&&i>270&&t<90?++l:i<t&&i<90&&t>270&&--l;var s=r*(l*360+t-o);return n.prevDeg=o+s,s}function Ll(t,r,n,o){return Ia(Ye(o.startAbsoluteOrigin,[t,r])/Math.PI*180,n,o)}function Fl(t,r,n,o,a,i){var l=t.props.throttleRotate,s=l===void 0?0:l,d=n.prevSnapDeg,c=0,f=!1;if(i){var u=zw(t,r,o,a+o);f=u.isSnap,c=a+u.dist}f||(c=pe(a+o,s));var p=c-a;return n.prevSnapDeg=p,[p-d,p,c]}function qf(t,r,n){var o=L(r,4),a=o[0],i=o[1],l=o[2],s=o[3];if(t==="none")return[];if(Ue(t))return t.map(function(g){return qf(g,[a,i,l,s],n)[0]});var d=L((t||"top").split("-"),2),c=d[0],f=d[1],u=[a,i];c==="left"?u=[l,a]:c==="right"?u=[i,s]:c==="bottom"&&(u=[s,l]);var p=[(u[0][0]+u[1][0])/2,(u[0][1]+u[1][1])/2],h=uu(u,n);if(f){var m=f==="top"||f==="left",y=c==="bottom"||c==="left";p=u[m&&!y||!m&&y?0:1]}return[[p,h]]}function jl(t,r){if(r.isRequest)return r.requestAble==="rotatable";var n=r.inputEvent.target;if(Qe(n,ae("rotation-control"))||t.props.rotateAroundControls&&Qe(n,ae("around-control"))||Qe(n,ae("control"))&&Qe(n,ae("rotatable")))return!0;var o=t.props.rotationTarget;return o?es(o,!0).some(function(a){return a?n===a||n.contains(a):!1}):!1}var Cw=`.rotation {
249
249
  position: absolute;
250
250
  height: 40px;
251
251
  width: 1px;
@@ -274,7 +274,7 @@ cursor: alias;
274
274
  .rotatable.direction.control.move {
275
275
  cursor: move;
276
276
  }
277
- `,Sw={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[Cw],viewClassName:function(t){return t.isDragging("rotatable")?ae("view-rotation-dragging"):""},render:function(t,r){var n=Jr(t.props,"rotatable"),o=n.rotatable,a=n.rotationPosition,i=n.zoom,l=n.renderDirections,s=n.rotateAroundControls,d=n.resolveAblesWithRotatable,c=t.getState(),f=c.renderPoses,u=c.direction;if(!o)return null;var p=qf(a,f,u),h=[];if(p.forEach(function(b,w){var _=L(b,2),C=_[0],S=_[1];h.push(r.createElement("div",{key:"rotation".concat(w),className:ae("rotation"),style:{transform:"translate(-50%) translate(".concat(C[0],"px, ").concat(C[1],"px) rotate(").concat(S,"rad)")}},r.createElement("div",{className:ae("line rotation-line"),style:{transform:"scaleX(".concat(i,")")}}),r.createElement("div",{className:ae("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(i,")")}})))}),l){var m=mr(d||{}),y={};m.forEach(function(b){d[b].forEach(function(w){y[w]=b})});var g=[];Ue(l)&&(g=l.map(function(b){var w=y[b];return{data:w?{resolve:w}:{},classNames:w?["move"]:[],dir:b}})),h.push.apply(h,K([],L(Sf(t,"rotatable",g,r)),!1))}return s&&h.push.apply(h,K([],L(kf(t,r)),!1)),h},dragControlCondition:jl,dragControlStart:function(t,r){var n,o,a=r.datas,i=r.clientX,l=r.clientY,s=r.parentRotate,d=r.parentFlag,c=r.isPinch,f=r.isRequest,u=t.state,p=u.target,h=u.left,m=u.top,y=u.direction,g=u.beforeDirection,b=u.targetTransform,w=u.moveableClientRect,_=u.offsetMatrix,C=u.targetMatrix,S=u.allMatrix,x=u.width,v=u.height;if(!f&&!p)return!1;var V=t.getRect();a.rect=V,a.transform=b,a.left=h,a.top=m;var $=function(J){var P=Yf(t.state,J);a.fixedDirection=P.fixedDirection,a.fixedOffset=P.fixedOffset,a.fixedPosition=P.fixedPosition,F&&F.setFixedPosition(J)},B=function(J){var P=ww(t.state,J);a.fixedDirection=P.fixedDirection,a.fixedOffset=P.fixedOffset,a.fixedPosition=P.fixedPosition,F&&F.setFixedDirection(J)},R=i,T=l;if(f||c||d){var k=s||0;a.beforeInfo={origin:V.beforeOrigin,prevDeg:k,defaultDeg:k,prevSnapDeg:0,startDist:0},a.afterInfo=A(A({},a.beforeInfo),{origin:V.origin}),a.absoluteInfo=A(A({},a.beforeInfo),{origin:V.origin,startValue:k})}else{var O=(o=r.inputEvent)===null||o===void 0?void 0:o.target;if(O){var N=O.getAttribute("data-direction")||"",D=N_[N];if(D){a.isControl=!0,a.isAroundControl=Ze(O,ae("around-control")),a.controlDirection=D;var I=O.getAttribute("data-resolve");I&&(a.resolveAble=I);var z=Kw(u.rootMatrix,u.renderPoses,w);n=L(rt(z,D),2),R=n[0],T=n[1]}}a.beforeInfo={origin:V.beforeOrigin},a.afterInfo={origin:V.origin},a.absoluteInfo={origin:V.origin,startValue:V.rotation};var M=$;$=function(J){var P=u.is3d?4:3,W=L(xe(Xd(C,P),J),2),Q=W[0],re=W[1],ne=lt(_,Ur([Q,re],P)),Y=lt(S,Ur([J[0],J[1]],P));M(J);var Z=u.posDelta;a.beforeInfo.origin=se(ne,Z),a.afterInfo.origin=se(Y,Z),a.absoluteInfo.origin=se(Y,Z),Al(t,a.beforeInfo,R,T,w),Al(t,a.afterInfo,R,T,w),Al(t,a.absoluteInfo,R,T,w)},B=function(J){var P=rt([[0,0],[x,0],[0,v],[x,v]],J);$(P)}}a.startClientX=R,a.startClientY=T,a.direction=y,a.beforeDirection=g,a.startValue=0,a.datas={},va(t,r,"rotate");var j=!1,F=!1;if(a.isControl&&a.resolveAble){var G=a.resolveAble;G==="resizable"&&(F=Ml.dragControlStart(t,A(A({},new wn("resizable").dragStart([0,0],r)),{parentPosition:a.controlPosition,parentFixedPosition:a.fixedPosition})))}F||(j=ft.dragStart(t,new wn().dragStart([0,0],r))),$(Zw(t));var H=ge(t,r,A(A({set:function(J){a.startValue=J*Math.PI/180},setFixedDirection:B,setFixedPosition:$},xa(t,r)),{dragStart:j,resizeStart:F})),X=te(t,"onRotateStart",H);return a.isRotate=X!==!1,u.snapRenderInfo={request:r.isRequest},a.isRotate?H:!1},dragControl:function(t,r){var n,o,a,i=r.datas,l=r.clientDistX,s=r.clientDistY,d=r.parentRotate,c=r.parentFlag,f=r.isPinch,u=r.groupDelta,p=r.resolveMatrix,h=i.beforeDirection,m=i.beforeInfo,y=i.afterInfo,g=i.absoluteInfo,b=i.isRotate,w=i.startValue,_=i.rect,C=i.startClientX,S=i.startClientY;if(b){Ca(t,r,"rotate");var x=$_(r),v=h*x,V=t.props.parentMoveable,$=0,B,R,T=0,k,O,N=0,D,I,z=180/Math.PI*w,M=g.startValue,j=!1,F=C+l,G=S+s;if(!c&&"parentDist"in r){var H=r.parentDist;B=H,k=H,D=H}else f||c?(B=Ia(d,h,m),k=Ia(d,v,y),D=Ia(d,v,g)):(B=Ll(F,G,h,m),k=Ll(F,G,v,y),D=Ll(F,G,v,g),j=!0);if(R=z+B,O=z+k,I=M+D,te(t,"onBeforeRotate",ge(t,r,{beforeRotation:R,rotation:O,absoluteRotation:I,setRotation:function(ye){k=ye-z,B=k,D=k}},!0)),n=L(Fl(t,_,m,B,z,j),3),$=n[0],B=n[1],R=n[2],o=L(Fl(t,_,y,k,z,j),3),T=o[0],k=o[1],O=o[2],a=L(Fl(t,_,g,D,M,j),3),N=a[0],D=a[1],I=a[2],!(!N&&!T&&!$&&!V&&!p)){var X=Sa(i,"rotate(".concat(O,"deg)"),"rotate(".concat(k,"deg)"));p&&(i.fixedPosition=Nl(t,i.targetAllTransform,i.fixedDirection,i.fixedOffset,i));var J=F_(t,k,i),P=se(xe(u||[0,0],J),i.prevInverseDist||[0,0]);i.prevInverseDist=J,i.requestValue=null;var W=_f(t,X,P,f,r),Q=W,re=nr([F,G],g.startAbsoluteOrigin)-g.startDist,ne=void 0;if(i.resolveAble==="resizable"){var Y=Ml.dragControl(t,A(A({},po(r,t.state,[r.deltaX,r.deltaY],!!f,!1,"resizable")),{resolveMatrix:!0,parentDistance:re}));Y&&(ne=Y,Q=gu(Q,Y,r))}var Z=ge(t,r,A(A({delta:T,dist:k,rotate:O,rotation:O,beforeDist:B,beforeDelta:$,beforeRotate:R,beforeRotation:R,absoluteDist:D,absoluteDelta:N,absoluteRotate:I,absoluteRotation:I,isPinch:!!f,resize:ne},W),Q));return te(t,"onRotate",Z),Z}}},dragControlEnd:function(t,r){var n=r.datas;if(n.isRotate){n.isRotate=!1;var o=Dt(t,r,{});return te(t,"onRotateEnd",o),o}},dragGroupControlCondition:jl,dragGroupControlStart:function(t,r){var n=r.datas,o=t.state,a=o.left,i=o.top,l=o.beforeOrigin,s=this.dragControlStart(t,r);if(!s)return!1;s.set(n.beforeDirection*t.rotation);var d=gr(t,this,"dragControlStart",r,function(u,p){var h=u.state,m=h.left,y=h.top,g=h.beforeOrigin,b=xe(se([m,y],[a,i]),se(g,l));return p.datas.startGroupClient=b,p.datas.groupClient=b,A(A({},p),{parentRotate:0})}),c=A(A({},s),{targets:t.props.targets,events:d}),f=te(t,"onRotateGroupStart",c);return n.isRotate=f!==!1,n.isRotate?s:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isRotate){Fa(t,"onBeforeRotate",function(c){te(t,"onBeforeRotateGroup",ge(t,r,A(A({},c),{targets:t.props.targets}),!0))});var o=this.dragControl(t,r);if(o){var a=n.beforeDirection,i=o.beforeDist,l=i/180*Math.PI,s=gr(t,this,"dragControl",r,function(c,f){var u=f.datas.startGroupClient,p=L(f.datas.groupClient,2),h=p[0],m=p[1],y=L(ao(u,l*a),2),g=y[0],b=y[1],w=[g-h,b-m];return f.datas.groupClient=[g,b],A(A({},f),{parentRotate:i,groupDelta:w})});t.rotation=a*o.beforeRotation;var d=A({targets:t.props.targets,events:s,set:function(c){t.rotation=c},setGroupRotation:function(c){t.rotation=c}},o);return te(t,"onRotateGroup",d),d}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isRotate){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onRotateGroupEnd",i),n}},request:function(t){var r={},n=0,o=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:r}},request:function(a){return"deltaRotate"in a?n+=a.deltaRotate:"rotate"in a&&(n=a.rotate-o),{datas:r,parentDist:n}},requestEnd:function(){return{datas:r,isDrag:!0}}}}};function xw(t,r){var n,o=t.direction,a=t.classNames,i=t.size,l=t.pos,s=t.zoom,d=t.key,c=o==="horizontal",f=c?"Y":"X";return r.createElement("div",{key:d,className:a.join(" "),style:(n={},n[c?"width":"height"]="".concat(i),n.transform="translate(".concat(l[0],", ").concat(l[1],") translate").concat(f,"(-50%) scale").concat(f,"(").concat(s,")"),n)})}function Pl(t,r){return xw(A(A({},t),{classNames:K([ae("line","guideline",t.direction)],L(t.classNames),!1).filter(function(n){return n}),size:t.size||"".concat(t.sizeValue,"px"),pos:t.pos||t.posValue.map(function(n){return"".concat(pe(n,.1),"px")})}),r)}function Jf(t,r,n,o,a,i,l,s){var d=t.props.zoom;return n.map(function(c,f){var u=c.type,p=c.pos,h=[0,0];return h[l]=o,h[l?0:1]=-a+p,Pl({key:"".concat(r,"TargetGuideline").concat(f),classNames:[ae("target","bold",u)],posValue:h,sizeValue:i,zoom:d,direction:r},s)})}function Kf(t,r,n,o,a,i){var l=t.props,s=l.zoom,d=l.isDisplayInnerSnapDigit,c=r==="horizontal"?kr:Nr,f=a[c.start],u=a[c.end];return n.filter(function(p){var h=p.hide,m=p.elementRect;if(h)return!1;if(d&&m){var y=m.rect;if(y[c.start]<=f&&u<=y[c.end])return!1}return!0}).map(function(p,h){var m=p.pos,y=p.size,g=p.element,b=p.className,w=[-o[0]+m[0],-o[1]+m[1]];return Pl({key:"".concat(r,"-default-guideline-").concat(h),classNames:g?[ae("bold"),b]:[ae("normal"),b],direction:r,posValue:w,sizeValue:y,zoom:s},i)})}function go(t,r,n,o,a,i,l,s){var d,c=t.props,f=c.snapDigit,u=f===void 0?0:f,p=c.isDisplaySnapDigit,h=p===void 0?!0:p,m=c.snapDistFormat,y=m===void 0?function(S,x){return S}:m,g=c.zoom,b=r==="horizontal"?"X":"Y",w=r==="vertical"?"height":"width",_=Math.abs(a),C=h?parseFloat(_.toFixed(u)):0;return s.createElement("div",{key:"".concat(r,"-").concat(n,"-guideline-").concat(o),className:ae("guideline-group",r),style:(d={left:"".concat(i[0],"px"),top:"".concat(i[1],"px")},d[w]="".concat(_,"px"),d)},Pl({direction:r,classNames:[ae(n),l],size:"100%",posValue:[0,0],sizeValue:_,zoom:g},s),s.createElement("div",{className:ae("size-value","gap"),style:{transform:"translate".concat(b,"(-50%) scale(").concat(g,")")}},C>0?y(C,r):""))}function vw(t,r,n,o){var a=t==="vertical"?0:1,i=t==="vertical"?1:0,l=a?kr:Nr,s=n[l.start],d=n[l.end];return bu(r,function(c){return c.pos[a]}).map(function(c){var f=[],u=[],p=[];return c.forEach(function(h){var m,y,g=h.element,b=h.elementRect.rect;if(b[l.end]<s)f.push(h);else if(d<b[l.start])u.push(h);else if(b[l.start]<=s&&d<=b[l.end]&&o){var w=h.pos,_={element:g,rect:A(A({},b),(m={},m[l.end]=b[l.start],m))},C={element:g,rect:A(A({},b),(y={},y[l.start]=b[l.end],y))},S=[0,0],x=[0,0];S[a]=w[a],S[i]=w[i],x[a]=w[a],x[i]=w[i]+h.size,f.push({type:t,pos:S,size:0,elementRect:_,direction:"",elementDirection:"end"}),u.push({type:t,pos:x,size:0,elementRect:C,direction:"",elementDirection:"start"})}}),f.sort(function(h,m){return m.pos[i]-h.pos[i]}),u.sort(function(h,m){return h.pos[i]-m.pos[i]}),{total:c,start:f,end:u,inner:p}})}function Ew(t,r,n,o,a){var i=t.props.isDisplayInnerSnapDigit,l=[];return["vertical","horizontal"].forEach(function(s){var d=r.filter(function(g){return g.type===s}),c=s==="vertical"?1:0,f=c?0:1,u=vw(s,d,o,i),p=c?Nr:kr,h=c?kr:Nr,m=o[p.start],y=o[p.end];u.forEach(function(g){var b=g.total,w=g.start,_=g.end,C=g.inner,S=n[f]+b[0].pos[f]-o[h.start],x=o;w.forEach(function(v){var V=v.elementRect.rect,$=x[p.start]-V[p.end];if($>0){var B=[0,0];B[c]=n[c]+x[p.start]-m-$,B[f]=S,l.push(go(t,s,"dashed",l.length,$,B,v.className,a))}x=V}),x=o,_.forEach(function(v){var V=v.elementRect.rect,$=V[p.start]-x[p.end];if($>0){var B=[0,0];B[c]=n[c]+x[p.end]-m,B[f]=S,l.push(go(t,s,"dashed",l.length,$,B,v.className,a))}x=V}),C.forEach(function(v){var V=v.elementRect.rect,$=m-V[p.start],B=V[p.end]-y,R=[0,0],T=[0,0];R[c]=n[c]-$,R[f]=S,T[c]=n[c]+y-m,T[f]=S,l.push(go(t,s,"dashed",l.length,$,R,v.className,a)),l.push(go(t,s,"dashed",l.length,B,T,v.className,a))})})}),l}function Vw(t,r,n,o,a){var i=[];return["horizontal","vertical"].forEach(function(l){var s=r.filter(function(g){return g.type===l}).slice(0,1),d=l==="vertical"?0:1,c=d?0:1,f=d?Nr:kr,u=d?kr:Nr,p=o[f.start],h=o[f.end],m=o[u.start],y=o[u.end];s.forEach(function(g){var b=g.gap,w=g.gapRects,_=Math.max.apply(Math,K([m],L(w.map(function(x){var v=x.rect;return v[u.start]})),!1)),C=Math.min.apply(Math,K([y],L(w.map(function(x){var v=x.rect;return v[u.end]})),!1)),S=(_+C)/2;_===C||S===(m+y)/2||w.forEach(function(x){var v=x.rect,V=x.className,$=[n[0],n[1]];if(v[f.end]<p)$[d]+=v[f.end]-p;else if(h<v[f.start])$[d]+=v[f.start]-p-b;else return;$[c]+=S-m,i.push(go(t,d?"vertical":"horizontal","gap",i.length,b,$,V,a))})})}),i}function Ul(t){var r,n,o=t.state,a=o.containerClientRect,i=o.hasFixed,l=a.overflow,s=a.scrollHeight,d=a.scrollWidth,c=a.clientHeight,f=a.clientWidth,u=a.clientLeft,p=a.clientTop,h=t.props,m=h.snapGap,y=m===void 0?!0:m,g=h.verticalGuidelines,b=h.horizontalGuidelines,w=h.snapThreshold,_=w===void 0?5:w,C=h.maxSnapElementGuidelineDistance,S=C===void 0?1/0:C,x=h.isDisplayGridGuidelines,v=Lt(jt(t.state)),V=v.top,$=v.left,B=v.bottom,R=v.right,T={top:V,left:$,bottom:B,right:R,center:($+R)/2,middle:(V+B)/2},k=Dw(t),O=K([],L(k),!1),N=((n=(r=o.snapThresholdInfo)===null||r===void 0?void 0:r.multiples)!==null&&n!==void 0?n:[1,1]).map(function(M){return M*_});y&&O.push.apply(O,K([],L(kw(t,T,N)),!1));var D=A({},o.snapOffset||{left:0,top:0,bottom:0,right:0});if(O.push.apply(O,K([],L($w(t,l?d:f,l?s:c,u,p,D,x)),!1)),i){var I=a.left,z=a.top;D.left+=I,D.top+=z,D.right+=I,D.bottom+=z}return O.push.apply(O,K([],L(eu(b||!1,g||!1,l?d:f,l?s:c,u,p,D)),!1)),O=O.filter(function(M){var j=M.element,F=M.elementRect,G=M.type;if(!j||!F)return!0;var H=F.rect;return Zf(T,H,G,S)}),O}function kw(t,r,n){var o=t.props,a=o.maxSnapElementGuidelineDistance,i=a===void 0?1/0:a,l=o.maxSnapElementGapDistance,s=l===void 0?1/0:l,d=t.state.elementRects,c=[];return[["vertical",kr,Nr],["horizontal",Nr,kr]].forEach(function(f){var u=L(f,3),p=u[0],h=u[1],m=u[2],y=r[h.start],g=r[h.end],b=r[h.center],w=r[m.start],_=r[m.end],C={left:n[0],top:n[1]};function S(V){var $=V.rect,B=C[h.start];return $[h.end]<y+B?y-$[h.end]:g-B<$[h.start]?$[h.start]-g:-1}var x=d.filter(function(V){var $=V.rect;return $[m.start]>_||$[m.end]<w?!1:S(V)>0}).sort(function(V,$){return S(V)-S($)}),v=[];x.forEach(function(V){x.forEach(function($){if(V!==$){var B=V.rect,R=$.rect,T=B[m.start],k=B[m.end],O=R[m.start],N=R[m.end];T>N||O>k||v.push([V,$])}})}),v.forEach(function(V){var $=L(V,2),B=$[0],R=$[1],T=B.rect,k=R.rect,O=T[h.start],N=T[h.end],D=k[h.start],I=k[h.end],z=C[h.start],M=0,j=0,F=!1,G=!1,H=!1;if(N<=y&&g<=D){if(G=!0,M=(D-N-(g-y))/2,j=N+M+(g-y)/2,q(j-b)>z)return}else if(N<D&&I<y+z){if(F=!0,M=D-N,j=I+M,q(j-y)>z)return}else if(N<D&&g-z<O){if(H=!0,M=D-N,j=O-M,q(j-g)>z)return}else return;M&&Zf(r,k,p,i)&&(M>s||c.push({type:p,pos:p==="vertical"?[j,0]:[0,j],element:R.element,size:0,className:R.className,isStart:F,isCenter:G,isEnd:H,gap:M,hide:!0,gapRects:[B,R],direction:"",elementDirection:""}))})}),c}function Nw(t,r,n,o){var a,i,l=t.props,s=t.state,d=l.snapGridAll,c=l.snapGridWidth,f=c===void 0?0:c,u=l.snapGridHeight,p=u===void 0?0:u,h=s.snapRenderInfo,m=h&&(((a=h.direction)===null||a===void 0?void 0:a[0])||((i=h.direction)===null||i===void 0?void 0:i[1])),y=t.moveables;if(d&&y&&m&&(f||p)){if(s.snapThresholdInfo)return;s.snapThresholdInfo={multiples:[1,1],offset:[0,0]};var g=t.getRect(),b=g.children,w=h.direction;if(b){var _=w.map(function(S,x){var v=x===0?{snapSize:f,posName:"left",sizeName:"width",clientOffset:o.left-r}:{snapSize:p,posName:"top",sizeName:"height",clientOffset:o.top-n},V=v.snapSize,$=v.posName,B=v.sizeName,R=v.clientOffset;if(!V)return{dir:S,multiple:1,snapSize:V,snapOffset:0};var T=g[B],k=g[$],O=_d(b.map(function(F){return[F[$]-k,F[B],T-F[B]-F[$]+k]})).filter(function(F){return F}).sort(function(F,G){return F-G}),N=O[0],D=O.map(function(F){return pe(F/N,.1)*V}),I=1,z=pe(T/N,.1);for(I=1;I<=10&&!D.every(function(F){return F*I%1===0});++I);var M=(-S+1)/2,j=ia(k-R,k-R+T,M,1-M);return{multiple:z*I,dir:S,snapSize:V,snapOffset:Math.round(j/V)}}),C=_.map(function(S){return S.multiple||1});s.snapThresholdInfo.multiples=C,s.snapThresholdInfo.offset=_.map(function(S){return S.snapOffset}),_.forEach(function(S,x){S.snapSize})}}else s.snapThresholdInfo=null}function $w(t,r,n,o,a,i,l){o===void 0&&(o=0),a===void 0&&(a=0);var s=t.props,d=t.state,c=s.snapGridWidth,f=c===void 0?0:c,u=s.snapGridHeight,p=u===void 0?0:u,h=[],m=i.left,y=i.top,g=[0,0];Nw(t,o,a,i);var b=d.snapThresholdInfo,w=f,_=p;if(b&&(f*=b.multiples[0]||1,p*=b.multiples[1]||1,g=b.offset),p){for(var C=function(x){h.push({type:"horizontal",pos:[m,pe(g[1]*_+x-a+y,.1)],className:ae("grid-guideline"),size:r,hide:!l,direction:"",grid:!0})},S=0;S<=n*2;S+=p)C(S);for(var S=-p;S>=-n;S-=p)C(S)}if(f){for(var C=function(v){h.push({type:"vertical",pos:[pe(g[0]*w+v-o+m,.1),y],className:ae("grid-guideline"),size:n,hide:!l,direction:"",grid:!0})},S=0;S<=r*2;S+=f)C(S);for(var S=-f;S>=-r;S-=f)C(S)}return h}function Zf(t,r,n,o){return n==="horizontal"?q(t.right-r.left)<=o||q(t.left-r.right)<=o||t.left<=r.right&&r.left<=t.right:n==="vertical"?q(t.bottom-r.top)<=o||q(t.top-r.bottom)<=o||t.top<=r.bottom&&r.top<=t.bottom:!0}function Dw(t){var r=t.state,n=t.props.elementGuidelines,o=n===void 0?[]:n;if(!o.length)return r.elementRects=[],[];var a=(r.elementRects||[]).filter(function(p){return!p.refresh}),i=o.map(function(p){return $t(p)&&"element"in p?A(A({},p),{element:ir(p.element,!0)}):{element:ir(p,!0)}}).filter(function(p){return p.element}),l=gn(a.map(function(p){return p.element}),i.map(function(p){return p.element})),s=l.maintained,d=l.added,c=[];s.forEach(function(p){var h=L(p,2),m=h[0],y=h[1];c[y]=a[m]}),Bw(t,d.map(function(p){return i[p]})).map(function(p,h){c[d[h]]=p}),r.elementRects=c;var f=Bl(t.props.elementSnapDirections),u=[];return c.forEach(function(p){var h=p.element,m=p.top,y=m===void 0?f.top:m,g=p.left,b=g===void 0?f.left:g,w=p.right,_=w===void 0?f.right:w,C=p.bottom,S=C===void 0?f.bottom:C,x=p.center,v=x===void 0?f.center:x,V=p.middle,$=V===void 0?f.middle:V,B=p.className,R=p.rect,T=Tl({top:y,right:_,left:b,bottom:S,center:v,middle:$},R),k=T.horizontal,O=T.vertical,N=T.horizontalNames,D=T.verticalNames,I=R.top,z=R.left,M=R.right-z,j=R.bottom-I,F=[M,j];O.forEach(function(G,H){u.push({type:"vertical",element:h,pos:[pe(G,.1),I],size:j,sizes:F,className:B,elementRect:p,elementDirection:Df[D[H]]||D[H],direction:""})}),k.forEach(function(G,H){u.push({type:"horizontal",element:h,pos:[z,pe(G,.1)],size:M,sizes:F,className:B,elementRect:p,elementDirection:Df[N[H]]||N[H],direction:""})})}),u}function Qf(t,r){return t?t.map(function(n){var o=$t(n)?n:{pos:n},a=o.pos;return un(a)?o:A(A({},o),{pos:Te(a,r)})}):[]}function eu(t,r,n,o,a,i,l){a===void 0&&(a=0),i===void 0&&(i=0),l===void 0&&(l={left:0,top:0,right:0,bottom:0});var s=[],d=l.left,c=l.top,f=l.bottom,u=l.right,p=n+u-d,h=o+f-c;return Qf(t,h).forEach(function(m){s.push({type:"horizontal",pos:[d,pe(m.pos-i+c,.1)],size:p,className:m.className,direction:""})}),Qf(r,p).forEach(function(m){s.push({type:"vertical",pos:[pe(m.pos-a+d,.1),c],size:h,className:m.className,direction:""})}),s}function Bw(t,r){if(!r.length)return[];var n=t.props.groupable,o=t.state,a=o.containerClientRect,i=o.rootMatrix,l=o.is3d,s=o.offsetDelta,d=l?4:3,c=L(tw(i,a,d),2),f=c[0],u=c[1],p=n?0:s[0],h=n?0:s[1];return r.map(function(m){var y=m.element.getBoundingClientRect(),g=y.left-f-p,b=y.top-u-h,w=b+y.height,_=g+y.width,C=L($n(i,[g,b],d),2),S=C[0],x=C[1],v=L($n(i,[_,w],d),2),V=v[0],$=v[1];return A(A({},m),{rect:{left:S,right:V,top:x,bottom:$,center:(S+V)/2,middle:(x+$)/2}})})}function za(t){var r=t.state,n=r.container,o=t.props.snapContainer||n;if(r.snapContainer===o&&r.guidelines&&r.guidelines.length)return!1;var a=r.containerClientRect,i={left:0,top:0,bottom:0,right:0};if(n!==o){var l=ir(o,!0);if(l){var s=Co(l),d=Cu(r,[s.left-a.left,s.top-a.top]),c=Cu(r,[s.right-a.right,s.bottom-a.bottom]);i.left=pe(d[0],1e-5),i.top=pe(d[1],1e-5),i.right=pe(c[0],1e-5),i.bottom=pe(c[1],1e-5)}}return r.snapContainer=o,r.snapOffset=i,r.guidelines=Ul(t),r.enableSnap=!0,!0}function tu(t,r,n,o,a,i){var l=qr(t,r,n,i?4:3),s=rt(l,o);return Xl(l,se(a,s))}function ru(t){return t?t/q(t):0}function Tw(t,r,n,o,a,i){var l=i.fixedDirection,s=aw(n,l,o),d=zl(t,r,n,o),c=K(K([],L(yw(t,r,s,o,a,i)),!1),L(Pf(t,d,i)),!1),f=Ba(c,0),u=Ba(c,1);return{width:{isBound:f.isBound,offset:f.offset[0]},height:{isBound:u.isBound,offset:u.offset[1]}}}function Ow(t,r,n,o,a,i,l,s,d){var c=rt(r,l),f=Oa(t,s,{vertical:[c[0]],horizontal:[c[1]]}),u=f.horizontal.offset,p=f.vertical.offset;if(pe(p,Sl)||pe(u,Sl)){var h=L(ar({datas:d,distX:-p,distY:-u}),2),m=h[0],y=h[1],g=Math.min(a||1/0,n+l[0]*m),b=Math.min(i||1/0,o+l[1]*y);return[g-n,b-o]}return[0,0]}function nu(t,r,n,o,a,i,l,s){for(var d=jt(t.state),c=t.props.keepRatio,f=0,u=0,p=0;p<2;++p){var h=r(f,u),m=Tw(t,h,a,c,l,s),y=m.width,g=m.height,b=y.isBound,w=g.isBound,_=y.offset,C=g.offset;if(p===1&&(b||(_=0),w||(C=0)),p===0&&l&&!b&&!w)return[0,0];if(c){var S=q(_)*(n?1/n:1),x=q(C)*(o?1/o:1),v=b&&w?S<x:w||!b&&S<x;v?_=n*C/o:C=o*_/n}f+=_,u+=C}if(!c&&a[0]&&a[1]){var V=_w(t,d,a,i,s),$=V.maxWidth,B=V.maxHeight,R=L(Ow(t,r(f,u).map(function(O){return O.map(function(N){return pe(N,Sl)})}),n+f,o+u,$,B,a,l,s),2),_=R[0],C=R[1];f+=_,u+=C}return[f,u]}function yo(t){return t<0&&(t=t%360+360),t%=360,t}function Iw(t,r){r=yo(r);var n=Math.floor(t/360),o=n*360+360-r,a=n*360+r;return q(t-o)<q(t-a)?o:a}function Wl(t,r){t=yo(t),r=yo(r);var n=yo(t-r);return Math.min(n,360-n)}function zw(t,r,n,o){var a,i=t.props,l=(a=i[Bf])!==null&&a!==void 0?a:5,s=i[Tf];if(Vn(t,"rotatable")){var d=r.pos1,c=r.pos2,f=r.pos3,u=r.pos4,p=r.origin,h=n*Math.PI/180,m=[d,c,f,u].map(function(C){return se(C,p)}),y=m.map(function(C){return ao(C,h)}),g=K(K([],L(K_(t,m,y,p,n)),!1),L(fw(t,m,y,p,n)),!1);g.sort(function(C,S){return q(C-n)-q(S-n)});var b=g.length>0;if(b)return{isSnap:b,dist:b?g[0]:n}}if(s!=null&&s.length&&l){var w=s.slice().sort(function(C,S){return Wl(C,o)-Wl(S,o)}),_=w[0];if(Wl(_,o)<=l)return{isSnap:!0,dist:n+Iw(o,_)-o}}return{isSnap:!1,dist:n}}function Rw(t,r,n,o,a,i,l){if(!Vn(t,"resizable"))return[0,0];var s=l.fixedDirection,d=l.nextAllMatrix,c=t.state,f=c.allMatrix,u=c.is3d;return nu(t,function(p,h){return tu(d||f,r+p,n+h,s,a,u)},r,n,o,a,i,l)}function Mw(t,r,n,o,a){if(!Vn(t,"scalable"))return[0,0];var i=a.startOffsetWidth,l=a.startOffsetHeight,s=a.fixedPosition,d=a.fixedDirection,c=a.is3d,f=nu(t,function(u,p){return tu(R_(a,xe(r,[u/i,p/l])),i,l,d,s,c)},i,l,n,s,o,a);return[f[0]/i,f[1]/l]}function Aw(t,r){r.absolutePoses=jt(t.state)}function ou(t){var r=[];return t.forEach(function(n){n.guidelineInfos.forEach(function(o){var a=o.guideline;_t(r,function(i){return i.guideline===a})||(a.direction="",r.push({guideline:a,posInfo:n}))})}),r.map(function(n){var o=n.guideline,a=n.posInfo;return A(A({},o),{direction:a.direction})})}function au(t,r,n,o,a,i){var l=Dl($a(t,i),r,n),s=l.vertical,d=l.horizontal,c=En();s.forEach(function(m){m.isBound&&(m.direction==="start"&&(c.left=!0),m.direction==="end"&&(c.right=!0),o.push({type:"bounds",pos:m.pos}))}),d.forEach(function(m){m.isBound&&(m.direction==="start"&&(c.top=!0),m.direction==="end"&&(c.bottom=!0),a.push({type:"bounds",pos:m.pos}))});var f=uw(t),u=f.boundMap,p=f.vertical,h=f.horizontal;return p.forEach(function(m){hr(o,function(y){var g=y.type,b=y.pos;return g==="bounds"&&b===m})>=0||o.push({type:"bounds",pos:m})}),h.forEach(function(m){hr(a,function(y){var g=y.type,b=y.pos;return g==="bounds"&&b===m})>=0||a.push({type:"bounds",pos:m})}),{boundMap:c,innerBoundMap:u}}var Lw=Ql("",["resizable","scalable"]),Fw={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll",Bf,Tf,Of,If,"horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap","bound"],css:[`:host {
277
+ `,Sw={name:"rotatable",canPinch:!0,props:["rotatable","rotationPosition","throttleRotate","renderDirections","rotationTarget","rotateAroundControls","edge","resolveAblesWithRotatable","displayAroundControls"],events:["rotateStart","beforeRotate","rotate","rotateEnd","rotateGroupStart","beforeRotateGroup","rotateGroup","rotateGroupEnd"],css:[Cw],viewClassName:function(t){return t.isDragging("rotatable")?ae("view-rotation-dragging"):""},render:function(t,r){var n=Jr(t.props,"rotatable"),o=n.rotatable,a=n.rotationPosition,i=n.zoom,l=n.renderDirections,s=n.rotateAroundControls,d=n.resolveAblesWithRotatable,c=t.getState(),f=c.renderPoses,u=c.direction;if(!o)return null;var p=qf(a,f,u),h=[];if(p.forEach(function(b,w){var _=L(b,2),C=_[0],S=_[1];h.push(r.createElement("div",{key:"rotation".concat(w),className:ae("rotation"),style:{transform:"translate(-50%) translate(".concat(C[0],"px, ").concat(C[1],"px) rotate(").concat(S,"rad)")}},r.createElement("div",{className:ae("line rotation-line"),style:{transform:"scaleX(".concat(i,")")}}),r.createElement("div",{className:ae("control rotation-control"),style:{transform:"translate(0.5px) scale(".concat(i,")")}})))}),l){var m=mr(d||{}),y={};m.forEach(function(b){d[b].forEach(function(w){y[w]=b})});var g=[];Ue(l)&&(g=l.map(function(b){var w=y[b];return{data:w?{resolve:w}:{},classNames:w?["move"]:[],dir:b}})),h.push.apply(h,K([],L(Sf(t,"rotatable",g,r)),!1))}return s&&h.push.apply(h,K([],L(kf(t,r)),!1)),h},dragControlCondition:jl,dragControlStart:function(t,r){var n,o,a=r.datas,i=r.clientX,l=r.clientY,s=r.parentRotate,d=r.parentFlag,c=r.isPinch,f=r.isRequest,u=t.state,p=u.target,h=u.left,m=u.top,y=u.direction,g=u.beforeDirection,b=u.targetTransform,w=u.moveableClientRect,_=u.offsetMatrix,C=u.targetMatrix,S=u.allMatrix,x=u.width,v=u.height;if(!f&&!p)return!1;var V=t.getRect();a.rect=V,a.transform=b,a.left=h,a.top=m;var $=function(J){var P=Yf(t.state,J);a.fixedDirection=P.fixedDirection,a.fixedOffset=P.fixedOffset,a.fixedPosition=P.fixedPosition,F&&F.setFixedPosition(J)},B=function(J){var P=ww(t.state,J);a.fixedDirection=P.fixedDirection,a.fixedOffset=P.fixedOffset,a.fixedPosition=P.fixedPosition,F&&F.setFixedDirection(J)},R=i,T=l;if(f||c||d){var k=s||0;a.beforeInfo={origin:V.beforeOrigin,prevDeg:k,defaultDeg:k,prevSnapDeg:0,startDist:0},a.afterInfo=A(A({},a.beforeInfo),{origin:V.origin}),a.absoluteInfo=A(A({},a.beforeInfo),{origin:V.origin,startValue:k})}else{var O=(o=r.inputEvent)===null||o===void 0?void 0:o.target;if(O){var N=O.getAttribute("data-direction")||"",D=N_[N];if(D){a.isControl=!0,a.isAroundControl=Qe(O,ae("around-control")),a.controlDirection=D;var I=O.getAttribute("data-resolve");I&&(a.resolveAble=I);var z=Kw(u.rootMatrix,u.renderPoses,w);n=L(rt(z,D),2),R=n[0],T=n[1]}}a.beforeInfo={origin:V.beforeOrigin},a.afterInfo={origin:V.origin},a.absoluteInfo={origin:V.origin,startValue:V.rotation};var M=$;$=function(J){var P=u.is3d?4:3,W=L(xe(Xd(C,P),J),2),Q=W[0],re=W[1],ne=lt(_,Ur([Q,re],P)),Y=lt(S,Ur([J[0],J[1]],P));M(J);var Z=u.posDelta;a.beforeInfo.origin=se(ne,Z),a.afterInfo.origin=se(Y,Z),a.absoluteInfo.origin=se(Y,Z),Al(t,a.beforeInfo,R,T,w),Al(t,a.afterInfo,R,T,w),Al(t,a.absoluteInfo,R,T,w)},B=function(J){var P=rt([[0,0],[x,0],[0,v],[x,v]],J);$(P)}}a.startClientX=R,a.startClientY=T,a.direction=y,a.beforeDirection=g,a.startValue=0,a.datas={},va(t,r,"rotate");var j=!1,F=!1;if(a.isControl&&a.resolveAble){var G=a.resolveAble;G==="resizable"&&(F=Ml.dragControlStart(t,A(A({},new wn("resizable").dragStart([0,0],r)),{parentPosition:a.controlPosition,parentFixedPosition:a.fixedPosition})))}F||(j=ft.dragStart(t,new wn().dragStart([0,0],r))),$(Zw(t));var H=ge(t,r,A(A({set:function(J){a.startValue=J*Math.PI/180},setFixedDirection:B,setFixedPosition:$},xa(t,r)),{dragStart:j,resizeStart:F})),X=te(t,"onRotateStart",H);return a.isRotate=X!==!1,u.snapRenderInfo={request:r.isRequest},a.isRotate?H:!1},dragControl:function(t,r){var n,o,a,i=r.datas,l=r.clientDistX,s=r.clientDistY,d=r.parentRotate,c=r.parentFlag,f=r.isPinch,u=r.groupDelta,p=r.resolveMatrix,h=i.beforeDirection,m=i.beforeInfo,y=i.afterInfo,g=i.absoluteInfo,b=i.isRotate,w=i.startValue,_=i.rect,C=i.startClientX,S=i.startClientY;if(b){Ca(t,r,"rotate");var x=$_(r),v=h*x,V=t.props.parentMoveable,$=0,B,R,T=0,k,O,N=0,D,I,z=180/Math.PI*w,M=g.startValue,j=!1,F=C+l,G=S+s;if(!c&&"parentDist"in r){var H=r.parentDist;B=H,k=H,D=H}else f||c?(B=Ia(d,h,m),k=Ia(d,v,y),D=Ia(d,v,g)):(B=Ll(F,G,h,m),k=Ll(F,G,v,y),D=Ll(F,G,v,g),j=!0);if(R=z+B,O=z+k,I=M+D,te(t,"onBeforeRotate",ge(t,r,{beforeRotation:R,rotation:O,absoluteRotation:I,setRotation:function(ye){k=ye-z,B=k,D=k}},!0)),n=L(Fl(t,_,m,B,z,j),3),$=n[0],B=n[1],R=n[2],o=L(Fl(t,_,y,k,z,j),3),T=o[0],k=o[1],O=o[2],a=L(Fl(t,_,g,D,M,j),3),N=a[0],D=a[1],I=a[2],!(!N&&!T&&!$&&!V&&!p)){var X=Sa(i,"rotate(".concat(O,"deg)"),"rotate(".concat(k,"deg)"));p&&(i.fixedPosition=Nl(t,i.targetAllTransform,i.fixedDirection,i.fixedOffset,i));var J=F_(t,k,i),P=se(xe(u||[0,0],J),i.prevInverseDist||[0,0]);i.prevInverseDist=J,i.requestValue=null;var W=_f(t,X,P,f,r),Q=W,re=nr([F,G],g.startAbsoluteOrigin)-g.startDist,ne=void 0;if(i.resolveAble==="resizable"){var Y=Ml.dragControl(t,A(A({},po(r,t.state,[r.deltaX,r.deltaY],!!f,!1,"resizable")),{resolveMatrix:!0,parentDistance:re}));Y&&(ne=Y,Q=gu(Q,Y,r))}var Z=ge(t,r,A(A({delta:T,dist:k,rotate:O,rotation:O,beforeDist:B,beforeDelta:$,beforeRotate:R,beforeRotation:R,absoluteDist:D,absoluteDelta:N,absoluteRotate:I,absoluteRotation:I,isPinch:!!f,resize:ne},W),Q));return te(t,"onRotate",Z),Z}}},dragControlEnd:function(t,r){var n=r.datas;if(n.isRotate){n.isRotate=!1;var o=Dt(t,r,{});return te(t,"onRotateEnd",o),o}},dragGroupControlCondition:jl,dragGroupControlStart:function(t,r){var n=r.datas,o=t.state,a=o.left,i=o.top,l=o.beforeOrigin,s=this.dragControlStart(t,r);if(!s)return!1;s.set(n.beforeDirection*t.rotation);var d=gr(t,this,"dragControlStart",r,function(u,p){var h=u.state,m=h.left,y=h.top,g=h.beforeOrigin,b=xe(se([m,y],[a,i]),se(g,l));return p.datas.startGroupClient=b,p.datas.groupClient=b,A(A({},p),{parentRotate:0})}),c=A(A({},s),{targets:t.props.targets,events:d}),f=te(t,"onRotateGroupStart",c);return n.isRotate=f!==!1,n.isRotate?s:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isRotate){Fa(t,"onBeforeRotate",function(c){te(t,"onBeforeRotateGroup",ge(t,r,A(A({},c),{targets:t.props.targets}),!0))});var o=this.dragControl(t,r);if(o){var a=n.beforeDirection,i=o.beforeDist,l=i/180*Math.PI,s=gr(t,this,"dragControl",r,function(c,f){var u=f.datas.startGroupClient,p=L(f.datas.groupClient,2),h=p[0],m=p[1],y=L(ao(u,l*a),2),g=y[0],b=y[1],w=[g-h,b-m];return f.datas.groupClient=[g,b],A(A({},f),{parentRotate:i,groupDelta:w})});t.rotation=a*o.beforeRotation;var d=A({targets:t.props.targets,events:s,set:function(c){t.rotation=c},setGroupRotation:function(c){t.rotation=c}},o);return te(t,"onRotateGroup",d),d}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isRotate){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onRotateGroupEnd",i),n}},request:function(t){var r={},n=0,o=t.getRotation();return{isControl:!0,requestStart:function(){return{datas:r}},request:function(a){return"deltaRotate"in a?n+=a.deltaRotate:"rotate"in a&&(n=a.rotate-o),{datas:r,parentDist:n}},requestEnd:function(){return{datas:r,isDrag:!0}}}}};function xw(t,r){var n,o=t.direction,a=t.classNames,i=t.size,l=t.pos,s=t.zoom,d=t.key,c=o==="horizontal",f=c?"Y":"X";return r.createElement("div",{key:d,className:a.join(" "),style:(n={},n[c?"width":"height"]="".concat(i),n.transform="translate(".concat(l[0],", ").concat(l[1],") translate").concat(f,"(-50%) scale").concat(f,"(").concat(s,")"),n)})}function Pl(t,r){return xw(A(A({},t),{classNames:K([ae("line","guideline",t.direction)],L(t.classNames),!1).filter(function(n){return n}),size:t.size||"".concat(t.sizeValue,"px"),pos:t.pos||t.posValue.map(function(n){return"".concat(pe(n,.1),"px")})}),r)}function Jf(t,r,n,o,a,i,l,s){var d=t.props.zoom;return n.map(function(c,f){var u=c.type,p=c.pos,h=[0,0];return h[l]=o,h[l?0:1]=-a+p,Pl({key:"".concat(r,"TargetGuideline").concat(f),classNames:[ae("target","bold",u)],posValue:h,sizeValue:i,zoom:d,direction:r},s)})}function Kf(t,r,n,o,a,i){var l=t.props,s=l.zoom,d=l.isDisplayInnerSnapDigit,c=r==="horizontal"?kr:Nr,f=a[c.start],u=a[c.end];return n.filter(function(p){var h=p.hide,m=p.elementRect;if(h)return!1;if(d&&m){var y=m.rect;if(y[c.start]<=f&&u<=y[c.end])return!1}return!0}).map(function(p,h){var m=p.pos,y=p.size,g=p.element,b=p.className,w=[-o[0]+m[0],-o[1]+m[1]];return Pl({key:"".concat(r,"-default-guideline-").concat(h),classNames:g?[ae("bold"),b]:[ae("normal"),b],direction:r,posValue:w,sizeValue:y,zoom:s},i)})}function go(t,r,n,o,a,i,l,s){var d,c=t.props,f=c.snapDigit,u=f===void 0?0:f,p=c.isDisplaySnapDigit,h=p===void 0?!0:p,m=c.snapDistFormat,y=m===void 0?function(S,x){return S}:m,g=c.zoom,b=r==="horizontal"?"X":"Y",w=r==="vertical"?"height":"width",_=Math.abs(a),C=h?parseFloat(_.toFixed(u)):0;return s.createElement("div",{key:"".concat(r,"-").concat(n,"-guideline-").concat(o),className:ae("guideline-group",r),style:(d={left:"".concat(i[0],"px"),top:"".concat(i[1],"px")},d[w]="".concat(_,"px"),d)},Pl({direction:r,classNames:[ae(n),l],size:"100%",posValue:[0,0],sizeValue:_,zoom:g},s),s.createElement("div",{className:ae("size-value","gap"),style:{transform:"translate".concat(b,"(-50%) scale(").concat(g,")")}},C>0?y(C,r):""))}function vw(t,r,n,o){var a=t==="vertical"?0:1,i=t==="vertical"?1:0,l=a?kr:Nr,s=n[l.start],d=n[l.end];return bu(r,function(c){return c.pos[a]}).map(function(c){var f=[],u=[],p=[];return c.forEach(function(h){var m,y,g=h.element,b=h.elementRect.rect;if(b[l.end]<s)f.push(h);else if(d<b[l.start])u.push(h);else if(b[l.start]<=s&&d<=b[l.end]&&o){var w=h.pos,_={element:g,rect:A(A({},b),(m={},m[l.end]=b[l.start],m))},C={element:g,rect:A(A({},b),(y={},y[l.start]=b[l.end],y))},S=[0,0],x=[0,0];S[a]=w[a],S[i]=w[i],x[a]=w[a],x[i]=w[i]+h.size,f.push({type:t,pos:S,size:0,elementRect:_,direction:"",elementDirection:"end"}),u.push({type:t,pos:x,size:0,elementRect:C,direction:"",elementDirection:"start"})}}),f.sort(function(h,m){return m.pos[i]-h.pos[i]}),u.sort(function(h,m){return h.pos[i]-m.pos[i]}),{total:c,start:f,end:u,inner:p}})}function Ew(t,r,n,o,a){var i=t.props.isDisplayInnerSnapDigit,l=[];return["vertical","horizontal"].forEach(function(s){var d=r.filter(function(g){return g.type===s}),c=s==="vertical"?1:0,f=c?0:1,u=vw(s,d,o,i),p=c?Nr:kr,h=c?kr:Nr,m=o[p.start],y=o[p.end];u.forEach(function(g){var b=g.total,w=g.start,_=g.end,C=g.inner,S=n[f]+b[0].pos[f]-o[h.start],x=o;w.forEach(function(v){var V=v.elementRect.rect,$=x[p.start]-V[p.end];if($>0){var B=[0,0];B[c]=n[c]+x[p.start]-m-$,B[f]=S,l.push(go(t,s,"dashed",l.length,$,B,v.className,a))}x=V}),x=o,_.forEach(function(v){var V=v.elementRect.rect,$=V[p.start]-x[p.end];if($>0){var B=[0,0];B[c]=n[c]+x[p.end]-m,B[f]=S,l.push(go(t,s,"dashed",l.length,$,B,v.className,a))}x=V}),C.forEach(function(v){var V=v.elementRect.rect,$=m-V[p.start],B=V[p.end]-y,R=[0,0],T=[0,0];R[c]=n[c]-$,R[f]=S,T[c]=n[c]+y-m,T[f]=S,l.push(go(t,s,"dashed",l.length,$,R,v.className,a)),l.push(go(t,s,"dashed",l.length,B,T,v.className,a))})})}),l}function Vw(t,r,n,o,a){var i=[];return["horizontal","vertical"].forEach(function(l){var s=r.filter(function(g){return g.type===l}).slice(0,1),d=l==="vertical"?0:1,c=d?0:1,f=d?Nr:kr,u=d?kr:Nr,p=o[f.start],h=o[f.end],m=o[u.start],y=o[u.end];s.forEach(function(g){var b=g.gap,w=g.gapRects,_=Math.max.apply(Math,K([m],L(w.map(function(x){var v=x.rect;return v[u.start]})),!1)),C=Math.min.apply(Math,K([y],L(w.map(function(x){var v=x.rect;return v[u.end]})),!1)),S=(_+C)/2;_===C||S===(m+y)/2||w.forEach(function(x){var v=x.rect,V=x.className,$=[n[0],n[1]];if(v[f.end]<p)$[d]+=v[f.end]-p;else if(h<v[f.start])$[d]+=v[f.start]-p-b;else return;$[c]+=S-m,i.push(go(t,d?"vertical":"horizontal","gap",i.length,b,$,V,a))})})}),i}function Ul(t){var r,n,o=t.state,a=o.containerClientRect,i=o.hasFixed,l=a.overflow,s=a.scrollHeight,d=a.scrollWidth,c=a.clientHeight,f=a.clientWidth,u=a.clientLeft,p=a.clientTop,h=t.props,m=h.snapGap,y=m===void 0?!0:m,g=h.verticalGuidelines,b=h.horizontalGuidelines,w=h.snapThreshold,_=w===void 0?5:w,C=h.maxSnapElementGuidelineDistance,S=C===void 0?1/0:C,x=h.isDisplayGridGuidelines,v=Lt(jt(t.state)),V=v.top,$=v.left,B=v.bottom,R=v.right,T={top:V,left:$,bottom:B,right:R,center:($+R)/2,middle:(V+B)/2},k=Dw(t),O=K([],L(k),!1),N=((n=(r=o.snapThresholdInfo)===null||r===void 0?void 0:r.multiples)!==null&&n!==void 0?n:[1,1]).map(function(M){return M*_});y&&O.push.apply(O,K([],L(kw(t,T,N)),!1));var D=A({},o.snapOffset||{left:0,top:0,bottom:0,right:0});if(O.push.apply(O,K([],L($w(t,l?d:f,l?s:c,u,p,D,x)),!1)),i){var I=a.left,z=a.top;D.left+=I,D.top+=z,D.right+=I,D.bottom+=z}return O.push.apply(O,K([],L(eu(b||!1,g||!1,l?d:f,l?s:c,u,p,D)),!1)),O=O.filter(function(M){var j=M.element,F=M.elementRect,G=M.type;if(!j||!F)return!0;var H=F.rect;return Zf(T,H,G,S)}),O}function kw(t,r,n){var o=t.props,a=o.maxSnapElementGuidelineDistance,i=a===void 0?1/0:a,l=o.maxSnapElementGapDistance,s=l===void 0?1/0:l,d=t.state.elementRects,c=[];return[["vertical",kr,Nr],["horizontal",Nr,kr]].forEach(function(f){var u=L(f,3),p=u[0],h=u[1],m=u[2],y=r[h.start],g=r[h.end],b=r[h.center],w=r[m.start],_=r[m.end],C={left:n[0],top:n[1]};function S(V){var $=V.rect,B=C[h.start];return $[h.end]<y+B?y-$[h.end]:g-B<$[h.start]?$[h.start]-g:-1}var x=d.filter(function(V){var $=V.rect;return $[m.start]>_||$[m.end]<w?!1:S(V)>0}).sort(function(V,$){return S(V)-S($)}),v=[];x.forEach(function(V){x.forEach(function($){if(V!==$){var B=V.rect,R=$.rect,T=B[m.start],k=B[m.end],O=R[m.start],N=R[m.end];T>N||O>k||v.push([V,$])}})}),v.forEach(function(V){var $=L(V,2),B=$[0],R=$[1],T=B.rect,k=R.rect,O=T[h.start],N=T[h.end],D=k[h.start],I=k[h.end],z=C[h.start],M=0,j=0,F=!1,G=!1,H=!1;if(N<=y&&g<=D){if(G=!0,M=(D-N-(g-y))/2,j=N+M+(g-y)/2,q(j-b)>z)return}else if(N<D&&I<y+z){if(F=!0,M=D-N,j=I+M,q(j-y)>z)return}else if(N<D&&g-z<O){if(H=!0,M=D-N,j=O-M,q(j-g)>z)return}else return;M&&Zf(r,k,p,i)&&(M>s||c.push({type:p,pos:p==="vertical"?[j,0]:[0,j],element:R.element,size:0,className:R.className,isStart:F,isCenter:G,isEnd:H,gap:M,hide:!0,gapRects:[B,R],direction:"",elementDirection:""}))})}),c}function Nw(t,r,n,o){var a,i,l=t.props,s=t.state,d=l.snapGridAll,c=l.snapGridWidth,f=c===void 0?0:c,u=l.snapGridHeight,p=u===void 0?0:u,h=s.snapRenderInfo,m=h&&(((a=h.direction)===null||a===void 0?void 0:a[0])||((i=h.direction)===null||i===void 0?void 0:i[1])),y=t.moveables;if(d&&y&&m&&(f||p)){if(s.snapThresholdInfo)return;s.snapThresholdInfo={multiples:[1,1],offset:[0,0]};var g=t.getRect(),b=g.children,w=h.direction;if(b){var _=w.map(function(S,x){var v=x===0?{snapSize:f,posName:"left",sizeName:"width",clientOffset:o.left-r}:{snapSize:p,posName:"top",sizeName:"height",clientOffset:o.top-n},V=v.snapSize,$=v.posName,B=v.sizeName,R=v.clientOffset;if(!V)return{dir:S,multiple:1,snapSize:V,snapOffset:0};var T=g[B],k=g[$],O=_d(b.map(function(F){return[F[$]-k,F[B],T-F[B]-F[$]+k]})).filter(function(F){return F}).sort(function(F,G){return F-G}),N=O[0],D=O.map(function(F){return pe(F/N,.1)*V}),I=1,z=pe(T/N,.1);for(I=1;I<=10&&!D.every(function(F){return F*I%1===0});++I);var M=(-S+1)/2,j=ia(k-R,k-R+T,M,1-M);return{multiple:z*I,dir:S,snapSize:V,snapOffset:Math.round(j/V)}}),C=_.map(function(S){return S.multiple||1});s.snapThresholdInfo.multiples=C,s.snapThresholdInfo.offset=_.map(function(S){return S.snapOffset}),_.forEach(function(S,x){S.snapSize})}}else s.snapThresholdInfo=null}function $w(t,r,n,o,a,i,l){o===void 0&&(o=0),a===void 0&&(a=0);var s=t.props,d=t.state,c=s.snapGridWidth,f=c===void 0?0:c,u=s.snapGridHeight,p=u===void 0?0:u,h=[],m=i.left,y=i.top,g=[0,0];Nw(t,o,a,i);var b=d.snapThresholdInfo,w=f,_=p;if(b&&(f*=b.multiples[0]||1,p*=b.multiples[1]||1,g=b.offset),p){for(var C=function(x){h.push({type:"horizontal",pos:[m,pe(g[1]*_+x-a+y,.1)],className:ae("grid-guideline"),size:r,hide:!l,direction:"",grid:!0})},S=0;S<=n*2;S+=p)C(S);for(var S=-p;S>=-n;S-=p)C(S)}if(f){for(var C=function(v){h.push({type:"vertical",pos:[pe(g[0]*w+v-o+m,.1),y],className:ae("grid-guideline"),size:n,hide:!l,direction:"",grid:!0})},S=0;S<=r*2;S+=f)C(S);for(var S=-f;S>=-r;S-=f)C(S)}return h}function Zf(t,r,n,o){return n==="horizontal"?q(t.right-r.left)<=o||q(t.left-r.right)<=o||t.left<=r.right&&r.left<=t.right:n==="vertical"?q(t.bottom-r.top)<=o||q(t.top-r.bottom)<=o||t.top<=r.bottom&&r.top<=t.bottom:!0}function Dw(t){var r=t.state,n=t.props.elementGuidelines,o=n===void 0?[]:n;if(!o.length)return r.elementRects=[],[];var a=(r.elementRects||[]).filter(function(p){return!p.refresh}),i=o.map(function(p){return $t(p)&&"element"in p?A(A({},p),{element:ir(p.element,!0)}):{element:ir(p,!0)}}).filter(function(p){return p.element}),l=gn(a.map(function(p){return p.element}),i.map(function(p){return p.element})),s=l.maintained,d=l.added,c=[];s.forEach(function(p){var h=L(p,2),m=h[0],y=h[1];c[y]=a[m]}),Bw(t,d.map(function(p){return i[p]})).map(function(p,h){c[d[h]]=p}),r.elementRects=c;var f=Bl(t.props.elementSnapDirections),u=[];return c.forEach(function(p){var h=p.element,m=p.top,y=m===void 0?f.top:m,g=p.left,b=g===void 0?f.left:g,w=p.right,_=w===void 0?f.right:w,C=p.bottom,S=C===void 0?f.bottom:C,x=p.center,v=x===void 0?f.center:x,V=p.middle,$=V===void 0?f.middle:V,B=p.className,R=p.rect,T=Tl({top:y,right:_,left:b,bottom:S,center:v,middle:$},R),k=T.horizontal,O=T.vertical,N=T.horizontalNames,D=T.verticalNames,I=R.top,z=R.left,M=R.right-z,j=R.bottom-I,F=[M,j];O.forEach(function(G,H){u.push({type:"vertical",element:h,pos:[pe(G,.1),I],size:j,sizes:F,className:B,elementRect:p,elementDirection:Df[D[H]]||D[H],direction:""})}),k.forEach(function(G,H){u.push({type:"horizontal",element:h,pos:[z,pe(G,.1)],size:M,sizes:F,className:B,elementRect:p,elementDirection:Df[N[H]]||N[H],direction:""})})}),u}function Qf(t,r){return t?t.map(function(n){var o=$t(n)?n:{pos:n},a=o.pos;return un(a)?o:A(A({},o),{pos:Te(a,r)})}):[]}function eu(t,r,n,o,a,i,l){a===void 0&&(a=0),i===void 0&&(i=0),l===void 0&&(l={left:0,top:0,right:0,bottom:0});var s=[],d=l.left,c=l.top,f=l.bottom,u=l.right,p=n+u-d,h=o+f-c;return Qf(t,h).forEach(function(m){s.push({type:"horizontal",pos:[d,pe(m.pos-i+c,.1)],size:p,className:m.className,direction:""})}),Qf(r,p).forEach(function(m){s.push({type:"vertical",pos:[pe(m.pos-a+d,.1),c],size:h,className:m.className,direction:""})}),s}function Bw(t,r){if(!r.length)return[];var n=t.props.groupable,o=t.state,a=o.containerClientRect,i=o.rootMatrix,l=o.is3d,s=o.offsetDelta,d=l?4:3,c=L(tw(i,a,d),2),f=c[0],u=c[1],p=n?0:s[0],h=n?0:s[1];return r.map(function(m){var y=m.element.getBoundingClientRect(),g=y.left-f-p,b=y.top-u-h,w=b+y.height,_=g+y.width,C=L($n(i,[g,b],d),2),S=C[0],x=C[1],v=L($n(i,[_,w],d),2),V=v[0],$=v[1];return A(A({},m),{rect:{left:S,right:V,top:x,bottom:$,center:(S+V)/2,middle:(x+$)/2}})})}function za(t){var r=t.state,n=r.container,o=t.props.snapContainer||n;if(r.snapContainer===o&&r.guidelines&&r.guidelines.length)return!1;var a=r.containerClientRect,i={left:0,top:0,bottom:0,right:0};if(n!==o){var l=ir(o,!0);if(l){var s=Co(l),d=Cu(r,[s.left-a.left,s.top-a.top]),c=Cu(r,[s.right-a.right,s.bottom-a.bottom]);i.left=pe(d[0],1e-5),i.top=pe(d[1],1e-5),i.right=pe(c[0],1e-5),i.bottom=pe(c[1],1e-5)}}return r.snapContainer=o,r.snapOffset=i,r.guidelines=Ul(t),r.enableSnap=!0,!0}function tu(t,r,n,o,a,i){var l=qr(t,r,n,i?4:3),s=rt(l,o);return Xl(l,se(a,s))}function ru(t){return t?t/q(t):0}function Tw(t,r,n,o,a,i){var l=i.fixedDirection,s=aw(n,l,o),d=zl(t,r,n,o),c=K(K([],L(yw(t,r,s,o,a,i)),!1),L(Pf(t,d,i)),!1),f=Ba(c,0),u=Ba(c,1);return{width:{isBound:f.isBound,offset:f.offset[0]},height:{isBound:u.isBound,offset:u.offset[1]}}}function Ow(t,r,n,o,a,i,l,s,d){var c=rt(r,l),f=Oa(t,s,{vertical:[c[0]],horizontal:[c[1]]}),u=f.horizontal.offset,p=f.vertical.offset;if(pe(p,Sl)||pe(u,Sl)){var h=L(ar({datas:d,distX:-p,distY:-u}),2),m=h[0],y=h[1],g=Math.min(a||1/0,n+l[0]*m),b=Math.min(i||1/0,o+l[1]*y);return[g-n,b-o]}return[0,0]}function nu(t,r,n,o,a,i,l,s){for(var d=jt(t.state),c=t.props.keepRatio,f=0,u=0,p=0;p<2;++p){var h=r(f,u),m=Tw(t,h,a,c,l,s),y=m.width,g=m.height,b=y.isBound,w=g.isBound,_=y.offset,C=g.offset;if(p===1&&(b||(_=0),w||(C=0)),p===0&&l&&!b&&!w)return[0,0];if(c){var S=q(_)*(n?1/n:1),x=q(C)*(o?1/o:1),v=b&&w?S<x:w||!b&&S<x;v?_=n*C/o:C=o*_/n}f+=_,u+=C}if(!c&&a[0]&&a[1]){var V=_w(t,d,a,i,s),$=V.maxWidth,B=V.maxHeight,R=L(Ow(t,r(f,u).map(function(O){return O.map(function(N){return pe(N,Sl)})}),n+f,o+u,$,B,a,l,s),2),_=R[0],C=R[1];f+=_,u+=C}return[f,u]}function yo(t){return t<0&&(t=t%360+360),t%=360,t}function Iw(t,r){r=yo(r);var n=Math.floor(t/360),o=n*360+360-r,a=n*360+r;return q(t-o)<q(t-a)?o:a}function Wl(t,r){t=yo(t),r=yo(r);var n=yo(t-r);return Math.min(n,360-n)}function zw(t,r,n,o){var a,i=t.props,l=(a=i[Bf])!==null&&a!==void 0?a:5,s=i[Tf];if(Vn(t,"rotatable")){var d=r.pos1,c=r.pos2,f=r.pos3,u=r.pos4,p=r.origin,h=n*Math.PI/180,m=[d,c,f,u].map(function(C){return se(C,p)}),y=m.map(function(C){return ao(C,h)}),g=K(K([],L(K_(t,m,y,p,n)),!1),L(fw(t,m,y,p,n)),!1);g.sort(function(C,S){return q(C-n)-q(S-n)});var b=g.length>0;if(b)return{isSnap:b,dist:b?g[0]:n}}if(s!=null&&s.length&&l){var w=s.slice().sort(function(C,S){return Wl(C,o)-Wl(S,o)}),_=w[0];if(Wl(_,o)<=l)return{isSnap:!0,dist:n+Iw(o,_)-o}}return{isSnap:!1,dist:n}}function Rw(t,r,n,o,a,i,l){if(!Vn(t,"resizable"))return[0,0];var s=l.fixedDirection,d=l.nextAllMatrix,c=t.state,f=c.allMatrix,u=c.is3d;return nu(t,function(p,h){return tu(d||f,r+p,n+h,s,a,u)},r,n,o,a,i,l)}function Mw(t,r,n,o,a){if(!Vn(t,"scalable"))return[0,0];var i=a.startOffsetWidth,l=a.startOffsetHeight,s=a.fixedPosition,d=a.fixedDirection,c=a.is3d,f=nu(t,function(u,p){return tu(R_(a,xe(r,[u/i,p/l])),i,l,d,s,c)},i,l,n,s,o,a);return[f[0]/i,f[1]/l]}function Aw(t,r){r.absolutePoses=jt(t.state)}function ou(t){var r=[];return t.forEach(function(n){n.guidelineInfos.forEach(function(o){var a=o.guideline;_t(r,function(i){return i.guideline===a})||(a.direction="",r.push({guideline:a,posInfo:n}))})}),r.map(function(n){var o=n.guideline,a=n.posInfo;return A(A({},o),{direction:a.direction})})}function au(t,r,n,o,a,i){var l=Dl($a(t,i),r,n),s=l.vertical,d=l.horizontal,c=En();s.forEach(function(m){m.isBound&&(m.direction==="start"&&(c.left=!0),m.direction==="end"&&(c.right=!0),o.push({type:"bounds",pos:m.pos}))}),d.forEach(function(m){m.isBound&&(m.direction==="start"&&(c.top=!0),m.direction==="end"&&(c.bottom=!0),a.push({type:"bounds",pos:m.pos}))});var f=uw(t),u=f.boundMap,p=f.vertical,h=f.horizontal;return p.forEach(function(m){hr(o,function(y){var g=y.type,b=y.pos;return g==="bounds"&&b===m})>=0||o.push({type:"bounds",pos:m})}),h.forEach(function(m){hr(a,function(y){var g=y.type,b=y.pos;return g==="bounds"&&b===m})>=0||a.push({type:"bounds",pos:m})}),{boundMap:c,innerBoundMap:u}}var Lw=Ql("",["resizable","scalable"]),Fw={name:"snappable",dragRelation:"strong",props:["snappable","snapContainer","snapDirections","elementSnapDirections","snapGap","snapGridWidth","snapGridHeight","isDisplaySnapDigit","isDisplayInnerSnapDigit","isDisplayGridGuidelines","snapDigit","snapThreshold","snapRenderThreshold","snapGridAll",Bf,Tf,Of,If,"horizontalGuidelines","verticalGuidelines","elementGuidelines","bounds","innerBounds","snapDistFormat","maxSnapElementGuidelineDistance","maxSnapElementGapDistance"],events:["snap","bound"],css:[`:host {
278
278
  --bounds-color: #d66;
279
279
  }
280
280
  .guideline {
@@ -317,7 +317,7 @@ background: #f55;
317
317
  .size-value.gap {
318
318
  color: #f55;
319
319
  }
320
- `],render:function(t,r){var n=t.state,o=n.top,a=n.left,i=n.pos1,l=n.pos2,s=n.pos3,d=n.pos4,c=n.snapRenderInfo,f=t.props.snapRenderThreshold,u=f===void 0?1:f;if(!c||!c.render||!Vn(t,""))return Dn(t,"boundMap",En(),function(X){return JSON.stringify(X)}),Dn(t,"innerBoundMap",En(),function(X){return JSON.stringify(X)}),[];n.guidelines=Ul(t);var p=Math.min(i[0],l[0],s[0],d[0]),h=Math.min(i[1],l[1],s[1],d[1]),m=c.externalPoses||[],y=jt(t.state),g=[],b=[],w=[],_=[],C=[],S=Lt(y),x=S.width,v=S.height,V=S.top,$=S.left,B=S.bottom,R=S.right,T={left:$,right:R,top:V,bottom:B,center:($+R)/2,middle:(V+B)/2},k=m.length>0,O=k?Lt(m):{};if(!c.request){if(c.direction&&C.push(ow(t,y,c.direction,u,u)),c.snap){var N=Lt(y);c.center&&(N.middle=(N.top+N.bottom)/2,N.center=(N.left+N.right)/2),C.push(Rf(t,N,u,u))}k&&(c.center&&(O.middle=(O.top+O.bottom)/2,O.center=(O.left+O.right)/2),C.push(Rf(t,O,u,u))),C.forEach(function(X){var J=X.vertical.posInfos,P=X.horizontal.posInfos;g.push.apply(g,K([],L(J.filter(function(W){var Q=W.guidelineInfos;return Q.some(function(re){var ne=re.guideline;return!ne.hide})}).map(function(W){return{type:"snap",pos:W.pos}})),!1)),b.push.apply(b,K([],L(P.filter(function(W){var Q=W.guidelineInfos;return Q.some(function(re){var ne=re.guideline;return!ne.hide})}).map(function(W){return{type:"snap",pos:W.pos}})),!1)),w.push.apply(w,K([],L(ou(J)),!1)),_.push.apply(_,K([],L(ou(P)),!1))})}var D=au(t,[$,R],[V,B],g,b),I=D.boundMap,z=D.innerBoundMap;k&&au(t,[O.left,O.right],[O.top,O.bottom],g,b,c.externalBounds);var M=K(K([],L(w),!1),L(_),!1),j=M.filter(function(X){return X.element&&!X.gapRects}),F=M.filter(function(X){return X.gapRects}).sort(function(X,J){return X.gap-J.gap});te(t,"onSnap",{guidelines:M.filter(function(X){var J=X.element;return!J}),elements:j,gaps:F},!0);var G=Dn(t,"boundMap",I,function(X){return JSON.stringify(X)},En()),H=Dn(t,"innerBoundMap",z,function(X){return JSON.stringify(X)},En());return(I===G||z===H)&&te(t,"onBound",{bounds:I,innerBounds:z},!0),K(K(K(K(K(K([],L(Ew(t,j,[p,h],T,r)),!1),L(Vw(t,F,[p,h],T,r)),!1),L(Kf(t,"horizontal",_,[a,o],T,r)),!1),L(Kf(t,"vertical",w,[a,o],T,r)),!1),L(Jf(t,"horizontal",b,p,o,x,0,r)),!1),L(Jf(t,"vertical",g,h,a,v,1,r)),!1)},dragStart:function(t,r){t.state.snapRenderInfo={request:r.isRequest,snap:!0,center:!0},za(t)},drag:function(t){var r=t.state;za(t)||(r.guidelines=Ul(t)),r.snapRenderInfo&&(r.snapRenderInfo.render=!0)},pinchStart:function(t){this.unset(t)},dragEnd:function(t){this.unset(t)},dragControlCondition:function(t,r){if(Lw(t,r)||jl(t,r))return!0;if(!r.isRequest&&r.inputEvent)return Ze(r.inputEvent.target,ae("snap-control"))},dragControlStart:function(t){t.state.snapRenderInfo=null,za(t)},dragControl:function(t){this.drag(t)},dragControlEnd:function(t){this.unset(t)},dragGroupStart:function(t,r){this.dragStart(t,r)},dragGroup:function(t){this.drag(t)},dragGroupEnd:function(t){this.unset(t)},dragGroupControlStart:function(t){t.state.snapRenderInfo=null,za(t)},dragGroupControl:function(t){this.drag(t)},dragGroupControlEnd:function(t){this.unset(t)},unset:function(t){var r=t.state;r.enableSnap=!1,r.guidelines=[],r.snapRenderInfo=null,r.elementRects=[]}};function jw(t,r){return[t[0]*r[0],t[1]*r[1]]}function ae(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return jb.apply(void 0,K([Cl],L(t),!1))}function iu(t){t()}function Pw(t){return!t||t==="none"?[1,0,0,1,0,0]:$t(t)?t:pn(t)}function bo(t,r,n){return pa(r,Wr(n,r),t,Wr(n.map(function(o){return-o}),r))}function Uw(t,r,n){if(r==="%"){var o=Hl(t.ownerSVGElement);return o[n?"width":"height"]/100}return 1}function Ww(t){var r=Gw(Jl(t,":before"));return r.map(function(n,o){var a=Pr(n),i=a.value,l=a.unit;return i*Uw(t,l,o===0)})}function Ra(t){return t?t.split(" "):["0","0"]}function Gw(t){return Ra(t.transformOrigin)}function lu(t){var r=St(t),n=r("transform");if(n&&n!=="none")return n;if("transform"in t){var o=t.transform,a=o.baseVal;if(!a)return"";var i=a.length;if(!i)return"";for(var l=[],s=function(c){var f=a[c].matrix;l.push("matrix(".concat(["a","b","c","d","e","f"].map(function(u){return f[u]}).join(", "),")"))},d=0;d<i;++d)s(d);return l.join(" ")}return""}function _o(t,r,n,o,a){var i,l,s=Wi(t)||Er(t),d=!1,c,f;if(!t||n)c=t;else{var u=(i=t==null?void 0:t.assignedSlot)===null||i===void 0?void 0:i.parentElement,p=t.parentElement;u?(d=!0,f=p,c=u):c=p}for(var h=!1,m=t===r||c===r,y="relative",g=1,b=parseFloat(a==null?void 0:a("zoom"))||1,w=a==null?void 0:a("position");c&&c!==s;){r===c&&(m=!0);var _=St(c),C=c.tagName.toLowerCase(),S=lu(c),x=_("willChange"),v=parseFloat(_("zoom"))||1;if(y=_("position"),o&&v!==1){g=v;break}if(!n&&o&&b!==1&&w&&w!=="absolute"||C==="svg"||C==="foreignobject"||y!=="static"||S&&S!=="none"||x==="transform")break;var V=(l=t==null?void 0:t.assignedSlot)===null||l===void 0?void 0:l.parentNode,$=c.parentNode;V&&(d=!0,f=$);var B=$;if(B&&B.nodeType===11){c=B.host,h=!0,y=St(c)("position");break}c=B,y="relative"}return{offsetZoom:g,hasSlot:d,parentSlotElement:f,isCustomElement:h,isStatic:y==="static",isEnd:m||!c||c===s,offsetParent:c||s}}function Hw(t,r){var n,o=t.tagName.toLowerCase(),a=t.offsetLeft,i=t.offsetTop,l=St(t),s=Kn(a),d=!s,c,f;return!d&&(o!=="svg"||t.ownerSVGElement)?(c=cf?Ww(t):Ra(l("transformOrigin")).map(function(u){return parseFloat(u)}),f=c.slice(),d=!0,o==="svg"?(a=0,i=0):(n=L(qw(t,c,t===r&&r.tagName.toLowerCase()==="g"),4),a=n[0],i=n[1],c[0]=n[2],c[1]=n[3])):(c=Ra(l("transformOrigin")).map(function(u){return parseFloat(u)}),f=c.slice()),{tagName:o,isSVG:s,hasOffset:d,offset:[a||0,i||0],origin:c,targetOrigin:f}}function su(t,r){var n=St(t),o=St(Er(t)),a=o("position");if(!r&&(!a||a==="static"))return[0,0];var i=parseInt(o("marginLeft"),10),l=parseInt(o("marginTop"),10);return n("position")==="absolute"&&((n("top")!=="auto"||n("bottom")!=="auto")&&(l=0),(n("left")!=="auto"||n("right")!=="auto")&&(i=0)),[i,l]}function Gl(t){t.forEach(function(r){var n=r.matrix;n&&(r.matrix=Jt(n,3,4))})}function Yw(t){for(var r=t.parentElement,n=!1,o=Er(t);r;){var a=Jl(r).transform;if(a&&a!=="none"){n=!0;break}if(r===o)break;r=r.parentElement}return{fixedContainer:r||o,hasTransform:n}}function Ma(t,r){return r===void 0&&(r=t.length>9),"".concat(r?"matrix3d":"matrix","(").concat(qd(t,!r).join(","),")")}function Hl(t){var r=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:r,clientHeight:n};var o=t.viewBox,a=o&&o.baseVal||{x:0,y:0,width:0,height:0};return{x:a.x,y:a.y,width:a.width||r,height:a.height||n,clientWidth:r,clientHeight:n}}function Xw(t,r){var n,o=Hl(t),a=o.width,i=o.height,l=o.clientWidth,s=o.clientHeight,d=l/a,c=s/i,f=t.preserveAspectRatio.baseVal,u=f.align,p=f.meetOrSlice,h=[0,0],m=[d,c],y=[0,0];if(u!==1){var g=(u-2)%3,b=Math.floor((u-2)/3);h[0]=a*g/2,h[1]=i*b/2;var w=p===2?Math.max(c,d):Math.min(d,c);m[0]=w,m[1]=w,y[0]=(l-a)/2*g,y[1]=(s-i)/2*b}var _=ol(m,r);return n=L(y,2),_[r*(r-1)]=n[0],_[r*(r-1)+1]=n[1],bo(_,r,h)}function qw(t,r,n){var o=t.tagName.toLowerCase();if(!t.getBBox||!n&&o==="g")return[0,0,0,0];var a=St(t),i=a("transform-box")==="fill-box",l=t.getBBox(),s=Hl(t.ownerSVGElement),d=l.x,c=l.y;o==="foreignobject"&&!d&&!c&&(d=parseFloat(t.getAttribute("x"))||0,c=parseFloat(t.getAttribute("y"))||0);var f=d-s.x,u=c-s.y,p=i?r[0]:r[0]-f,h=i?r[1]:r[1]-u;return[f,u,p,h]}function Ge(t,r,n){return lt(t,Ur(r,n),n)}function qr(t,r,n,o){return[[0,0],[r,0],[0,n],[r,n]].map(function(a){return Ge(t,a,o)})}function Lt(t){var r=t.map(function(c){return c[0]}),n=t.map(function(c){return c[1]}),o=Math.min.apply(Math,K([],L(r),!1)),a=Math.min.apply(Math,K([],L(n),!1)),i=Math.max.apply(Math,K([],L(r),!1)),l=Math.max.apply(Math,K([],L(n),!1)),s=i-o,d=l-a;return{left:o,top:a,right:i,bottom:l,width:s,height:d}}function cu(t,r,n,o){var a=qr(t,r,n,o);return Lt(a)}function Jw(t,r,n,o,a){var i,l=t.target,s=t.origin,d=r.matrix,c=fu(l),f=c.offsetWidth,u=c.offsetHeight,p=n.getBoundingClientRect(),h=[0,0];n===Er(n)&&(h=su(l,!0));for(var m=l.getBoundingClientRect(),y=m.left-p.left+n.scrollLeft-(n.clientLeft||0)+h[0],g=m.top-p.top+n.scrollTop-(n.clientTop||0)+h[1],b=m.width,w=m.height,_=pa(o,a,d),C=cu(_,f,u,o),S=C.left,x=C.top,v=C.width,V=C.height,$=Ge(_,s,o),B=se($,[S,x]),R=[y+B[0]*b/v,g+B[1]*w/V],T=[0,0],k=0;++k<10;){var O=qt(a,o);i=L(se(Ge(O,R,o),Ge(O,$,o)),2),T[0]=i[0],T[1]=i[1];var N=pa(o,a,Wr(T,o),d),D=cu(N,f,u,o),I=D.left,z=D.top,M=I-y,j=z-g;if(q(M)<2&&q(j)<2)break;R[0]-=M,R[1]-=j}return T.map(function(F){return Math.round(F)})}function Kw(t,r,n){var o=t.length===16,a=o?4:3,i=r.map(function(d){return Ge(t,d,a)}),l=n.left,s=n.top;return i.map(function(d){return[d[0]+l,d[1]+s]})}function Ft(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function du(t,r){return Ft([r[0]-t[0],r[1]-t[1]])}function wo(t,r,n,o){n===void 0&&(n=1),o===void 0&&(o=Ye(t,r));var a=du(t,r);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(o,"rad) scaleY(").concat(n,")"),width:"".concat(a,"px")}}function Aa(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=n.length,i=n.reduce(function(s,d){return s+d[0]},0)/a,l=n.reduce(function(s,d){return s+d[1]},0)/a;return{transform:"translateZ(0px) translate(".concat(i,"px, ").concat(l,"px) rotate(").concat(t,"rad) scale(").concat(r,")")}}function Jr(t,r){var n=t[r];return $t(n)?A(A({},t),n):t}function fu(t){var r=t&&!Kn(t.offsetWidth),n=0,o=0,a=0,i=0,l=0,s=0,d=0,c=0,f=0,u=0,p=0,h=0,m=1/0,y=1/0,g=1/0,b=1/0,w=0,_=0,C=!1;if(t)if(!r&&t.ownerSVGElement){var S=t.getBBox();C=!0,n=S.width,o=S.height,l=n,s=o,d=n,c=o,a=n,i=o}else{var x=St(t),v=t.style,V=x("boxSizing")==="border-box",$=parseFloat(x("borderLeftWidth"))||0,B=parseFloat(x("borderRightWidth"))||0,R=parseFloat(x("borderTopWidth"))||0,T=parseFloat(x("borderBottomWidth"))||0,k=parseFloat(x("paddingLeft"))||0,O=parseFloat(x("paddingRight"))||0,N=parseFloat(x("paddingTop"))||0,D=parseFloat(x("paddingBottom"))||0,I=k+O,z=N+D,M=$+B,j=R+T,F=I+M,G=z+j,H=x("position"),X=0,J=0;if("clientLeft"in t){var P=null;if(H==="absolute"){var W=_o(t,Er(t));P=W.offsetParent}else P=t.parentElement;if(P){var Q=St(P);X=parseFloat(Q("width")),J=parseFloat(Q("height"))}}f=Math.max(I,Te(x("minWidth"),X)||0),u=Math.max(z,Te(x("minHeight"),J)||0),m=Te(x("maxWidth"),X),y=Te(x("maxHeight"),J),isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0),w=Te(v.width,0)||0,_=Te(v.height,0)||0,l=parseFloat(x("width"))||0,s=parseFloat(x("height"))||0,d=q(l-w)<1?ca(f,w||l,m):l,c=q(s-_)<1?ca(u,_||s,y):s,n=d,o=c,a=d,i=c,V?(g=m,b=y,p=f,h=u,d=n-F,c=o-G):(g=m+F,b=y+G,p=f+F,h=u+G,n=d+F,o=c+G),a=d+I,i=c+z}return{svg:C,offsetWidth:n,offsetHeight:o,clientWidth:a,clientHeight:i,contentWidth:d,contentHeight:c,inlineCSSWidth:w,inlineCSSHeight:_,cssWidth:l,cssHeight:s,minWidth:f,minHeight:u,maxWidth:m,maxHeight:y,minOffsetWidth:p,minOffsetHeight:h,maxOffsetWidth:g,maxOffsetHeight:b}}function uu(t,r){return Ye(r>0?t[0]:t[1],r>0?t[1]:t[0])}function La(){return{left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0}}function pu(t,r){var n=t===Er(t)||t===Wi(t),o={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(o.clientHeight=Math.max(r.height,o.clientHeight),o.scrollHeight=Math.max(r.height,o.scrollHeight)),o.overflow=St(t)("overflow")!=="visible",A(A({},r),o)}function Yl(t,r,n,o){var a=t.left,i=t.right,l=t.top,s=t.bottom,d=r.top,c=r.left,f={left:c+a,top:d+l,right:c+i,bottom:d+s,width:i-a,height:s-l};return n&&o?pu(n,f):f}function Co(t,r){var n=0,o=0,a=0,i=0;if(t){var l=t.getBoundingClientRect();n=l.left,o=l.top,a=l.width,i=l.height}var s={left:n,top:o,width:a,height:i,right:n+a,bottom:o+i};return t&&r?pu(t,s):s}function Zw(t){var r=t.props,n=r.groupable,o=r.svgOrigin,a=t.getState(),i=a.offsetWidth,l=a.offsetHeight,s=a.svg,d=a.transformOrigin;return!n&&s&&o?rs(o,i,l):d}function hu(t,r,n,o){var a;if(t)a=t;else if(r)a=[0,0];else{var i=n.target;a=mu(i,o)}return a}function mu(t,r){if(t){var n=t.getAttribute("data-rotation")||"",o=t.getAttribute("data-direction");if(r.deg=n,!!o){var a=[0,0];return o.indexOf("w")>-1&&(a[0]=-1),o.indexOf("e")>-1&&(a[0]=1),o.indexOf("n")>-1&&(a[1]=-1),o.indexOf("s")>-1&&(a[1]=1),a}}}function Xl(t,r){return[xe(r,t[0]),xe(r,t[1]),xe(r,t[2]),xe(r,t[3])]}function jt(t){var r=t.left,n=t.top,o=t.pos1,a=t.pos2,i=t.pos3,l=t.pos4;return Xl([o,a,i,l],[r,n])}function ql(t,r){t[r?"controlAbles":"targetAbles"].forEach(function(n){n.unset&&n.unset(t)})}function kn(t,r){var n=r?"controlGesto":"targetGesto",o=t[n];(o==null?void 0:o.isIdle())===!1&&ql(t,r),o==null||o.unset(),t[n]=null}function ut(t,r){if(r){var n=Sn(r);n.nextStyle=A(A({},n.nextStyle),t)}return{style:t,cssText:mr(t).map(function(o){return"".concat(sa(o,"-"),": ").concat(t[o],";")}).join("")}}function gu(t,r,n){var o=r.afterTransform||r.transform;return A(A({},ut(A(A(A({},t.style),r.style),{transform:o}),n)),{afterTransform:o,transform:t.transform})}function ge(t,r,n,o){var a=r.datas;a.datas||(a.datas={});var i=A(A({},n),{target:t.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:t,moveable:t,datas:a.datas,isRequest:r.isRequest,isRequestChild:r.isRequestChild,isFirstDrag:!!r.isFirstDrag,isTrusted:r.isTrusted!==!1,stopAble:function(){a.isEventStart=!1},stopDrag:function(){var l;(l=r.stop)===null||l===void 0||l.call(r)}});return a.isStartEvent?o||(a.lastEvent=i):a.isStartEvent=!0,i}function Dt(t,r,n){var o=r.datas,a="isDrag"in n?n.isDrag:r.isDrag;return o.datas||(o.datas={}),A(A({isDrag:a},n),{moveable:t,target:t.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:t,lastEvent:o.lastEvent,isDouble:r.isDouble,datas:o.datas,isFirstDrag:!!r.isFirstDrag})}function Fa(t,r,n){t._emitter.on(r,n)}function te(t,r,n,o,a){return t.triggerEvent(r,n,o,a)}function Jl(t,r){return At(t).getComputedStyle(t,r)}function ja(t,r,n){var o={},a={};return t.filter(function(i){var l=i.name;if(o[l]||!r.some(function(s){return i[s]}))return!1;if(!n&&i.ableGroup){if(a[i.ableGroup])return!1;a[i.ableGroup]=!0}return o[l]=!0,!0})}function Kl(t,r){return t===r||t==null&&r==null}function yu(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=t.length-1,o=0;o<n;++o){var a=t[o];if(!Kn(a))return a}return t[n]}function bu(t,r){var n=[],o=[];return t.forEach(function(a,i){var l=r(a,i,t),s=o.indexOf(l),d=n[s]||[];s===-1&&(o.push(l),n.push(d)),d.push(a)}),n}function Qw(t,r){var n=[],o={};return t.forEach(function(a,i){var l=r(a,i,t),s=o[l];s||(s=[],o[l]=s,n.push(s)),s.push(a)}),n}function _u(t){return t.reduce(function(r,n){return r.concat(n)},[])}function Nn(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.sort(function(n,o){return q(o)-q(n)}),t[0]}function $n(t,r,n){return lt(qt(t,n),Ur(r,n),n)}function wu(t,r){var n,o=t.is3d,a=t.rootMatrix,i=o?4:3;return n=L($n(a,[r.distX,r.distY],i),2),r.distX=n[0],r.distY=n[1],r}function Pt(t,r,n,o){if(!n[0]&&!n[1])return r;var a=Ge(t,[ru(n[0]||1),0],o),i=Ge(t,[0,ru(n[1]||1)],o),l=Ge(t,[n[0]/Ft(a),n[1]/Ft(i)],o);return xe(r,l)}function Zt(t,r,n){return n?"".concat(t/r*100,"%"):"".concat(t,"px")}function Pa(t){return q(t)<=dt?0:t}function Zl(t){return function(r){if(!r.isDragging(t))return"";var n=U_(r,t),o=n.deg;return o?ae("view-control-rotation".concat(o)):""}}function Ql(t,r){return r===void 0&&(r=[t]),function(n,o){if(o.isRequest)return r.some(function(i){return o.requestAble===i})?o.parentDirection:!1;var a=o.inputEvent.target;return Ze(a,ae("direction"))&&(!t||Ze(a,ae(t)))}}function eC(t,r,n){var o,a=mn(t,{"x%":function(S){return S/100*r.offsetWidth},"y%":function(S){return S/100*r.offsetHeight}}),i=t.slice(0,n<0?void 0:n),l=t.slice(0,n<0?void 0:n+1),s=t[n]||"",d=n<0?[]:t.slice(n),c=n<0?[]:t.slice(n+1),f=a.slice(0,n<0?void 0:n),u=a.slice(0,n<0?void 0:n+1),p=(o=a[n])!==null&&o!==void 0?o:mn([""])[0],h=n<0?[]:a.slice(n),m=n<0?[]:a.slice(n+1),y=p?[p]:[],g=hn(f),b=hn(u),w=hn(h),_=hn(m),C=Oe(g,w,4);return{transforms:t,beforeFunctionMatrix:g,beforeFunctionMatrix2:b,targetFunctionMatrix:hn(y),afterFunctionMatrix:w,afterFunctionMatrix2:_,allFunctionMatrix:C,beforeFunctions:f,beforeFunctions2:u,targetFunction:y[0],afterFunctions:h,afterFunctions2:m,beforeFunctionTexts:i,beforeFunctionTexts2:l,targetFunctionText:s,afterFunctionTexts:d,afterFunctionTexts2:c}}function tC(t){return!t||!$t(t)||Vr(t)?!1:Ue(t)||"length"in t}function ir(t,r){return t?Vr(t)?t:at(t)?r?document.querySelector(t):t:la(t)?t():Sd(t)?t:"current"in t?t.current:t:null}function es(t,r){if(!t)return[];var n=tC(t)?[].slice.call(t):[t];return n.reduce(function(o,a){return at(a)&&r?K(K([],L(o),!1),L([].slice.call(document.querySelectorAll(a))),!1):(Ue(a)?o.push(es(a,r)):o.push(ir(a,r)),o)},[])}function rC(t,r,n){var o=Ye(t,r)/Math.PI*180;return o=n>=0?o:180-o,o=o>=0?o:360+o,o}function Cu(t,r){var n=t.rootMatrix,o=t.is3d,a=o?4:3,i=qt(n,a);return o||(i=Jt(i,3,4)),i[12]=0,i[13]=0,i[14]=0,ma(i,r)}function Su(t,r,n,o,a){var i=L(t,2),l=i[0],s=i[1],d=0,c=0;if(a&&l&&s){var f=Ye([0,0],r),u=Ye([0,0],o),p=Ft(r),h=Math.cos(f-u)*p;if(!o[0])c=h,d=c*n;else if(!o[1])d=h,c=d/n;else{var m=o[0]*l,y=o[1]*s,g=Math.atan2(m+r[0],y+r[1]),b=Math.atan2(m,y);g<0&&(g+=Math.PI*2),b<0&&(b+=Math.PI*2);var w=0;q(g-b)<Math.PI/2||q(g-b)>Math.PI/2*3||(b+=Math.PI),w=g-b,w>Math.PI*2?w-=Math.PI*2:w>Math.PI?w=2*Math.PI-w:w<-Math.PI&&(w=-2*Math.PI-w);var _=Ft([m+r[0],y+r[1]])*Math.cos(w);d=_*Math.sin(b)-m,c=_*Math.cos(b)-y,o[0]<0&&(d*=-1),o[1]<0&&(c*=-1)}}else d=o[0]*r[0],c=o[1]*r[1];return[d,c]}function xu(t,r,n,o){var a,i=n.ratio,l=n.startOffsetWidth,s=n.startOffsetHeight,d=0,c=0,f=o.distX,u=o.distY,p=o.pinchScale,h=o.parentDistance,m=o.parentDist,y=o.parentScale,g=n.fixedDirection,b=[0,1].map(function(v){return q(t[v]-g[v])}),w=[0,1].map(function(v){var V=b[v];return V!==0&&(V=2/V),V});if(m)d=m[0],c=m[1],r&&(d?c||(c=d/i):d=c*i);else if(un(p))d=(p-1)*l,c=(p-1)*s;else if(y)d=(y[0]-1)*l,c=(y[1]-1)*s;else if(h){var _=l*b[0],C=s*b[1],S=Ft([_,C]);d=h/S*_*w[0],c=h/S*C*w[1]}else{var x=ar({datas:n,distX:f,distY:u});x=w.map(function(v,V){return x[V]*v}),a=L(Su([l,s],x,i,t,r),2),d=a[0],c=a[1]}return{distWidth:d,distHeight:c}}function ts(t,r){if(r){if(t==="left")return{x:"0%",y:"50%"};if(t==="top")return{x:"50%",y:"50%"};if(t==="center")return{x:"50%",y:"50%"};if(t==="right")return{x:"100%",y:"50%"};if(t==="bottom")return{x:"50%",y:"100%"};var n=L(t.split(" "),2),o=n[0],a=n[1],i=ts(o||""),l=ts(a||""),s=A(A({},i),l),d={x:"50%",y:"50%"};return s.x&&(d.x=s.x),s.y&&(d.y=s.y),s.value&&(s.x&&!s.y&&(d.y=s.value),!s.x&&s.y&&(d.x=s.value)),d}return t==="left"?{x:"0%"}:t==="right"?{x:"100%"}:t==="top"?{y:"0%"}:t==="bottom"?{y:"100%"}:t?t==="center"?{value:"50%"}:{value:t}:{}}function rs(t,r,n){var o=ts(t,!0),a=o.x,i=o.y;return[Te(a,r)||0,Te(i,n)||0]}function nC(t,r,n){var o=t.map(function(i){return se(i,r)}),a=o.map(function(i){return ao(i,n)});return{prev:o,next:a,result:a.map(function(i){return xe(i,r)})}}function vu(t,r){return t.length===r.length&&t.every(function(n,o){var a=r[o],i=Ue(n),l=Ue(a);return i&&l?vu(n,a):!i&&!l?n===a:!1})}function Dn(t,r,n,o,a){var i=t._store,l=i[r];if(!(r in i))if(a!=null)i[r]=a,l=a;else return i[r]=n,n;return l===n||o(l)===o(n)?l:(i[r]=n,n)}function pt(t){return t>=0?1:-1}function q(t){return Math.abs(t)}function ns(t,r){return n1(t).map(function(n){return r(n)})}function Eu(t){return un(t)?{top:t,left:t,right:t,bottom:t}:{left:t.left||0,top:t.top||0,right:t.right||0,bottom:t.bottom||0}}var oC=uo("pinchable",{props:["pinchable"],events:["pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd"],dragStart:function(){return!0},pinchStart:function(t,r){var n=r.datas,o=r.targets,a=r.angle,i=r.originalDatas,l=t.props,s=l.pinchable,d=l.ables;if(!s)return!1;var c="onPinch".concat(o?"Group":"","Start"),f="drag".concat(o?"Group":"","ControlStart"),u=(s===!0?t.controlAbles:d.filter(function(y){return s.indexOf(y.name)>-1})).filter(function(y){return y.canPinch&&y[f]}),p=ge(t,r,{});o&&(p.targets=o);var h=te(t,c,p);n.isPinch=h!==!1,n.ables=u;var m=n.isPinch;return m?(u.forEach(function(y){if(i[y.name]=i[y.name]||{},!!y[f]){var g=A(A({},r),{datas:i[y.name],parentRotate:a,isPinch:!0});y[f](t,g)}}),t.state.snapRenderInfo={request:r.isRequest,direction:[0,0]},m):!1},pinch:function(t,r){var n=r.datas,o=r.scale,a=r.distance,i=r.originalDatas,l=r.inputEvent,s=r.targets,d=r.angle;if(n.isPinch){var c=a*(1-1/o),f=ge(t,r,{});s&&(f.targets=s);var u="onPinch".concat(s?"Group":"");te(t,u,f);var p=n.ables,h="drag".concat(s?"Group":"","Control");return p.forEach(function(m){m[h]&&m[h](t,A(A({},r),{datas:i[m.name],inputEvent:l,resolveMatrix:!0,pinchScale:o,parentDistance:c,parentRotate:d,isPinch:!0}))}),f}},pinchEnd:function(t,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,i=r.targets,l=r.originalDatas;if(n.isPinch){var s="onPinch".concat(i?"Group":"","End"),d=Dt(t,r,{isDrag:o});i&&(d.targets=i),te(t,s,d);var c=n.ables,f="drag".concat(i?"Group":"","ControlEnd");return c.forEach(function(u){u[f]&&u[f](t,A(A({},r),{isDrag:o,datas:l[u.name],inputEvent:a,isPinch:!0}))}),o}},pinchGroupStart:function(t,r){return this.pinchStart(t,A(A({},r),{targets:t.props.targets}))},pinchGroup:function(t,r){return this.pinch(t,A(A({},r),{targets:t.props.targets}))},pinchGroupEnd:function(t,r){return this.pinchEnd(t,A(A({},r),{targets:t.props.targets}))}}),Vu=Ql("scalable"),aC={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Ef("scalable"),dragControlCondition:Vu,viewClassName:Zl("scalable"),dragControlStart:function(t,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,i=r.parentDirection,l=hu(i,o,a,n),s=t.state,d=s.width,c=s.height,f=s.targetTransform,u=s.target,p=s.pos1,h=s.pos2,m=s.pos4;if(!l||!u)return!1;o||Hr(t,r),n.datas={},n.transform=f,n.prevDist=[1,1],n.direction=l,n.startOffsetWidth=d,n.startOffsetHeight=c,n.startValue=[1,1];var y=!l[0]&&!l[1]||l[0]||!l[1];va(t,r,"scale"),n.isWidth=y;function g(x){n.ratio=x&&isFinite(x)?x:0}n.startPositions=jt(t.state);function b(x){var v=Hf(n.startPositions,x);n.fixedDirection=v.fixedDirection,n.fixedPosition=v.fixedPosition,n.fixedOffset=v.fixedOffset}n.setFixedDirection=b,g(nr(p,h)/nr(h,m)),b([-l[0],-l[1]]);var w=function(x){n.minScaleSize=x},_=function(x){n.maxScaleSize=x};w([-1/0,-1/0]),_([1/0,1/0]);var C=ge(t,r,A(A({direction:l,set:function(x){n.startValue=x},setRatio:g,setFixedDirection:b,setMinScaleSize:w,setMaxScaleSize:_},xa(t,r)),{dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))})),S=te(t,"onScaleStart",C);return n.startFixedDirection=n.fixedDirection,S!==!1&&(n.isScale=!0,t.state.snapRenderInfo={request:r.isRequest,direction:l}),n.isScale?C:!1},dragControl:function(t,r){Ca(t,r,"scale");var n=r.datas,o=r.parentKeepRatio,a=r.parentFlag,i=r.isPinch,l=r.dragClient,s=r.isRequest,d=r.useSnap,c=r.resolveMatrix,f=n.prevDist,u=n.direction,p=n.startOffsetWidth,h=n.startOffsetHeight,m=n.isScale,y=n.startValue,g=n.isWidth,b=n.ratio;if(!m)return!1;var w=t.props,_=w.throttleScale,C=w.parentMoveable,S=u;!u[0]&&!u[1]&&(S=[1,1]);var x=b&&(o??w.keepRatio)||!1,v=t.state,V=[y[0],y[1]];function $(){var Y=xu(S,x,n,r),Z=Y.distWidth,ye=Y.distHeight,ie=p?(p+Z)/p:1,ce=h?(h+ye)/h:1;y[0]||(V[0]=Z/p),y[1]||(V[1]=ye/h);var oe=(S[0]||x?ie:1)*V[0],_e=(S[1]||x?ce:1)*V[1];return oe===0&&(oe=pt(f[0])*wa),_e===0&&(_e=pt(f[1])*wa),[oe,_e]}var B=$();if(!i&&t.props.groupable){var R=v.snapRenderInfo||{},T=R.direction;Ue(T)&&(T[0]||T[1])&&(v.snapRenderInfo={direction:u,request:r.isRequest})}te(t,"onBeforeScale",ge(t,r,{scale:B,setFixedDirection:function(Y){return n.setFixedDirection(Y),B=$(),B},startFixedDirection:n.startFixedDirection,setScale:function(Y){B=Y}},!0));var k=[B[0]/V[0],B[1]/V[1]],O=l,N=[0,0],D=pt(k[0]*k[1]),I=!l&&!a&&i;if(I||c?O=Nl(t,n.targetAllTransform,[0,0],[0,0],n):l||(O=n.fixedPosition),i||(N=Mw(t,k,u,!d&&s,n)),x){S[0]&&S[1]&&N[0]&&N[1]&&(Math.abs(N[0]*p)>Math.abs(N[1]*h)?N[1]=0:N[0]=0);var z=!N[0]&&!N[1];if(z&&(g?k[0]=pe(k[0]*V[0],_)/V[0]:k[1]=pe(k[1]*V[1],_)/V[1]),S[0]&&!S[1]||N[0]&&!N[1]||z&&g){k[0]+=N[0];var M=p*k[0]*V[0]/b;k[1]=pt(D*k[0])*q(M/h/V[1])}else if(!S[0]&&S[1]||!N[0]&&N[1]||z&&!g){k[1]+=N[1];var j=h*k[1]*V[1]*b;k[0]=pt(D*k[1])*q(j/p/V[0])}}else k[0]+=N[0],k[1]+=N[1],N[0]||(k[0]=pe(k[0]*V[0],_)/V[0]),N[1]||(k[1]=pe(k[1]*V[1],_)/V[1]);k[0]===0&&(k[0]=pt(f[0])*wa),k[1]===0&&(k[1]=pt(f[1])*wa),B=jw(k,[V[0],V[1]]);var F=[p,h],G=[p*B[0],h*B[1]];G=ji(G,n.minScaleSize,n.maxScaleSize,x?b:!1),B=ns(2,function(Y){return F[Y]?G[Y]/F[Y]:G[Y]}),k=ns(2,function(Y){return B[Y]/V[Y]});var H=ns(2,function(Y){return f[Y]?k[Y]/f[Y]:k[Y]}),X="scale(".concat(k.join(", "),")"),J="scale(".concat(B.join(", "),")"),P=Sa(n,J,X),W=!y[0]||!y[1],Q=M_(t,W?J:X,n.fixedDirection,O,n.fixedOffset,n,W),re=I?Q:se(Q,n.prevInverseDist||[0,0]);if(n.prevDist=k,n.prevInverseDist=Q,B[0]===f[0]&&B[1]===f[1]&&re.every(function(Y){return!Y})&&!C&&!I)return!1;var ne=ge(t,r,A({offsetWidth:p,offsetHeight:h,direction:u,scale:B,dist:k,delta:H,isPinch:!!i},_f(t,P,re,i,r)));return te(t,"onScale",ne),ne},dragControlEnd:function(t,r){var n=r.datas;if(!n.isScale)return!1;n.isScale=!1;var o=Dt(t,r,{});return te(t,"onScaleEnd",o),o},dragGroupControlCondition:Vu,dragGroupControlStart:function(t,r){var n=r.datas,o=this.dragControlStart(t,r);if(!o)return!1;var a=Kt(t,"resizable",r);n.moveableScale=t.scale;var i=gr(t,this,"dragControlStart",r,function(c,f){return Na(t,c,n,f)}),l=function(c){o.setFixedDirection(c),i.forEach(function(f,u){f.setFixedDirection(c),Na(t,f.moveable,n,a[u])})};n.setFixedDirection=l;var s=A(A({},o),{targets:t.props.targets,events:i,setFixedDirection:l}),d=te(t,"onScaleGroupStart",s);return n.isScale=d!==!1,n.isScale?s:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isScale){Fa(t,"onBeforeScale",function(f){te(t,"onBeforeScaleGroup",ge(t,r,A(A({},f),{targets:t.props.targets}),!0))});var o=this.dragControl(t,r);if(o){var a=o.dist,i=n.moveableScale;t.scale=[a[0]*i[0],a[1]*i[1]];var l=t.props.keepRatio,s=n.fixedPosition,d=gr(t,this,"dragControl",r,function(f,u){var p=L(lt(io(t.rotation/180*Math.PI,3),[u.datas.originalX*a[0],u.datas.originalY*a[1],1],3),2),h=p[0],m=p[1];return A(A({},u),{parentDist:null,parentScale:a,parentKeepRatio:l,dragClient:xe(s,[h,m])})}),c=A({targets:t.props.targets,events:d},o);return te(t,"onScaleGroup",c),c}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isScale){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onScaleGroupEnd",i),n}},request:function(){var t={},r=0,n=0,o=!1;return{isControl:!0,requestStart:function(a){return o=a.useSnap,{datas:t,parentDirection:a.direction||[1,1],useSnap:o}},request:function(a){return r+=a.deltaWidth,n+=a.deltaHeight,{datas:t,parentDist:[r,n],parentKeepRatio:a.keepRatio,useSnap:o}},requestEnd:function(){return{datas:t,isDrag:!0,useSnap:o}}}}};function Br(t,r){return t.map(function(n,o){return ia(n,r[o],1,2)})}function ku(t,r,n){var o=Ye(t,r),a=Ye(t,n),i=a-o;return i>=0?i:i+2*Math.PI}function iC(t,r){var n=ku(t[0],t[1],t[2]),o=ku(r[0],r[1],r[2]),a=Math.PI;return!(n>=a&&o<=a||n<=a&&o>=a)}var lC={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:Zl("warpable"),render:function(t,r){var n=t.props,o=n.resizable,a=n.scalable,i=n.warpable,l=n.zoom;if(o||a||!i)return[];var s=t.state,d=s.pos1,c=s.pos2,f=s.pos3,u=s.pos4,p=Br(d,c),h=Br(c,d),m=Br(d,f),y=Br(f,d),g=Br(f,u),b=Br(u,f),w=Br(c,u),_=Br(u,c);return K([r.createElement("div",{className:ae("line"),key:"middeLine1",style:wo(p,g,l)}),r.createElement("div",{className:ae("line"),key:"middeLine2",style:wo(h,b,l)}),r.createElement("div",{className:ae("line"),key:"middeLine3",style:wo(m,w,l)}),r.createElement("div",{className:ae("line"),key:"middeLine4",style:wo(y,_,l)})],L(Vf(t,"warpable",r)),!1)},dragControlCondition:function(t,r){if(r.isRequest)return!1;var n=r.inputEvent.target;return Ze(n,ae("direction"))&&Ze(n,ae("warpable"))},dragControlStart:function(t,r){var n=r.datas,o=r.inputEvent,a=t.props.target,i=o.target,l=mu(i,n);if(!l||!a)return!1;var s=t.state,d=s.transformOrigin,c=s.is3d,f=s.targetTransform,u=s.targetMatrix,p=s.width,h=s.height,m=s.left,y=s.top;n.datas={},n.targetTransform=f,n.warpTargetMatrix=c?u:Jt(u,3,4),n.targetInverseMatrix=Yd(qt(n.warpTargetMatrix,4),3,4),n.direction=l,n.left=m,n.top=y,n.poses=[[0,0],[p,0],[0,h],[p,h]].map(function(w){return se(w,d)}),n.nextPoses=n.poses.map(function(w){var _=L(w,2),C=_[0],S=_[1];return lt(n.warpTargetMatrix,[C,S,0,1],4)}),n.startValue=Me(4),n.prevMatrix=Me(4),n.absolutePoses=jt(s),n.posIndexes=bf(l),Hr(t,r),va(t,r,"matrix3d"),s.snapRenderInfo={request:r.isRequest,direction:l};var g=ge(t,r,A({set:function(w){n.startValue=w}},xa(t,r))),b=te(t,"onWarpStart",g);return b!==!1&&(n.isWarp=!0),n.isWarp},dragControl:function(t,r){var n=r.datas,o=r.isRequest,a=r.distX,i=r.distY,l=n.targetInverseMatrix,s=n.prevMatrix,d=n.isWarp,c=n.startValue,f=n.poses,u=n.posIndexes,p=n.absolutePoses;if(!d)return!1;if(Ca(t,r,"matrix3d"),Vn(t,"warpable")){var h=u.map(function($){return p[$]});h.length>1&&h.push([(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]);var m=Oa(t,o,{horizontal:h.map(function($){return $[1]+i}),vertical:h.map(function($){return $[0]+a})}),y=m.horizontal,g=m.vertical;i-=y.offset,a-=g.offset}var b=ar({datas:n,distX:a,distY:i},!0),w=n.nextPoses.slice();if(u.forEach(function($){w[$]=xe(w[$],b)}),!k_.every(function($){return iC($.map(function(B){return f[B]}),$.map(function(B){return w[B]}))}))return!1;var _=al(f[0],f[2],f[1],f[3],w[0],w[2],w[1],w[3]);if(!_.length)return!1;var C=Oe(l,_,4),S=gf(n,C,!0),x=Oe(qt(s,4),S,4);n.prevMatrix=S;var v=Oe(c,S,4),V=Sa(n,"matrix3d(".concat(v.join(", "),")"),"matrix3d(".concat(S.join(", "),")"));return kl(r,V),te(t,"onWarp",ge(t,r,A({delta:x,matrix:v,dist:S,multiply:Oe,transform:V},ut({transform:V},r)))),!0},dragControlEnd:function(t,r){var n=r.datas,o=r.isDrag;return n.isWarp?(n.isWarp=!1,te(t,"onWarpEnd",Dt(t,r,{})),o):!1}},sC=ae("area-pieces"),Ua=ae("area-piece"),Nu=ae("avoid"),cC=ae("view-dragging");function os(t){var r=t.areaElement;if(r){var n=t.state,o=n.width,a=n.height;Cd(r,Nu),r.style.cssText+="left: 0px; top: 0px; width: ".concat(o,"px; height: ").concat(a,"px")}}function $u(t){return t.createElement("div",{key:"area_pieces",className:sC},t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}))}var Du={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,r){var n=t.props,o=n.target,a=n.dragArea,i=n.groupable,l=n.passDragArea,s=t.getState(),d=s.width,c=s.height,f=s.renderPoses,u=l?ae("area","pass"):ae("area");if(i)return[r.createElement("div",{key:"area",ref:pr(t,"areaElement"),className:u}),$u(r)];if(!o||!a)return[];var p=al([0,0],[d,0],[0,c],[d,c],f[0],f[1],f[2],f[3]),h=p.length?Ma(p,!0):"none";return[r.createElement("div",{key:"area",ref:pr(t,"areaElement"),className:u,style:{top:"0px",left:"0px",width:"".concat(d,"px"),height:"".concat(c,"px"),transformOrigin:"0 0",transform:h}}),$u(r)]},dragStart:function(t,r){var n=r.datas,o=r.clientX,a=r.clientY,i=r.inputEvent;if(!i)return!1;n.isDragArea=!1;var l=t.areaElement,s=t.state,d=s.moveableClientRect,c=s.renderPoses,f=s.rootMatrix,u=s.is3d,p=d.left,h=d.top,m=Lt(c),y=m.left,g=m.top,b=m.width,w=m.height,_=u?4:3,C=L($n(f,[o-p,a-h],_),2),S=C[0],x=C[1];S-=y,x-=g;var v=[{left:y,top:g,width:b,height:x-10},{left:y,top:g,width:S-10,height:w},{left:y,top:g+x+10,width:b,height:w-x-10},{left:y+S+10,top:g,width:b-S-10,height:w}],V=[].slice.call(l.nextElementSibling.children);v.forEach(function($,B){V[B].style.cssText="left: ".concat($.left,"px;top: ").concat($.top,"px; width: ").concat($.width,"px; height: ").concat($.height,"px;")}),Ui(l,Nu),s.disableNativeEvent=!0},drag:function(t,r){var n=r.datas,o=r.inputEvent;if(this.enableNativeEvent(t),!o)return!1;n.isDragArea||(n.isDragArea=!0,os(t))},dragEnd:function(t,r){this.enableNativeEvent(t);var n=r.inputEvent,o=r.datas;if(!n)return!1;o.isDragArea||os(t)},dragGroupStart:function(t,r){return this.dragStart(t,r)},dragGroup:function(t,r){return this.drag(t,r)},dragGroupEnd:function(t,r){return this.dragEnd(t,r)},unset:function(t){os(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var r=t.state;r.disableNativeEvent&&md(function(){r.disableNativeEvent=!1})}},dC=uo("origin",{props:["origin","svgOrigin"],render:function(t,r){var n=t.props,o=n.zoom,a=n.svgOrigin,i=n.groupable,l=t.getState(),s=l.beforeOrigin,d=l.rotation,c=l.svg,f=l.allMatrix,u=l.is3d,p=l.left,h=l.top,m=l.offsetWidth,y=l.offsetHeight,g;if(!i&&c&&a){var b=L(rs(a,m,y),2),w=b[0],_=b[1],C=u?4:3,S=Ge(f,[w,_],C);g=Aa(d,o,se(S,[p,h]))}else g=Aa(d,o,s);return[r.createElement("div",{className:ae("control","origin"),style:g,key:"beforeOrigin"})]}});function fC(t){var r=t.scrollContainer;return[r.scrollLeft,r.scrollTop]}var uC={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(t,r){var n=t.props,o=n.scrollContainer,a=o===void 0?t.getContainer():o,i=n.scrollOptions,l=new Qd,s=ir(a,!0);r.datas.dragScroll=l,t.state.dragScroll=l;var d=r.isControl?"controlGesto":"targetGesto",c=r.targets;l.on("scroll",function(f){var u=f.container,p=f.direction,h=ge(t,r,{scrollContainer:u,direction:p}),m=c?"onScrollGroup":"onScroll";c&&(h.targets=c),te(t,m,h)}).on("move",function(f){var u=f.offsetX,p=f.offsetY,h=f.inputEvent;t[d].scrollBy(u,p,h.inputEvent,!1)}).on("scrollDrag",function(f){var u=f.next;u(t[d].getCurrentEvent())}),l.dragStart(r,A({container:s},i))},checkScroll:function(t,r){var n=r.datas.dragScroll;if(n){var o=t.props,a=o.scrollContainer,i=a===void 0?t.getContainer():a,l=o.scrollThreshold,s=l===void 0?0:l,d=o.scrollThrottleTime,c=d===void 0?0:d,f=o.getScrollPosition,u=f===void 0?fC:f,p=o.scrollOptions;return n.drag(r,A({container:i,threshold:s,throttleTime:c,getScrollPosition:function(h){return u({scrollContainer:h.container,direction:h.direction})}},p)),!0}},drag:function(t,r){return this.checkScroll(t,r)},dragEnd:function(t,r){r.datas.dragScroll.dragEnd(),r.datas.dragScroll=null},dragControlStart:function(t,r){return this.dragStart(t,A(A({},r),{isControl:!0}))},dragControl:function(t,r){return this.drag(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupStart:function(t,r){return this.dragStart(t,A(A({},r),{targets:t.props.targets}))},dragGroup:function(t,r){return this.drag(t,A(A({},r),{targets:t.props.targets}))},dragGroupEnd:function(t,r){return this.dragEnd(t,A(A({},r),{targets:t.props.targets}))},dragGroupControlStart:function(t,r){return this.dragStart(t,A(A({},r),{targets:t.props.targets,isControl:!0}))},dragGroupControl:function(t,r){return this.drag(t,A(A({},r),{targets:t.props.targets}))},dragGroupControEnd:function(t,r){return this.dragEnd(t,A(A({},r),{targets:t.props.targets}))},unset:function(t){var r,n=t.state;(r=n.dragScroll)===null||r===void 0||r.dragEnd(),n.dragScroll=null}},Bu={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","preventRightClick","preventWheelClick","requestStyles"],events:["changeTargets"]},pC=uo("padding",{props:["padding"],render:function(t,r){var n=t.props;if(n.dragArea)return[];var o=Eu(n.padding||{}),a=o.left,i=o.top,l=o.right,s=o.bottom,d=t.getState(),c=d.renderPoses,f=d.pos1,u=d.pos2,p=d.pos3,h=d.pos4,m=[f,u,p,h],y=[];return a>0&&y.push([0,2]),i>0&&y.push([0,1]),l>0&&y.push([1,3]),s>0&&y.push([2,3]),y.map(function(g,b){var w=L(g,2),_=w[0],C=w[1],S=m[_],x=m[C],v=c[_],V=c[C],$=al([0,0],[100,0],[0,100],[100,100],S,x,v,V);if($.length)return r.createElement("div",{key:"padding".concat(b),className:ae("padding"),style:{transform:Ma($,!0)}})})}}),Tu=["nw","ne","se","sw"];function Wa(t,r){var n=t[0]+t[1],o=n>r?r/n:1;return t[0]*=o,t[1]=r-t[1]*o,t}var hC=[1,2,5,6],mC=[0,3,4,7],Kr=[1,-1,-1,1],Zr=[1,1,-1,-1];function as(t,r,n,o,a,i,l,s){a===void 0&&(a=0),i===void 0&&(i=0),l===void 0&&(l=n),s===void 0&&(s=o);var d=[],c=!1,f=t.filter(function(p){return!p.virtual}),u=f.map(function(p){var h=p.horizontal,m=p.vertical,y=p.pos;if(m&&!c&&(c=!0,d.push("/")),c){var g=Math.max(0,m===1?y[1]-i:s-y[1]);return d.push(Zt(g,o,r)),g}else{var g=Math.max(0,h===1?y[0]-a:l-y[0]);return d.push(Zt(g,n,r)),g}});return{radiusPoses:f,styles:d,raws:u}}function Ou(t){for(var r=[0,0],n=[0,0],o=t.length,a=0;a<o;++a){var i=t[a];i.sub&&(i.horizontal&&(r[1]===0&&(r[0]=a),r[1]=a-r[0]+1,n[0]=a+1),i.vertical&&(n[1]===0&&(n[0]=a),n[1]=a-n[0]+1))}return{horizontalRange:r,verticalRange:n}}function Iu(t,r,n,o,a,i,l){var s,d,c,f;i===void 0&&(i=[0,0]),l===void 0&&(l=!1);var u=t.indexOf("/"),p=(u>-1?t.slice(0,u):t).length,h=t.slice(0,p),m=t.slice(p+1),y=h.length,g=m.length,b=g>0,w=L(h,4),_=w[0],C=_===void 0?"0px":_,S=w[1],x=S===void 0?C:S,v=w[2],V=v===void 0?C:v,$=w[3],B=$===void 0?x:$,R=L(m,4),T=R[0],k=T===void 0?C:T,O=R[1],N=O===void 0?b?k:x:O,D=R[2],I=D===void 0?b?k:V:D,z=R[3],M=z===void 0?b?N:B:z,j=[C,x,V,B].map(function(P){return Te(P,r)}),F=[k,N,I,M].map(function(P){return Te(P,n)}),G=j.slice(),H=F.slice();s=L(Wa([G[0],G[1]],r),2),G[0]=s[0],G[1]=s[1],d=L(Wa([G[3],G[2]],r),2),G[3]=d[0],G[2]=d[1],c=L(Wa([H[0],H[3]],n),2),H[0]=c[0],H[3]=c[1],f=L(Wa([H[1],H[2]],n),2),H[1]=f[0],H[2]=f[1];var X=l?G:G.slice(0,Math.max(i[0],y)),J=l?H:H.slice(0,Math.max(i[1],g));return K(K([],L(X.map(function(P,W){var Q=Tu[W];return{virtual:W>=y,horizontal:Kr[W],vertical:0,pos:[o+P,a+(Zr[W]===-1?n:0)],sub:!0,raw:j[W],direction:Q}})),!1),L(J.map(function(P,W){var Q=Tu[W];return{virtual:W>=g,horizontal:0,vertical:Zr[W],pos:[o+(Kr[W]===-1?r:0),a+P],sub:!0,raw:F[W],direction:Q}})),!1)}function gC(t,r,n,o,a){a===void 0&&(a=r.length);var i=Ou(t.slice(o)),l=i.horizontalRange,s=i.verticalRange,d=n-o,c=0;if(d===0)c=a;else if(d>0&&d<l[1])c=l[1]-d;else if(d>=s[0])c=s[0]+s[1]-d;else return;t.splice(n,c),r.splice(n,c)}function yC(t,r,n,o,a,i,l,s,d,c,f){c===void 0&&(c=0),f===void 0&&(f=0);var u=Ou(t.slice(n)),p=u.horizontalRange,h=u.verticalRange;if(o>-1)for(var m=Kr[o]===1?i-c:s-i,y=p[1];y<=o;++y){var g=Zr[y]===1?f:d,b=0;if(o===y?b=i:y===0?b=c+m:Kr[y]===-1&&(b=s-(r[n][0]-c)),t.splice(n+y,0,{horizontal:Kr[y],vertical:0,pos:[b,g]}),r.splice(n+y,0,[b,g]),y===0)break}else if(a>-1){var w=Zr[a]===1?l-f:d-l;if(p[1]===0&&h[1]===0){var _=[c+w,f];t.push({horizontal:Kr[0],vertical:0,pos:_}),r.push(_)}for(var C=h[0],y=h[1];y<=a;++y){var b=Kr[y]===1?c:s,g=0;if(a===y?g=l:y===0?g=f+w:Zr[y]===1?g=r[n+C][1]:Zr[y]===-1&&(g=d-(r[n+C][1]-f)),t.push({horizontal:0,vertical:Zr[y],pos:[b,g]}),r.push([b,g]),y===0)break}}}function bC(t,r){r===void 0&&(r=t.map(function(a){return a.raw}));var n=t.map(function(a,i){return a.horizontal?r[i]:null}).filter(function(a){return a!=null}),o=t.map(function(a,i){return a.vertical?r[i]:null}).filter(function(a){return a!=null});return{horizontals:n,verticals:o}}var _C=[[0,-1,"n"],[1,0,"e"]],wC=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function is(t,r,n){var o=t.props.clipRelative,a=t.state,i=a.width,l=a.height,s=r,d=s.type,c=s.poses,f=d==="rect",u=d==="circle";if(d==="polygon")return n.map(function(x){return"".concat(Zt(x[0],i,o)," ").concat(Zt(x[1],l,o))});if(f||d==="inset"){var p=n[1][1],h=n[3][0],m=n[7][0],y=n[5][1];if(f)return[p,h,y,m].map(function(x){return"".concat(x,"px")});var g=[p,i-h,l-y,m].map(function(x,v){return Zt(x,v%2?i:l,o)});if(n.length>8){var b=L(se(n[4],n[0]),2),w=b[0],_=b[1];g.push.apply(g,K(["round"],L(as(c.slice(8).map(function(x,v){return A(A({},x),{pos:n[v]})}),o,w,_,m,p,h,y).styles),!1))}return g}else if(u||d==="ellipse"){var C=n[0],S=Zt(q(n[1][1]-C[1]),u?Math.sqrt((i*i+l*l)/2):l,o),g=u?[S]:[Zt(q(n[2][0]-C[0]),i,o),S];return g.push("at",Zt(C[0],i,o),Zt(C[1],l,o)),g}}function Ga(t,r,n,o){var a=[o,(o+r)/2,r],i=[t,(t+n)/2,n];return wC.map(function(l){var s=L(l,3),d=s[0],c=s[1],f=s[2],u=a[d+1],p=i[c+1];return{vertical:q(c),horizontal:q(d),direction:f,pos:[u,p]}})}function zu(t){var r=[1/0,-1/0],n=[1/0,-1/0];return t.forEach(function(o){var a=o.pos;r[0]=Math.min(r[0],a[0]),r[1]=Math.max(r[1],a[0]),n[0]=Math.min(n[0],a[1]),n[1]=Math.max(n[1],a[1])}),[q(r[1]-r[0]),q(n[1]-n[0])]}function Ru(t,r,n,o,a){var i,l,s,d,c,f,u,p,h;if(t){var m=a;if(!m){var y=St(t),g=y("clipPath");m=g!=="none"?g:y("clip")}if(!((!m||m==="none"||m==="auto")&&(m=o,!m))){var b=hd(m),w=b.prefix,_=w===void 0?m:w,C=b.value,S=C===void 0?"":C,x=_==="circle",v=" ";if(_==="polygon"){var V=jr(S||"0% 0%, 100% 0%, 100% 100%, 0% 100%");v=",";var $=V.map(function(be){var Ve=L(be.split(" "),2),Ne=Ve[0],we=Ve[1];return{vertical:1,horizontal:1,pos:[Te(Ne,r),Te(we,n)]}}),B=Gr($.map(function(be){return be.pos}));return{type:_,clipText:m,poses:$,splitter:v,left:B.minX,right:B.maxX,top:B.minY,bottom:B.maxY}}else if(x||_==="ellipse"){var R="",T="",k=0,O=0,V=vr(S);if(x){var N="";i=L(V,4),l=i[0],N=l===void 0?"50%":l,s=i[2],R=s===void 0?"50%":s,d=i[3],T=d===void 0?"50%":d,k=Te(N,Math.sqrt((r*r+n*n)/2)),O=k}else{var D="",I="";c=L(V,5),f=c[0],D=f===void 0?"50%":f,u=c[1],I=u===void 0?"50%":u,p=c[3],R=p===void 0?"50%":p,h=c[4],T=h===void 0?"50%":h,k=Te(D,r),O=Te(I,n)}var z=[Te(R,r),Te(T,n)],$=K([{vertical:1,horizontal:1,pos:z,direction:"nesw"}],L(_C.slice(0,x?1:2).map(function(Ne){return{vertical:q(Ne[1]),horizontal:Ne[0],direction:Ne[2],sub:!0,pos:[z[0]+Ne[0]*k,z[1]+Ne[1]*O]}})),!1);return{type:_,clipText:m,radiusX:k,radiusY:O,left:z[0]-k,top:z[1]-O,right:z[0]+k,bottom:z[1]+O,poses:$,splitter:v}}else if(_==="inset"){var V=vr(S||"0 0 0 0"),M=V.indexOf("round"),j=(M>-1?V.slice(0,M):V).length,F=V.slice(j+1),G=L(V.slice(0,j),4),H=G[0],X=G[1],J=X===void 0?H:X,P=G[2],W=P===void 0?H:P,Q=G[3],re=Q===void 0?J:Q,ne=L([H,W].map(function(Ne){return Te(Ne,n)}),2),Y=ne[0],Z=ne[1],ye=L([re,J].map(function(Ne){return Te(Ne,r)}),2),ie=ye[0],ce=ye[1],oe=r-ce,_e=n-Z,Ce=Iu(F,oe-ie,_e-Y,ie,Y),$=K(K([],L(Ga(Y,oe,_e,ie)),!1),L(Ce),!1);return{type:"inset",clipText:m,poses:$,top:Y,left:ie,right:oe,bottom:_e,radius:F,splitter:v}}else if(_==="rect"){var V=jr(S||"0px, ".concat(r,"px, ").concat(n,"px, 0px"));v=",";var ue=L(V.map(function(Ir){var zr=Pr(Ir).value;return zr}),4),Ee=ue[0],ce=ue[1],Z=ue[2],ie=ue[3],$=Ga(Ee,ce,Z,ie);return{type:"rect",clipText:m,poses:$,top:Ee,right:ce,bottom:Z,left:ie,values:V,splitter:v}}}}}function CC(t,r,n,o,a){var i=t[r],l=i.direction,s=i.sub,d=t.map(function(){return[0,0]}),c=l?l.split(""):[];if(o&&r<8){var f=c.filter(function(k){return k==="w"||k==="e"}),u=c.filter(function(k){return k==="n"||k==="s"}),p=f[0],h=u[0];d[r]=n;var m=L(zu(t),2),y=m[0],g=m[1],b=y&&g?y/g:0;if(b&&a){var w=(r+4)%8,_=t[w].pos,C=[0,0];l.indexOf("w")>-1?C[0]=-1:l.indexOf("e")>-1&&(C[0]=1),l.indexOf("n")>-1?C[1]=-1:l.indexOf("s")>-1&&(C[1]=1);var S=Su([y,g],n,b,C,!0),x=y+S[0],v=g+S[1],V=_[1],$=_[1],B=_[0],R=_[0];C[0]===-1?B=R-x:C[0]===1?R=B+x:(B=B-x/2,R=R+x/2),C[1]===-1?V=$-v:(C[1]===1||(V=$-v/2),$=V+v);var T=Ga(V,R,$,B);t.forEach(function(k,O){d[O][0]=T[O].pos[0]-k.pos[0],d[O][1]=T[O].pos[1]-k.pos[1]})}else t.forEach(function(k,O){var N=k.direction;N&&(N.indexOf(p)>-1&&(d[O][0]=n[0]),N.indexOf(h)>-1&&(d[O][1]=n[1]))}),p&&(d[1][0]=n[0]/2,d[5][0]=n[0]/2),h&&(d[3][1]=n[1]/2,d[7][1]=n[1]/2)}else l&&!s?c.forEach(function(k){var O=k==="n"||k==="s";t.forEach(function(N,D){var I=N.direction,z=N.horizontal,M=N.vertical;!I||I.indexOf(k)===-1||(d[D]=[O||!z?0:n[0],!O||!M?0:n[1]])})}):d[r]=n;return d}function SC(t,r){var n=L(mf(t,r),2),o=n[0],a=n[1],i=r.datas,l=i.clipPath,s=i.clipIndex,d=l,c=d.type,f=d.poses,u=d.splitter,p=f.map(function(w){return w.pos});if(c==="polygon")p.splice(s,0,[o,a]);else if(c==="inset"){var h=hC.indexOf(s),m=mC.indexOf(s),y=f.length;if(yC(f,p,8,h,m,o,a,p[4][0],p[4][1],p[0][0],p[0][1]),y===f.length)return}else return;var g=is(t,l,p),b="".concat(c,"(").concat(g.join(u),")");te(t,"onClip",ge(t,r,A({clipEventType:"added",clipType:c,poses:p,clipStyles:g,clipStyle:b,distX:0,distY:0},ut({clipPath:b},r))))}function xC(t,r){var n=r.datas,o=n.clipPath,a=n.clipIndex,i=o,l=i.type,s=i.poses,d=i.splitter,c=s.map(function(h){return h.pos}),f=c.length;if(l==="polygon")s.splice(a,1),c.splice(a,1);else if(l==="inset"){if(a<8||(gC(s,c,a,8,f),f===s.length))return}else return;var u=is(t,o,c),p="".concat(l,"(").concat(u.join(d),")");te(t,"onClip",ge(t,r,A({clipEventType:"removed",clipType:l,poses:c,clipStyles:u,clipStyle:p,distX:0,distY:0},ut({clipPath:p},r))))}var vC={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[`.control.clip-control {
320
+ `],render:function(t,r){var n=t.state,o=n.top,a=n.left,i=n.pos1,l=n.pos2,s=n.pos3,d=n.pos4,c=n.snapRenderInfo,f=t.props.snapRenderThreshold,u=f===void 0?1:f;if(!c||!c.render||!Vn(t,""))return Dn(t,"boundMap",En(),function(X){return JSON.stringify(X)}),Dn(t,"innerBoundMap",En(),function(X){return JSON.stringify(X)}),[];n.guidelines=Ul(t);var p=Math.min(i[0],l[0],s[0],d[0]),h=Math.min(i[1],l[1],s[1],d[1]),m=c.externalPoses||[],y=jt(t.state),g=[],b=[],w=[],_=[],C=[],S=Lt(y),x=S.width,v=S.height,V=S.top,$=S.left,B=S.bottom,R=S.right,T={left:$,right:R,top:V,bottom:B,center:($+R)/2,middle:(V+B)/2},k=m.length>0,O=k?Lt(m):{};if(!c.request){if(c.direction&&C.push(ow(t,y,c.direction,u,u)),c.snap){var N=Lt(y);c.center&&(N.middle=(N.top+N.bottom)/2,N.center=(N.left+N.right)/2),C.push(Rf(t,N,u,u))}k&&(c.center&&(O.middle=(O.top+O.bottom)/2,O.center=(O.left+O.right)/2),C.push(Rf(t,O,u,u))),C.forEach(function(X){var J=X.vertical.posInfos,P=X.horizontal.posInfos;g.push.apply(g,K([],L(J.filter(function(W){var Q=W.guidelineInfos;return Q.some(function(re){var ne=re.guideline;return!ne.hide})}).map(function(W){return{type:"snap",pos:W.pos}})),!1)),b.push.apply(b,K([],L(P.filter(function(W){var Q=W.guidelineInfos;return Q.some(function(re){var ne=re.guideline;return!ne.hide})}).map(function(W){return{type:"snap",pos:W.pos}})),!1)),w.push.apply(w,K([],L(ou(J)),!1)),_.push.apply(_,K([],L(ou(P)),!1))})}var D=au(t,[$,R],[V,B],g,b),I=D.boundMap,z=D.innerBoundMap;k&&au(t,[O.left,O.right],[O.top,O.bottom],g,b,c.externalBounds);var M=K(K([],L(w),!1),L(_),!1),j=M.filter(function(X){return X.element&&!X.gapRects}),F=M.filter(function(X){return X.gapRects}).sort(function(X,J){return X.gap-J.gap});te(t,"onSnap",{guidelines:M.filter(function(X){var J=X.element;return!J}),elements:j,gaps:F},!0);var G=Dn(t,"boundMap",I,function(X){return JSON.stringify(X)},En()),H=Dn(t,"innerBoundMap",z,function(X){return JSON.stringify(X)},En());return(I===G||z===H)&&te(t,"onBound",{bounds:I,innerBounds:z},!0),K(K(K(K(K(K([],L(Ew(t,j,[p,h],T,r)),!1),L(Vw(t,F,[p,h],T,r)),!1),L(Kf(t,"horizontal",_,[a,o],T,r)),!1),L(Kf(t,"vertical",w,[a,o],T,r)),!1),L(Jf(t,"horizontal",b,p,o,x,0,r)),!1),L(Jf(t,"vertical",g,h,a,v,1,r)),!1)},dragStart:function(t,r){t.state.snapRenderInfo={request:r.isRequest,snap:!0,center:!0},za(t)},drag:function(t){var r=t.state;za(t)||(r.guidelines=Ul(t)),r.snapRenderInfo&&(r.snapRenderInfo.render=!0)},pinchStart:function(t){this.unset(t)},dragEnd:function(t){this.unset(t)},dragControlCondition:function(t,r){if(Lw(t,r)||jl(t,r))return!0;if(!r.isRequest&&r.inputEvent)return Qe(r.inputEvent.target,ae("snap-control"))},dragControlStart:function(t){t.state.snapRenderInfo=null,za(t)},dragControl:function(t){this.drag(t)},dragControlEnd:function(t){this.unset(t)},dragGroupStart:function(t,r){this.dragStart(t,r)},dragGroup:function(t){this.drag(t)},dragGroupEnd:function(t){this.unset(t)},dragGroupControlStart:function(t){t.state.snapRenderInfo=null,za(t)},dragGroupControl:function(t){this.drag(t)},dragGroupControlEnd:function(t){this.unset(t)},unset:function(t){var r=t.state;r.enableSnap=!1,r.guidelines=[],r.snapRenderInfo=null,r.elementRects=[]}};function jw(t,r){return[t[0]*r[0],t[1]*r[1]]}function ae(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return jb.apply(void 0,K([Cl],L(t),!1))}function iu(t){t()}function Pw(t){return!t||t==="none"?[1,0,0,1,0,0]:$t(t)?t:pn(t)}function bo(t,r,n){return pa(r,Wr(n,r),t,Wr(n.map(function(o){return-o}),r))}function Uw(t,r,n){if(r==="%"){var o=Hl(t.ownerSVGElement);return o[n?"width":"height"]/100}return 1}function Ww(t){var r=Gw(Jl(t,":before"));return r.map(function(n,o){var a=Pr(n),i=a.value,l=a.unit;return i*Uw(t,l,o===0)})}function Ra(t){return t?t.split(" "):["0","0"]}function Gw(t){return Ra(t.transformOrigin)}function lu(t){var r=St(t),n=r("transform");if(n&&n!=="none")return n;if("transform"in t){var o=t.transform,a=o.baseVal;if(!a)return"";var i=a.length;if(!i)return"";for(var l=[],s=function(c){var f=a[c].matrix;l.push("matrix(".concat(["a","b","c","d","e","f"].map(function(u){return f[u]}).join(", "),")"))},d=0;d<i;++d)s(d);return l.join(" ")}return""}function _o(t,r,n,o,a){var i,l,s=Wi(t)||Er(t),d=!1,c,f;if(!t||n)c=t;else{var u=(i=t==null?void 0:t.assignedSlot)===null||i===void 0?void 0:i.parentElement,p=t.parentElement;u?(d=!0,f=p,c=u):c=p}for(var h=!1,m=t===r||c===r,y="relative",g=1,b=parseFloat(a==null?void 0:a("zoom"))||1,w=a==null?void 0:a("position");c&&c!==s;){r===c&&(m=!0);var _=St(c),C=c.tagName.toLowerCase(),S=lu(c),x=_("willChange"),v=parseFloat(_("zoom"))||1;if(y=_("position"),o&&v!==1){g=v;break}if(!n&&o&&b!==1&&w&&w!=="absolute"||C==="svg"||C==="foreignobject"||y!=="static"||S&&S!=="none"||x==="transform")break;var V=(l=t==null?void 0:t.assignedSlot)===null||l===void 0?void 0:l.parentNode,$=c.parentNode;V&&(d=!0,f=$);var B=$;if(B&&B.nodeType===11){c=B.host,h=!0,y=St(c)("position");break}c=B,y="relative"}return{offsetZoom:g,hasSlot:d,parentSlotElement:f,isCustomElement:h,isStatic:y==="static",isEnd:m||!c||c===s,offsetParent:c||s}}function Hw(t,r){var n,o=t.tagName.toLowerCase(),a=t.offsetLeft,i=t.offsetTop,l=St(t),s=Kn(a),d=!s,c,f;return!d&&(o!=="svg"||t.ownerSVGElement)?(c=cf?Ww(t):Ra(l("transformOrigin")).map(function(u){return parseFloat(u)}),f=c.slice(),d=!0,o==="svg"?(a=0,i=0):(n=L(qw(t,c,t===r&&r.tagName.toLowerCase()==="g"),4),a=n[0],i=n[1],c[0]=n[2],c[1]=n[3])):(c=Ra(l("transformOrigin")).map(function(u){return parseFloat(u)}),f=c.slice()),{tagName:o,isSVG:s,hasOffset:d,offset:[a||0,i||0],origin:c,targetOrigin:f}}function su(t,r){var n=St(t),o=St(Er(t)),a=o("position");if(!r&&(!a||a==="static"))return[0,0];var i=parseInt(o("marginLeft"),10),l=parseInt(o("marginTop"),10);return n("position")==="absolute"&&((n("top")!=="auto"||n("bottom")!=="auto")&&(l=0),(n("left")!=="auto"||n("right")!=="auto")&&(i=0)),[i,l]}function Gl(t){t.forEach(function(r){var n=r.matrix;n&&(r.matrix=Jt(n,3,4))})}function Yw(t){for(var r=t.parentElement,n=!1,o=Er(t);r;){var a=Jl(r).transform;if(a&&a!=="none"){n=!0;break}if(r===o)break;r=r.parentElement}return{fixedContainer:r||o,hasTransform:n}}function Ma(t,r){return r===void 0&&(r=t.length>9),"".concat(r?"matrix3d":"matrix","(").concat(qd(t,!r).join(","),")")}function Hl(t){var r=t.clientWidth,n=t.clientHeight;if(!t)return{x:0,y:0,width:0,height:0,clientWidth:r,clientHeight:n};var o=t.viewBox,a=o&&o.baseVal||{x:0,y:0,width:0,height:0};return{x:a.x,y:a.y,width:a.width||r,height:a.height||n,clientWidth:r,clientHeight:n}}function Xw(t,r){var n,o=Hl(t),a=o.width,i=o.height,l=o.clientWidth,s=o.clientHeight,d=l/a,c=s/i,f=t.preserveAspectRatio.baseVal,u=f.align,p=f.meetOrSlice,h=[0,0],m=[d,c],y=[0,0];if(u!==1){var g=(u-2)%3,b=Math.floor((u-2)/3);h[0]=a*g/2,h[1]=i*b/2;var w=p===2?Math.max(c,d):Math.min(d,c);m[0]=w,m[1]=w,y[0]=(l-a)/2*g,y[1]=(s-i)/2*b}var _=ol(m,r);return n=L(y,2),_[r*(r-1)]=n[0],_[r*(r-1)+1]=n[1],bo(_,r,h)}function qw(t,r,n){var o=t.tagName.toLowerCase();if(!t.getBBox||!n&&o==="g")return[0,0,0,0];var a=St(t),i=a("transform-box")==="fill-box",l=t.getBBox(),s=Hl(t.ownerSVGElement),d=l.x,c=l.y;o==="foreignobject"&&!d&&!c&&(d=parseFloat(t.getAttribute("x"))||0,c=parseFloat(t.getAttribute("y"))||0);var f=d-s.x,u=c-s.y,p=i?r[0]:r[0]-f,h=i?r[1]:r[1]-u;return[f,u,p,h]}function Ge(t,r,n){return lt(t,Ur(r,n),n)}function qr(t,r,n,o){return[[0,0],[r,0],[0,n],[r,n]].map(function(a){return Ge(t,a,o)})}function Lt(t){var r=t.map(function(c){return c[0]}),n=t.map(function(c){return c[1]}),o=Math.min.apply(Math,K([],L(r),!1)),a=Math.min.apply(Math,K([],L(n),!1)),i=Math.max.apply(Math,K([],L(r),!1)),l=Math.max.apply(Math,K([],L(n),!1)),s=i-o,d=l-a;return{left:o,top:a,right:i,bottom:l,width:s,height:d}}function cu(t,r,n,o){var a=qr(t,r,n,o);return Lt(a)}function Jw(t,r,n,o,a){var i,l=t.target,s=t.origin,d=r.matrix,c=fu(l),f=c.offsetWidth,u=c.offsetHeight,p=n.getBoundingClientRect(),h=[0,0];n===Er(n)&&(h=su(l,!0));for(var m=l.getBoundingClientRect(),y=m.left-p.left+n.scrollLeft-(n.clientLeft||0)+h[0],g=m.top-p.top+n.scrollTop-(n.clientTop||0)+h[1],b=m.width,w=m.height,_=pa(o,a,d),C=cu(_,f,u,o),S=C.left,x=C.top,v=C.width,V=C.height,$=Ge(_,s,o),B=se($,[S,x]),R=[y+B[0]*b/v,g+B[1]*w/V],T=[0,0],k=0;++k<10;){var O=qt(a,o);i=L(se(Ge(O,R,o),Ge(O,$,o)),2),T[0]=i[0],T[1]=i[1];var N=pa(o,a,Wr(T,o),d),D=cu(N,f,u,o),I=D.left,z=D.top,M=I-y,j=z-g;if(q(M)<2&&q(j)<2)break;R[0]-=M,R[1]-=j}return T.map(function(F){return Math.round(F)})}function Kw(t,r,n){var o=t.length===16,a=o?4:3,i=r.map(function(d){return Ge(t,d,a)}),l=n.left,s=n.top;return i.map(function(d){return[d[0]+l,d[1]+s]})}function Ft(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function du(t,r){return Ft([r[0]-t[0],r[1]-t[1]])}function wo(t,r,n,o){n===void 0&&(n=1),o===void 0&&(o=Ye(t,r));var a=du(t,r);return{transform:"translateY(-50%) translate(".concat(t[0],"px, ").concat(t[1],"px) rotate(").concat(o,"rad) scaleY(").concat(n,")"),width:"".concat(a,"px")}}function Aa(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=n.length,i=n.reduce(function(s,d){return s+d[0]},0)/a,l=n.reduce(function(s,d){return s+d[1]},0)/a;return{transform:"translateZ(0px) translate(".concat(i,"px, ").concat(l,"px) rotate(").concat(t,"rad) scale(").concat(r,")")}}function Jr(t,r){var n=t[r];return $t(n)?A(A({},t),n):t}function fu(t){var r=t&&!Kn(t.offsetWidth),n=0,o=0,a=0,i=0,l=0,s=0,d=0,c=0,f=0,u=0,p=0,h=0,m=1/0,y=1/0,g=1/0,b=1/0,w=0,_=0,C=!1;if(t)if(!r&&t.ownerSVGElement){var S=t.getBBox();C=!0,n=S.width,o=S.height,l=n,s=o,d=n,c=o,a=n,i=o}else{var x=St(t),v=t.style,V=x("boxSizing")==="border-box",$=parseFloat(x("borderLeftWidth"))||0,B=parseFloat(x("borderRightWidth"))||0,R=parseFloat(x("borderTopWidth"))||0,T=parseFloat(x("borderBottomWidth"))||0,k=parseFloat(x("paddingLeft"))||0,O=parseFloat(x("paddingRight"))||0,N=parseFloat(x("paddingTop"))||0,D=parseFloat(x("paddingBottom"))||0,I=k+O,z=N+D,M=$+B,j=R+T,F=I+M,G=z+j,H=x("position"),X=0,J=0;if("clientLeft"in t){var P=null;if(H==="absolute"){var W=_o(t,Er(t));P=W.offsetParent}else P=t.parentElement;if(P){var Q=St(P);X=parseFloat(Q("width")),J=parseFloat(Q("height"))}}f=Math.max(I,Te(x("minWidth"),X)||0),u=Math.max(z,Te(x("minHeight"),J)||0),m=Te(x("maxWidth"),X),y=Te(x("maxHeight"),J),isNaN(m)&&(m=1/0),isNaN(y)&&(y=1/0),w=Te(v.width,0)||0,_=Te(v.height,0)||0,l=parseFloat(x("width"))||0,s=parseFloat(x("height"))||0,d=q(l-w)<1?ca(f,w||l,m):l,c=q(s-_)<1?ca(u,_||s,y):s,n=d,o=c,a=d,i=c,V?(g=m,b=y,p=f,h=u,d=n-F,c=o-G):(g=m+F,b=y+G,p=f+F,h=u+G,n=d+F,o=c+G),a=d+I,i=c+z}return{svg:C,offsetWidth:n,offsetHeight:o,clientWidth:a,clientHeight:i,contentWidth:d,contentHeight:c,inlineCSSWidth:w,inlineCSSHeight:_,cssWidth:l,cssHeight:s,minWidth:f,minHeight:u,maxWidth:m,maxHeight:y,minOffsetWidth:p,minOffsetHeight:h,maxOffsetWidth:g,maxOffsetHeight:b}}function uu(t,r){return Ye(r>0?t[0]:t[1],r>0?t[1]:t[0])}function La(){return{left:0,top:0,width:0,height:0,right:0,bottom:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0}}function pu(t,r){var n=t===Er(t)||t===Wi(t),o={clientLeft:t.clientLeft,clientTop:t.clientTop,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight,overflow:!1};return n&&(o.clientHeight=Math.max(r.height,o.clientHeight),o.scrollHeight=Math.max(r.height,o.scrollHeight)),o.overflow=St(t)("overflow")!=="visible",A(A({},r),o)}function Yl(t,r,n,o){var a=t.left,i=t.right,l=t.top,s=t.bottom,d=r.top,c=r.left,f={left:c+a,top:d+l,right:c+i,bottom:d+s,width:i-a,height:s-l};return n&&o?pu(n,f):f}function Co(t,r){var n=0,o=0,a=0,i=0;if(t){var l=t.getBoundingClientRect();n=l.left,o=l.top,a=l.width,i=l.height}var s={left:n,top:o,width:a,height:i,right:n+a,bottom:o+i};return t&&r?pu(t,s):s}function Zw(t){var r=t.props,n=r.groupable,o=r.svgOrigin,a=t.getState(),i=a.offsetWidth,l=a.offsetHeight,s=a.svg,d=a.transformOrigin;return!n&&s&&o?rs(o,i,l):d}function hu(t,r,n,o){var a;if(t)a=t;else if(r)a=[0,0];else{var i=n.target;a=mu(i,o)}return a}function mu(t,r){if(t){var n=t.getAttribute("data-rotation")||"",o=t.getAttribute("data-direction");if(r.deg=n,!!o){var a=[0,0];return o.indexOf("w")>-1&&(a[0]=-1),o.indexOf("e")>-1&&(a[0]=1),o.indexOf("n")>-1&&(a[1]=-1),o.indexOf("s")>-1&&(a[1]=1),a}}}function Xl(t,r){return[xe(r,t[0]),xe(r,t[1]),xe(r,t[2]),xe(r,t[3])]}function jt(t){var r=t.left,n=t.top,o=t.pos1,a=t.pos2,i=t.pos3,l=t.pos4;return Xl([o,a,i,l],[r,n])}function ql(t,r){t[r?"controlAbles":"targetAbles"].forEach(function(n){n.unset&&n.unset(t)})}function kn(t,r){var n=r?"controlGesto":"targetGesto",o=t[n];(o==null?void 0:o.isIdle())===!1&&ql(t,r),o==null||o.unset(),t[n]=null}function ut(t,r){if(r){var n=Sn(r);n.nextStyle=A(A({},n.nextStyle),t)}return{style:t,cssText:mr(t).map(function(o){return"".concat(sa(o,"-"),": ").concat(t[o],";")}).join("")}}function gu(t,r,n){var o=r.afterTransform||r.transform;return A(A({},ut(A(A(A({},t.style),r.style),{transform:o}),n)),{afterTransform:o,transform:t.transform})}function ge(t,r,n,o){var a=r.datas;a.datas||(a.datas={});var i=A(A({},n),{target:t.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:t,moveable:t,datas:a.datas,isRequest:r.isRequest,isRequestChild:r.isRequestChild,isFirstDrag:!!r.isFirstDrag,isTrusted:r.isTrusted!==!1,stopAble:function(){a.isEventStart=!1},stopDrag:function(){var l;(l=r.stop)===null||l===void 0||l.call(r)}});return a.isStartEvent?o||(a.lastEvent=i):a.isStartEvent=!0,i}function Dt(t,r,n){var o=r.datas,a="isDrag"in n?n.isDrag:r.isDrag;return o.datas||(o.datas={}),A(A({isDrag:a},n),{moveable:t,target:t.state.target,clientX:r.clientX,clientY:r.clientY,inputEvent:r.inputEvent,currentTarget:t,lastEvent:o.lastEvent,isDouble:r.isDouble,datas:o.datas,isFirstDrag:!!r.isFirstDrag})}function Fa(t,r,n){t._emitter.on(r,n)}function te(t,r,n,o,a){return t.triggerEvent(r,n,o,a)}function Jl(t,r){return At(t).getComputedStyle(t,r)}function ja(t,r,n){var o={},a={};return t.filter(function(i){var l=i.name;if(o[l]||!r.some(function(s){return i[s]}))return!1;if(!n&&i.ableGroup){if(a[i.ableGroup])return!1;a[i.ableGroup]=!0}return o[l]=!0,!0})}function Kl(t,r){return t===r||t==null&&r==null}function yu(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=t.length-1,o=0;o<n;++o){var a=t[o];if(!Kn(a))return a}return t[n]}function bu(t,r){var n=[],o=[];return t.forEach(function(a,i){var l=r(a,i,t),s=o.indexOf(l),d=n[s]||[];s===-1&&(o.push(l),n.push(d)),d.push(a)}),n}function Qw(t,r){var n=[],o={};return t.forEach(function(a,i){var l=r(a,i,t),s=o[l];s||(s=[],o[l]=s,n.push(s)),s.push(a)}),n}function _u(t){return t.reduce(function(r,n){return r.concat(n)},[])}function Nn(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.sort(function(n,o){return q(o)-q(n)}),t[0]}function $n(t,r,n){return lt(qt(t,n),Ur(r,n),n)}function wu(t,r){var n,o=t.is3d,a=t.rootMatrix,i=o?4:3;return n=L($n(a,[r.distX,r.distY],i),2),r.distX=n[0],r.distY=n[1],r}function Pt(t,r,n,o){if(!n[0]&&!n[1])return r;var a=Ge(t,[ru(n[0]||1),0],o),i=Ge(t,[0,ru(n[1]||1)],o),l=Ge(t,[n[0]/Ft(a),n[1]/Ft(i)],o);return xe(r,l)}function Zt(t,r,n){return n?"".concat(t/r*100,"%"):"".concat(t,"px")}function Pa(t){return q(t)<=dt?0:t}function Zl(t){return function(r){if(!r.isDragging(t))return"";var n=U_(r,t),o=n.deg;return o?ae("view-control-rotation".concat(o)):""}}function Ql(t,r){return r===void 0&&(r=[t]),function(n,o){if(o.isRequest)return r.some(function(i){return o.requestAble===i})?o.parentDirection:!1;var a=o.inputEvent.target;return Qe(a,ae("direction"))&&(!t||Qe(a,ae(t)))}}function eC(t,r,n){var o,a=mn(t,{"x%":function(S){return S/100*r.offsetWidth},"y%":function(S){return S/100*r.offsetHeight}}),i=t.slice(0,n<0?void 0:n),l=t.slice(0,n<0?void 0:n+1),s=t[n]||"",d=n<0?[]:t.slice(n),c=n<0?[]:t.slice(n+1),f=a.slice(0,n<0?void 0:n),u=a.slice(0,n<0?void 0:n+1),p=(o=a[n])!==null&&o!==void 0?o:mn([""])[0],h=n<0?[]:a.slice(n),m=n<0?[]:a.slice(n+1),y=p?[p]:[],g=hn(f),b=hn(u),w=hn(h),_=hn(m),C=Oe(g,w,4);return{transforms:t,beforeFunctionMatrix:g,beforeFunctionMatrix2:b,targetFunctionMatrix:hn(y),afterFunctionMatrix:w,afterFunctionMatrix2:_,allFunctionMatrix:C,beforeFunctions:f,beforeFunctions2:u,targetFunction:y[0],afterFunctions:h,afterFunctions2:m,beforeFunctionTexts:i,beforeFunctionTexts2:l,targetFunctionText:s,afterFunctionTexts:d,afterFunctionTexts2:c}}function tC(t){return!t||!$t(t)||Vr(t)?!1:Ue(t)||"length"in t}function ir(t,r){return t?Vr(t)?t:at(t)?r?document.querySelector(t):t:la(t)?t():Sd(t)?t:"current"in t?t.current:t:null}function es(t,r){if(!t)return[];var n=tC(t)?[].slice.call(t):[t];return n.reduce(function(o,a){return at(a)&&r?K(K([],L(o),!1),L([].slice.call(document.querySelectorAll(a))),!1):(Ue(a)?o.push(es(a,r)):o.push(ir(a,r)),o)},[])}function rC(t,r,n){var o=Ye(t,r)/Math.PI*180;return o=n>=0?o:180-o,o=o>=0?o:360+o,o}function Cu(t,r){var n=t.rootMatrix,o=t.is3d,a=o?4:3,i=qt(n,a);return o||(i=Jt(i,3,4)),i[12]=0,i[13]=0,i[14]=0,ma(i,r)}function Su(t,r,n,o,a){var i=L(t,2),l=i[0],s=i[1],d=0,c=0;if(a&&l&&s){var f=Ye([0,0],r),u=Ye([0,0],o),p=Ft(r),h=Math.cos(f-u)*p;if(!o[0])c=h,d=c*n;else if(!o[1])d=h,c=d/n;else{var m=o[0]*l,y=o[1]*s,g=Math.atan2(m+r[0],y+r[1]),b=Math.atan2(m,y);g<0&&(g+=Math.PI*2),b<0&&(b+=Math.PI*2);var w=0;q(g-b)<Math.PI/2||q(g-b)>Math.PI/2*3||(b+=Math.PI),w=g-b,w>Math.PI*2?w-=Math.PI*2:w>Math.PI?w=2*Math.PI-w:w<-Math.PI&&(w=-2*Math.PI-w);var _=Ft([m+r[0],y+r[1]])*Math.cos(w);d=_*Math.sin(b)-m,c=_*Math.cos(b)-y,o[0]<0&&(d*=-1),o[1]<0&&(c*=-1)}}else d=o[0]*r[0],c=o[1]*r[1];return[d,c]}function xu(t,r,n,o){var a,i=n.ratio,l=n.startOffsetWidth,s=n.startOffsetHeight,d=0,c=0,f=o.distX,u=o.distY,p=o.pinchScale,h=o.parentDistance,m=o.parentDist,y=o.parentScale,g=n.fixedDirection,b=[0,1].map(function(v){return q(t[v]-g[v])}),w=[0,1].map(function(v){var V=b[v];return V!==0&&(V=2/V),V});if(m)d=m[0],c=m[1],r&&(d?c||(c=d/i):d=c*i);else if(un(p))d=(p-1)*l,c=(p-1)*s;else if(y)d=(y[0]-1)*l,c=(y[1]-1)*s;else if(h){var _=l*b[0],C=s*b[1],S=Ft([_,C]);d=h/S*_*w[0],c=h/S*C*w[1]}else{var x=ar({datas:n,distX:f,distY:u});x=w.map(function(v,V){return x[V]*v}),a=L(Su([l,s],x,i,t,r),2),d=a[0],c=a[1]}return{distWidth:d,distHeight:c}}function ts(t,r){if(r){if(t==="left")return{x:"0%",y:"50%"};if(t==="top")return{x:"50%",y:"50%"};if(t==="center")return{x:"50%",y:"50%"};if(t==="right")return{x:"100%",y:"50%"};if(t==="bottom")return{x:"50%",y:"100%"};var n=L(t.split(" "),2),o=n[0],a=n[1],i=ts(o||""),l=ts(a||""),s=A(A({},i),l),d={x:"50%",y:"50%"};return s.x&&(d.x=s.x),s.y&&(d.y=s.y),s.value&&(s.x&&!s.y&&(d.y=s.value),!s.x&&s.y&&(d.x=s.value)),d}return t==="left"?{x:"0%"}:t==="right"?{x:"100%"}:t==="top"?{y:"0%"}:t==="bottom"?{y:"100%"}:t?t==="center"?{value:"50%"}:{value:t}:{}}function rs(t,r,n){var o=ts(t,!0),a=o.x,i=o.y;return[Te(a,r)||0,Te(i,n)||0]}function nC(t,r,n){var o=t.map(function(i){return se(i,r)}),a=o.map(function(i){return ao(i,n)});return{prev:o,next:a,result:a.map(function(i){return xe(i,r)})}}function vu(t,r){return t.length===r.length&&t.every(function(n,o){var a=r[o],i=Ue(n),l=Ue(a);return i&&l?vu(n,a):!i&&!l?n===a:!1})}function Dn(t,r,n,o,a){var i=t._store,l=i[r];if(!(r in i))if(a!=null)i[r]=a,l=a;else return i[r]=n,n;return l===n||o(l)===o(n)?l:(i[r]=n,n)}function pt(t){return t>=0?1:-1}function q(t){return Math.abs(t)}function ns(t,r){return n1(t).map(function(n){return r(n)})}function Eu(t){return un(t)?{top:t,left:t,right:t,bottom:t}:{left:t.left||0,top:t.top||0,right:t.right||0,bottom:t.bottom||0}}var oC=uo("pinchable",{props:["pinchable"],events:["pinchStart","pinch","pinchEnd","pinchGroupStart","pinchGroup","pinchGroupEnd"],dragStart:function(){return!0},pinchStart:function(t,r){var n=r.datas,o=r.targets,a=r.angle,i=r.originalDatas,l=t.props,s=l.pinchable,d=l.ables;if(!s)return!1;var c="onPinch".concat(o?"Group":"","Start"),f="drag".concat(o?"Group":"","ControlStart"),u=(s===!0?t.controlAbles:d.filter(function(y){return s.indexOf(y.name)>-1})).filter(function(y){return y.canPinch&&y[f]}),p=ge(t,r,{});o&&(p.targets=o);var h=te(t,c,p);n.isPinch=h!==!1,n.ables=u;var m=n.isPinch;return m?(u.forEach(function(y){if(i[y.name]=i[y.name]||{},!!y[f]){var g=A(A({},r),{datas:i[y.name],parentRotate:a,isPinch:!0});y[f](t,g)}}),t.state.snapRenderInfo={request:r.isRequest,direction:[0,0]},m):!1},pinch:function(t,r){var n=r.datas,o=r.scale,a=r.distance,i=r.originalDatas,l=r.inputEvent,s=r.targets,d=r.angle;if(n.isPinch){var c=a*(1-1/o),f=ge(t,r,{});s&&(f.targets=s);var u="onPinch".concat(s?"Group":"");te(t,u,f);var p=n.ables,h="drag".concat(s?"Group":"","Control");return p.forEach(function(m){m[h]&&m[h](t,A(A({},r),{datas:i[m.name],inputEvent:l,resolveMatrix:!0,pinchScale:o,parentDistance:c,parentRotate:d,isPinch:!0}))}),f}},pinchEnd:function(t,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,i=r.targets,l=r.originalDatas;if(n.isPinch){var s="onPinch".concat(i?"Group":"","End"),d=Dt(t,r,{isDrag:o});i&&(d.targets=i),te(t,s,d);var c=n.ables,f="drag".concat(i?"Group":"","ControlEnd");return c.forEach(function(u){u[f]&&u[f](t,A(A({},r),{isDrag:o,datas:l[u.name],inputEvent:a,isPinch:!0}))}),o}},pinchGroupStart:function(t,r){return this.pinchStart(t,A(A({},r),{targets:t.props.targets}))},pinchGroup:function(t,r){return this.pinch(t,A(A({},r),{targets:t.props.targets}))},pinchGroupEnd:function(t,r){return this.pinchEnd(t,A(A({},r),{targets:t.props.targets}))}}),Vu=Ql("scalable"),aC={name:"scalable",ableGroup:"size",canPinch:!0,props:["scalable","throttleScale","renderDirections","keepRatio","edge","displayAroundControls"],events:["scaleStart","beforeScale","scale","scaleEnd","scaleGroupStart","beforeScaleGroup","scaleGroup","scaleGroupEnd"],render:Ef("scalable"),dragControlCondition:Vu,viewClassName:Zl("scalable"),dragControlStart:function(t,r){var n=r.datas,o=r.isPinch,a=r.inputEvent,i=r.parentDirection,l=hu(i,o,a,n),s=t.state,d=s.width,c=s.height,f=s.targetTransform,u=s.target,p=s.pos1,h=s.pos2,m=s.pos4;if(!l||!u)return!1;o||Hr(t,r),n.datas={},n.transform=f,n.prevDist=[1,1],n.direction=l,n.startOffsetWidth=d,n.startOffsetHeight=c,n.startValue=[1,1];var y=!l[0]&&!l[1]||l[0]||!l[1];va(t,r,"scale"),n.isWidth=y;function g(x){n.ratio=x&&isFinite(x)?x:0}n.startPositions=jt(t.state);function b(x){var v=Hf(n.startPositions,x);n.fixedDirection=v.fixedDirection,n.fixedPosition=v.fixedPosition,n.fixedOffset=v.fixedOffset}n.setFixedDirection=b,g(nr(p,h)/nr(h,m)),b([-l[0],-l[1]]);var w=function(x){n.minScaleSize=x},_=function(x){n.maxScaleSize=x};w([-1/0,-1/0]),_([1/0,1/0]);var C=ge(t,r,A(A({direction:l,set:function(x){n.startValue=x},setRatio:g,setFixedDirection:b,setMinScaleSize:w,setMaxScaleSize:_},xa(t,r)),{dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))})),S=te(t,"onScaleStart",C);return n.startFixedDirection=n.fixedDirection,S!==!1&&(n.isScale=!0,t.state.snapRenderInfo={request:r.isRequest,direction:l}),n.isScale?C:!1},dragControl:function(t,r){Ca(t,r,"scale");var n=r.datas,o=r.parentKeepRatio,a=r.parentFlag,i=r.isPinch,l=r.dragClient,s=r.isRequest,d=r.useSnap,c=r.resolveMatrix,f=n.prevDist,u=n.direction,p=n.startOffsetWidth,h=n.startOffsetHeight,m=n.isScale,y=n.startValue,g=n.isWidth,b=n.ratio;if(!m)return!1;var w=t.props,_=w.throttleScale,C=w.parentMoveable,S=u;!u[0]&&!u[1]&&(S=[1,1]);var x=b&&(o??w.keepRatio)||!1,v=t.state,V=[y[0],y[1]];function $(){var Y=xu(S,x,n,r),Z=Y.distWidth,ye=Y.distHeight,ie=p?(p+Z)/p:1,ce=h?(h+ye)/h:1;y[0]||(V[0]=Z/p),y[1]||(V[1]=ye/h);var oe=(S[0]||x?ie:1)*V[0],_e=(S[1]||x?ce:1)*V[1];return oe===0&&(oe=pt(f[0])*wa),_e===0&&(_e=pt(f[1])*wa),[oe,_e]}var B=$();if(!i&&t.props.groupable){var R=v.snapRenderInfo||{},T=R.direction;Ue(T)&&(T[0]||T[1])&&(v.snapRenderInfo={direction:u,request:r.isRequest})}te(t,"onBeforeScale",ge(t,r,{scale:B,setFixedDirection:function(Y){return n.setFixedDirection(Y),B=$(),B},startFixedDirection:n.startFixedDirection,setScale:function(Y){B=Y}},!0));var k=[B[0]/V[0],B[1]/V[1]],O=l,N=[0,0],D=pt(k[0]*k[1]),I=!l&&!a&&i;if(I||c?O=Nl(t,n.targetAllTransform,[0,0],[0,0],n):l||(O=n.fixedPosition),i||(N=Mw(t,k,u,!d&&s,n)),x){S[0]&&S[1]&&N[0]&&N[1]&&(Math.abs(N[0]*p)>Math.abs(N[1]*h)?N[1]=0:N[0]=0);var z=!N[0]&&!N[1];if(z&&(g?k[0]=pe(k[0]*V[0],_)/V[0]:k[1]=pe(k[1]*V[1],_)/V[1]),S[0]&&!S[1]||N[0]&&!N[1]||z&&g){k[0]+=N[0];var M=p*k[0]*V[0]/b;k[1]=pt(D*k[0])*q(M/h/V[1])}else if(!S[0]&&S[1]||!N[0]&&N[1]||z&&!g){k[1]+=N[1];var j=h*k[1]*V[1]*b;k[0]=pt(D*k[1])*q(j/p/V[0])}}else k[0]+=N[0],k[1]+=N[1],N[0]||(k[0]=pe(k[0]*V[0],_)/V[0]),N[1]||(k[1]=pe(k[1]*V[1],_)/V[1]);k[0]===0&&(k[0]=pt(f[0])*wa),k[1]===0&&(k[1]=pt(f[1])*wa),B=jw(k,[V[0],V[1]]);var F=[p,h],G=[p*B[0],h*B[1]];G=ji(G,n.minScaleSize,n.maxScaleSize,x?b:!1),B=ns(2,function(Y){return F[Y]?G[Y]/F[Y]:G[Y]}),k=ns(2,function(Y){return B[Y]/V[Y]});var H=ns(2,function(Y){return f[Y]?k[Y]/f[Y]:k[Y]}),X="scale(".concat(k.join(", "),")"),J="scale(".concat(B.join(", "),")"),P=Sa(n,J,X),W=!y[0]||!y[1],Q=M_(t,W?J:X,n.fixedDirection,O,n.fixedOffset,n,W),re=I?Q:se(Q,n.prevInverseDist||[0,0]);if(n.prevDist=k,n.prevInverseDist=Q,B[0]===f[0]&&B[1]===f[1]&&re.every(function(Y){return!Y})&&!C&&!I)return!1;var ne=ge(t,r,A({offsetWidth:p,offsetHeight:h,direction:u,scale:B,dist:k,delta:H,isPinch:!!i},_f(t,P,re,i,r)));return te(t,"onScale",ne),ne},dragControlEnd:function(t,r){var n=r.datas;if(!n.isScale)return!1;n.isScale=!1;var o=Dt(t,r,{});return te(t,"onScaleEnd",o),o},dragGroupControlCondition:Vu,dragGroupControlStart:function(t,r){var n=r.datas,o=this.dragControlStart(t,r);if(!o)return!1;var a=Kt(t,"resizable",r);n.moveableScale=t.scale;var i=gr(t,this,"dragControlStart",r,function(c,f){return Na(t,c,n,f)}),l=function(c){o.setFixedDirection(c),i.forEach(function(f,u){f.setFixedDirection(c),Na(t,f.moveable,n,a[u])})};n.setFixedDirection=l;var s=A(A({},o),{targets:t.props.targets,events:i,setFixedDirection:l}),d=te(t,"onScaleGroupStart",s);return n.isScale=d!==!1,n.isScale?s:!1},dragGroupControl:function(t,r){var n=r.datas;if(n.isScale){Fa(t,"onBeforeScale",function(f){te(t,"onBeforeScaleGroup",ge(t,r,A(A({},f),{targets:t.props.targets}),!0))});var o=this.dragControl(t,r);if(o){var a=o.dist,i=n.moveableScale;t.scale=[a[0]*i[0],a[1]*i[1]];var l=t.props.keepRatio,s=n.fixedPosition,d=gr(t,this,"dragControl",r,function(f,u){var p=L(lt(io(t.rotation/180*Math.PI,3),[u.datas.originalX*a[0],u.datas.originalY*a[1],1],3),2),h=p[0],m=p[1];return A(A({},u),{parentDist:null,parentScale:a,parentKeepRatio:l,dragClient:xe(s,[h,m])})}),c=A({targets:t.props.targets,events:d},o);return te(t,"onScaleGroup",c),c}}},dragGroupControlEnd:function(t,r){var n=r.isDrag,o=r.datas;if(o.isScale){this.dragControlEnd(t,r);var a=gr(t,this,"dragControlEnd",r),i=Dt(t,r,{targets:t.props.targets,events:a});return te(t,"onScaleGroupEnd",i),n}},request:function(){var t={},r=0,n=0,o=!1;return{isControl:!0,requestStart:function(a){return o=a.useSnap,{datas:t,parentDirection:a.direction||[1,1],useSnap:o}},request:function(a){return r+=a.deltaWidth,n+=a.deltaHeight,{datas:t,parentDist:[r,n],parentKeepRatio:a.keepRatio,useSnap:o}},requestEnd:function(){return{datas:t,isDrag:!0,useSnap:o}}}}};function Br(t,r){return t.map(function(n,o){return ia(n,r[o],1,2)})}function ku(t,r,n){var o=Ye(t,r),a=Ye(t,n),i=a-o;return i>=0?i:i+2*Math.PI}function iC(t,r){var n=ku(t[0],t[1],t[2]),o=ku(r[0],r[1],r[2]),a=Math.PI;return!(n>=a&&o<=a||n<=a&&o>=a)}var lC={name:"warpable",ableGroup:"size",props:["warpable","renderDirections","edge","displayAroundControls"],events:["warpStart","warp","warpEnd"],viewClassName:Zl("warpable"),render:function(t,r){var n=t.props,o=n.resizable,a=n.scalable,i=n.warpable,l=n.zoom;if(o||a||!i)return[];var s=t.state,d=s.pos1,c=s.pos2,f=s.pos3,u=s.pos4,p=Br(d,c),h=Br(c,d),m=Br(d,f),y=Br(f,d),g=Br(f,u),b=Br(u,f),w=Br(c,u),_=Br(u,c);return K([r.createElement("div",{className:ae("line"),key:"middeLine1",style:wo(p,g,l)}),r.createElement("div",{className:ae("line"),key:"middeLine2",style:wo(h,b,l)}),r.createElement("div",{className:ae("line"),key:"middeLine3",style:wo(m,w,l)}),r.createElement("div",{className:ae("line"),key:"middeLine4",style:wo(y,_,l)})],L(Vf(t,"warpable",r)),!1)},dragControlCondition:function(t,r){if(r.isRequest)return!1;var n=r.inputEvent.target;return Qe(n,ae("direction"))&&Qe(n,ae("warpable"))},dragControlStart:function(t,r){var n=r.datas,o=r.inputEvent,a=t.props.target,i=o.target,l=mu(i,n);if(!l||!a)return!1;var s=t.state,d=s.transformOrigin,c=s.is3d,f=s.targetTransform,u=s.targetMatrix,p=s.width,h=s.height,m=s.left,y=s.top;n.datas={},n.targetTransform=f,n.warpTargetMatrix=c?u:Jt(u,3,4),n.targetInverseMatrix=Yd(qt(n.warpTargetMatrix,4),3,4),n.direction=l,n.left=m,n.top=y,n.poses=[[0,0],[p,0],[0,h],[p,h]].map(function(w){return se(w,d)}),n.nextPoses=n.poses.map(function(w){var _=L(w,2),C=_[0],S=_[1];return lt(n.warpTargetMatrix,[C,S,0,1],4)}),n.startValue=Me(4),n.prevMatrix=Me(4),n.absolutePoses=jt(s),n.posIndexes=bf(l),Hr(t,r),va(t,r,"matrix3d"),s.snapRenderInfo={request:r.isRequest,direction:l};var g=ge(t,r,A({set:function(w){n.startValue=w}},xa(t,r))),b=te(t,"onWarpStart",g);return b!==!1&&(n.isWarp=!0),n.isWarp},dragControl:function(t,r){var n=r.datas,o=r.isRequest,a=r.distX,i=r.distY,l=n.targetInverseMatrix,s=n.prevMatrix,d=n.isWarp,c=n.startValue,f=n.poses,u=n.posIndexes,p=n.absolutePoses;if(!d)return!1;if(Ca(t,r,"matrix3d"),Vn(t,"warpable")){var h=u.map(function($){return p[$]});h.length>1&&h.push([(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]);var m=Oa(t,o,{horizontal:h.map(function($){return $[1]+i}),vertical:h.map(function($){return $[0]+a})}),y=m.horizontal,g=m.vertical;i-=y.offset,a-=g.offset}var b=ar({datas:n,distX:a,distY:i},!0),w=n.nextPoses.slice();if(u.forEach(function($){w[$]=xe(w[$],b)}),!k_.every(function($){return iC($.map(function(B){return f[B]}),$.map(function(B){return w[B]}))}))return!1;var _=al(f[0],f[2],f[1],f[3],w[0],w[2],w[1],w[3]);if(!_.length)return!1;var C=Oe(l,_,4),S=gf(n,C,!0),x=Oe(qt(s,4),S,4);n.prevMatrix=S;var v=Oe(c,S,4),V=Sa(n,"matrix3d(".concat(v.join(", "),")"),"matrix3d(".concat(S.join(", "),")"));return kl(r,V),te(t,"onWarp",ge(t,r,A({delta:x,matrix:v,dist:S,multiply:Oe,transform:V},ut({transform:V},r)))),!0},dragControlEnd:function(t,r){var n=r.datas,o=r.isDrag;return n.isWarp?(n.isWarp=!1,te(t,"onWarpEnd",Dt(t,r,{})),o):!1}},sC=ae("area-pieces"),Ua=ae("area-piece"),Nu=ae("avoid"),cC=ae("view-dragging");function os(t){var r=t.areaElement;if(r){var n=t.state,o=n.width,a=n.height;Cd(r,Nu),r.style.cssText+="left: 0px; top: 0px; width: ".concat(o,"px; height: ").concat(a,"px")}}function $u(t){return t.createElement("div",{key:"area_pieces",className:sC},t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}),t.createElement("div",{className:Ua}))}var Du={name:"dragArea",props:["dragArea","passDragArea"],events:["click","clickGroup"],render:function(t,r){var n=t.props,o=n.target,a=n.dragArea,i=n.groupable,l=n.passDragArea,s=t.getState(),d=s.width,c=s.height,f=s.renderPoses,u=l?ae("area","pass"):ae("area");if(i)return[r.createElement("div",{key:"area",ref:pr(t,"areaElement"),className:u}),$u(r)];if(!o||!a)return[];var p=al([0,0],[d,0],[0,c],[d,c],f[0],f[1],f[2],f[3]),h=p.length?Ma(p,!0):"none";return[r.createElement("div",{key:"area",ref:pr(t,"areaElement"),className:u,style:{top:"0px",left:"0px",width:"".concat(d,"px"),height:"".concat(c,"px"),transformOrigin:"0 0",transform:h}}),$u(r)]},dragStart:function(t,r){var n=r.datas,o=r.clientX,a=r.clientY,i=r.inputEvent;if(!i)return!1;n.isDragArea=!1;var l=t.areaElement,s=t.state,d=s.moveableClientRect,c=s.renderPoses,f=s.rootMatrix,u=s.is3d,p=d.left,h=d.top,m=Lt(c),y=m.left,g=m.top,b=m.width,w=m.height,_=u?4:3,C=L($n(f,[o-p,a-h],_),2),S=C[0],x=C[1];S-=y,x-=g;var v=[{left:y,top:g,width:b,height:x-10},{left:y,top:g,width:S-10,height:w},{left:y,top:g+x+10,width:b,height:w-x-10},{left:y+S+10,top:g,width:b-S-10,height:w}],V=[].slice.call(l.nextElementSibling.children);v.forEach(function($,B){V[B].style.cssText="left: ".concat($.left,"px;top: ").concat($.top,"px; width: ").concat($.width,"px; height: ").concat($.height,"px;")}),Ui(l,Nu),s.disableNativeEvent=!0},drag:function(t,r){var n=r.datas,o=r.inputEvent;if(this.enableNativeEvent(t),!o)return!1;n.isDragArea||(n.isDragArea=!0,os(t))},dragEnd:function(t,r){this.enableNativeEvent(t);var n=r.inputEvent,o=r.datas;if(!n)return!1;o.isDragArea||os(t)},dragGroupStart:function(t,r){return this.dragStart(t,r)},dragGroup:function(t,r){return this.drag(t,r)},dragGroupEnd:function(t,r){return this.dragEnd(t,r)},unset:function(t){os(t),t.state.disableNativeEvent=!1},enableNativeEvent:function(t){var r=t.state;r.disableNativeEvent&&md(function(){r.disableNativeEvent=!1})}},dC=uo("origin",{props:["origin","svgOrigin"],render:function(t,r){var n=t.props,o=n.zoom,a=n.svgOrigin,i=n.groupable,l=t.getState(),s=l.beforeOrigin,d=l.rotation,c=l.svg,f=l.allMatrix,u=l.is3d,p=l.left,h=l.top,m=l.offsetWidth,y=l.offsetHeight,g;if(!i&&c&&a){var b=L(rs(a,m,y),2),w=b[0],_=b[1],C=u?4:3,S=Ge(f,[w,_],C);g=Aa(d,o,se(S,[p,h]))}else g=Aa(d,o,s);return[r.createElement("div",{className:ae("control","origin"),style:g,key:"beforeOrigin"})]}});function fC(t){var r=t.scrollContainer;return[r.scrollLeft,r.scrollTop]}var uC={name:"scrollable",canPinch:!0,props:["scrollable","scrollContainer","scrollThreshold","scrollThrottleTime","getScrollPosition","scrollOptions"],events:["scroll","scrollGroup"],dragRelation:"strong",dragStart:function(t,r){var n=t.props,o=n.scrollContainer,a=o===void 0?t.getContainer():o,i=n.scrollOptions,l=new Qd,s=ir(a,!0);r.datas.dragScroll=l,t.state.dragScroll=l;var d=r.isControl?"controlGesto":"targetGesto",c=r.targets;l.on("scroll",function(f){var u=f.container,p=f.direction,h=ge(t,r,{scrollContainer:u,direction:p}),m=c?"onScrollGroup":"onScroll";c&&(h.targets=c),te(t,m,h)}).on("move",function(f){var u=f.offsetX,p=f.offsetY,h=f.inputEvent;t[d].scrollBy(u,p,h.inputEvent,!1)}).on("scrollDrag",function(f){var u=f.next;u(t[d].getCurrentEvent())}),l.dragStart(r,A({container:s},i))},checkScroll:function(t,r){var n=r.datas.dragScroll;if(n){var o=t.props,a=o.scrollContainer,i=a===void 0?t.getContainer():a,l=o.scrollThreshold,s=l===void 0?0:l,d=o.scrollThrottleTime,c=d===void 0?0:d,f=o.getScrollPosition,u=f===void 0?fC:f,p=o.scrollOptions;return n.drag(r,A({container:i,threshold:s,throttleTime:c,getScrollPosition:function(h){return u({scrollContainer:h.container,direction:h.direction})}},p)),!0}},drag:function(t,r){return this.checkScroll(t,r)},dragEnd:function(t,r){r.datas.dragScroll.dragEnd(),r.datas.dragScroll=null},dragControlStart:function(t,r){return this.dragStart(t,A(A({},r),{isControl:!0}))},dragControl:function(t,r){return this.drag(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupStart:function(t,r){return this.dragStart(t,A(A({},r),{targets:t.props.targets}))},dragGroup:function(t,r){return this.drag(t,A(A({},r),{targets:t.props.targets}))},dragGroupEnd:function(t,r){return this.dragEnd(t,A(A({},r),{targets:t.props.targets}))},dragGroupControlStart:function(t,r){return this.dragStart(t,A(A({},r),{targets:t.props.targets,isControl:!0}))},dragGroupControl:function(t,r){return this.drag(t,A(A({},r),{targets:t.props.targets}))},dragGroupControEnd:function(t,r){return this.dragEnd(t,A(A({},r),{targets:t.props.targets}))},unset:function(t){var r,n=t.state;(r=n.dragScroll)===null||r===void 0||r.dragEnd(),n.dragScroll=null}},Bu={name:"",props:["target","dragTargetSelf","dragTarget","dragContainer","container","warpSelf","rootContainer","useResizeObserver","useMutationObserver","zoom","dragFocusedInput","transformOrigin","ables","className","pinchThreshold","pinchOutside","triggerAblesSimultaneously","checkInput","cspNonce","translateZ","hideDefaultLines","props","flushSync","stopPropagation","preventClickEventOnDrag","preventClickDefault","viewContainer","persistData","useAccuratePosition","firstRenderState","linePadding","controlPadding","preventDefault","preventRightClick","preventWheelClick","requestStyles"],events:["changeTargets"]},pC=uo("padding",{props:["padding"],render:function(t,r){var n=t.props;if(n.dragArea)return[];var o=Eu(n.padding||{}),a=o.left,i=o.top,l=o.right,s=o.bottom,d=t.getState(),c=d.renderPoses,f=d.pos1,u=d.pos2,p=d.pos3,h=d.pos4,m=[f,u,p,h],y=[];return a>0&&y.push([0,2]),i>0&&y.push([0,1]),l>0&&y.push([1,3]),s>0&&y.push([2,3]),y.map(function(g,b){var w=L(g,2),_=w[0],C=w[1],S=m[_],x=m[C],v=c[_],V=c[C],$=al([0,0],[100,0],[0,100],[100,100],S,x,v,V);if($.length)return r.createElement("div",{key:"padding".concat(b),className:ae("padding"),style:{transform:Ma($,!0)}})})}}),Tu=["nw","ne","se","sw"];function Wa(t,r){var n=t[0]+t[1],o=n>r?r/n:1;return t[0]*=o,t[1]=r-t[1]*o,t}var hC=[1,2,5,6],mC=[0,3,4,7],Kr=[1,-1,-1,1],Zr=[1,1,-1,-1];function as(t,r,n,o,a,i,l,s){a===void 0&&(a=0),i===void 0&&(i=0),l===void 0&&(l=n),s===void 0&&(s=o);var d=[],c=!1,f=t.filter(function(p){return!p.virtual}),u=f.map(function(p){var h=p.horizontal,m=p.vertical,y=p.pos;if(m&&!c&&(c=!0,d.push("/")),c){var g=Math.max(0,m===1?y[1]-i:s-y[1]);return d.push(Zt(g,o,r)),g}else{var g=Math.max(0,h===1?y[0]-a:l-y[0]);return d.push(Zt(g,n,r)),g}});return{radiusPoses:f,styles:d,raws:u}}function Ou(t){for(var r=[0,0],n=[0,0],o=t.length,a=0;a<o;++a){var i=t[a];i.sub&&(i.horizontal&&(r[1]===0&&(r[0]=a),r[1]=a-r[0]+1,n[0]=a+1),i.vertical&&(n[1]===0&&(n[0]=a),n[1]=a-n[0]+1))}return{horizontalRange:r,verticalRange:n}}function Iu(t,r,n,o,a,i,l){var s,d,c,f;i===void 0&&(i=[0,0]),l===void 0&&(l=!1);var u=t.indexOf("/"),p=(u>-1?t.slice(0,u):t).length,h=t.slice(0,p),m=t.slice(p+1),y=h.length,g=m.length,b=g>0,w=L(h,4),_=w[0],C=_===void 0?"0px":_,S=w[1],x=S===void 0?C:S,v=w[2],V=v===void 0?C:v,$=w[3],B=$===void 0?x:$,R=L(m,4),T=R[0],k=T===void 0?C:T,O=R[1],N=O===void 0?b?k:x:O,D=R[2],I=D===void 0?b?k:V:D,z=R[3],M=z===void 0?b?N:B:z,j=[C,x,V,B].map(function(P){return Te(P,r)}),F=[k,N,I,M].map(function(P){return Te(P,n)}),G=j.slice(),H=F.slice();s=L(Wa([G[0],G[1]],r),2),G[0]=s[0],G[1]=s[1],d=L(Wa([G[3],G[2]],r),2),G[3]=d[0],G[2]=d[1],c=L(Wa([H[0],H[3]],n),2),H[0]=c[0],H[3]=c[1],f=L(Wa([H[1],H[2]],n),2),H[1]=f[0],H[2]=f[1];var X=l?G:G.slice(0,Math.max(i[0],y)),J=l?H:H.slice(0,Math.max(i[1],g));return K(K([],L(X.map(function(P,W){var Q=Tu[W];return{virtual:W>=y,horizontal:Kr[W],vertical:0,pos:[o+P,a+(Zr[W]===-1?n:0)],sub:!0,raw:j[W],direction:Q}})),!1),L(J.map(function(P,W){var Q=Tu[W];return{virtual:W>=g,horizontal:0,vertical:Zr[W],pos:[o+(Kr[W]===-1?r:0),a+P],sub:!0,raw:F[W],direction:Q}})),!1)}function gC(t,r,n,o,a){a===void 0&&(a=r.length);var i=Ou(t.slice(o)),l=i.horizontalRange,s=i.verticalRange,d=n-o,c=0;if(d===0)c=a;else if(d>0&&d<l[1])c=l[1]-d;else if(d>=s[0])c=s[0]+s[1]-d;else return;t.splice(n,c),r.splice(n,c)}function yC(t,r,n,o,a,i,l,s,d,c,f){c===void 0&&(c=0),f===void 0&&(f=0);var u=Ou(t.slice(n)),p=u.horizontalRange,h=u.verticalRange;if(o>-1)for(var m=Kr[o]===1?i-c:s-i,y=p[1];y<=o;++y){var g=Zr[y]===1?f:d,b=0;if(o===y?b=i:y===0?b=c+m:Kr[y]===-1&&(b=s-(r[n][0]-c)),t.splice(n+y,0,{horizontal:Kr[y],vertical:0,pos:[b,g]}),r.splice(n+y,0,[b,g]),y===0)break}else if(a>-1){var w=Zr[a]===1?l-f:d-l;if(p[1]===0&&h[1]===0){var _=[c+w,f];t.push({horizontal:Kr[0],vertical:0,pos:_}),r.push(_)}for(var C=h[0],y=h[1];y<=a;++y){var b=Kr[y]===1?c:s,g=0;if(a===y?g=l:y===0?g=f+w:Zr[y]===1?g=r[n+C][1]:Zr[y]===-1&&(g=d-(r[n+C][1]-f)),t.push({horizontal:0,vertical:Zr[y],pos:[b,g]}),r.push([b,g]),y===0)break}}}function bC(t,r){r===void 0&&(r=t.map(function(a){return a.raw}));var n=t.map(function(a,i){return a.horizontal?r[i]:null}).filter(function(a){return a!=null}),o=t.map(function(a,i){return a.vertical?r[i]:null}).filter(function(a){return a!=null});return{horizontals:n,verticals:o}}var _C=[[0,-1,"n"],[1,0,"e"]],wC=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function is(t,r,n){var o=t.props.clipRelative,a=t.state,i=a.width,l=a.height,s=r,d=s.type,c=s.poses,f=d==="rect",u=d==="circle";if(d==="polygon")return n.map(function(x){return"".concat(Zt(x[0],i,o)," ").concat(Zt(x[1],l,o))});if(f||d==="inset"){var p=n[1][1],h=n[3][0],m=n[7][0],y=n[5][1];if(f)return[p,h,y,m].map(function(x){return"".concat(x,"px")});var g=[p,i-h,l-y,m].map(function(x,v){return Zt(x,v%2?i:l,o)});if(n.length>8){var b=L(se(n[4],n[0]),2),w=b[0],_=b[1];g.push.apply(g,K(["round"],L(as(c.slice(8).map(function(x,v){return A(A({},x),{pos:n[v]})}),o,w,_,m,p,h,y).styles),!1))}return g}else if(u||d==="ellipse"){var C=n[0],S=Zt(q(n[1][1]-C[1]),u?Math.sqrt((i*i+l*l)/2):l,o),g=u?[S]:[Zt(q(n[2][0]-C[0]),i,o),S];return g.push("at",Zt(C[0],i,o),Zt(C[1],l,o)),g}}function Ga(t,r,n,o){var a=[o,(o+r)/2,r],i=[t,(t+n)/2,n];return wC.map(function(l){var s=L(l,3),d=s[0],c=s[1],f=s[2],u=a[d+1],p=i[c+1];return{vertical:q(c),horizontal:q(d),direction:f,pos:[u,p]}})}function zu(t){var r=[1/0,-1/0],n=[1/0,-1/0];return t.forEach(function(o){var a=o.pos;r[0]=Math.min(r[0],a[0]),r[1]=Math.max(r[1],a[0]),n[0]=Math.min(n[0],a[1]),n[1]=Math.max(n[1],a[1])}),[q(r[1]-r[0]),q(n[1]-n[0])]}function Ru(t,r,n,o,a){var i,l,s,d,c,f,u,p,h;if(t){var m=a;if(!m){var y=St(t),g=y("clipPath");m=g!=="none"?g:y("clip")}if(!((!m||m==="none"||m==="auto")&&(m=o,!m))){var b=hd(m),w=b.prefix,_=w===void 0?m:w,C=b.value,S=C===void 0?"":C,x=_==="circle",v=" ";if(_==="polygon"){var V=jr(S||"0% 0%, 100% 0%, 100% 100%, 0% 100%");v=",";var $=V.map(function(be){var Ve=L(be.split(" "),2),Ne=Ve[0],we=Ve[1];return{vertical:1,horizontal:1,pos:[Te(Ne,r),Te(we,n)]}}),B=Gr($.map(function(be){return be.pos}));return{type:_,clipText:m,poses:$,splitter:v,left:B.minX,right:B.maxX,top:B.minY,bottom:B.maxY}}else if(x||_==="ellipse"){var R="",T="",k=0,O=0,V=vr(S);if(x){var N="";i=L(V,4),l=i[0],N=l===void 0?"50%":l,s=i[2],R=s===void 0?"50%":s,d=i[3],T=d===void 0?"50%":d,k=Te(N,Math.sqrt((r*r+n*n)/2)),O=k}else{var D="",I="";c=L(V,5),f=c[0],D=f===void 0?"50%":f,u=c[1],I=u===void 0?"50%":u,p=c[3],R=p===void 0?"50%":p,h=c[4],T=h===void 0?"50%":h,k=Te(D,r),O=Te(I,n)}var z=[Te(R,r),Te(T,n)],$=K([{vertical:1,horizontal:1,pos:z,direction:"nesw"}],L(_C.slice(0,x?1:2).map(function(Ne){return{vertical:q(Ne[1]),horizontal:Ne[0],direction:Ne[2],sub:!0,pos:[z[0]+Ne[0]*k,z[1]+Ne[1]*O]}})),!1);return{type:_,clipText:m,radiusX:k,radiusY:O,left:z[0]-k,top:z[1]-O,right:z[0]+k,bottom:z[1]+O,poses:$,splitter:v}}else if(_==="inset"){var V=vr(S||"0 0 0 0"),M=V.indexOf("round"),j=(M>-1?V.slice(0,M):V).length,F=V.slice(j+1),G=L(V.slice(0,j),4),H=G[0],X=G[1],J=X===void 0?H:X,P=G[2],W=P===void 0?H:P,Q=G[3],re=Q===void 0?J:Q,ne=L([H,W].map(function(Ne){return Te(Ne,n)}),2),Y=ne[0],Z=ne[1],ye=L([re,J].map(function(Ne){return Te(Ne,r)}),2),ie=ye[0],ce=ye[1],oe=r-ce,_e=n-Z,Ce=Iu(F,oe-ie,_e-Y,ie,Y),$=K(K([],L(Ga(Y,oe,_e,ie)),!1),L(Ce),!1);return{type:"inset",clipText:m,poses:$,top:Y,left:ie,right:oe,bottom:_e,radius:F,splitter:v}}else if(_==="rect"){var V=jr(S||"0px, ".concat(r,"px, ").concat(n,"px, 0px"));v=",";var ue=L(V.map(function(Ir){var zr=Pr(Ir).value;return zr}),4),Ee=ue[0],ce=ue[1],Z=ue[2],ie=ue[3],$=Ga(Ee,ce,Z,ie);return{type:"rect",clipText:m,poses:$,top:Ee,right:ce,bottom:Z,left:ie,values:V,splitter:v}}}}}function CC(t,r,n,o,a){var i=t[r],l=i.direction,s=i.sub,d=t.map(function(){return[0,0]}),c=l?l.split(""):[];if(o&&r<8){var f=c.filter(function(k){return k==="w"||k==="e"}),u=c.filter(function(k){return k==="n"||k==="s"}),p=f[0],h=u[0];d[r]=n;var m=L(zu(t),2),y=m[0],g=m[1],b=y&&g?y/g:0;if(b&&a){var w=(r+4)%8,_=t[w].pos,C=[0,0];l.indexOf("w")>-1?C[0]=-1:l.indexOf("e")>-1&&(C[0]=1),l.indexOf("n")>-1?C[1]=-1:l.indexOf("s")>-1&&(C[1]=1);var S=Su([y,g],n,b,C,!0),x=y+S[0],v=g+S[1],V=_[1],$=_[1],B=_[0],R=_[0];C[0]===-1?B=R-x:C[0]===1?R=B+x:(B=B-x/2,R=R+x/2),C[1]===-1?V=$-v:(C[1]===1||(V=$-v/2),$=V+v);var T=Ga(V,R,$,B);t.forEach(function(k,O){d[O][0]=T[O].pos[0]-k.pos[0],d[O][1]=T[O].pos[1]-k.pos[1]})}else t.forEach(function(k,O){var N=k.direction;N&&(N.indexOf(p)>-1&&(d[O][0]=n[0]),N.indexOf(h)>-1&&(d[O][1]=n[1]))}),p&&(d[1][0]=n[0]/2,d[5][0]=n[0]/2),h&&(d[3][1]=n[1]/2,d[7][1]=n[1]/2)}else l&&!s?c.forEach(function(k){var O=k==="n"||k==="s";t.forEach(function(N,D){var I=N.direction,z=N.horizontal,M=N.vertical;!I||I.indexOf(k)===-1||(d[D]=[O||!z?0:n[0],!O||!M?0:n[1]])})}):d[r]=n;return d}function SC(t,r){var n=L(mf(t,r),2),o=n[0],a=n[1],i=r.datas,l=i.clipPath,s=i.clipIndex,d=l,c=d.type,f=d.poses,u=d.splitter,p=f.map(function(w){return w.pos});if(c==="polygon")p.splice(s,0,[o,a]);else if(c==="inset"){var h=hC.indexOf(s),m=mC.indexOf(s),y=f.length;if(yC(f,p,8,h,m,o,a,p[4][0],p[4][1],p[0][0],p[0][1]),y===f.length)return}else return;var g=is(t,l,p),b="".concat(c,"(").concat(g.join(u),")");te(t,"onClip",ge(t,r,A({clipEventType:"added",clipType:c,poses:p,clipStyles:g,clipStyle:b,distX:0,distY:0},ut({clipPath:b},r))))}function xC(t,r){var n=r.datas,o=n.clipPath,a=n.clipIndex,i=o,l=i.type,s=i.poses,d=i.splitter,c=s.map(function(h){return h.pos}),f=c.length;if(l==="polygon")s.splice(a,1),c.splice(a,1);else if(l==="inset"){if(a<8||(gC(s,c,a,8,f),f===s.length))return}else return;var u=is(t,o,c),p="".concat(l,"(").concat(u.join(d),")");te(t,"onClip",ge(t,r,A({clipEventType:"removed",clipType:l,poses:c,clipStyles:u,clipStyle:p,distX:0,distY:0},ut({clipPath:p},r))))}var vC={name:"clippable",props:["clippable","defaultClipPath","customClipPath","keepRatio","clipRelative","clipArea","dragWithClip","clipTargetBounds","clipVerticalGuidelines","clipHorizontalGuidelines","clipSnapThreshold"],events:["clipStart","clip","clipEnd"],css:[`.control.clip-control {
321
321
  background: #6d6;
322
322
  cursor: pointer;
323
323
  }
@@ -351,7 +351,7 @@ background: #d66;
351
351
  background: var(--bounds-color);
352
352
  }`],render:function(t,r){var n=t.props,o=n.customClipPath,a=n.defaultClipPath,i=n.clipArea,l=n.zoom,s=n.groupable,d=t.getState(),c=d.target,f=d.width,u=d.height,p=d.allMatrix,h=d.is3d,m=d.left,y=d.top,g=d.pos1,b=d.pos2,w=d.pos3,_=d.pos4,C=d.clipPathState,S=d.snapBoundInfos,x=d.rotation;if(!c||s)return[];var v=Ru(c,f,u,a||"inset",C||o);if(!v)return[];var V=h?4:3,$=v.type,B=v.poses,R=B.map(function(ce){var oe=Ge(p,ce.pos,V);return[oe[0]-m,oe[1]-y]}),T=[],k=[],O=$==="rect",N=$==="inset",D=$==="polygon";if(O||N||D){var I=N?R.slice(0,8):R;k=I.map(function(ce,oe){var _e=oe===0?I[I.length-1]:I[oe-1],Ce=Ye(_e,ce),ue=du(_e,ce);return r.createElement("div",{key:"clipLine".concat(oe),className:ae("line","clip-line","snap-control"),"data-clip-index":oe,style:{width:"".concat(ue,"px"),transform:"translate(".concat(_e[0],"px, ").concat(_e[1],"px) rotate(").concat(Ce,"rad) scaleY(").concat(l,")")}})})}if(T=R.map(function(ce,oe){return r.createElement("div",{key:"clipControl".concat(oe),className:ae("control","clip-control","snap-control"),"data-clip-index":oe,style:{transform:"translate(".concat(ce[0],"px, ").concat(ce[1],"px) rotate(").concat(x,"rad) scale(").concat(l,")")}})}),N&&T.push.apply(T,K([],L(R.slice(8).map(function(ce,oe){return r.createElement("div",{key:"clipRadiusControl".concat(oe),className:ae("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+oe,style:{transform:"translate(".concat(ce[0],"px, ").concat(ce[1],"px) rotate(").concat(x,"rad) scale(").concat(l,")")}})})),!1)),$==="circle"||$==="ellipse"){var z=v.left,M=v.top,j=v.radiusX,F=v.radiusY,G=L(se(Ge(p,[z,M],V),Ge(p,[0,0],V)),2),H=G[0],X=G[1],J="none";if(!i){for(var P=Math.max(10,j/5,F/5),W=[],Q=0;Q<=P;++Q){var re=Math.PI*2/P*Q;W.push([j+(j-l)*Math.cos(re),F+(F-l)*Math.sin(re)])}W.push([j,-2]),W.push([-2,-2]),W.push([-2,F*2+2]),W.push([j*2+2,F*2+2]),W.push([j*2+2,-2]),W.push([j,-2]),J="polygon(".concat(W.map(function(ce){return"".concat(ce[0],"px ").concat(ce[1],"px")}).join(", "),")")}T.push(r.createElement("div",{key:"clipEllipse",className:ae("clip-ellipse","snap-control"),style:{width:"".concat(j*2,"px"),height:"".concat(F*2,"px"),clipPath:J,transform:"translate(".concat(-m+H,"px, ").concat(-y+X,"px) ").concat(Ma(p))}}))}if(i){var ne=Lt(K([g,b,w,_],L(R),!1)),Y=ne.width,Z=ne.height,ye=ne.left,ie=ne.top;if(D||O||N){var W=N?R.slice(0,8):R;T.push(r.createElement("div",{key:"clipArea",className:ae("clip-area","snap-control"),style:{width:"".concat(Y,"px"),height:"".concat(Z,"px"),transform:"translate(".concat(ye,"px, ").concat(ie,"px)"),clipPath:"polygon(".concat(W.map(function(oe){return"".concat(oe[0]-ye,"px ").concat(oe[1]-ie,"px")}).join(", "),")")}}))}}return S&&["vertical","horizontal"].forEach(function(ce){var oe=S[ce],_e=ce==="horizontal";oe.isSnap&&k.push.apply(k,K([],L(oe.snap.posInfos.map(function(Ce,ue){var Ee=Ce.pos,be=se(Ge(p,_e?[0,Ee]:[Ee,0],V),[m,y]),Ve=se(Ge(p,_e?[f,Ee]:[Ee,u],V),[m,y]);return mo(r,"",be,Ve,l,"clip".concat(ce,"snap").concat(ue),"guideline")})),!1)),oe.isBound&&k.push.apply(k,K([],L(oe.bounds.map(function(Ce,ue){var Ee=Ce.pos,be=se(Ge(p,_e?[0,Ee]:[Ee,0],V),[m,y]),Ve=se(Ge(p,_e?[f,Ee]:[Ee,u],V),[m,y]);return mo(r,"",be,Ve,l,"clip".concat(ce,"bounds").concat(ue),"guideline","bounds","bold")})),!1))}),K(K([],L(T),!1),L(k),!1)},dragControlCondition:function(t,r){return r.inputEvent&&(r.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(t,r){var n=t.props,o=n.dragWithClip,a=o===void 0?!0:o;return a?!1:this.dragControlStart(t,r)},drag:function(t,r){return this.dragControl(t,A(A({},r),{isDragTarget:!0}))},dragEnd:function(t,r){return this.dragControlEnd(t,r)},dragControlStart:function(t,r){var n=t.state,o=t.props,a=o.defaultClipPath,i=o.customClipPath,l=n.target,s=n.width,d=n.height,c=r.inputEvent?r.inputEvent.target:null,f=c&&c.getAttribute("class")||"",u=r.datas,p=Ru(l,s,d,a||"inset",i);if(!p)return!1;var h=p.clipText,m=p.type,y=p.poses,g=te(t,"onClipStart",ge(t,r,{clipType:m,clipStyle:h,poses:y.map(function(b){return b.pos})}));return g===!1?(u.isClipStart=!1,!1):(u.isControl=f&&f.indexOf("clip-control")>-1,u.isLine=f.indexOf("clip-line")>-1,u.isArea=f.indexOf("clip-area")>-1||f.indexOf("clip-ellipse")>-1,u.clipIndex=c?parseInt(c.getAttribute("data-clip-index"),10):-1,u.clipPath=p,u.isClipStart=!0,n.clipPathState=h,Hr(t,r),!0)},dragControl:function(t,r){var n,o,a,i=r.datas,l=r.originalDatas,s=r.isDragTarget;if(!i.isClipStart)return!1;var d=i,c=d.isControl,f=d.isLine,u=d.isArea,p=d.clipIndex,h=d.clipPath;if(!h)return!1;var m=Jr(t.props,"clippable"),y=m.keepRatio,g=0,b=0,w=l.draggable,_=ar(r);s&&w?(n=L(w.prevBeforeDist,2),g=n[0],b=n[1]):(o=L(_,2),g=o[0],b=o[1]);var C=[g,b],S=t.state,x=S.width,v=S.height,V=!u&&!c&&!f,$=h.type,B=h.poses,R=h.splitter,T=B.map(function(ze){return ze.pos});V&&(g=-g,b=-b);var k=!c||B[p].direction==="nesw",O=$==="inset"||$==="rect",N=B.map(function(){return[0,0]});if(c&&!k){var D=B[p],I=D.horizontal,z=D.vertical,M=[g*q(I),b*q(z)];N=CC(B,p,M,O,y)}else k&&(N=T.map(function(){return[g,b]}));var j=T.map(function(ze,gt){return xe(ze,N[gt])}),F=K([],L(j),!1);S.snapBoundInfos=null;var G=h.type==="circle",H=h.type==="ellipse";if(G||H){var X=Lt(j),J=q(X.bottom-X.top),P=q(H?X.right-X.left:J),W=j[0][1]+J,Q=j[0][0]-P,re=j[0][0]+P;G&&(F.push([re,X.bottom]),N.push([1,0])),F.push([X.left,W]),N.push([0,1]),F.push([Q,X.bottom]),N.push([1,0])}var ne=eu((m.clipHorizontalGuidelines||[]).map(function(ze){return Te("".concat(ze),v)}),(m.clipVerticalGuidelines||[]).map(function(ze){return Te("".concat(ze),x)}),x,v),Y=[],Z=[];if(G||H)Y=[F[4][0],F[2][0]],Z=[F[1][1],F[3][1]];else if(O){var ye=[F[0],F[2],F[4],F[6]],ie=[N[0],N[2],N[4],N[6]];Y=ye.filter(function(ze,gt){return ie[gt][0]}).map(function(ze){return ze[0]}),Z=ye.filter(function(ze,gt){return ie[gt][1]}).map(function(ze){return ze[1]})}else Y=F.filter(function(ze,gt){return N[gt][0]}).map(function(ze){return ze[0]}),Z=F.filter(function(ze,gt){return N[gt][1]}).map(function(ze){return ze[1]});var ce=[0,0],oe=Wf(ne,m.clipTargetBounds&&{left:0,top:0,right:x,bottom:v},Y,Z,5,5),_e=oe.horizontal,Ce=oe.vertical,ue=_e.offset,Ee=Ce.offset;if(_e.isBound&&(ce[1]+=ue),Ce.isBound&&(ce[0]+=Ee),(H||G)&&N[0][0]===0&&N[0][1]===0){var X=Lt(j),be=X.bottom-X.top,Ve=H?X.right-X.left:be,Ne=Ce.isBound?q(Ee):Ce.snapIndex===0?-Ee:Ee,we=_e.isBound?q(ue):_e.snapIndex===0?-ue:ue;Ve-=Ne,be-=we,G&&(be=Af(Ce,_e)>0?be:Ve,Ve=be);var nt=F[0];F[1][1]=nt[1]-be,F[2][0]=nt[0]+Ve,F[3][1]=nt[1]+be,F[4][0]=nt[0]-Ve}else if(O&&y&&c){var Ir=L(zu(B),2),zr=Ir[0],Em=Ir[1],Vm=zr&&Em?zr/Em:0,jI=B[p],ii=jI.direction||"",oc=F[1][1],W=F[5][1],Q=F[7][0],re=F[3][0];q(ue)<=q(Ee)?ue=pt(ue)*q(Ee)/Vm:Ee=pt(Ee)*q(ue)*Vm,ii.indexOf("w")>-1?Q-=Ee:ii.indexOf("e")>-1?re-=Ee:(Q+=Ee/2,re-=Ee/2),ii.indexOf("n")>-1?oc-=ue:ii.indexOf("s")>-1?W-=ue:(oc+=ue/2,W-=ue/2);var PI=Ga(oc,re,W,Q);F.forEach(function($m,HI){var lc;lc=L(PI[HI].pos,2),$m[0]=lc[0],$m[1]=lc[1]})}else F.forEach(function(ze,gt){var Nm=N[gt];Nm[0]&&(ze[0]-=Ee),Nm[1]&&(ze[1]-=ue)});var km=is(t,h,j),ac="".concat($,"(").concat(km.join(R),")");if(S.clipPathState=ac,G||H)Y=[F[4][0],F[2][0]],Z=[F[1][1],F[3][1]];else if(O){var ye=[F[0],F[2],F[4],F[6]];Y=ye.map(function(gt){return gt[0]}),Z=ye.map(function(gt){return gt[1]})}else Y=F.map(function(ze){return ze[0]}),Z=F.map(function(ze){return ze[1]});if(S.snapBoundInfos=Wf(ne,m.clipTargetBounds&&{left:0,top:0,right:x,bottom:v},Y,Z,1,1),w){var UI=S.is3d,WI=S.allMatrix,GI=UI?4:3,ic=ce;s&&(ic=[C[0]+ce[0]-_[0],C[1]+ce[1]-_[1]]),w.deltaOffset=Oe(WI,[ic[0],ic[1],0,0],GI)}return te(t,"onClip",ge(t,r,A({clipEventType:"changed",clipType:$,poses:j,clipStyle:ac,clipStyles:km,distX:g,distY:b},ut((a={},a[$==="rect"?"clip":"clipPath"]=ac,a),r)))),!0},dragControlEnd:function(t,r){this.unset(t);var n=r.isDrag,o=r.datas,a=r.isDouble,i=o.isLine,l=o.isClipStart,s=o.isControl;return l?(te(t,"onClipEnd",Dt(t,r,{})),a&&(s?xC(t,r):i&&SC(t,r)),a||n):!1},unset:function(t){t.state.clipPathState="",t.state.snapBoundInfos=null}},EC={name:"originDraggable",props:["originDraggable","originRelative"],events:["dragOriginStart","dragOrigin","dragOriginEnd"],css:[`:host[data-able-origindraggable] .control.origin {
353
353
  pointer-events: auto;
354
- }`],dragControlCondition:function(t,r){return r.isRequest?r.requestAble==="originDraggable":Ze(r.inputEvent.target,ae("origin"))},dragControlStart:function(t,r){var n=r.datas;Hr(t,r);var o=ge(t,r,{dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))}),a=te(t,"onDragOriginStart",o);return n.startOrigin=t.state.transformOrigin,n.startTargetOrigin=t.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,a===!1?(n.isDragOrigin=!1,!1):o},dragControl:function(t,r){var n=r.datas,o=r.isPinch,a=r.isRequest;if(!n.isDragOrigin)return!1;var i=L(ar(r),2),l=i[0],s=i[1],d=t.state,c=d.width,f=d.height,u=d.offsetMatrix,p=d.targetMatrix,h=d.is3d,m=t.props.originRelative,y=m===void 0?!0:m,g=h?4:3,b=[l,s];if(a){var w=r.distOrigin;(w[0]||w[1])&&(b=w)}var _=xe(n.startOrigin,b),C=xe(n.startTargetOrigin,b),S=se(b,n.prevOrigin),x=ho(u,p,_,g),v=t.getRect(),V=Lt(qr(x,c,f,g)),$=[v.left-V.left,v.top-V.top];n.prevOrigin=b;var B=[Zt(C[0],c,y),Zt(C[1],f,y)].join(" "),R=ft.drag(t,po(r,t.state,$,!!o,!1)),T=ge(t,r,A(A({width:c,height:f,origin:_,dist:b,delta:S,transformOrigin:B,drag:R},ut({transformOrigin:B,transform:R.transform},r)),{afterTransform:R.transform}));return te(t,"onDragOrigin",T),T},dragControlEnd:function(t,r){var n=r.datas;return n.isDragOrigin?(te(t,"onDragOriginEnd",Dt(t,r,{})),!0):!1},dragGroupControlCondition:function(t,r){return this.dragControlCondition(t,r)},dragGroupControlStart:function(t,r){var n=this.dragControlStart(t,r);return!!n},dragGroupControl:function(t,r){var n=this.dragControl(t,r);return n?(t.transformOrigin=n.transformOrigin,!0):!1},request:function(t){var r={},n=t.getRect(),o=0,a=0,i=n.transformOrigin,l=[0,0];return{isControl:!0,requestStart:function(){return{datas:r}},request:function(s){return"deltaOrigin"in s?(l[0]+=s.deltaOrigin[0],l[1]+=s.deltaOrigin[1]):"origin"in s?(l[0]=s.origin[0]-i[0],l[1]=s.origin[1]-i[1]):("x"in s?o=s.x-n.left:"deltaX"in s&&(o+=s.deltaX),"y"in s?a=s.y-n.top:"deltaY"in s&&(a+=s.deltaY)),{datas:r,distX:o,distY:a,distOrigin:l}},requestEnd:function(){return{datas:r,isDrag:!0}}}}};function VC(t,r,n,o){var a=t.filter(function(d){var c=d.virtual,f=d.horizontal;return f&&!c}).length,i=t.filter(function(d){var c=d.virtual,f=d.vertical;return f&&!c}).length,l=-1;if(r===0&&(a===0?l=0:a===1&&(l=1)),r===2&&(a<=2?l=2:a<=3&&(l=3)),r===3&&(i===0?l=4:i<4&&(l=7)),r===1&&(i<=1?l=5:i<=2&&(l=6)),!(l===-1||!t[l].virtual)){var s=t[l];kC(t,l),l<4?s.pos[0]=n:s.pos[1]=o}}function kC(t,r){r<4?t.slice(0,r+1).forEach(function(n){n.virtual=!1}):(t[0].virtual&&(t[0].virtual=!1),t.slice(4,r+1).forEach(function(n){n.virtual=!1}))}function NC(t,r){r<4?t.slice(r,4).forEach(function(n){n.virtual=!0}):t.slice(r).forEach(function(n){n.virtual=!0})}function Mu(t,r,n,o,a){o===void 0&&(o=[0,0]);var i=[];return!t||t==="0px"?i=[]:i=vr(t),Iu(i,r,n,0,0,o,a)}function Au(t,r,n,o,a){var i=t.state,l=i.width,s=i.height,d=as(a,t.props.roundRelative,l,s),c=d.raws,f=d.styles,u=d.radiusPoses,p=bC(u,c),h=p.horizontals,m=p.verticals,y=f.join(" ");i.borderRadiusState=y;var g=ge(t,r,A({horizontals:h,verticals:m,borderRadius:y,width:l,height:s,delta:o,dist:n},ut({borderRadius:y},r)));return te(t,"onRound",g),g}function Lu(t){var r,n,o=t.getState().style,a=o.borderRadius||"";if(!a&&t.props.groupable){var i=t.moveables[0],l=t.getTargets()[0];l&&((i==null?void 0:i.props.target)===l?(a=(n=(r=t.moveables[0])===null||r===void 0?void 0:r.state.style.borderRadius)!==null&&n!==void 0?n:"",o.borderRadius=a):(a=Jl(l).borderRadius,o.borderRadius=a))}return a}var $C={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[`.control.border-radius {
354
+ }`],dragControlCondition:function(t,r){return r.isRequest?r.requestAble==="originDraggable":Qe(r.inputEvent.target,ae("origin"))},dragControlStart:function(t,r){var n=r.datas;Hr(t,r);var o=ge(t,r,{dragStart:ft.dragStart(t,new wn().dragStart([0,0],r))}),a=te(t,"onDragOriginStart",o);return n.startOrigin=t.state.transformOrigin,n.startTargetOrigin=t.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,a===!1?(n.isDragOrigin=!1,!1):o},dragControl:function(t,r){var n=r.datas,o=r.isPinch,a=r.isRequest;if(!n.isDragOrigin)return!1;var i=L(ar(r),2),l=i[0],s=i[1],d=t.state,c=d.width,f=d.height,u=d.offsetMatrix,p=d.targetMatrix,h=d.is3d,m=t.props.originRelative,y=m===void 0?!0:m,g=h?4:3,b=[l,s];if(a){var w=r.distOrigin;(w[0]||w[1])&&(b=w)}var _=xe(n.startOrigin,b),C=xe(n.startTargetOrigin,b),S=se(b,n.prevOrigin),x=ho(u,p,_,g),v=t.getRect(),V=Lt(qr(x,c,f,g)),$=[v.left-V.left,v.top-V.top];n.prevOrigin=b;var B=[Zt(C[0],c,y),Zt(C[1],f,y)].join(" "),R=ft.drag(t,po(r,t.state,$,!!o,!1)),T=ge(t,r,A(A({width:c,height:f,origin:_,dist:b,delta:S,transformOrigin:B,drag:R},ut({transformOrigin:B,transform:R.transform},r)),{afterTransform:R.transform}));return te(t,"onDragOrigin",T),T},dragControlEnd:function(t,r){var n=r.datas;return n.isDragOrigin?(te(t,"onDragOriginEnd",Dt(t,r,{})),!0):!1},dragGroupControlCondition:function(t,r){return this.dragControlCondition(t,r)},dragGroupControlStart:function(t,r){var n=this.dragControlStart(t,r);return!!n},dragGroupControl:function(t,r){var n=this.dragControl(t,r);return n?(t.transformOrigin=n.transformOrigin,!0):!1},request:function(t){var r={},n=t.getRect(),o=0,a=0,i=n.transformOrigin,l=[0,0];return{isControl:!0,requestStart:function(){return{datas:r}},request:function(s){return"deltaOrigin"in s?(l[0]+=s.deltaOrigin[0],l[1]+=s.deltaOrigin[1]):"origin"in s?(l[0]=s.origin[0]-i[0],l[1]=s.origin[1]-i[1]):("x"in s?o=s.x-n.left:"deltaX"in s&&(o+=s.deltaX),"y"in s?a=s.y-n.top:"deltaY"in s&&(a+=s.deltaY)),{datas:r,distX:o,distY:a,distOrigin:l}},requestEnd:function(){return{datas:r,isDrag:!0}}}}};function VC(t,r,n,o){var a=t.filter(function(d){var c=d.virtual,f=d.horizontal;return f&&!c}).length,i=t.filter(function(d){var c=d.virtual,f=d.vertical;return f&&!c}).length,l=-1;if(r===0&&(a===0?l=0:a===1&&(l=1)),r===2&&(a<=2?l=2:a<=3&&(l=3)),r===3&&(i===0?l=4:i<4&&(l=7)),r===1&&(i<=1?l=5:i<=2&&(l=6)),!(l===-1||!t[l].virtual)){var s=t[l];kC(t,l),l<4?s.pos[0]=n:s.pos[1]=o}}function kC(t,r){r<4?t.slice(0,r+1).forEach(function(n){n.virtual=!1}):(t[0].virtual&&(t[0].virtual=!1),t.slice(4,r+1).forEach(function(n){n.virtual=!1}))}function NC(t,r){r<4?t.slice(r,4).forEach(function(n){n.virtual=!0}):t.slice(r).forEach(function(n){n.virtual=!0})}function Mu(t,r,n,o,a){o===void 0&&(o=[0,0]);var i=[];return!t||t==="0px"?i=[]:i=vr(t),Iu(i,r,n,0,0,o,a)}function Au(t,r,n,o,a){var i=t.state,l=i.width,s=i.height,d=as(a,t.props.roundRelative,l,s),c=d.raws,f=d.styles,u=d.radiusPoses,p=bC(u,c),h=p.horizontals,m=p.verticals,y=f.join(" ");i.borderRadiusState=y;var g=ge(t,r,A({horizontals:h,verticals:m,borderRadius:y,width:l,height:s,delta:o,dist:n},ut({borderRadius:y},r)));return te(t,"onRound",g),g}function Lu(t){var r,n,o=t.getState().style,a=o.borderRadius||"";if(!a&&t.props.groupable){var i=t.moveables[0],l=t.getTargets()[0];l&&((i==null?void 0:i.props.target)===l?(a=(n=(r=t.moveables[0])===null||r===void 0?void 0:r.state.style.borderRadius)!==null&&n!==void 0?n:"",o.borderRadius=a):(a=Jl(l).borderRadius,o.borderRadius=a))}return a}var $C={name:"roundable",props:["roundable","roundRelative","minRoundControls","maxRoundControls","roundClickable","roundPadding","isDisplayShadowRoundControls"],events:["roundStart","round","roundEnd","roundGroupStart","roundGroup","roundGroupEnd"],css:[`.control.border-radius {
355
355
  background: #d66;
356
356
  cursor: pointer;
357
357
  z-index: 3;
@@ -363,12 +363,12 @@ opacity: 0.5;
363
363
  z-index: 1;
364
364
  }`,`:host.round-line-clickable .line.direction {
365
365
  cursor: pointer;
366
- }`],className:function(t){var r=t.props.roundClickable;return r===!0||r==="line"?ae("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(t,r){var n=t.getState(),o=n.target,a=n.width,i=n.height,l=n.allMatrix,s=n.is3d,d=n.left,c=n.top,f=n.borderRadiusState,u=t.props,p=u.minRoundControls,h=p===void 0?[0,0]:p,m=u.maxRoundControls,y=m===void 0?[4,4]:m,g=u.zoom,b=u.roundPadding,w=b===void 0?0:b,_=u.isDisplayShadowRoundControls,C=u.groupable;if(!o)return null;var S=f||Lu(t),x=s?4:3,v=Mu(S,a,i,h,!0);if(!v)return null;var V=0,$=0,B=C?[0,0]:[d,c];return v.map(function(R,T){var k=R.horizontal,O=R.vertical,N=R.direction||"",D=K([],L(R.pos),!1);$+=Math.abs(k),V+=Math.abs(O),k&&N.indexOf("n")>-1&&(D[1]-=w),O&&N.indexOf("w")>-1&&(D[0]-=w),k&&N.indexOf("s")>-1&&(D[1]+=w),O&&N.indexOf("e")>-1&&(D[0]+=w);var I=se(Ge(l,D,x),B),z=_&&_!=="horizontal",M=R.vertical?V<=y[1]&&(z||!R.virtual):$<=y[0]&&(_||!R.virtual);return r.createElement("div",{key:"borderRadiusControl".concat(T),className:ae("control","border-radius",R.vertical?"vertical":"",R.virtual?"virtual":""),"data-radius-index":T,style:{display:M?"block":"none",transform:"translate(".concat(I[0],"px, ").concat(I[1],"px) scale(").concat(g,")")}})})},dragControlCondition:function(t,r){if(!r.inputEvent||r.isRequest)return!1;var n=r.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(t,r){return this.dragControlCondition(t,r)},dragControlStart:function(t,r){var n=r.inputEvent,o=r.datas,a=n.target,i=a.getAttribute("class")||"",l=i.indexOf("border-radius")>-1,s=i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1,d=l?parseInt(a.getAttribute("data-radius-index"),10):-1,c=-1;if(s){var f=a.getAttribute("data-line-key")||"";f&&(c=parseInt(f.replace(/render-line-/g,""),10),isNaN(c)&&(c=-1))}if(!l&&!s)return!1;var u=ge(t,r,{}),p=te(t,"onRoundStart",u);if(p===!1)return!1;o.lineIndex=c,o.controlIndex=d,o.isControl=l,o.isLine=s,Hr(t,r);var h=t.props,m=h.roundRelative,y=h.minRoundControls,g=y===void 0?[0,0]:y,b=t.state,w=b.width,_=b.height;o.isRound=!0,o.prevDist=[0,0];var C=Lu(t),S=Mu(C||"",w,_,g,!0)||[];return o.controlPoses=S,b.borderRadiusState=as(S,m,w,_).styles.join(" "),u},dragControl:function(t,r){var n=r.datas,o=n.controlPoses;if(!n.isRound||!n.isControl||!o.length)return!1;var a=n.controlIndex,i=L(ar(r),2),l=i[0],s=i[1],d=[l,s],c=se(d,n.prevDist),f=t.props.maxRoundControls,u=f===void 0?[4,4]:f,p=t.state,h=p.width,m=p.height,y=o[a],g=y.vertical,b=y.horizontal,w=o.map(function(C){var S=C.horizontal,x=C.vertical,v=[S*b*d[0],x*g*d[1]];if(S){if(u[0]===1)return v;if(u[0]<4&&S!==b)return v}else{if(u[1]===0)return v[1]=x*b*d[0]/h*m,v;if(g){if(u[1]===1)return v;if(u[1]<4&&x!==g)return v}}return[0,0]});w[a]=d;var _=o.map(function(C,S){return A(A({},C),{pos:xe(C.pos,w[S])})});return a<4?_.slice(0,a+1).forEach(function(C){C.virtual=!1}):_.slice(4,a+1).forEach(function(C){C.virtual=!1}),n.prevDist=[l,s],Au(t,r,d,c,_)},dragControlEnd:function(t,r){var n=t.state;n.borderRadiusState="";var o=r.datas,a=r.isDouble;if(!o.isRound)return!1;var i=o.isControl,l=o.controlIndex,s=o.isLine,d=o.lineIndex,c=o.controlPoses,f=c.filter(function(b){var w=b.virtual;return w}).length,u=t.props.roundClickable,p=u===void 0?!0:u;if(a&&p){if(i&&(p===!0||p==="control"))NC(c,l);else if(s&&(p===!0||p==="line")){var h=L(mf(t,r),2),m=h[0],y=h[1];VC(c,d,m,y)}f!==c.filter(function(b){var w=b.virtual;return w}).length&&Au(t,r,[0,0],[0,0],c)}var g=Dt(t,r,{});return te(t,"onRoundEnd",g),n.borderRadiusState="",g},dragGroupControlStart:function(t,r){var n=this.dragControlStart(t,r);if(!n)return!1;var o=t.moveables,a=t.props.targets,i=Kt(t,"roundable",r),l=A({targets:t.props.targets,events:i.map(function(s,d){return A(A({},s),{target:a[d],moveable:o[d],currentTarget:o[d]})})},n);return te(t,"onRoundGroupStart",l),n},dragGroupControl:function(t,r){var n=this.dragControl(t,r);if(!n)return!1;var o=t.moveables,a=t.props.targets,i=Kt(t,"roundable",r),l=A({targets:t.props.targets,events:i.map(function(s,d){return A(A(A({},s),{target:a[d],moveable:o[d],currentTarget:o[d]}),ut({borderRadius:n.borderRadius},s))})},n);return te(t,"onRoundGroup",l),l},dragGroupControlEnd:function(t,r){var n=t.moveables,o=t.props.targets,a=Kt(t,"roundable",r);Fa(t,"onRound",function(s){var d=A({targets:t.props.targets,events:a.map(function(c,f){return A(A(A({},c),{target:o[f],moveable:n[f],currentTarget:n[f]}),ut({borderRadius:s.borderRadius},c))})},s);te(t,"onRoundGroup",d)});var i=this.dragControlEnd(t,r);if(!i)return!1;var l=A({targets:t.props.targets,events:a.map(function(s,d){var c;return A(A({},s),{target:o[d],moveable:n[d],currentTarget:n[d],lastEvent:(c=s.datas)===null||c===void 0?void 0:c.lastEvent})})},i);return te(t,"onRoundGroupEnd",l),l},unset:function(t){t.state.borderRadiusState=""}};function DC(t,r){var n=r?4:3,o=Me(n),a="matrix".concat(r?"3d":"","(").concat(o.join(","),")");return t===a||t==="matrix(1,0,0,1,0,0)"}var Fu={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,r){var n=t.state,o=n.is3d,a=n.targetMatrix,i=n.inlineTransform,l=o?"matrix3d(".concat(a.join(","),")"):"matrix(".concat(qd(a,!0),")"),s=!i||i==="none"?l:i;r.datas.startTransforms=DC(s,o)?[]:vr(s)},resetStyle:function(t){var r=t.datas;r.nextStyle={},r.nextTransforms=t.datas.startTransforms,r.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,r){return ge(t,r,{setTransform:function(n){r.datas.startTransforms=Ue(n)?n:vr(n)},isPinch:!!r.isPinch})},fillDragParams:function(t,r){return ge(t,r,{isPinch:!!r.isPinch})},dragStart:function(t,r){this.setTransform(t,r),this.resetStyle(r),te(t,"onBeforeRenderStart",this.fillDragStartParams(t,r))},drag:function(t,r){r.datas.startTransforms||this.setTransform(t,r),this.resetStyle(r),te(t,"onBeforeRender",ge(t,r,{isPinch:!!r.isPinch}))},dragEnd:function(t,r){r.datas.startTransforms||(this.setTransform(t,r),this.resetStyle(r)),te(t,"onBeforeRenderEnd",ge(t,r,{isPinch:!!r.isPinch,isDrag:r.isDrag}))},dragGroupStart:function(t,r){var n=this;this.dragStart(t,r);var o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.setTransform(d,l),n.resetStyle(l),n.fillDragStartParams(d,l)});te(t,"onBeforeRenderGroupStart",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets,setTransform:function(){},events:i}))},dragGroup:function(t,r){var n=this;this.drag(t,r);var o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.resetStyle(l),n.fillDragParams(d,l)});te(t,"onBeforeRenderGroup",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets,events:i}))},dragGroupEnd:function(t,r){this.dragEnd(t,r),te(t,"onBeforeRenderGroupEnd",ge(t,r,{isPinch:!!r.isPinch,isDrag:r.isDrag,targets:t.props.targets}))},dragControlStart:function(t,r){return this.dragStart(t,r)},dragControl:function(t,r){return this.drag(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupControlStart:function(t,r){return this.dragGroupStart(t,r)},dragGroupControl:function(t,r){return this.dragGroup(t,r)},dragGroupControlEnd:function(t,r){return this.dragGroupEnd(t,r)}},ju={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,r){te(t,"onRenderStart",ge(t,r,{isPinch:!!r.isPinch}))},drag:function(t,r){te(t,"onRender",this.fillDragParams(t,r))},dragAfter:function(t,r){return this.drag(t,r)},dragEnd:function(t,r){te(t,"onRenderEnd",this.fillDragEndParams(t,r))},dragGroupStart:function(t,r){te(t,"onRenderGroupStart",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets}))},dragGroup:function(t,r){var n=this,o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.fillDragParams(d,l)});te(t,"onRenderGroup",ge(t,r,A(A({isPinch:!!r.isPinch,targets:t.props.targets,transform:Va(r),transformObject:{}},ut(ka(r))),{events:i})))},dragGroupEnd:function(t,r){var n=this,o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.fillDragEndParams(d,l)});te(t,"onRenderGroupEnd",ge(t,r,A({isPinch:!!r.isPinch,isDrag:r.isDrag,targets:t.props.targets,events:i,transformObject:{},transform:Va(r)},ut(ka(r)))))},dragControlStart:function(t,r){return this.dragStart(t,r)},dragControl:function(t,r){return this.drag(t,r)},dragControlAfter:function(t,r){return this.dragAfter(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupControlStart:function(t,r){return this.dragGroupStart(t,r)},dragGroupControl:function(t,r){return this.dragGroup(t,r)},dragGroupControlEnd:function(t,r){return this.dragGroupEnd(t,r)},fillDragParams:function(t,r){var n={};return mn(Ea(r)||[]).forEach(function(o){n[o.name]=o.functionValue}),ge(t,r,A({isPinch:!!r.isPinch,transformObject:n,transform:Va(r)},ut(ka(r))))},fillDragEndParams:function(t,r){var n={};return mn(Ea(r)||[]).forEach(function(o){n[o.name]=o.functionValue}),ge(t,r,A({isPinch:!!r.isPinch,isDrag:r.isDrag,transformObject:n,transform:Va(r)},ut(ka(r))))}};function So(t,r,n,o,a,i,l){i.clientDistX=i.distX,i.clientDistY=i.distY;var s=a==="Start",d=a==="End",c=a==="After",f=t.state.target,u=i.isRequest,p=o.indexOf("Control")>-1;if(!f||s&&p&&!u&&t.areaElement===i.inputEvent.target)return!1;var h=K([],L(r),!1);if(u){var m=i.requestAble;h.some(function(T){return T.name===m})||h.push.apply(h,K([],L(t.props.ables.filter(function(T){return T.name===m})),!1))}if(!h.length||h.every(function(T){return T.dragRelation}))return!1;var y=i.inputEvent,g;d&&y&&(g=document.elementFromPoint(i.clientX,i.clientY)||y.target);var b=!1,w=function(){var T;b=!0,(T=i.stop)===null||T===void 0||T.call(i)},_=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());_&&t.updateRect(a,!0,!1);var C=i.datas,S=p?"controlGesto":"targetGesto",x=t[S],v=function(T,k,O){if(!(k in T)||x!==t[S])return!1;var N=T.name,D=C[N]||(C[N]={});if(s&&(D.isEventStart=!O||!T[O]||T[O](t,i)),!D.isEventStart)return!1;var I=T[k](t,A(A({},i),{stop:w,datas:D,originalDatas:C,inputTarget:g}));return t._emitter.off(),s&&I===!1&&(D.isEventStart=!1),I};_&&h.forEach(function(T){T.unset&&T.unset(t)}),v(Fu,"drag".concat(o).concat(a));var V=0,$=0;n.forEach(function(T){if(b)return!1;var k="".concat(T).concat(o).concat(a),O="".concat(T).concat(o,"Condition");a===""&&!u&&wu(t.state,i);var N=h.filter(function(z){return z[k]});N=N.filter(function(z,M){return z.name&&N.indexOf(z)===M});var D=N.filter(function(z){return v(z,k,O)}),I=D.length;b&&++V,I&&++$,!b&&s&&N.length&&!I&&(V+=N.filter(function(z){var M=z.name,j=C[M];return j.isEventStart?z.dragRelation!=="strong":!1}).length?1:0)}),(!c||$)&&v(ju,"drag".concat(o).concat(a));var B=x!==t[S]||V===n.length;if((d||b||B)&&(t.state.gestos={},t.moveables&&t.moveables.forEach(function(T){T.state.gestos={}}),h.forEach(function(T){T.unset&&T.unset(t)})),s&&!B&&!u&&$&&t.props.preventDefault&&(i==null||i.preventDefault()),t.isUnmounted||B)return!1;if(!s&&$&&!l||d){var R=t.props.flushSync||iu;R(function(){t.updateRect(d?a:"",!0,!1),t.forceUpdate()})}return!s&&!d&&!c&&$&&!l&&So(t,r,n,o,a+"After",i),!0}function ls(t,r){return function(n,o){var a;o===void 0&&(o=n.inputEvent.target);var i=o,l=t.areaElement,s=t._dragTarget;return!s||!r&&(!((a=t.controlGesto)===null||a===void 0)&&a.isFlag())?!1:i===s||s.contains(i)||i===l||!t.isMoveableElement(i)&&!t.controlBox.contains(i)||Ze(i,"moveable-area")||Ze(i,"moveable-padding")||Ze(i,"moveable-edgeDraggable")}}function Pu(t,r,n){var o=t.controlBox,a=[],i=t.props,l=i.dragArea,s=t.state.target,d=i.dragTarget;a.push(o),(!l||d)&&a.push(r),!l&&d&&s&&r!==s&&i.dragTargetSelf&&a.push(s);var c=ls(t);return Wu(t,a,"targetAbles",n,{dragStart:c,pinchStart:c})}function Uu(t,r){var n=t.controlBox,o=[];o.push(n);var a=ls(t,!0),i=function(l,s){if(s===void 0&&(s=l.inputEvent.target),s===n)return!0;var d=a(l,s);return!d};return Wu(t,o,"controlAbles",r,{dragStart:i,pinchStart:i})}function Wu(t,r,n,o,a){a===void 0&&(a={});var i=n==="targetAbles",l=t.props,s=l.pinchOutside,d=l.pinchThreshold,c=l.preventClickEventOnDrag,f=l.preventClickDefault,u=l.checkInput,p=l.dragFocusedInput,h=l.preventDefault,m=h===void 0?!0:h,y=l.preventRightClick,g=y===void 0?!0:y,b=l.preventWheelClick,w=b===void 0?!0:b,_=l.dragContainer,C=ir(_,!0),S={preventDefault:m,preventRightClick:g,preventWheelClick:w,container:C||At(t.getControlBoxElement()),pinchThreshold:d,pinchOutside:s,preventClickEventOnDrag:i?c:!1,preventClickEventOnDragStart:i?f:!1,preventClickEventByCondition:i?null:function(V){return t.controlBox.contains(V.target)},checkInput:i?u:!1,dragFocusedInput:p},x=new of(r,S),v=o==="Control";return["drag","pinch"].forEach(function(V){["Start","","End"].forEach(function($){x.on("".concat(V).concat($),function(B){var R,T=B.eventType,k=V==="drag"&&B.isPinch;if(a[T]&&!a[T](B)){B.stop();return}if(!k){var O=V==="drag"?[V]:["drag",V],N=K([],L(t[n]),!1),D=So(t,N,O,o,$,B);D?(t.props.stopPropagation||$==="Start"&&v)&&((R=B==null?void 0:B.inputEvent)===null||R===void 0||R.stopPropagation()):B.stop()}})})}),x}var BC=function(){function t(r,n,o){var a=this;this.target=r,this.moveable=n,this.eventName=o,this.ables=[],this._onEvent=function(i){var l=a.eventName,s=a.moveable;s.state.disableNativeEvent||a.ables.forEach(function(d){d[l](s,{inputEvent:i})})},r.addEventListener(o.toLowerCase(),this._onEvent)}return t.prototype.setAbles=function(r){this.ables=r},t.prototype.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function TC(t,r,n,o){var a;n===void 0&&(n=r);var i=Cf(t,r),l=i.matrixes,s=i.is3d,d=i.targetMatrix,c=i.transformOrigin,f=i.targetOrigin,u=i.offsetContainer,p=i.hasFixed,h=i.zoom,m=Y_(u,n),y=m.matrixes,g=m.is3d,b=m.offsetContainer,w=m.zoom,_=o||g||s,C=_?4:3,S=t.tagName.toLowerCase()!=="svg"&&"ownerSVGElement"in t,x=d,v=Me(C),V=Me(C),$=Me(C),B=Me(C),R=l.length,T=y.map(function(M){return A(A({},M),{matrix:M.matrix?K([],L(M.matrix),!1):void 0})}).reverse();l.reverse(),!s&&_&&(x=Jt(x,3,4),Gl(l)),!g&&_&&Gl(T),T.forEach(function(M){V=Oe(V,M.matrix,C)});var k=n||Er(t),O=((a=T[0])===null||a===void 0?void 0:a.target)||_o(k,k,!0).offsetParent,N=T.slice(1).reduce(function(M,j){return Oe(M,j.matrix,C)},Me(C));l.forEach(function(M,j){if(R-2===j&&($=v.slice()),R-1===j&&(B=v.slice()),!M.matrix){var F=l[j+1],G=Jw(M,F,O,C,Oe(N,v,C));M.matrix=Wr(G,C)}v=Oe(v,M.matrix,C)});var D=!S&&s;x||(x=Me(D?4:3));var I=Ma(S&&x.length===16?Jt(x,4,3):x,D),z=V;return V=Yd(V,C,C),{hasZoom:h!==1||w!==1,hasFixed:p,matrixes:l,rootMatrix:V,originalRootMatrix:z,beforeMatrix:$,offsetMatrix:B,allMatrix:v,targetMatrix:x,targetTransform:I,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:f,is3d:_,offsetContainer:u,offsetRootContainer:b}}function OC(t,r,n,o){n===void 0&&(n=r);var a=0,i=0,l=0,s={},d=fu(t);if(t&&(a=d.offsetWidth,i=d.offsetHeight),t){var c=TC(t,r,n,o),f=Cn(c.allMatrix,c.transformOrigin,a,i);s=A(A({},c),f);var u=Cn(c.allMatrix,[50,50],100,100);l=uu([u.pos1,u.pos2],u.direction)}var p=o?4:3;return A(A(A({hasZoom:!1,width:a,height:i,rotation:l},d),{originalRootMatrix:Me(p),rootMatrix:Me(p),beforeMatrix:Me(p),offsetMatrix:Me(p),allMatrix:Me(p),targetMatrix:Me(p),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!o,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),s)}function ss(t,r,n,o,a,i){i===void 0&&(i=[]);var l=1,s=[0,0],d=La(),c=La(),f=La(),u=La(),p=[0,0],h={},m=OC(r,n,a,!0);if(r){var y=St(r);i.forEach(function(T){h[T]=y(T)});var g=m.is3d?4:3,b=Cn(m.offsetMatrix,xe(m.transformOrigin,Xd(m.targetMatrix,g)),m.width,m.height);l=b.direction,s=xe(b.origin,[b.left-m.left,b.top-m.top]),u=Co(m.offsetRootContainer);var w=_o(o,o,!0).offsetParent||m.offsetRootContainer;if(m.hasZoom){var _=Cn(Oe(m.originalRootMatrix,m.allMatrix),m.transformOrigin,m.width,m.height),C=Cn(m.originalRootMatrix,Ra(St(w)("transformOrigin")).map(function(T){return parseFloat(T)}),w.offsetWidth,w.offsetHeight);if(d=Yl(_,u),f=Yl(C,u,w,!0),t){var S=_.left,x=_.top;c=Yl({left:S,top:x,bottom:x,right:x},u)}}else{d=Co(r),f=H_(w),t&&(c=Co(t));var v=f.left,V=f.top,$=f.clientLeft,B=f.clientTop,R=[d.left-v,d.top-V];p=se($n(m.rootMatrix,R,4),[$+m.left,B+m.top])}}return A({targetClientRect:d,containerClientRect:f,moveableClientRect:c,rootContainerClientRect:u,beforeDirection:l,beforeOrigin:s,originalBeforeOrigin:s,target:r,style:h,offsetDelta:p},m)}function Gu(t){var r=t.pos1,n=t.pos2,o=t.pos3,a=t.pos4;if(!r||!n||!o||!a)return null;var i=Gr([r,n,o,a]),l=[i.minX,i.minY],s=se(t.origin,l);return r=se(r,l),n=se(n,l),o=se(o,l),a=se(a,l),A(A({},t),{left:t.left,top:t.top,posDelta:l,pos1:r,pos2:n,pos3:o,pos4:a,origin:s,beforeOrigin:s,isPersisted:!0})}var Bn=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.state=A({container:null,gestos:{},renderLines:[[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]]],renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},ss(null)),n.renderState={},n.enabledAbles=[],n.targetAbles=[],n.controlAbles=[],n.rotation=0,n.scale=[1,1],n.isMoveableMounted=!1,n.isUnmounted=!1,n.events={mouseEnter:null,mouseLeave:null},n._emitter=new yn,n._prevOriginalDragTarget=null,n._originalDragTarget=null,n._prevDragTarget=null,n._dragTarget=null,n._prevPropTarget=null,n._propTarget=null,n._prevDragArea=!1,n._isPropTargetChanged=!1,n._hasFirstTarget=!1,n._reiszeObserver=null,n._observerId=0,n._mutationObserver=null,n._rootContainer=null,n._viewContainer=null,n._viewClassNames=[],n._store={},n.checkUpdateRect=function(){if(!n.isDragging()){var o=n.props.parentMoveable;if(o){o.checkUpdateRect();return}Qb(n._observerId),n._observerId=md(function(){n.isDragging()||n.updateRect()})}},n._onPreventClick=function(o){o.stopPropagation(),o.preventDefault()},n}return r.prototype.render=function(){var n=this.props,o=this.getState(),a=n.parentPosition,i=n.className,l=n.target,s=n.zoom,d=n.cspNonce,c=n.translateZ,f=n.cssStyled,u=n.groupable,p=n.linePadding,h=n.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var m=L(a||[0,0],2),y=m[0],g=m[1],b=o.left,w=o.top,_=o.target,C=o.direction,S=o.hasFixed,x=o.offsetDelta,v=n.targets,V=this.isDragging(),$={};this.getEnabledAbles().forEach(function(N){$["data-able-".concat(N.name.toLowerCase())]=!0});var B=this._getAbleClassName(),R=v&&v.length&&(_||u)||l||!this._hasFirstTarget&&this.state.isPersisted,T=this.controlBox||this.props.firstRenderState||this.props.persistData,k=[b-y,w-g];!u&&n.useAccuratePosition&&(k[0]+=x[0],k[1]+=x[1]);var O={position:S?"fixed":"absolute",display:R?"block":"none",visibility:T?"visible":"hidden",transform:"translate3d(".concat(k[0],"px, ").concat(k[1],"px, ").concat(c,")"),"--zoom":s,"--zoompx":"".concat(s,"px")};return p&&(O["--moveable-line-padding"]=p),h&&(O["--moveable-control-padding"]=h),Xt(f,A({cspNonce:d,ref:pr(this,"controlBox"),className:"".concat(ae("control-box",C===-1?"reverse":"",V?"dragging":"")," ").concat(B," ").concat(i)},$,{onClick:this._onPreventClick,style:O}),this.renderAbles(),this._renderLines())},r.prototype.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var n=this.props,o=n.parentMoveable,a=n.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),!a&&!o&&!this.state.isPersisted&&(this.updateRect("",!1,!1),this.forceUpdate())},r.prototype.componentDidUpdate=function(n){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(n)},r.prototype.componentWillUnmount=function(){var n,o;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),(n=this._reiszeObserver)===null||n===void 0||n.disconnect(),(o=this._mutationObserver)===null||o===void 0||o.disconnect();var a=this._viewContainer;a&&this._changeAbleViewClassNames([]),kn(this,!1),kn(this,!0);var i=this.events;for(var l in i){var s=i[l];s&&s.destroy()}},r.prototype.getTargets=function(){var n=this.props.target;return n?[n]:[]},r.prototype.getAble=function(n){var o=this.props.ables||[];return _t(o,function(a){return a.name===n})},r.prototype.getContainer=function(){var n=this.props,o=n.parentMoveable,a=n.wrapperMoveable,i=n.container;return i||a&&a.getContainer()||o&&o.getContainer()||this.controlBox.parentElement},r.prototype.getControlBoxElement=function(){return this.controlBox},r.prototype.getDragElement=function(){return this._dragTarget},r.prototype.isMoveableElement=function(n){var o;return n&&(((o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"class"))||"").indexOf(Cl)>-1},r.prototype.dragStart=function(n,o){o===void 0&&(o=n.target);var a=this.targetGesto,i=this.controlGesto;return a&&ls(this)({inputEvent:n},o)?a.isFlag()||a.triggerDragStart(n):i&&this.isMoveableElement(o)&&(i.isFlag()||i.triggerDragStart(n)),this},r.prototype.hitTest=function(n){var o=this.state,a=o.target,i=o.pos1,l=o.pos2,s=o.pos3,d=o.pos4,c=o.targetClientRect;if(!a)return 0;var f;if(Vr(n)){var u=n.getBoundingClientRect();f={left:u.left,top:u.top,width:u.width,height:u.height}}else f=A({width:0,height:0},n);var p=f.left,h=f.top,m=f.width,y=f.height,g=dl([i,l,d,s],c),b=e_(g,[[p,h],[p+m,h],[p+m,h+y],[p,h+y]]),w=so(g);return!b||!w?0:Math.min(100,b/w*100)},r.prototype.isInside=function(n,o){var a=this.state,i=a.target,l=a.pos1,s=a.pos2,d=a.pos3,c=a.pos4,f=a.targetClientRect;return i?ya([n,o],dl([l,s,c,d],f)):!1},r.prototype.updateRect=function(n,o,a){a===void 0&&(a=!0);var i=this.props,l=!i.parentPosition&&!i.wrapperMoveable;l&&vn(!0);var s=i.parentMoveable,d=this.state,c=d.target||i.target,f=this.getContainer(),u=s?s._rootContainer:this._rootContainer,p=ss(this.controlBox,c,f,f,u||f,this._getRequestStyles());if(!c&&this._hasFirstTarget&&i.persistData){var h=Gu(i.persistData);for(var m in h)p[m]=h[m]}l&&vn(),this.updateState(p,s?!1:a)},r.prototype.isDragging=function(n){var o,a,i=this.targetGesto,l=this.controlGesto;if(i!=null&&i.isFlag()){if(!n)return!0;var s=i.getEventData();return!!(!((o=s[n])===null||o===void 0)&&o.isEventStart)}if(l!=null&&l.isFlag()){if(!n)return!0;var s=l.getEventData();return!!(!((a=s[n])===null||a===void 0)&&a.isEventStart)}return!1},r.prototype.updateTarget=function(n){this.updateRect(n,!0)},r.prototype.getRect=function(){var n=this.state,o=jt(this.state),a=L(o,4),i=a[0],l=a[1],s=a[2],d=a[3],c=Lt(o),f=n.width,u=n.height,p=c.width,h=c.height,m=c.left,y=c.top,g=[n.left,n.top],b=xe(g,n.origin),w=xe(g,n.beforeOrigin),_=n.transformOrigin;return{width:p,height:h,left:m,top:y,pos1:i,pos2:l,pos3:s,pos4:d,offsetWidth:f,offsetHeight:u,beforeOrigin:w,origin:b,transformOrigin:_,rotation:this.getRotation()}},r.prototype.getManager=function(){return this},r.prototype.stopDrag=function(n){if(!n||n==="target"){var o=this.targetGesto;(o==null?void 0:o.isIdle())===!1&&ql(this,!1),o==null||o.stop()}if(!n||n==="control"){var o=this.controlGesto;(o==null?void 0:o.isIdle())===!1&&ql(this,!0),o==null||o.stop()}},r.prototype.getRotation=function(){var n=this.state,o=n.pos1,a=n.pos2,i=n.direction;return rC(o,a,i)},r.prototype.request=function(n,o,a){o===void 0&&(o={});var i=this,l=i.props,s=l.parentMoveable||l.wrapperMoveable||i,d=s.props.ables,c=l.groupable,f=_t(d,function(b){return b.name===n});if(this.isDragging()||!f||!f.request)return{request:function(){return this},requestEnd:function(){return this}};var u=f.request(i),p=a||o.isInstant,h=u.isControl?"controlAbles":"targetAbles",m="".concat(c?"Group":"").concat(u.isControl?"Control":""),y=K([],L(s[h]),!1),g={request:function(b){return So(i,y,["drag"],m,"",A(A({},u.request(b)),{requestAble:n,isRequest:!0}),p),g},requestEnd:function(){return So(i,y,["drag"],m,"End",A(A({},u.requestEnd()),{requestAble:n,isRequest:!0}),p),g}};return So(i,y,["drag"],m,"Start",A(A({},u.requestStart(o)),{requestAble:n,isRequest:!0}),p),p?g.request(o).requestEnd():g},r.prototype.getMoveables=function(){return[this]},r.prototype.destroy=function(){this.componentWillUnmount()},r.prototype.updateRenderPoses=function(){var n=this.getState(),o=this.props,a=o.padding,i=n.originalBeforeOrigin,l=n.transformOrigin,s=n.allMatrix,d=n.is3d,c=n.pos1,f=n.pos2,u=n.pos3,p=n.pos4,h=n.left,m=n.top,y=n.isPersisted,g=o.zoom||1;if(!a&&g<=1){n.renderPoses=[c,f,u,p],n.renderLines=[[c,f],[f,p],[p,u],[u,c]];return}var b=Eu(a||{}),w=b.left,_=b.top,C=b.bottom,S=b.right,x=d?4:3,v=[];y?v=l:this.controlBox&&o.groupable?v=i:v=xe(i,[h,m]);var V=pa(x,Wr(v.map(function(O){return-O}),x),s,Wr(l,x)),$=Pt(V,c,[-w,-_],x),B=Pt(V,f,[S,-_],x),R=Pt(V,u,[-w,C],x),T=Pt(V,p,[S,C],x);if(n.renderPoses=[$,B,R,T],n.renderLines=[[$,B],[B,T],[T,R],[R,$]],g){var k=g/2;n.renderLines=[[Pt(V,c,[-w-k,-_],x),Pt(V,f,[S+k,-_],x)],[Pt(V,f,[S,-_-k],x),Pt(V,p,[S,C+k],x)],[Pt(V,p,[S+k,C],x),Pt(V,u,[-w-k,C],x)],[Pt(V,u,[-w,C+k],x),Pt(V,c,[-w,-_-k],x)]]}},r.prototype.checkUpdate=function(){this._isPropTargetChanged=!1;var n=this.props,o=n.target,a=n.container,i=n.parentMoveable,l=this.state,s=l.target,d=l.container;if(!(!s&&!o)){this.updateAbles();var c=!Kl(s,o),f=c||!Kl(d,a);if(f){var u=a||this.controlBox;u&&this.unsetAbles(),this.updateState({target:o,container:a}),!i&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=c}}},r.prototype.waitToChangeTarget=function(){return new Promise(function(){})},r.prototype.triggerEvent=function(n,o){var a=this.props;if(this._emitter.trigger(n,o),a.parentMoveable&&o.isRequest&&!o.isRequestChild)return a.parentMoveable.triggerEvent(n,o,!0);var i=a[n];return i&&i(o)},r.prototype.useCSS=function(n,o){var a=this.props.customStyledMap,i=n+o;return a[i]||(a[i]=lf(n,o)),a[i]},r.prototype.getState=function(){var n,o=this.props;(o.target||!((n=o.targets)===null||n===void 0)&&n.length)&&(this._hasFirstTarget=!0);var a=this.controlBox,i=o.persistData,l=o.firstRenderState;if(l&&!a)return l;if(!this._hasFirstTarget&&i){var s=Gu(i);if(s)return this.updateState(s,!1),this.state}return this.state.isPersisted=!1,this.state},r.prototype.updateSelectors=function(){},r.prototype.unsetAbles=function(){var n=this;this.targetAbles.forEach(function(o){o.unset&&o.unset(n)})},r.prototype.updateAbles=function(n,o){n===void 0&&(n=this.props.ables),o===void 0&&(o="");var a=this.props,i=a.triggerAblesSimultaneously,l=this.getEnabledAbles(n),s="drag".concat(o,"Start"),d="pinch".concat(o,"Start"),c="drag".concat(o,"ControlStart"),f=ja(l,[s,d],i),u=ja(l,[c],i);this.enabledAbles=l,this.targetAbles=f,this.controlAbles=u},r.prototype.updateState=function(n,o){if(o){if(this.isUnmounted)return;this.setState(n)}else{var a=this.state;for(var i in n)a[i]=n[i]}},r.prototype.getEnabledAbles=function(n){n===void 0&&(n=this.props.ables);var o=this.props;return n.filter(function(a){return a&&(a.always&&o[a.name]!==!1||o[a.name])})},r.prototype.renderAbles=function(){var n=this,o=this.props,a=o.triggerAblesSimultaneously,i={createElement:Xt};return this.renderState={},Qw(_u(ja(this.getEnabledAbles(),["render"],a).map(function(l){var s=l.render;return s(n,i)||[]})).filter(function(l){return l}),function(l){var s=l.key;return s}).map(function(l){return l[0]})},r.prototype.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},r.prototype._getRequestStyles=function(){var n=this.getEnabledAbles().reduce(function(o,a){var i,l,s=(l=(i=a.requestStyle)===null||i===void 0?void 0:i.call(a))!==null&&l!==void 0?l:[];return K(K([],L(o),!1),L(s),!1)},K([],L(this.props.requestStyles||[]),!1));return n},r.prototype._updateObserver=function(n){this._updateResizeObserver(n),this._updateMutationObserver(n)},r.prototype._updateEvents=function(){var n=this.targetAbles.length,o=this.controlAbles.length,a=this._dragTarget,i=!n&&this.targetGesto||this._isTargetChanged(!0);i&&(kn(this,!1),this.updateState({gestos:{}})),o||kn(this,!0),a&&n&&!this.targetGesto&&(this.targetGesto=Pu(this,a,"")),!this.controlGesto&&o&&(this.controlGesto=Uu(this,"Control"))},r.prototype._updateTargets=function(){var n=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=n.dragArea,this._propTarget=n.target,this._originalDragTarget=n.dragTarget||n.target,this._dragTarget=ir(this._originalDragTarget,!0)},r.prototype._renderLines=function(){var n=this.props,o=n,a=o.zoom,i=o.hideDefaultLines,l=o.hideChildMoveableDefaultLines,s=o.parentMoveable;if(i||s&&l)return[];var d=this.getState(),c={createElement:Xt};return d.renderLines.map(function(f,u){return mo(c,"",f[0],f[1],a,"render-line-".concat(u))})},r.prototype._isTargetChanged=function(n){var o=this.props,a=o.dragTarget||o.target,i=this._prevOriginalDragTarget,l=this._prevDragArea,s=o.dragArea,d=!s&&i!==a,c=(n||s)&&l!==s;return d||c||this._prevPropTarget!=this._propTarget},r.prototype._updateNativeEvents=function(){var n=this,o=this.props,a=o.dragArea?this.areaElement:this.state.target,i=this.events,l=mr(i);if(this._isTargetChanged())for(var s in i){var d=i[s];d&&d.destroy(),i[s]=null}if(a){var c=this.enabledAbles;l.forEach(function(f){var u=ja(c,[f]),p=u.length>0,h=i[f];if(!p){h&&(h.destroy(),i[f]=null);return}h||(h=new BC(a,n,f),i[f]=h),h.setAbles(u)})}},r.prototype._checkUpdateRootContainer=function(){var n=this.props.rootContainer;!this._rootContainer&&n&&(this._rootContainer=ir(n,!0))},r.prototype._checkUpdateViewContainer=function(){var n=this.props.viewContainer;!this._viewContainer&&n&&(this._viewContainer=ir(n,!0));var o=this._viewContainer;o&&this._changeAbleViewClassNames(K(K([],L(this._getAbleViewClassNames()),!1),[this.isDragging()?cC:""],!1))},r.prototype._changeAbleViewClassNames=function(n){var o=this._viewContainer,a=bu(n.filter(Boolean),function(c){return c}).map(function(c){var f=L(c,1),u=f[0];return u}),i=this._viewClassNames,l=Qn(i,a),s=l.removed,d=l.added;s.forEach(function(c){Cd(o,i[c])}),d.forEach(function(c){Ui(o,a[c])}),this._viewClassNames=a},r.prototype._getAbleViewClassNames=function(){var n=this;return(this.getEnabledAbles().map(function(o){var a;return((a=o.viewClassName)===null||a===void 0?void 0:a.call(o,n))||""}).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},r.prototype._getAbleClassName=function(n){var o=this;n===void 0&&(n="");var a=this.getEnabledAbles(),i=this.targetGesto,l=this.controlGesto,s=i!=null&&i.isFlag()?i.getEventData():{},d=l!=null&&l.isFlag()?l.getEventData():{};return a.map(function(c){var f,u,p,h=c.name,m=((f=c.className)===null||f===void 0?void 0:f.call(c,o))||"";return(!((u=s[h])===null||u===void 0)&&u.isEventStart||!((p=d[h])===null||p===void 0)&&p.isEventStart)&&(m+=" ".concat(ae("".concat(h).concat(n,"-dragging")))),m.trim()}).filter(Boolean).join(" ")},r.prototype._updateResizeObserver=function(n){var o,a=this.props,i=a.target,l=At(this.getControlBoxElement());if(!l.ResizeObserver||!i||!a.useResizeObserver){(o=this._reiszeObserver)===null||o===void 0||o.disconnect();return}if(!(n.target===i&&this._reiszeObserver)){var s=new l.ResizeObserver(this.checkUpdateRect);s.observe(i,{box:"border-box"}),this._reiszeObserver=s}},r.prototype._updateMutationObserver=function(n){var o=this,a,i=this.props,l=i.target,s=At(this.getControlBoxElement());if(!s.MutationObserver||!l||!i.useMutationObserver){(a=this._mutationObserver)===null||a===void 0||a.disconnect();return}if(!(n.target===l&&this._mutationObserver)){var d=new s.MutationObserver(function(c){var f,u;try{for(var p=m_(c),h=p.next();!h.done;h=p.next()){var m=h.value;m.type==="attributes"&&m.attributeName==="style"&&o.checkUpdateRect()}}catch(y){f={error:y}}finally{try{h&&!h.done&&(u=p.return)&&u.call(p)}finally{if(f)throw f.error}}});d.observe(l,{attributes:!0}),this._mutationObserver=d}},r.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,preventRightClick:!0,preventWheelClick:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:iu,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},r}(Td),cs={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,r){var n,o=t.props,a=o.targets||[],i=t.getState(),l=i.left,s=i.top,d=i.isPersisted,c=o.zoom||1,f=t.renderGroupRects,u=((n=o.persistData)===null||n===void 0?void 0:n.children)||[];d?a=u.map(function(){return null}):u=[];var p=Dn(t,"parentPosition",[l,s],function(m){return m.join(",")}),h=Dn(t,"requestStyles",t.getRequestChildStyles(),function(m){return m.join(",")});return t.moveables=t.moveables.slice(0,a.length),K(K([],L(a.map(function(m,y){return r.createElement(Bn,{key:"moveable"+y,ref:fd(t,"moveables",y),target:m,origin:!1,requestStyles:h,cssStyled:o.cssStyled,customStyledMap:o.customStyledMap,useResizeObserver:o.useResizeObserver,useMutationObserver:o.useMutationObserver,hideChildMoveableDefaultLines:o.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[l,s],persistData:u[y],zoom:c})})),!1),L(_u(f.map(function(m,y){var g=m.pos1,b=m.pos2,w=m.pos3,_=m.pos4,C=[g,b,w,_];return[[0,1],[1,3],[3,2],[2,0]].map(function(S,x){var v=L(S,2),V=v[0],$=v[1];return mo(r,"",se(C[V],p),se(C[$],p),c,"group-rect-".concat(y,"-").concat(x))})}))),!1)}},IC=uo("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,r){r.datas.inputTarget=r.inputEvent&&r.inputEvent.target},dragEnd:function(t,r){var n=t.props.target,o=r.inputEvent,a=r.inputTarget,i=t.isMoveableElement(a),l=!i&&t.controlBox.contains(a);if(!(!o||!a||r.isDrag||t.isMoveableElement(a)||l)){var s=n.contains(a);te(t,"onClick",ge(t,r,{isDouble:r.isDouble,inputTarget:a,isTarget:n===a,moveableTarget:t.props.target,containsTarget:s}))}},dragGroupEnd:function(t,r){var n=r.inputEvent,o=r.inputTarget;if(!(!n||!o||r.isDrag||t.isMoveableElement(o)||r.datas.inputTarget===o)){var a=t.props.targets,i=a.indexOf(o),l=i>-1,s=!1;i===-1&&(i=hr(a,function(d){return d.contains(o)}),s=i>-1),te(t,"onClickGroup",ge(t,r,{isDouble:r.isDouble,targets:a,inputTarget:o,targetIndex:i,isTarget:l,containsTarget:s,moveableTarget:a[i]}))}},dragControlEnd:function(t,r){this.dragEnd(t,r)},dragGroupControlEnd:function(t,r){this.dragEnd(t,r)}});function Tn(t){var r=t.originalDatas.draggable;return r||(t.originalDatas.draggable={},r=t.originalDatas.draggable),A(A({},t),{datas:r})}var zC=uo("edgeDraggable",{css:[`.edge.edgeDraggable.line {
366
+ }`],className:function(t){var r=t.props.roundClickable;return r===!0||r==="line"?ae("round-line-clickable"):""},requestStyle:function(){return["borderRadius"]},requestChildStyle:function(){return["borderRadius"]},render:function(t,r){var n=t.getState(),o=n.target,a=n.width,i=n.height,l=n.allMatrix,s=n.is3d,d=n.left,c=n.top,f=n.borderRadiusState,u=t.props,p=u.minRoundControls,h=p===void 0?[0,0]:p,m=u.maxRoundControls,y=m===void 0?[4,4]:m,g=u.zoom,b=u.roundPadding,w=b===void 0?0:b,_=u.isDisplayShadowRoundControls,C=u.groupable;if(!o)return null;var S=f||Lu(t),x=s?4:3,v=Mu(S,a,i,h,!0);if(!v)return null;var V=0,$=0,B=C?[0,0]:[d,c];return v.map(function(R,T){var k=R.horizontal,O=R.vertical,N=R.direction||"",D=K([],L(R.pos),!1);$+=Math.abs(k),V+=Math.abs(O),k&&N.indexOf("n")>-1&&(D[1]-=w),O&&N.indexOf("w")>-1&&(D[0]-=w),k&&N.indexOf("s")>-1&&(D[1]+=w),O&&N.indexOf("e")>-1&&(D[0]+=w);var I=se(Ge(l,D,x),B),z=_&&_!=="horizontal",M=R.vertical?V<=y[1]&&(z||!R.virtual):$<=y[0]&&(_||!R.virtual);return r.createElement("div",{key:"borderRadiusControl".concat(T),className:ae("control","border-radius",R.vertical?"vertical":"",R.virtual?"virtual":""),"data-radius-index":T,style:{display:M?"block":"none",transform:"translate(".concat(I[0],"px, ").concat(I[1],"px) scale(").concat(g,")")}})})},dragControlCondition:function(t,r){if(!r.inputEvent||r.isRequest)return!1;var n=r.inputEvent.target.getAttribute("class")||"";return n.indexOf("border-radius")>-1||n.indexOf("moveable-line")>-1&&n.indexOf("moveable-direction")>-1},dragGroupControlCondition:function(t,r){return this.dragControlCondition(t,r)},dragControlStart:function(t,r){var n=r.inputEvent,o=r.datas,a=n.target,i=a.getAttribute("class")||"",l=i.indexOf("border-radius")>-1,s=i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1,d=l?parseInt(a.getAttribute("data-radius-index"),10):-1,c=-1;if(s){var f=a.getAttribute("data-line-key")||"";f&&(c=parseInt(f.replace(/render-line-/g,""),10),isNaN(c)&&(c=-1))}if(!l&&!s)return!1;var u=ge(t,r,{}),p=te(t,"onRoundStart",u);if(p===!1)return!1;o.lineIndex=c,o.controlIndex=d,o.isControl=l,o.isLine=s,Hr(t,r);var h=t.props,m=h.roundRelative,y=h.minRoundControls,g=y===void 0?[0,0]:y,b=t.state,w=b.width,_=b.height;o.isRound=!0,o.prevDist=[0,0];var C=Lu(t),S=Mu(C||"",w,_,g,!0)||[];return o.controlPoses=S,b.borderRadiusState=as(S,m,w,_).styles.join(" "),u},dragControl:function(t,r){var n=r.datas,o=n.controlPoses;if(!n.isRound||!n.isControl||!o.length)return!1;var a=n.controlIndex,i=L(ar(r),2),l=i[0],s=i[1],d=[l,s],c=se(d,n.prevDist),f=t.props.maxRoundControls,u=f===void 0?[4,4]:f,p=t.state,h=p.width,m=p.height,y=o[a],g=y.vertical,b=y.horizontal,w=o.map(function(C){var S=C.horizontal,x=C.vertical,v=[S*b*d[0],x*g*d[1]];if(S){if(u[0]===1)return v;if(u[0]<4&&S!==b)return v}else{if(u[1]===0)return v[1]=x*b*d[0]/h*m,v;if(g){if(u[1]===1)return v;if(u[1]<4&&x!==g)return v}}return[0,0]});w[a]=d;var _=o.map(function(C,S){return A(A({},C),{pos:xe(C.pos,w[S])})});return a<4?_.slice(0,a+1).forEach(function(C){C.virtual=!1}):_.slice(4,a+1).forEach(function(C){C.virtual=!1}),n.prevDist=[l,s],Au(t,r,d,c,_)},dragControlEnd:function(t,r){var n=t.state;n.borderRadiusState="";var o=r.datas,a=r.isDouble;if(!o.isRound)return!1;var i=o.isControl,l=o.controlIndex,s=o.isLine,d=o.lineIndex,c=o.controlPoses,f=c.filter(function(b){var w=b.virtual;return w}).length,u=t.props.roundClickable,p=u===void 0?!0:u;if(a&&p){if(i&&(p===!0||p==="control"))NC(c,l);else if(s&&(p===!0||p==="line")){var h=L(mf(t,r),2),m=h[0],y=h[1];VC(c,d,m,y)}f!==c.filter(function(b){var w=b.virtual;return w}).length&&Au(t,r,[0,0],[0,0],c)}var g=Dt(t,r,{});return te(t,"onRoundEnd",g),n.borderRadiusState="",g},dragGroupControlStart:function(t,r){var n=this.dragControlStart(t,r);if(!n)return!1;var o=t.moveables,a=t.props.targets,i=Kt(t,"roundable",r),l=A({targets:t.props.targets,events:i.map(function(s,d){return A(A({},s),{target:a[d],moveable:o[d],currentTarget:o[d]})})},n);return te(t,"onRoundGroupStart",l),n},dragGroupControl:function(t,r){var n=this.dragControl(t,r);if(!n)return!1;var o=t.moveables,a=t.props.targets,i=Kt(t,"roundable",r),l=A({targets:t.props.targets,events:i.map(function(s,d){return A(A(A({},s),{target:a[d],moveable:o[d],currentTarget:o[d]}),ut({borderRadius:n.borderRadius},s))})},n);return te(t,"onRoundGroup",l),l},dragGroupControlEnd:function(t,r){var n=t.moveables,o=t.props.targets,a=Kt(t,"roundable",r);Fa(t,"onRound",function(s){var d=A({targets:t.props.targets,events:a.map(function(c,f){return A(A(A({},c),{target:o[f],moveable:n[f],currentTarget:n[f]}),ut({borderRadius:s.borderRadius},c))})},s);te(t,"onRoundGroup",d)});var i=this.dragControlEnd(t,r);if(!i)return!1;var l=A({targets:t.props.targets,events:a.map(function(s,d){var c;return A(A({},s),{target:o[d],moveable:n[d],currentTarget:n[d],lastEvent:(c=s.datas)===null||c===void 0?void 0:c.lastEvent})})},i);return te(t,"onRoundGroupEnd",l),l},unset:function(t){t.state.borderRadiusState=""}};function DC(t,r){var n=r?4:3,o=Me(n),a="matrix".concat(r?"3d":"","(").concat(o.join(","),")");return t===a||t==="matrix(1,0,0,1,0,0)"}var Fu={isPinch:!0,name:"beforeRenderable",props:[],events:["beforeRenderStart","beforeRender","beforeRenderEnd","beforeRenderGroupStart","beforeRenderGroup","beforeRenderGroupEnd"],dragRelation:"weak",setTransform:function(t,r){var n=t.state,o=n.is3d,a=n.targetMatrix,i=n.inlineTransform,l=o?"matrix3d(".concat(a.join(","),")"):"matrix(".concat(qd(a,!0),")"),s=!i||i==="none"?l:i;r.datas.startTransforms=DC(s,o)?[]:vr(s)},resetStyle:function(t){var r=t.datas;r.nextStyle={},r.nextTransforms=t.datas.startTransforms,r.nextTransformAppendedIndexes=[]},fillDragStartParams:function(t,r){return ge(t,r,{setTransform:function(n){r.datas.startTransforms=Ue(n)?n:vr(n)},isPinch:!!r.isPinch})},fillDragParams:function(t,r){return ge(t,r,{isPinch:!!r.isPinch})},dragStart:function(t,r){this.setTransform(t,r),this.resetStyle(r),te(t,"onBeforeRenderStart",this.fillDragStartParams(t,r))},drag:function(t,r){r.datas.startTransforms||this.setTransform(t,r),this.resetStyle(r),te(t,"onBeforeRender",ge(t,r,{isPinch:!!r.isPinch}))},dragEnd:function(t,r){r.datas.startTransforms||(this.setTransform(t,r),this.resetStyle(r)),te(t,"onBeforeRenderEnd",ge(t,r,{isPinch:!!r.isPinch,isDrag:r.isDrag}))},dragGroupStart:function(t,r){var n=this;this.dragStart(t,r);var o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.setTransform(d,l),n.resetStyle(l),n.fillDragStartParams(d,l)});te(t,"onBeforeRenderGroupStart",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets,setTransform:function(){},events:i}))},dragGroup:function(t,r){var n=this;this.drag(t,r);var o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.resetStyle(l),n.fillDragParams(d,l)});te(t,"onBeforeRenderGroup",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets,events:i}))},dragGroupEnd:function(t,r){this.dragEnd(t,r),te(t,"onBeforeRenderGroupEnd",ge(t,r,{isPinch:!!r.isPinch,isDrag:r.isDrag,targets:t.props.targets}))},dragControlStart:function(t,r){return this.dragStart(t,r)},dragControl:function(t,r){return this.drag(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupControlStart:function(t,r){return this.dragGroupStart(t,r)},dragGroupControl:function(t,r){return this.dragGroup(t,r)},dragGroupControlEnd:function(t,r){return this.dragGroupEnd(t,r)}},ju={name:"renderable",props:[],events:["renderStart","render","renderEnd","renderGroupStart","renderGroup","renderGroupEnd"],dragRelation:"weak",dragStart:function(t,r){te(t,"onRenderStart",ge(t,r,{isPinch:!!r.isPinch}))},drag:function(t,r){te(t,"onRender",this.fillDragParams(t,r))},dragAfter:function(t,r){return this.drag(t,r)},dragEnd:function(t,r){te(t,"onRenderEnd",this.fillDragEndParams(t,r))},dragGroupStart:function(t,r){te(t,"onRenderGroupStart",ge(t,r,{isPinch:!!r.isPinch,targets:t.props.targets}))},dragGroup:function(t,r){var n=this,o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.fillDragParams(d,l)});te(t,"onRenderGroup",ge(t,r,A(A({isPinch:!!r.isPinch,targets:t.props.targets,transform:Va(r),transformObject:{}},ut(ka(r))),{events:i})))},dragGroupEnd:function(t,r){var n=this,o=Kt(t,"beforeRenderable",r),a=t.moveables,i=o.map(function(l,s){var d=a[s];return n.fillDragEndParams(d,l)});te(t,"onRenderGroupEnd",ge(t,r,A({isPinch:!!r.isPinch,isDrag:r.isDrag,targets:t.props.targets,events:i,transformObject:{},transform:Va(r)},ut(ka(r)))))},dragControlStart:function(t,r){return this.dragStart(t,r)},dragControl:function(t,r){return this.drag(t,r)},dragControlAfter:function(t,r){return this.dragAfter(t,r)},dragControlEnd:function(t,r){return this.dragEnd(t,r)},dragGroupControlStart:function(t,r){return this.dragGroupStart(t,r)},dragGroupControl:function(t,r){return this.dragGroup(t,r)},dragGroupControlEnd:function(t,r){return this.dragGroupEnd(t,r)},fillDragParams:function(t,r){var n={};return mn(Ea(r)||[]).forEach(function(o){n[o.name]=o.functionValue}),ge(t,r,A({isPinch:!!r.isPinch,transformObject:n,transform:Va(r)},ut(ka(r))))},fillDragEndParams:function(t,r){var n={};return mn(Ea(r)||[]).forEach(function(o){n[o.name]=o.functionValue}),ge(t,r,A({isPinch:!!r.isPinch,isDrag:r.isDrag,transformObject:n,transform:Va(r)},ut(ka(r))))}};function So(t,r,n,o,a,i,l){i.clientDistX=i.distX,i.clientDistY=i.distY;var s=a==="Start",d=a==="End",c=a==="After",f=t.state.target,u=i.isRequest,p=o.indexOf("Control")>-1;if(!f||s&&p&&!u&&t.areaElement===i.inputEvent.target)return!1;var h=K([],L(r),!1);if(u){var m=i.requestAble;h.some(function(T){return T.name===m})||h.push.apply(h,K([],L(t.props.ables.filter(function(T){return T.name===m})),!1))}if(!h.length||h.every(function(T){return T.dragRelation}))return!1;var y=i.inputEvent,g;d&&y&&(g=document.elementFromPoint(i.clientX,i.clientY)||y.target);var b=!1,w=function(){var T;b=!0,(T=i.stop)===null||T===void 0||T.call(i)},_=s&&(!t.targetGesto||!t.controlGesto||!t.targetGesto.isFlag()||!t.controlGesto.isFlag());_&&t.updateRect(a,!0,!1);var C=i.datas,S=p?"controlGesto":"targetGesto",x=t[S],v=function(T,k,O){if(!(k in T)||x!==t[S])return!1;var N=T.name,D=C[N]||(C[N]={});if(s&&(D.isEventStart=!O||!T[O]||T[O](t,i)),!D.isEventStart)return!1;var I=T[k](t,A(A({},i),{stop:w,datas:D,originalDatas:C,inputTarget:g}));return t._emitter.off(),s&&I===!1&&(D.isEventStart=!1),I};_&&h.forEach(function(T){T.unset&&T.unset(t)}),v(Fu,"drag".concat(o).concat(a));var V=0,$=0;n.forEach(function(T){if(b)return!1;var k="".concat(T).concat(o).concat(a),O="".concat(T).concat(o,"Condition");a===""&&!u&&wu(t.state,i);var N=h.filter(function(z){return z[k]});N=N.filter(function(z,M){return z.name&&N.indexOf(z)===M});var D=N.filter(function(z){return v(z,k,O)}),I=D.length;b&&++V,I&&++$,!b&&s&&N.length&&!I&&(V+=N.filter(function(z){var M=z.name,j=C[M];return j.isEventStart?z.dragRelation!=="strong":!1}).length?1:0)}),(!c||$)&&v(ju,"drag".concat(o).concat(a));var B=x!==t[S]||V===n.length;if((d||b||B)&&(t.state.gestos={},t.moveables&&t.moveables.forEach(function(T){T.state.gestos={}}),h.forEach(function(T){T.unset&&T.unset(t)})),s&&!B&&!u&&$&&t.props.preventDefault&&(i==null||i.preventDefault()),t.isUnmounted||B)return!1;if(!s&&$&&!l||d){var R=t.props.flushSync||iu;R(function(){t.updateRect(d?a:"",!0,!1),t.forceUpdate()})}return!s&&!d&&!c&&$&&!l&&So(t,r,n,o,a+"After",i),!0}function ls(t,r){return function(n,o){var a;o===void 0&&(o=n.inputEvent.target);var i=o,l=t.areaElement,s=t._dragTarget;return!s||!r&&(!((a=t.controlGesto)===null||a===void 0)&&a.isFlag())?!1:i===s||s.contains(i)||i===l||!t.isMoveableElement(i)&&!t.controlBox.contains(i)||Qe(i,"moveable-area")||Qe(i,"moveable-padding")||Qe(i,"moveable-edgeDraggable")}}function Pu(t,r,n){var o=t.controlBox,a=[],i=t.props,l=i.dragArea,s=t.state.target,d=i.dragTarget;a.push(o),(!l||d)&&a.push(r),!l&&d&&s&&r!==s&&i.dragTargetSelf&&a.push(s);var c=ls(t);return Wu(t,a,"targetAbles",n,{dragStart:c,pinchStart:c})}function Uu(t,r){var n=t.controlBox,o=[];o.push(n);var a=ls(t,!0),i=function(l,s){if(s===void 0&&(s=l.inputEvent.target),s===n)return!0;var d=a(l,s);return!d};return Wu(t,o,"controlAbles",r,{dragStart:i,pinchStart:i})}function Wu(t,r,n,o,a){a===void 0&&(a={});var i=n==="targetAbles",l=t.props,s=l.pinchOutside,d=l.pinchThreshold,c=l.preventClickEventOnDrag,f=l.preventClickDefault,u=l.checkInput,p=l.dragFocusedInput,h=l.preventDefault,m=h===void 0?!0:h,y=l.preventRightClick,g=y===void 0?!0:y,b=l.preventWheelClick,w=b===void 0?!0:b,_=l.dragContainer,C=ir(_,!0),S={preventDefault:m,preventRightClick:g,preventWheelClick:w,container:C||At(t.getControlBoxElement()),pinchThreshold:d,pinchOutside:s,preventClickEventOnDrag:i?c:!1,preventClickEventOnDragStart:i?f:!1,preventClickEventByCondition:i?null:function(V){return t.controlBox.contains(V.target)},checkInput:i?u:!1,dragFocusedInput:p},x=new of(r,S),v=o==="Control";return["drag","pinch"].forEach(function(V){["Start","","End"].forEach(function($){x.on("".concat(V).concat($),function(B){var R,T=B.eventType,k=V==="drag"&&B.isPinch;if(a[T]&&!a[T](B)){B.stop();return}if(!k){var O=V==="drag"?[V]:["drag",V],N=K([],L(t[n]),!1),D=So(t,N,O,o,$,B);D?(t.props.stopPropagation||$==="Start"&&v)&&((R=B==null?void 0:B.inputEvent)===null||R===void 0||R.stopPropagation()):B.stop()}})})}),x}var BC=function(){function t(r,n,o){var a=this;this.target=r,this.moveable=n,this.eventName=o,this.ables=[],this._onEvent=function(i){var l=a.eventName,s=a.moveable;s.state.disableNativeEvent||a.ables.forEach(function(d){d[l](s,{inputEvent:i})})},r.addEventListener(o.toLowerCase(),this._onEvent)}return t.prototype.setAbles=function(r){this.ables=r},t.prototype.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},t}();function TC(t,r,n,o){var a;n===void 0&&(n=r);var i=Cf(t,r),l=i.matrixes,s=i.is3d,d=i.targetMatrix,c=i.transformOrigin,f=i.targetOrigin,u=i.offsetContainer,p=i.hasFixed,h=i.zoom,m=Y_(u,n),y=m.matrixes,g=m.is3d,b=m.offsetContainer,w=m.zoom,_=o||g||s,C=_?4:3,S=t.tagName.toLowerCase()!=="svg"&&"ownerSVGElement"in t,x=d,v=Me(C),V=Me(C),$=Me(C),B=Me(C),R=l.length,T=y.map(function(M){return A(A({},M),{matrix:M.matrix?K([],L(M.matrix),!1):void 0})}).reverse();l.reverse(),!s&&_&&(x=Jt(x,3,4),Gl(l)),!g&&_&&Gl(T),T.forEach(function(M){V=Oe(V,M.matrix,C)});var k=n||Er(t),O=((a=T[0])===null||a===void 0?void 0:a.target)||_o(k,k,!0).offsetParent,N=T.slice(1).reduce(function(M,j){return Oe(M,j.matrix,C)},Me(C));l.forEach(function(M,j){if(R-2===j&&($=v.slice()),R-1===j&&(B=v.slice()),!M.matrix){var F=l[j+1],G=Jw(M,F,O,C,Oe(N,v,C));M.matrix=Wr(G,C)}v=Oe(v,M.matrix,C)});var D=!S&&s;x||(x=Me(D?4:3));var I=Ma(S&&x.length===16?Jt(x,4,3):x,D),z=V;return V=Yd(V,C,C),{hasZoom:h!==1||w!==1,hasFixed:p,matrixes:l,rootMatrix:V,originalRootMatrix:z,beforeMatrix:$,offsetMatrix:B,allMatrix:v,targetMatrix:x,targetTransform:I,inlineTransform:t.style.transform,transformOrigin:c,targetOrigin:f,is3d:_,offsetContainer:u,offsetRootContainer:b}}function OC(t,r,n,o){n===void 0&&(n=r);var a=0,i=0,l=0,s={},d=fu(t);if(t&&(a=d.offsetWidth,i=d.offsetHeight),t){var c=TC(t,r,n,o),f=Cn(c.allMatrix,c.transformOrigin,a,i);s=A(A({},c),f);var u=Cn(c.allMatrix,[50,50],100,100);l=uu([u.pos1,u.pos2],u.direction)}var p=o?4:3;return A(A(A({hasZoom:!1,width:a,height:i,rotation:l},d),{originalRootMatrix:Me(p),rootMatrix:Me(p),beforeMatrix:Me(p),offsetMatrix:Me(p),allMatrix:Me(p),targetMatrix:Me(p),targetTransform:"",inlineTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!o,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1,offsetContainer:null,offsetRootContainer:null,matrixes:[]}),s)}function ss(t,r,n,o,a,i){i===void 0&&(i=[]);var l=1,s=[0,0],d=La(),c=La(),f=La(),u=La(),p=[0,0],h={},m=OC(r,n,a,!0);if(r){var y=St(r);i.forEach(function(T){h[T]=y(T)});var g=m.is3d?4:3,b=Cn(m.offsetMatrix,xe(m.transformOrigin,Xd(m.targetMatrix,g)),m.width,m.height);l=b.direction,s=xe(b.origin,[b.left-m.left,b.top-m.top]),u=Co(m.offsetRootContainer);var w=_o(o,o,!0).offsetParent||m.offsetRootContainer;if(m.hasZoom){var _=Cn(Oe(m.originalRootMatrix,m.allMatrix),m.transformOrigin,m.width,m.height),C=Cn(m.originalRootMatrix,Ra(St(w)("transformOrigin")).map(function(T){return parseFloat(T)}),w.offsetWidth,w.offsetHeight);if(d=Yl(_,u),f=Yl(C,u,w,!0),t){var S=_.left,x=_.top;c=Yl({left:S,top:x,bottom:x,right:x},u)}}else{d=Co(r),f=H_(w),t&&(c=Co(t));var v=f.left,V=f.top,$=f.clientLeft,B=f.clientTop,R=[d.left-v,d.top-V];p=se($n(m.rootMatrix,R,4),[$+m.left,B+m.top])}}return A({targetClientRect:d,containerClientRect:f,moveableClientRect:c,rootContainerClientRect:u,beforeDirection:l,beforeOrigin:s,originalBeforeOrigin:s,target:r,style:h,offsetDelta:p},m)}function Gu(t){var r=t.pos1,n=t.pos2,o=t.pos3,a=t.pos4;if(!r||!n||!o||!a)return null;var i=Gr([r,n,o,a]),l=[i.minX,i.minY],s=se(t.origin,l);return r=se(r,l),n=se(n,l),o=se(o,l),a=se(a,l),A(A({},t),{left:t.left,top:t.top,posDelta:l,pos1:r,pos2:n,pos3:o,pos4:a,origin:s,beforeOrigin:s,isPersisted:!0})}var Bn=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.state=A({container:null,gestos:{},renderLines:[[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]],[[0,0],[0,0]]],renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1,posDelta:[0,0]},ss(null)),n.renderState={},n.enabledAbles=[],n.targetAbles=[],n.controlAbles=[],n.rotation=0,n.scale=[1,1],n.isMoveableMounted=!1,n.isUnmounted=!1,n.events={mouseEnter:null,mouseLeave:null},n._emitter=new yn,n._prevOriginalDragTarget=null,n._originalDragTarget=null,n._prevDragTarget=null,n._dragTarget=null,n._prevPropTarget=null,n._propTarget=null,n._prevDragArea=!1,n._isPropTargetChanged=!1,n._hasFirstTarget=!1,n._reiszeObserver=null,n._observerId=0,n._mutationObserver=null,n._rootContainer=null,n._viewContainer=null,n._viewClassNames=[],n._store={},n.checkUpdateRect=function(){if(!n.isDragging()){var o=n.props.parentMoveable;if(o){o.checkUpdateRect();return}Qb(n._observerId),n._observerId=md(function(){n.isDragging()||n.updateRect()})}},n._onPreventClick=function(o){o.stopPropagation(),o.preventDefault()},n}return r.prototype.render=function(){var n=this.props,o=this.getState(),a=n.parentPosition,i=n.className,l=n.target,s=n.zoom,d=n.cspNonce,c=n.translateZ,f=n.cssStyled,u=n.groupable,p=n.linePadding,h=n.controlPadding;this._checkUpdateRootContainer(),this.checkUpdate(),this.updateRenderPoses();var m=L(a||[0,0],2),y=m[0],g=m[1],b=o.left,w=o.top,_=o.target,C=o.direction,S=o.hasFixed,x=o.offsetDelta,v=n.targets,V=this.isDragging(),$={};this.getEnabledAbles().forEach(function(N){$["data-able-".concat(N.name.toLowerCase())]=!0});var B=this._getAbleClassName(),R=v&&v.length&&(_||u)||l||!this._hasFirstTarget&&this.state.isPersisted,T=this.controlBox||this.props.firstRenderState||this.props.persistData,k=[b-y,w-g];!u&&n.useAccuratePosition&&(k[0]+=x[0],k[1]+=x[1]);var O={position:S?"fixed":"absolute",display:R?"block":"none",visibility:T?"visible":"hidden",transform:"translate3d(".concat(k[0],"px, ").concat(k[1],"px, ").concat(c,")"),"--zoom":s,"--zoompx":"".concat(s,"px")};return p&&(O["--moveable-line-padding"]=p),h&&(O["--moveable-control-padding"]=h),Xt(f,A({cspNonce:d,ref:pr(this,"controlBox"),className:"".concat(ae("control-box",C===-1?"reverse":"",V?"dragging":"")," ").concat(B," ").concat(i)},$,{onClick:this._onPreventClick,style:O}),this.renderAbles(),this._renderLines())},r.prototype.componentDidMount=function(){this.isMoveableMounted=!0,this.isUnmounted=!1;var n=this.props,o=n.parentMoveable,a=n.container;this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(this.props),!a&&!o&&!this.state.isPersisted&&(this.updateRect("",!1,!1),this.forceUpdate())},r.prototype.componentDidUpdate=function(n){this._checkUpdateRootContainer(),this._checkUpdateViewContainer(),this._updateNativeEvents(),this._updateTargets(),this._updateEvents(),this.updateCheckInput(),this._updateObserver(n)},r.prototype.componentWillUnmount=function(){var n,o;this.isMoveableMounted=!1,this.isUnmounted=!0,this._emitter.off(),(n=this._reiszeObserver)===null||n===void 0||n.disconnect(),(o=this._mutationObserver)===null||o===void 0||o.disconnect();var a=this._viewContainer;a&&this._changeAbleViewClassNames([]),kn(this,!1),kn(this,!0);var i=this.events;for(var l in i){var s=i[l];s&&s.destroy()}},r.prototype.getTargets=function(){var n=this.props.target;return n?[n]:[]},r.prototype.getAble=function(n){var o=this.props.ables||[];return _t(o,function(a){return a.name===n})},r.prototype.getContainer=function(){var n=this.props,o=n.parentMoveable,a=n.wrapperMoveable,i=n.container;return i||a&&a.getContainer()||o&&o.getContainer()||this.controlBox.parentElement},r.prototype.getControlBoxElement=function(){return this.controlBox},r.prototype.getDragElement=function(){return this._dragTarget},r.prototype.isMoveableElement=function(n){var o;return n&&(((o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"class"))||"").indexOf(Cl)>-1},r.prototype.dragStart=function(n,o){o===void 0&&(o=n.target);var a=this.targetGesto,i=this.controlGesto;return a&&ls(this)({inputEvent:n},o)?a.isFlag()||a.triggerDragStart(n):i&&this.isMoveableElement(o)&&(i.isFlag()||i.triggerDragStart(n)),this},r.prototype.hitTest=function(n){var o=this.state,a=o.target,i=o.pos1,l=o.pos2,s=o.pos3,d=o.pos4,c=o.targetClientRect;if(!a)return 0;var f;if(Vr(n)){var u=n.getBoundingClientRect();f={left:u.left,top:u.top,width:u.width,height:u.height}}else f=A({width:0,height:0},n);var p=f.left,h=f.top,m=f.width,y=f.height,g=dl([i,l,d,s],c),b=e_(g,[[p,h],[p+m,h],[p+m,h+y],[p,h+y]]),w=so(g);return!b||!w?0:Math.min(100,b/w*100)},r.prototype.isInside=function(n,o){var a=this.state,i=a.target,l=a.pos1,s=a.pos2,d=a.pos3,c=a.pos4,f=a.targetClientRect;return i?ya([n,o],dl([l,s,c,d],f)):!1},r.prototype.updateRect=function(n,o,a){a===void 0&&(a=!0);var i=this.props,l=!i.parentPosition&&!i.wrapperMoveable;l&&vn(!0);var s=i.parentMoveable,d=this.state,c=d.target||i.target,f=this.getContainer(),u=s?s._rootContainer:this._rootContainer,p=ss(this.controlBox,c,f,f,u||f,this._getRequestStyles());if(!c&&this._hasFirstTarget&&i.persistData){var h=Gu(i.persistData);for(var m in h)p[m]=h[m]}l&&vn(),this.updateState(p,s?!1:a)},r.prototype.isDragging=function(n){var o,a,i=this.targetGesto,l=this.controlGesto;if(i!=null&&i.isFlag()){if(!n)return!0;var s=i.getEventData();return!!(!((o=s[n])===null||o===void 0)&&o.isEventStart)}if(l!=null&&l.isFlag()){if(!n)return!0;var s=l.getEventData();return!!(!((a=s[n])===null||a===void 0)&&a.isEventStart)}return!1},r.prototype.updateTarget=function(n){this.updateRect(n,!0)},r.prototype.getRect=function(){var n=this.state,o=jt(this.state),a=L(o,4),i=a[0],l=a[1],s=a[2],d=a[3],c=Lt(o),f=n.width,u=n.height,p=c.width,h=c.height,m=c.left,y=c.top,g=[n.left,n.top],b=xe(g,n.origin),w=xe(g,n.beforeOrigin),_=n.transformOrigin;return{width:p,height:h,left:m,top:y,pos1:i,pos2:l,pos3:s,pos4:d,offsetWidth:f,offsetHeight:u,beforeOrigin:w,origin:b,transformOrigin:_,rotation:this.getRotation()}},r.prototype.getManager=function(){return this},r.prototype.stopDrag=function(n){if(!n||n==="target"){var o=this.targetGesto;(o==null?void 0:o.isIdle())===!1&&ql(this,!1),o==null||o.stop()}if(!n||n==="control"){var o=this.controlGesto;(o==null?void 0:o.isIdle())===!1&&ql(this,!0),o==null||o.stop()}},r.prototype.getRotation=function(){var n=this.state,o=n.pos1,a=n.pos2,i=n.direction;return rC(o,a,i)},r.prototype.request=function(n,o,a){o===void 0&&(o={});var i=this,l=i.props,s=l.parentMoveable||l.wrapperMoveable||i,d=s.props.ables,c=l.groupable,f=_t(d,function(b){return b.name===n});if(this.isDragging()||!f||!f.request)return{request:function(){return this},requestEnd:function(){return this}};var u=f.request(i),p=a||o.isInstant,h=u.isControl?"controlAbles":"targetAbles",m="".concat(c?"Group":"").concat(u.isControl?"Control":""),y=K([],L(s[h]),!1),g={request:function(b){return So(i,y,["drag"],m,"",A(A({},u.request(b)),{requestAble:n,isRequest:!0}),p),g},requestEnd:function(){return So(i,y,["drag"],m,"End",A(A({},u.requestEnd()),{requestAble:n,isRequest:!0}),p),g}};return So(i,y,["drag"],m,"Start",A(A({},u.requestStart(o)),{requestAble:n,isRequest:!0}),p),p?g.request(o).requestEnd():g},r.prototype.getMoveables=function(){return[this]},r.prototype.destroy=function(){this.componentWillUnmount()},r.prototype.updateRenderPoses=function(){var n=this.getState(),o=this.props,a=o.padding,i=n.originalBeforeOrigin,l=n.transformOrigin,s=n.allMatrix,d=n.is3d,c=n.pos1,f=n.pos2,u=n.pos3,p=n.pos4,h=n.left,m=n.top,y=n.isPersisted,g=o.zoom||1;if(!a&&g<=1){n.renderPoses=[c,f,u,p],n.renderLines=[[c,f],[f,p],[p,u],[u,c]];return}var b=Eu(a||{}),w=b.left,_=b.top,C=b.bottom,S=b.right,x=d?4:3,v=[];y?v=l:this.controlBox&&o.groupable?v=i:v=xe(i,[h,m]);var V=pa(x,Wr(v.map(function(O){return-O}),x),s,Wr(l,x)),$=Pt(V,c,[-w,-_],x),B=Pt(V,f,[S,-_],x),R=Pt(V,u,[-w,C],x),T=Pt(V,p,[S,C],x);if(n.renderPoses=[$,B,R,T],n.renderLines=[[$,B],[B,T],[T,R],[R,$]],g){var k=g/2;n.renderLines=[[Pt(V,c,[-w-k,-_],x),Pt(V,f,[S+k,-_],x)],[Pt(V,f,[S,-_-k],x),Pt(V,p,[S,C+k],x)],[Pt(V,p,[S+k,C],x),Pt(V,u,[-w-k,C],x)],[Pt(V,u,[-w,C+k],x),Pt(V,c,[-w,-_-k],x)]]}},r.prototype.checkUpdate=function(){this._isPropTargetChanged=!1;var n=this.props,o=n.target,a=n.container,i=n.parentMoveable,l=this.state,s=l.target,d=l.container;if(!(!s&&!o)){this.updateAbles();var c=!Kl(s,o),f=c||!Kl(d,a);if(f){var u=a||this.controlBox;u&&this.unsetAbles(),this.updateState({target:o,container:a}),!i&&u&&this.updateRect("End",!1,!1),this._isPropTargetChanged=c}}},r.prototype.waitToChangeTarget=function(){return new Promise(function(){})},r.prototype.triggerEvent=function(n,o){var a=this.props;if(this._emitter.trigger(n,o),a.parentMoveable&&o.isRequest&&!o.isRequestChild)return a.parentMoveable.triggerEvent(n,o,!0);var i=a[n];return i&&i(o)},r.prototype.useCSS=function(n,o){var a=this.props.customStyledMap,i=n+o;return a[i]||(a[i]=lf(n,o)),a[i]},r.prototype.getState=function(){var n,o=this.props;(o.target||!((n=o.targets)===null||n===void 0)&&n.length)&&(this._hasFirstTarget=!0);var a=this.controlBox,i=o.persistData,l=o.firstRenderState;if(l&&!a)return l;if(!this._hasFirstTarget&&i){var s=Gu(i);if(s)return this.updateState(s,!1),this.state}return this.state.isPersisted=!1,this.state},r.prototype.updateSelectors=function(){},r.prototype.unsetAbles=function(){var n=this;this.targetAbles.forEach(function(o){o.unset&&o.unset(n)})},r.prototype.updateAbles=function(n,o){n===void 0&&(n=this.props.ables),o===void 0&&(o="");var a=this.props,i=a.triggerAblesSimultaneously,l=this.getEnabledAbles(n),s="drag".concat(o,"Start"),d="pinch".concat(o,"Start"),c="drag".concat(o,"ControlStart"),f=ja(l,[s,d],i),u=ja(l,[c],i);this.enabledAbles=l,this.targetAbles=f,this.controlAbles=u},r.prototype.updateState=function(n,o){if(o){if(this.isUnmounted)return;this.setState(n)}else{var a=this.state;for(var i in n)a[i]=n[i]}},r.prototype.getEnabledAbles=function(n){n===void 0&&(n=this.props.ables);var o=this.props;return n.filter(function(a){return a&&(a.always&&o[a.name]!==!1||o[a.name])})},r.prototype.renderAbles=function(){var n=this,o=this.props,a=o.triggerAblesSimultaneously,i={createElement:Xt};return this.renderState={},Qw(_u(ja(this.getEnabledAbles(),["render"],a).map(function(l){var s=l.render;return s(n,i)||[]})).filter(function(l){return l}),function(l){var s=l.key;return s}).map(function(l){return l[0]})},r.prototype.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},r.prototype._getRequestStyles=function(){var n=this.getEnabledAbles().reduce(function(o,a){var i,l,s=(l=(i=a.requestStyle)===null||i===void 0?void 0:i.call(a))!==null&&l!==void 0?l:[];return K(K([],L(o),!1),L(s),!1)},K([],L(this.props.requestStyles||[]),!1));return n},r.prototype._updateObserver=function(n){this._updateResizeObserver(n),this._updateMutationObserver(n)},r.prototype._updateEvents=function(){var n=this.targetAbles.length,o=this.controlAbles.length,a=this._dragTarget,i=!n&&this.targetGesto||this._isTargetChanged(!0);i&&(kn(this,!1),this.updateState({gestos:{}})),o||kn(this,!0),a&&n&&!this.targetGesto&&(this.targetGesto=Pu(this,a,"")),!this.controlGesto&&o&&(this.controlGesto=Uu(this,"Control"))},r.prototype._updateTargets=function(){var n=this.props;this._prevPropTarget=this._propTarget,this._prevDragTarget=this._dragTarget,this._prevOriginalDragTarget=this._originalDragTarget,this._prevDragArea=n.dragArea,this._propTarget=n.target,this._originalDragTarget=n.dragTarget||n.target,this._dragTarget=ir(this._originalDragTarget,!0)},r.prototype._renderLines=function(){var n=this.props,o=n,a=o.zoom,i=o.hideDefaultLines,l=o.hideChildMoveableDefaultLines,s=o.parentMoveable;if(i||s&&l)return[];var d=this.getState(),c={createElement:Xt};return d.renderLines.map(function(f,u){return mo(c,"",f[0],f[1],a,"render-line-".concat(u))})},r.prototype._isTargetChanged=function(n){var o=this.props,a=o.dragTarget||o.target,i=this._prevOriginalDragTarget,l=this._prevDragArea,s=o.dragArea,d=!s&&i!==a,c=(n||s)&&l!==s;return d||c||this._prevPropTarget!=this._propTarget},r.prototype._updateNativeEvents=function(){var n=this,o=this.props,a=o.dragArea?this.areaElement:this.state.target,i=this.events,l=mr(i);if(this._isTargetChanged())for(var s in i){var d=i[s];d&&d.destroy(),i[s]=null}if(a){var c=this.enabledAbles;l.forEach(function(f){var u=ja(c,[f]),p=u.length>0,h=i[f];if(!p){h&&(h.destroy(),i[f]=null);return}h||(h=new BC(a,n,f),i[f]=h),h.setAbles(u)})}},r.prototype._checkUpdateRootContainer=function(){var n=this.props.rootContainer;!this._rootContainer&&n&&(this._rootContainer=ir(n,!0))},r.prototype._checkUpdateViewContainer=function(){var n=this.props.viewContainer;!this._viewContainer&&n&&(this._viewContainer=ir(n,!0));var o=this._viewContainer;o&&this._changeAbleViewClassNames(K(K([],L(this._getAbleViewClassNames()),!1),[this.isDragging()?cC:""],!1))},r.prototype._changeAbleViewClassNames=function(n){var o=this._viewContainer,a=bu(n.filter(Boolean),function(c){return c}).map(function(c){var f=L(c,1),u=f[0];return u}),i=this._viewClassNames,l=Qn(i,a),s=l.removed,d=l.added;s.forEach(function(c){Cd(o,i[c])}),d.forEach(function(c){Ui(o,a[c])}),this._viewClassNames=a},r.prototype._getAbleViewClassNames=function(){var n=this;return(this.getEnabledAbles().map(function(o){var a;return((a=o.viewClassName)===null||a===void 0?void 0:a.call(o,n))||""}).join(" ")+" ".concat(this._getAbleClassName("-view"))).split(/\s+/g)},r.prototype._getAbleClassName=function(n){var o=this;n===void 0&&(n="");var a=this.getEnabledAbles(),i=this.targetGesto,l=this.controlGesto,s=i!=null&&i.isFlag()?i.getEventData():{},d=l!=null&&l.isFlag()?l.getEventData():{};return a.map(function(c){var f,u,p,h=c.name,m=((f=c.className)===null||f===void 0?void 0:f.call(c,o))||"";return(!((u=s[h])===null||u===void 0)&&u.isEventStart||!((p=d[h])===null||p===void 0)&&p.isEventStart)&&(m+=" ".concat(ae("".concat(h).concat(n,"-dragging")))),m.trim()}).filter(Boolean).join(" ")},r.prototype._updateResizeObserver=function(n){var o,a=this.props,i=a.target,l=At(this.getControlBoxElement());if(!l.ResizeObserver||!i||!a.useResizeObserver){(o=this._reiszeObserver)===null||o===void 0||o.disconnect();return}if(!(n.target===i&&this._reiszeObserver)){var s=new l.ResizeObserver(this.checkUpdateRect);s.observe(i,{box:"border-box"}),this._reiszeObserver=s}},r.prototype._updateMutationObserver=function(n){var o=this,a,i=this.props,l=i.target,s=At(this.getControlBoxElement());if(!s.MutationObserver||!l||!i.useMutationObserver){(a=this._mutationObserver)===null||a===void 0||a.disconnect();return}if(!(n.target===l&&this._mutationObserver)){var d=new s.MutationObserver(function(c){var f,u;try{for(var p=m_(c),h=p.next();!h.done;h=p.next()){var m=h.value;m.type==="attributes"&&m.attributeName==="style"&&o.checkUpdateRect()}}catch(y){f={error:y}}finally{try{h&&!h.done&&(u=p.return)&&u.call(p)}finally{if(f)throw f.error}}});d.observe(l,{attributes:!0}),this._mutationObserver=d}},r.defaultProps={dragTargetSelf:!1,target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,parentMoveable:null,wrapperMoveable:null,isWrapperMounted:!1,parentPosition:null,warpSelf:!1,svgOrigin:"",dragContainer:null,useResizeObserver:!1,useMutationObserver:!1,preventDefault:!0,preventRightClick:!0,preventWheelClick:!0,linePadding:0,controlPadding:0,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,dragFocusedInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{},stopPropagation:!1,preventClickDefault:!1,preventClickEventOnDrag:!0,flushSync:iu,firstRenderState:null,persistData:null,viewContainer:null,requestStyles:[],useAccuratePosition:!1},r}(Td),cs={name:"groupable",props:["defaultGroupRotate","useDefaultGroupRotate","defaultGroupOrigin","groupable","groupableProps","targetGroups","hideChildMoveableDefaultLines"],events:[],render:function(t,r){var n,o=t.props,a=o.targets||[],i=t.getState(),l=i.left,s=i.top,d=i.isPersisted,c=o.zoom||1,f=t.renderGroupRects,u=((n=o.persistData)===null||n===void 0?void 0:n.children)||[];d?a=u.map(function(){return null}):u=[];var p=Dn(t,"parentPosition",[l,s],function(m){return m.join(",")}),h=Dn(t,"requestStyles",t.getRequestChildStyles(),function(m){return m.join(",")});return t.moveables=t.moveables.slice(0,a.length),K(K([],L(a.map(function(m,y){return r.createElement(Bn,{key:"moveable"+y,ref:fd(t,"moveables",y),target:m,origin:!1,requestStyles:h,cssStyled:o.cssStyled,customStyledMap:o.customStyledMap,useResizeObserver:o.useResizeObserver,useMutationObserver:o.useMutationObserver,hideChildMoveableDefaultLines:o.hideChildMoveableDefaultLines,parentMoveable:t,parentPosition:[l,s],persistData:u[y],zoom:c})})),!1),L(_u(f.map(function(m,y){var g=m.pos1,b=m.pos2,w=m.pos3,_=m.pos4,C=[g,b,w,_];return[[0,1],[1,3],[3,2],[2,0]].map(function(S,x){var v=L(S,2),V=v[0],$=v[1];return mo(r,"",se(C[V],p),se(C[$],p),c,"group-rect-".concat(y,"-").concat(x))})}))),!1)}},IC=uo("clickable",{props:["clickable"],events:["click","clickGroup"],always:!0,dragRelation:"weak",dragStart:function(){},dragControlStart:function(){},dragGroupStart:function(t,r){r.datas.inputTarget=r.inputEvent&&r.inputEvent.target},dragEnd:function(t,r){var n=t.props.target,o=r.inputEvent,a=r.inputTarget,i=t.isMoveableElement(a),l=!i&&t.controlBox.contains(a);if(!(!o||!a||r.isDrag||t.isMoveableElement(a)||l)){var s=n.contains(a);te(t,"onClick",ge(t,r,{isDouble:r.isDouble,inputTarget:a,isTarget:n===a,moveableTarget:t.props.target,containsTarget:s}))}},dragGroupEnd:function(t,r){var n=r.inputEvent,o=r.inputTarget;if(!(!n||!o||r.isDrag||t.isMoveableElement(o)||r.datas.inputTarget===o)){var a=t.props.targets,i=a.indexOf(o),l=i>-1,s=!1;i===-1&&(i=hr(a,function(d){return d.contains(o)}),s=i>-1),te(t,"onClickGroup",ge(t,r,{isDouble:r.isDouble,targets:a,inputTarget:o,targetIndex:i,isTarget:l,containsTarget:s,moveableTarget:a[i]}))}},dragControlEnd:function(t,r){this.dragEnd(t,r)},dragGroupControlEnd:function(t,r){this.dragEnd(t,r)}});function Tn(t){var r=t.originalDatas.draggable;return r||(t.originalDatas.draggable={},r=t.originalDatas.draggable),A(A({},t),{datas:r})}var zC=uo("edgeDraggable",{css:[`.edge.edgeDraggable.line {
367
367
  cursor: move;
368
- }`],render:function(t,r){var n=t.props,o=n.edgeDraggable;return o?vf(r,"edgeDraggable",o,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,r){var n,o=t.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Ze(a,ae("direction"))&&Ze(a,ae("edge"))&&Ze(a,ae("edgeDraggable"))},dragStart:function(t,r){return ft.dragStart(t,Tn(r))},drag:function(t,r){return ft.drag(t,Tn(r))},dragEnd:function(t,r){return ft.dragEnd(t,Tn(r))},dragGroupCondition:function(t,r){var n,o=t.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Ze(a,ae("direction"))&&Ze(a,ae("line"))},dragGroupStart:function(t,r){return ft.dragGroupStart(t,Tn(r))},dragGroup:function(t,r){return ft.dragGroup(t,Tn(r))},dragGroupEnd:function(t,r){return ft.dragGroupEnd(t,Tn(r))},unset:function(t){return ft.unset(t)}}),Hu={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},ds=[Fu,Bu,Fw,oC,ft,zC,Ml,aC,lC,Sw,uC,pC,dC,EC,vC,$C,cs,Hu,IC,Du,ju],RC=ds.reduce(function(t,r){return(r.events||[]).forEach(function(n){wd(t,n)}),t},[]),MC=ds.reduce(function(t,r){return(r.props||[]).forEach(function(n){wd(t,n)}),t},[]);function Yu(t,r){var n=L(t,3),o=n[0],a=n[1],i=n[2];return(o*r[0]+a*r[1]+i)/Math.sqrt(o*o+a*a)}function Ha(t,r){var n=L(t,2),o=n[0],a=n[1];return-o*r[0]-a*r[1]}function Xu(t,r){return Math.max.apply(Math,K([],L(t.map(function(n){var o=L(n,4),a=o[0],i=o[1],l=o[2],s=o[3];return Math.max(a[r],i[r],l[r],s[r])})),!1))}function qu(t,r){return Math.min.apply(Math,K([],L(t.map(function(n){var o=L(n,4),a=o[0],i=o[1],l=o[2],s=o[3];return Math.min(a[r],i[r],l[r],s[r])})),!1))}function AC(t,r){var n,o,a,i=[0,0],l=[0,0],s=[0,0],d=[0,0],c=0,f=0;if(!t.length)return{pos1:i,pos2:l,pos3:s,pos4:d,minX:0,minY:0,maxX:0,maxY:0,width:c,height:f,rotation:r};var u=pe(r,dt);if(u%90){var p=u/180*Math.PI,h=Math.tan(p),m=-1/h,y=[xl,uf],g=[[0,0],[0,0]],b=[xl,uf],w=[[0,0],[0,0]];t.forEach(function(H){H.forEach(function(X){var J=Yu([-h,1,0],X),P=Yu([-m,1,0],X);y[0]>J&&(g[0]=X,y[0]=J),y[1]<J&&(g[1]=X,y[1]=J),b[0]>P&&(w[0]=X,b[0]=P),b[1]<P&&(w[1]=X,b[1]=P)})});var _=L(g,2),C=_[0],S=_[1],x=L(w,2),v=x[0],V=x[1],$=[-h,1,Ha([-h,1],C)],B=[-h,1,Ha([-h,1],S)],R=[-m,1,Ha([-m,1],v)],T=[-m,1,Ha([-m,1],V)];n=L([[$,R],[$,T],[B,R],[B,T]].map(function(H){var X=L(H,2),J=X[0],P=X[1];return fl(J,P)[0]}),4),i=n[0],l=n[1],s=n[2],d=n[3],c=b[1]-b[0],f=y[1]-y[0]}else{var k=qu(t,0),O=qu(t,1),N=Xu(t,0),D=Xu(t,1);if(i=[k,O],l=[N,O],s=[k,D],d=[N,D],c=N-k,f=D-O,u%180){var I=[s,i,d,l];o=L(I,4),i=o[0],l=o[1],s=o[2],d=o[3],c=D-O,f=N-k}}if(u%360>180){var I=[d,s,l,i];a=L(I,4),i=a[0],l=a[1],s=a[2],d=a[3]}var z=Gr([i,l,s,d]),M=z.minX,j=z.minY,F=z.maxX,G=z.maxY;return{pos1:i,pos2:l,pos3:s,pos4:d,width:c,height:f,minX:M,minY:j,maxX:F,maxY:G,rotation:r}}function Ju(t,r){var n=r.map(function(o){if(Ue(o)){var a=Ju(t,o),i=a.length;return i>1?a:i===1?a[0]:null}else{var l=_t(t,function(s){var d=s.manager;return d.props.target===o});return l?(l.finded=!0,l.manager):null}}).filter(Boolean);return n.length===1&&Ue(n[0])?n[0]:n}var LC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.differ=new Kd,n.moveables=[],n.transformOrigin="50% 50%",n.renderGroupRects=[],n._targetGroups=[],n._hasFirstTargets=!1,n}return r.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this)},r.prototype.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},r.prototype.getTargets=function(){return this.props.targets},r.prototype.updateRect=function(n,o,a){var i;a===void 0&&(a=!0);var l=this.state;if(!this.controlBox||l.isPersisted)return;vn(!0),this.moveables.forEach(function(Q){Q.updateRect(n,!1,!1)});var s=this.props,d=this.moveables,c=l.target||s.target,f=d.map(function(Q){return{finded:!1,manager:Q}}),u=this.props.targetGroups||[],p=Ju(f,u),h=s.useDefaultGroupRotate;p.push.apply(p,K([],L(f.filter(function(Q){var re=Q.finded;return!re}).map(function(Q){var re=Q.manager;return re})),!1));var m=[],y=!o||n!==""&&s.updateGroup,g=s.defaultGroupRotate||0;if(!this._hasFirstTargets){var b=(i=s.persistData)===null||i===void 0?void 0:i.rotation;b!=null&&(g=b)}function w(Q,re,ne){var Y=Q.map(function(Ce){if(Ue(Ce)){var ue=w(Ce,re),Ee=[ue.pos1,ue.pos2,ue.pos3,ue.pos4];return m.push(ue),{poses:Ee,rotation:ue.rotation}}else return{poses:jt(Ce.state),rotation:Ce.getRotation()}}),Z=Y.map(function(Ce){var ue=Ce.rotation;return ue}),ye=0,ie=Z[0],ce=Z.every(function(Ce){return Math.abs(ie-Ce)<.1});y?ye=!h&&ce?ie:g:ye=!h&&!ne&&ce?ie:re;var oe=Y.map(function(Ce){var ue=Ce.poses;return ue}),_e=AC(oe,ye);return _e}var _=w(p,this.rotation,!0);y&&(this.rotation=_.rotation,this.transformOrigin=s.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=u,this.renderGroupRects=m;var C=this.transformOrigin,S=this.rotation,x=this.scale,v=_.width,V=_.height,$=_.minX,B=_.minY,R=nC([[0,0],[v,0],[0,V],[v,V]],rs(C,v,V),this.rotation/180*Math.PI),T=Gr(R.result),k=T.minX,O=T.minY,N=" rotate(".concat(S,"deg)")+" scale(".concat(pt(x[0]),", ").concat(pt(x[1]),")"),D="translate(".concat(-k,"px, ").concat(-O,"px)").concat(N);this.controlBox.style.transform="translate3d(".concat($,"px, ").concat(B,"px, ").concat(this.props.translateZ||0,")"),c.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(C,";")+"width:".concat(v,"px;height:").concat(V,"px;")+"transform: ".concat(D),l.width=v,l.height=V;var I=this.getContainer(),z=ss(this.controlBox,c,this.controlBox,this.getContainer(),this._rootContainer||I,[]),M=[z.left,z.top],j=L(jt(z),4),F=j[0],G=j[1],H=j[2],X=j[3],J=Gr([F,G,H,X]),P=[J.minX,J.minY],W=pt(x[0]*x[1]);z.pos1=se(F,P),z.pos2=se(G,P),z.pos3=se(H,P),z.pos4=se(X,P),z.left=$-z.left+P[0],z.top=B-z.top+P[1],z.origin=se(xe(M,z.origin),P),z.beforeOrigin=se(xe(M,z.beforeOrigin),P),z.originalBeforeOrigin=xe(M,z.originalBeforeOrigin),z.transformOrigin=se(xe(M,z.transformOrigin),P),c.style.transform="translate(".concat(-k-P[0],"px, ").concat(-O-P[1],"px)")+N,vn(),this.updateState(A(A({},z),{posDelta:P,direction:W,beforeDirection:W}),a)},r.prototype.getRect=function(){return A(A({},t.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.prototype.triggerEvent=function(n,o,a){if(a||n.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,n,o);this._emitter.trigger(n,o)},r.prototype.getRequestChildStyles=function(){var n=this.getEnabledAbles().reduce(function(o,a){var i,l,s=(l=(i=a.requestChildStyle)===null||i===void 0?void 0:i.call(a))!==null&&l!==void 0?l:[];return K(K([],L(o),!1),L(s),!1)},[]);return n},r.prototype.getMoveables=function(){return K([],L(this.moveables),!1)},r.prototype.updateAbles=function(){t.prototype.updateAbles.call(this,K(K([],L(this.props.ables),!1),[cs],!1),"Group")},r.prototype._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=ir(this._originalDragTarget,!0)},r.prototype._updateEvents=function(){var n=this.state,o=this.props,a=this._prevDragTarget,i=o.dragTarget||this.areaElement,l=o.targets,s=this.differ.update(l),d=s.added,c=s.changed,f=s.removed,u=d.length||f.length;(u||this._prevOriginalDragTarget!==this._originalDragTarget)&&(kn(this,!1),kn(this,!0),this.updateState({gestos:{}})),a!==i&&(n.target=null),n.target||(n.target=this.areaElement,this.controlBox.style.display="block"),n.target&&(this.targetGesto||(this.targetGesto=Pu(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=Uu(this,"GroupControl")));var p=!Kl(n.container,o.container);p&&(n.container=o.container),(p||u||this.transformOrigin!==(o.defaultGroupOrigin||"50% 50%")||c.length||l.length&&!vu(this._targetGroups,o.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!u},r.prototype._updateObserver=function(){},r.defaultProps=A(A({},Bn.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),r}(Bn),FC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.moveables=[],n}return r.prototype.render=function(){var n=this,o,a=this.props,i=a.cspNonce,l=a.cssStyled,s=a.persistData,d=a.targets||[],c=d.length,f=this.isUnmounted||!c,u=(o=s==null?void 0:s.children)!==null&&o!==void 0?o:[];return f&&!c&&u.length?d=u.map(function(){return null}):f||(u=[]),Xt(l,{cspNonce:i,ref:pr(this,"controlBox"),className:ae("control-box")},d.map(function(p,h){var m,y,g=(y=(m=a.individualGroupableProps)===null||m===void 0?void 0:m.call(a,p,h))!==null&&y!==void 0?y:{};return Xt(Bn,A({key:"moveable"+h,ref:fd(n,"moveables",h)},a,g,{target:p,wrapperMoveable:n,isWrapperMounted:n.isMoveableMounted,persistData:u[h]}))}))},r.prototype.componentDidMount=function(){},r.prototype.componentDidUpdate=function(){},r.prototype.getTargets=function(){return this.props.targets},r.prototype.updateRect=function(n,o,a){a===void 0&&(a=!0),vn(!0),this.moveables.forEach(function(i){i.updateRect(n,o,a)}),vn()},r.prototype.getRect=function(){return A(A({},t.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.prototype.request=function(n,o,a){o===void 0&&(o={});var i=this.moveables.map(function(d){return d.request(n,A(A({},o),{isInstant:!1}),!1)}),l=a||o.isInstant,s={request:function(d){return i.forEach(function(c){return c.request(d)}),this},requestEnd:function(){return i.forEach(function(d){return d.requestEnd()}),this}};return l?s.request(o).requestEnd():s},r.prototype.dragStart=function(n,o){o===void 0&&(o=n.target);var a=o,i=_t(this.moveables,function(l){var s=l.getTargets()[0],d=l.getControlBoxElement(),c=l.getDragElement();return!s||!c?!1:c===a||c.contains(a)||c!==s&&s===a||s.contains(a)||d===a||d.contains(a)});return i&&i.dragStart(n,o),this},r.prototype.hitTest=function(){return 0},r.prototype.isInside=function(){return!1},r.prototype.isDragging=function(){return!1},r.prototype.getDragElement=function(){return null},r.prototype.getMoveables=function(){return K([],L(this.moveables),!1)},r.prototype.updateRenderPoses=function(){},r.prototype.checkUpdate=function(){},r.prototype.triggerEvent=function(){},r.prototype.updateAbles=function(){},r.prototype._updateEvents=function(){},r.prototype._updateObserver=function(){},r}(Bn);function Ku(t,r){var n=[];return t.forEach(function(o){if(o){if(at(o)){r[o]&&n.push.apply(n,K([],L(r[o]),!1));return}Ue(o)?n.push.apply(n,K([],L(Ku(o,r)),!1)):n.push(o)}}),n}function Zu(t,r){var n=[];return t.forEach(function(o){if(o){if(at(o)){r[o]&&n.push.apply(n,K([],L(r[o]),!1));return}Ue(o)?n.push(Zu(o,r)):n.push(o)}}),n}function Qu(t,r){return t.length!==r.length||t.some(function(n,o){var a=r[o];return!n&&!a?!1:n!=a?Ue(n)&&Ue(a)?Qu(n,a):!0:!1})}var jC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.refTargets=[],n.selectorMap={},n._differ=new Kd,n._elementTargets=[],n._tmpRefTargets=[],n._tmpSelectorMap={},n._onChangeTargets=null,n}return r.makeStyled=function(){var n={},o=this.getTotalAbles();o.forEach(function(i){var l=i.css;l&&l.forEach(function(s){n[s]=!0})});var a=mr(n).join(`
368
+ }`],render:function(t,r){var n=t.props,o=n.edgeDraggable;return o?vf(r,"edgeDraggable",o,t.getState().renderPoses,n.zoom):[]},dragCondition:function(t,r){var n,o=t.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Qe(a,ae("direction"))&&Qe(a,ae("edge"))&&Qe(a,ae("edgeDraggable"))},dragStart:function(t,r){return ft.dragStart(t,Tn(r))},drag:function(t,r){return ft.drag(t,Tn(r))},dragEnd:function(t,r){return ft.dragEnd(t,Tn(r))},dragGroupCondition:function(t,r){var n,o=t.props,a=(n=r.inputEvent)===null||n===void 0?void 0:n.target;return!o.edgeDraggable||!a?!1:!o.draggable&&Qe(a,ae("direction"))&&Qe(a,ae("line"))},dragGroupStart:function(t,r){return ft.dragGroupStart(t,Tn(r))},dragGroup:function(t,r){return ft.dragGroup(t,Tn(r))},dragGroupEnd:function(t,r){return ft.dragGroupEnd(t,Tn(r))},unset:function(t){return ft.unset(t)}}),Hu={name:"individualGroupable",props:["individualGroupable","individualGroupableProps"],events:[]},ds=[Fu,Bu,Fw,oC,ft,zC,Ml,aC,lC,Sw,uC,pC,dC,EC,vC,$C,cs,Hu,IC,Du,ju],RC=ds.reduce(function(t,r){return(r.events||[]).forEach(function(n){wd(t,n)}),t},[]),MC=ds.reduce(function(t,r){return(r.props||[]).forEach(function(n){wd(t,n)}),t},[]);function Yu(t,r){var n=L(t,3),o=n[0],a=n[1],i=n[2];return(o*r[0]+a*r[1]+i)/Math.sqrt(o*o+a*a)}function Ha(t,r){var n=L(t,2),o=n[0],a=n[1];return-o*r[0]-a*r[1]}function Xu(t,r){return Math.max.apply(Math,K([],L(t.map(function(n){var o=L(n,4),a=o[0],i=o[1],l=o[2],s=o[3];return Math.max(a[r],i[r],l[r],s[r])})),!1))}function qu(t,r){return Math.min.apply(Math,K([],L(t.map(function(n){var o=L(n,4),a=o[0],i=o[1],l=o[2],s=o[3];return Math.min(a[r],i[r],l[r],s[r])})),!1))}function AC(t,r){var n,o,a,i=[0,0],l=[0,0],s=[0,0],d=[0,0],c=0,f=0;if(!t.length)return{pos1:i,pos2:l,pos3:s,pos4:d,minX:0,minY:0,maxX:0,maxY:0,width:c,height:f,rotation:r};var u=pe(r,dt);if(u%90){var p=u/180*Math.PI,h=Math.tan(p),m=-1/h,y=[xl,uf],g=[[0,0],[0,0]],b=[xl,uf],w=[[0,0],[0,0]];t.forEach(function(H){H.forEach(function(X){var J=Yu([-h,1,0],X),P=Yu([-m,1,0],X);y[0]>J&&(g[0]=X,y[0]=J),y[1]<J&&(g[1]=X,y[1]=J),b[0]>P&&(w[0]=X,b[0]=P),b[1]<P&&(w[1]=X,b[1]=P)})});var _=L(g,2),C=_[0],S=_[1],x=L(w,2),v=x[0],V=x[1],$=[-h,1,Ha([-h,1],C)],B=[-h,1,Ha([-h,1],S)],R=[-m,1,Ha([-m,1],v)],T=[-m,1,Ha([-m,1],V)];n=L([[$,R],[$,T],[B,R],[B,T]].map(function(H){var X=L(H,2),J=X[0],P=X[1];return fl(J,P)[0]}),4),i=n[0],l=n[1],s=n[2],d=n[3],c=b[1]-b[0],f=y[1]-y[0]}else{var k=qu(t,0),O=qu(t,1),N=Xu(t,0),D=Xu(t,1);if(i=[k,O],l=[N,O],s=[k,D],d=[N,D],c=N-k,f=D-O,u%180){var I=[s,i,d,l];o=L(I,4),i=o[0],l=o[1],s=o[2],d=o[3],c=D-O,f=N-k}}if(u%360>180){var I=[d,s,l,i];a=L(I,4),i=a[0],l=a[1],s=a[2],d=a[3]}var z=Gr([i,l,s,d]),M=z.minX,j=z.minY,F=z.maxX,G=z.maxY;return{pos1:i,pos2:l,pos3:s,pos4:d,width:c,height:f,minX:M,minY:j,maxX:F,maxY:G,rotation:r}}function Ju(t,r){var n=r.map(function(o){if(Ue(o)){var a=Ju(t,o),i=a.length;return i>1?a:i===1?a[0]:null}else{var l=_t(t,function(s){var d=s.manager;return d.props.target===o});return l?(l.finded=!0,l.manager):null}}).filter(Boolean);return n.length===1&&Ue(n[0])?n[0]:n}var LC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.differ=new Kd,n.moveables=[],n.transformOrigin="50% 50%",n.renderGroupRects=[],n._targetGroups=[],n._hasFirstTargets=!1,n}return r.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this)},r.prototype.checkUpdate=function(){this._isPropTargetChanged=!1,this.updateAbles()},r.prototype.getTargets=function(){return this.props.targets},r.prototype.updateRect=function(n,o,a){var i;a===void 0&&(a=!0);var l=this.state;if(!this.controlBox||l.isPersisted)return;vn(!0),this.moveables.forEach(function(Q){Q.updateRect(n,!1,!1)});var s=this.props,d=this.moveables,c=l.target||s.target,f=d.map(function(Q){return{finded:!1,manager:Q}}),u=this.props.targetGroups||[],p=Ju(f,u),h=s.useDefaultGroupRotate;p.push.apply(p,K([],L(f.filter(function(Q){var re=Q.finded;return!re}).map(function(Q){var re=Q.manager;return re})),!1));var m=[],y=!o||n!==""&&s.updateGroup,g=s.defaultGroupRotate||0;if(!this._hasFirstTargets){var b=(i=s.persistData)===null||i===void 0?void 0:i.rotation;b!=null&&(g=b)}function w(Q,re,ne){var Y=Q.map(function(Ce){if(Ue(Ce)){var ue=w(Ce,re),Ee=[ue.pos1,ue.pos2,ue.pos3,ue.pos4];return m.push(ue),{poses:Ee,rotation:ue.rotation}}else return{poses:jt(Ce.state),rotation:Ce.getRotation()}}),Z=Y.map(function(Ce){var ue=Ce.rotation;return ue}),ye=0,ie=Z[0],ce=Z.every(function(Ce){return Math.abs(ie-Ce)<.1});y?ye=!h&&ce?ie:g:ye=!h&&!ne&&ce?ie:re;var oe=Y.map(function(Ce){var ue=Ce.poses;return ue}),_e=AC(oe,ye);return _e}var _=w(p,this.rotation,!0);y&&(this.rotation=_.rotation,this.transformOrigin=s.defaultGroupOrigin||"50% 50%",this.scale=[1,1]),this._targetGroups=u,this.renderGroupRects=m;var C=this.transformOrigin,S=this.rotation,x=this.scale,v=_.width,V=_.height,$=_.minX,B=_.minY,R=nC([[0,0],[v,0],[0,V],[v,V]],rs(C,v,V),this.rotation/180*Math.PI),T=Gr(R.result),k=T.minX,O=T.minY,N=" rotate(".concat(S,"deg)")+" scale(".concat(pt(x[0]),", ").concat(pt(x[1]),")"),D="translate(".concat(-k,"px, ").concat(-O,"px)").concat(N);this.controlBox.style.transform="translate3d(".concat($,"px, ").concat(B,"px, ").concat(this.props.translateZ||0,")"),c.style.cssText+="left:0px;top:0px;"+"transform-origin:".concat(C,";")+"width:".concat(v,"px;height:").concat(V,"px;")+"transform: ".concat(D),l.width=v,l.height=V;var I=this.getContainer(),z=ss(this.controlBox,c,this.controlBox,this.getContainer(),this._rootContainer||I,[]),M=[z.left,z.top],j=L(jt(z),4),F=j[0],G=j[1],H=j[2],X=j[3],J=Gr([F,G,H,X]),P=[J.minX,J.minY],W=pt(x[0]*x[1]);z.pos1=se(F,P),z.pos2=se(G,P),z.pos3=se(H,P),z.pos4=se(X,P),z.left=$-z.left+P[0],z.top=B-z.top+P[1],z.origin=se(xe(M,z.origin),P),z.beforeOrigin=se(xe(M,z.beforeOrigin),P),z.originalBeforeOrigin=xe(M,z.originalBeforeOrigin),z.transformOrigin=se(xe(M,z.transformOrigin),P),c.style.transform="translate(".concat(-k-P[0],"px, ").concat(-O-P[1],"px)")+N,vn(),this.updateState(A(A({},z),{posDelta:P,direction:W,beforeDirection:W}),a)},r.prototype.getRect=function(){return A(A({},t.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.prototype.triggerEvent=function(n,o,a){if(a||n.indexOf("Group")>-1)return t.prototype.triggerEvent.call(this,n,o);this._emitter.trigger(n,o)},r.prototype.getRequestChildStyles=function(){var n=this.getEnabledAbles().reduce(function(o,a){var i,l,s=(l=(i=a.requestChildStyle)===null||i===void 0?void 0:i.call(a))!==null&&l!==void 0?l:[];return K(K([],L(o),!1),L(s),!1)},[]);return n},r.prototype.getMoveables=function(){return K([],L(this.moveables),!1)},r.prototype.updateAbles=function(){t.prototype.updateAbles.call(this,K(K([],L(this.props.ables),!1),[cs],!1),"Group")},r.prototype._updateTargets=function(){t.prototype._updateTargets.call(this),this._originalDragTarget=this.props.dragTarget||this.areaElement,this._dragTarget=ir(this._originalDragTarget,!0)},r.prototype._updateEvents=function(){var n=this.state,o=this.props,a=this._prevDragTarget,i=o.dragTarget||this.areaElement,l=o.targets,s=this.differ.update(l),d=s.added,c=s.changed,f=s.removed,u=d.length||f.length;(u||this._prevOriginalDragTarget!==this._originalDragTarget)&&(kn(this,!1),kn(this,!0),this.updateState({gestos:{}})),a!==i&&(n.target=null),n.target||(n.target=this.areaElement,this.controlBox.style.display="block"),n.target&&(this.targetGesto||(this.targetGesto=Pu(this,this._dragTarget,"Group")),this.controlGesto||(this.controlGesto=Uu(this,"GroupControl")));var p=!Kl(n.container,o.container);p&&(n.container=o.container),(p||u||this.transformOrigin!==(o.defaultGroupOrigin||"50% 50%")||c.length||l.length&&!vu(this._targetGroups,o.targetGroups||[]))&&(this.updateRect(),this._hasFirstTargets=!0),this._isPropTargetChanged=!!u},r.prototype._updateObserver=function(){},r.defaultProps=A(A({},Bn.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),r}(Bn),FC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.moveables=[],n}return r.prototype.render=function(){var n=this,o,a=this.props,i=a.cspNonce,l=a.cssStyled,s=a.persistData,d=a.targets||[],c=d.length,f=this.isUnmounted||!c,u=(o=s==null?void 0:s.children)!==null&&o!==void 0?o:[];return f&&!c&&u.length?d=u.map(function(){return null}):f||(u=[]),Xt(l,{cspNonce:i,ref:pr(this,"controlBox"),className:ae("control-box")},d.map(function(p,h){var m,y,g=(y=(m=a.individualGroupableProps)===null||m===void 0?void 0:m.call(a,p,h))!==null&&y!==void 0?y:{};return Xt(Bn,A({key:"moveable"+h,ref:fd(n,"moveables",h)},a,g,{target:p,wrapperMoveable:n,isWrapperMounted:n.isMoveableMounted,persistData:u[h]}))}))},r.prototype.componentDidMount=function(){},r.prototype.componentDidUpdate=function(){},r.prototype.getTargets=function(){return this.props.targets},r.prototype.updateRect=function(n,o,a){a===void 0&&(a=!0),vn(!0),this.moveables.forEach(function(i){i.updateRect(n,o,a)}),vn()},r.prototype.getRect=function(){return A(A({},t.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.prototype.request=function(n,o,a){o===void 0&&(o={});var i=this.moveables.map(function(d){return d.request(n,A(A({},o),{isInstant:!1}),!1)}),l=a||o.isInstant,s={request:function(d){return i.forEach(function(c){return c.request(d)}),this},requestEnd:function(){return i.forEach(function(d){return d.requestEnd()}),this}};return l?s.request(o).requestEnd():s},r.prototype.dragStart=function(n,o){o===void 0&&(o=n.target);var a=o,i=_t(this.moveables,function(l){var s=l.getTargets()[0],d=l.getControlBoxElement(),c=l.getDragElement();return!s||!c?!1:c===a||c.contains(a)||c!==s&&s===a||s.contains(a)||d===a||d.contains(a)});return i&&i.dragStart(n,o),this},r.prototype.hitTest=function(){return 0},r.prototype.isInside=function(){return!1},r.prototype.isDragging=function(){return!1},r.prototype.getDragElement=function(){return null},r.prototype.getMoveables=function(){return K([],L(this.moveables),!1)},r.prototype.updateRenderPoses=function(){},r.prototype.checkUpdate=function(){},r.prototype.triggerEvent=function(){},r.prototype.updateAbles=function(){},r.prototype._updateEvents=function(){},r.prototype._updateObserver=function(){},r}(Bn);function Ku(t,r){var n=[];return t.forEach(function(o){if(o){if(at(o)){r[o]&&n.push.apply(n,K([],L(r[o]),!1));return}Ue(o)?n.push.apply(n,K([],L(Ku(o,r)),!1)):n.push(o)}}),n}function Zu(t,r){var n=[];return t.forEach(function(o){if(o){if(at(o)){r[o]&&n.push.apply(n,K([],L(r[o]),!1));return}Ue(o)?n.push(Zu(o,r)):n.push(o)}}),n}function Qu(t,r){return t.length!==r.length||t.some(function(n,o){var a=r[o];return!n&&!a?!1:n!=a?Ue(n)&&Ue(a)?Qu(n,a):!0:!1})}var jC=function(t){fo(r,t);function r(){var n=t!==null&&t.apply(this,arguments)||this;return n.refTargets=[],n.selectorMap={},n._differ=new Kd,n._elementTargets=[],n._tmpRefTargets=[],n._tmpSelectorMap={},n._onChangeTargets=null,n}return r.makeStyled=function(){var n={},o=this.getTotalAbles();o.forEach(function(i){var l=i.css;l&&l.forEach(function(s){n[s]=!0})});var a=mr(n).join(`
369
369
  `);this.defaultStyled=lf("div",Pb(Cl,V_+a))},r.getTotalAbles=function(){return K([Bu,cs,Hu,Du],L(this.defaultAbles),!1)},r.prototype.render=function(){var n,o=this.constructor;o.defaultStyled||o.makeStyled();var a=this.props,i=a.ables,l=a.props,s=p_(a,["ables","props"]),d=L(this._updateRefs(!0),2),c=d[0],f=d[1],u=Ku(c,f),p=u.length>1,h=o.getTotalAbles(),m=K(K([],L(h),!1),L(i||[]),!1),y=A(A(A({},s),l||{}),{ables:m,cssStyled:o.defaultStyled,customStyledMap:o.customStyledMap});this._elementTargets=u;var g=null,b=this.moveable,w=s.persistData;if(w!=null&&w.children&&(p=!0),s.individualGroupable)return Xt(FC,A({key:"individual-group",ref:pr(this,"moveable")},y,{target:null,targets:u}));if(p){var _=Zu(c,f);if(b&&!b.props.groupable&&!b.props.individualGroupable){var C=b.props.target;C&&u.indexOf(C)>-1&&(g=A({},b.state))}return Xt(LC,A({key:"group",ref:pr(this,"moveable")},y,(n=s.groupableProps)!==null&&n!==void 0?n:{},{target:null,targets:u,targetGroups:_,firstRenderState:g}))}else{var S=u[0];if(b&&(b.props.groupable||b.props.individualGroupable)){var x=b.moveables||[],v=_t(x,function(V){return V.props.target===S});v&&(g=A({},v.state))}return Xt(Bn,A({key:"single",ref:pr(this,"moveable")},y,{target:S,firstRenderState:g}))}},r.prototype.componentDidMount=function(){this._checkChangeTargets()},r.prototype.componentDidUpdate=function(){this._checkChangeTargets()},r.prototype.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},r.prototype.getTargets=function(){var n,o;return(o=(n=this.moveable)===null||n===void 0?void 0:n.getTargets())!==null&&o!==void 0?o:[]},r.prototype.updateSelectors=function(){this.selectorMap={},this._updateRefs(),this.forceUpdate()},r.prototype.waitToChangeTarget=function(){var n=this,o;return this._onChangeTargets=function(){n._onChangeTargets=null,o()},new Promise(function(a){o=a})},r.prototype.waitToChangeTargets=function(){return this.waitToChangeTarget()},r.prototype.getManager=function(){return this.moveable},r.prototype.getMoveables=function(){return this.moveable.getMoveables()},r.prototype.getDragElement=function(){return this.moveable.getDragElement()},r.prototype._updateRefs=function(n){var o=this.refTargets,a=es(this.props.target||this.props.targets),i=typeof document<"u",l=Qu(o,a),s=this.selectorMap,d={};return this.refTargets.forEach(function c(f){if(at(f)){var u=s[f];u?d[f]=s[f]:i&&(l=!0,d[f]=[].slice.call(document.querySelectorAll(f)))}else Ue(f)&&f.forEach(c)}),this._tmpRefTargets=a,this._tmpSelectorMap=d,[a,d,!n&&l]},r.prototype._checkChangeTargets=function(){var n,o,a;this.refTargets=this._tmpRefTargets,this.selectorMap=this._tmpSelectorMap;var i=this._differ.update(this._elementTargets),l=i.added,s=i.removed,d=l.length||s.length;d&&((o=(n=this.props).onChangeTargets)===null||o===void 0||o.call(n,{moveable:this.moveable,targets:this._elementTargets}),(a=this._onChangeTargets)===null||a===void 0||a.call(this));var c=L(this._updateRefs(),3),f=c[0],u=c[1],p=c[2];this.refTargets=f,this.selectorMap=u,p&&this.forceUpdate()},r.defaultAbles=[],r.customStyledMap={},r.defaultStyled=null,h_([Ub(hf)],r.prototype,"moveable",void 0),r}(Td),PC=function(t){fo(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.defaultAbles=ds,r}(jC),fs=function(t,r){return fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},fs(t,r)};function us(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");fs(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var xo=function(){return xo=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},xo.apply(this,arguments)};function UC(t,r,n,o){var a=arguments.length,i=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,r,n,o);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(i=(a<3?l(i):a>3?l(r,n,i):l(r,n))||i);return a>3&&i&&Object.defineProperty(r,n,i),i}var WC=function(t){us(r,t);function r(o){var a=t.call(this,o)||this;return a.state={},a.state=a.props,a}var n=r.prototype;return n.render=function(){return Xt(PC,xo({ref:pr(this,"moveable")},this.state))},r}(qi),Ya=MC,ep=hf,tp=RC,GC=function(t){us(r,t);function r(o,a){a===void 0&&(a={});var i=t.call(this)||this;i.containerProvider=null,i.selfElement=null,i._warp=!1;var l=xo({},a),s={};tp.forEach(function(f){s[Fi("on ".concat(f))]=function(u){return i.trigger(f,u)}});var d;a.warpSelf?(delete a.warpSelf,i._warp=!0,d=o):(d=wt(o).createElement("div"),o.appendChild(d)),i.containerProvider=Md(Xt(WC,xo({ref:pr(i,"innerMoveable")},l,s)),d),i.selfElement=d;var c=l.target;return Ue(c)&&c.length>1&&i.updateRect(),i}var n=r.prototype;return n.setState=function(o,a){this.innerMoveable.setState(o,a)},n.forceUpdate=function(o){this.innerMoveable.forceUpdate(o)},n.dragStart=function(o,a){a===void 0&&(a=o.target);var i=this.innerMoveable;i.$_timer&&this.forceUpdate(),this.getMoveable().dragStart(o,a)},n.destroy=function(){var o,a=this.selfElement;Md(null,a,this.containerProvider),this._warp||(o=a==null?void 0:a.parentElement)===null||o===void 0||o.removeChild(a),this.containerProvider=null,this.off(),this.selfElement=null,this.innerMoveable=null},n.getMoveable=function(){return this.innerMoveable.moveable},r=UC([Ri(ep,function(o,a){o[a]||(o[a]=function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];var s=this.getMoveable();if(!(!s||!s[a]))return s[a].apply(s,i)})}),Ri(Ya,function(o,a){Object.defineProperty(o,a,{get:function(){return this.getMoveable().props[a]},set:function(i){var l;this.setState((l={},l[a]=i,l))},enumerable:!0,configurable:!0})})],r),r}(yn),HC=function(t){us(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r}(GC);const rp={};ep.forEach(t=>{rp[t]=function(...r){return this.$_moveable[t](...r)}});const np={};Ya.forEach(t=>{np[t]=function(r){this.$_moveable[t]=r}});const YC=e.defineComponent({name:"moveable",methods:rp,props:Ya,watch:np,mounted(){const t={},r=this.$props;Ya.forEach(i=>{const l=r[i];Kn(l)||(t[i]=r[i])});const o=this.$refs.moveableElement,a=new HC(o,{...t,warpSelf:!0});tp.forEach(i=>{a.on(i,l=>{this.$emit(i,{...l})})}),this.$_moveable=a},beforeUnmount(){this.$_moveable.destroy()}}),XC=(t,r)=>{const n=t.__vccOpts||t;for(const[o,a]of r)n[o]=a;return n},qC={ref:"moveableElement"};function JC(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",qC,null,512)}const KC=XC(YC,[["render",JC]]);var ps=function(t,r){return ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},ps(t,r)};function ZC(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");ps(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}function QC(t,r){return r={exports:{}},t(r,r.exports),r.exports}var vo=QC(function(t,r){function n(d){if(d&&typeof d=="object"){var c=d.which||d.keyCode||d.charCode;c&&(d=c)}if(typeof d=="number")return l[d];var f=String(d),u=o[f.toLowerCase()];if(u)return u;var u=a[f.toLowerCase()];if(u)return u;if(f.length===1)return f.charCodeAt(0)}n.isEventKey=function(c,f){if(c&&typeof c=="object"){var u=c.which||c.keyCode||c.charCode;if(u==null)return!1;if(typeof f=="string"){var p=o[f.toLowerCase()];if(p)return p===u;var p=a[f.toLowerCase()];if(p)return p===u}else if(typeof f=="number")return f===u;return!1}},r=t.exports=n;var o=r.code=r.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},a=r.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
370
370
  * Programatically add the following
371
- */for(i=97;i<123;i++)o[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)o[i-48]=i;for(i=1;i<13;i++)o["f"+i]=i+111;for(i=0;i<10;i++)o["numpad "+i]=i+96;var l=r.names=r.title={};for(i in o)l[o[i]]=i;for(var s in a)o[s]=a[s]});vo.code,vo.codes,vo.aliases;var eS=vo.names;vo.title;var op={"+":"plus","left command":"meta","right command":"meta"},ap={shift:1,ctrl:2,alt:3,meta:4};function ip(t,r){var n=(eS[t]||r||"").toLowerCase();for(var o in op)n=n.replace(o,op[o]);return n.replace(/\s/g,"")}function lp(t,r){r===void 0&&(r=ip(t.keyCode,t.key));var n=tS(t);return n.indexOf(r)===-1&&n.push(r),n.filter(Boolean)}function tS(t){var r=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"];return r.filter(Boolean)}function sp(t){var r=t.slice();return r.sort(function(n,o){var a=ap[n]||5,i=ap[o]||5;return a-i}),r}var cp,rS=function(t){ZC(r,t);function r(o){o===void 0&&(o=window);var a=t.call(this)||this;return a.container=o,a.ctrlKey=!1,a.altKey=!1,a.shiftKey=!1,a.metaKey=!1,a.clear=function(){return a.ctrlKey=!1,a.altKey=!1,a.shiftKey=!1,a.metaKey=!1,a},a.keydownEvent=function(i){a.triggerEvent("keydown",i)},a.keyupEvent=function(i){a.triggerEvent("keyup",i)},a.blur=function(){a.clear(),a.trigger("blur")},Xe(o,"blur",a.blur),Xe(o,"keydown",a.keydownEvent),Xe(o,"keyup",a.keyupEvent),a}var n=r.prototype;return Object.defineProperty(r,"global",{get:function(){return cp||(cp=new r)},enumerable:!1,configurable:!0}),r.setGlobal=function(){return this.global},n.destroy=function(){var o=this.container;this.clear(),this.off(),We(o,"blur",this.blur),We(o,"keydown",this.keydownEvent),We(o,"keyup",this.keyupEvent)},n.keydown=function(o,a){return this.addEvent("keydown",o,a)},n.offKeydown=function(o,a){return this.removeEvent("keydown",o,a)},n.offKeyup=function(o,a){return this.removeEvent("keyup",o,a)},n.keyup=function(o,a){return this.addEvent("keyup",o,a)},n.addEvent=function(o,a,i){return Ue(a)?this.on("".concat(o,".").concat(sp(a).join(".")),i):at(a)?this.on("".concat(o,".").concat(a),i):this.on(o,a),this},n.removeEvent=function(o,a,i){return Ue(a)?this.off("".concat(o,".").concat(sp(a).join(".")),i):at(a)?this.off("".concat(o,".").concat(a),i):this.off(o,a),this},n.triggerEvent=function(o,a){this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.altKey=a.altKey,this.metaKey=a.metaKey;var i=ip(a.keyCode,a.key),l=i==="ctrl"||i==="shift"||i==="meta"||i==="alt",s={key:i,isToggle:l,inputEvent:a,keyCode:a.keyCode,ctrlKey:a.ctrlKey,altKey:a.altKey,shiftKey:a.shiftKey,metaKey:a.metaKey};this.trigger(o,s),this.trigger("".concat(o,".").concat(i),s);var d=lp(a,i);d.length>1&&this.trigger("".concat(o,".").concat(d.join(".")),s)},r}(yn);const nS=rS;var hs=function(t,r){return hs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},hs(t,r)};function dp(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");hs(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var et=function(){return et=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},et.apply(this,arguments)};function oS(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function aS(t,r,n,o){var a=arguments.length,i=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,r,n,o);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(i=(a<3?l(i):a>3?l(r,n,i):l(r,n))||i);return a>3&&i&&Object.defineProperty(r,n,i),i}function Eo(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function iS(t){if("touches"in t){var r=t.touches[0]||t.changedTouches[0];return{clientX:r.clientX,clientY:r.clientY}}else return{clientX:t.clientX,clientY:t.clientY}}function lS(t){if(typeof Map>"u")return t.filter(function(n,o){return t.indexOf(n)===o});var r=new Map;return t.filter(function(n){return r.has(n)?!1:(r.set(n,!0),!0)})}function sS(t,r,n){var o=wt(t);return o.elementFromPoint&&o.elementFromPoint(r,n)||null}function fp(t,r,n){var o=t.tag,a=t.children,i=t.attributes,l=t.className,s=t.style,d=r||wt(n).createElement(o);for(var c in i)d.setAttribute(c,i[c]);var f=d.children;if(a.forEach(function(p,h){fp(p,f[h],d)}),l&&l.split(/\s+/g).forEach(function(p){p&&!Ze(d,p)&&Ui(d,p)}),s){var u=d.style;for(var c in s)u[c]=s[c]}return!r&&n&&n.appendChild(d),d}function cS(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=r||{},i=a.className,l=i===void 0?"":i,s=a.style,d=s===void 0?{}:s,c=oS(a,["className","style"]);return{tag:t,className:l,style:d,attributes:c,children:n}}function ms(t,r,n){t!==r&&n(t,r)}function up(t,r,n){var o;n===void 0&&(n=t.data.boundArea);var a=t.distX,i=a===void 0?0:a,l=t.distY,s=l===void 0?0:l,d=t.data,c=d.startX,f=d.startY;if(r>0){var u=Math.sqrt((i*i+s*s)/(1+r*r)),p=r*u;i=(i>=0?1:-1)*p,s=(s>=0?1:-1)*u}var h=Math.abs(i),m=Math.abs(s),y=i<0?c-n.left:n.right-c,g=s<0?f-n.top:n.bottom-f;o=ji([h,m],[0,0],[y,g],!!r),h=o[0],m=o[1],i=(i>=0?1:-1)*h,s=(s>=0?1:-1)*m;var b=Math.min(0,i),w=Math.min(0,s),_=c+b,C=f+w;return{left:_,top:C,right:_+h,bottom:C+m,width:h,height:m}}function Xa(t){var r=t.getBoundingClientRect(),n=r.left,o=r.top,a=r.width,i=r.height;return{pos1:[n,o],pos2:[n+a,o],pos3:[n,o+i],pos4:[n+a,o+i]}}function pp(t,r,n){var o=gn(t,r),a=o.list,i=o.prevList,l=o.added,s=o.removed,d=o.maintained;return Eo(Eo(Eo([],l.map(function(c){return a[c]}),!0),s.map(function(c){return i[c]}),!0),n?d.map(function(c){var f=c[1];return a[f]}):[],!0)}function hp(t){for(var r=0,n=t.length,o=1;o<n;++o)r=Math.max(nr(t[o],t[o-1]),r);return r}var mp=af(`
371
+ */for(i=97;i<123;i++)o[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)o[i-48]=i;for(i=1;i<13;i++)o["f"+i]=i+111;for(i=0;i<10;i++)o["numpad "+i]=i+96;var l=r.names=r.title={};for(i in o)l[o[i]]=i;for(var s in a)o[s]=a[s]});vo.code,vo.codes,vo.aliases;var eS=vo.names;vo.title;var op={"+":"plus","left command":"meta","right command":"meta"},ap={shift:1,ctrl:2,alt:3,meta:4};function ip(t,r){var n=(eS[t]||r||"").toLowerCase();for(var o in op)n=n.replace(o,op[o]);return n.replace(/\s/g,"")}function lp(t,r){r===void 0&&(r=ip(t.keyCode,t.key));var n=tS(t);return n.indexOf(r)===-1&&n.push(r),n.filter(Boolean)}function tS(t){var r=[t.shiftKey&&"shift",t.ctrlKey&&"ctrl",t.altKey&&"alt",t.metaKey&&"meta"];return r.filter(Boolean)}function sp(t){var r=t.slice();return r.sort(function(n,o){var a=ap[n]||5,i=ap[o]||5;return a-i}),r}var cp,rS=function(t){ZC(r,t);function r(o){o===void 0&&(o=window);var a=t.call(this)||this;return a.container=o,a.ctrlKey=!1,a.altKey=!1,a.shiftKey=!1,a.metaKey=!1,a.clear=function(){return a.ctrlKey=!1,a.altKey=!1,a.shiftKey=!1,a.metaKey=!1,a},a.keydownEvent=function(i){a.triggerEvent("keydown",i)},a.keyupEvent=function(i){a.triggerEvent("keyup",i)},a.blur=function(){a.clear(),a.trigger("blur")},Xe(o,"blur",a.blur),Xe(o,"keydown",a.keydownEvent),Xe(o,"keyup",a.keyupEvent),a}var n=r.prototype;return Object.defineProperty(r,"global",{get:function(){return cp||(cp=new r)},enumerable:!1,configurable:!0}),r.setGlobal=function(){return this.global},n.destroy=function(){var o=this.container;this.clear(),this.off(),We(o,"blur",this.blur),We(o,"keydown",this.keydownEvent),We(o,"keyup",this.keyupEvent)},n.keydown=function(o,a){return this.addEvent("keydown",o,a)},n.offKeydown=function(o,a){return this.removeEvent("keydown",o,a)},n.offKeyup=function(o,a){return this.removeEvent("keyup",o,a)},n.keyup=function(o,a){return this.addEvent("keyup",o,a)},n.addEvent=function(o,a,i){return Ue(a)?this.on("".concat(o,".").concat(sp(a).join(".")),i):at(a)?this.on("".concat(o,".").concat(a),i):this.on(o,a),this},n.removeEvent=function(o,a,i){return Ue(a)?this.off("".concat(o,".").concat(sp(a).join(".")),i):at(a)?this.off("".concat(o,".").concat(a),i):this.off(o,a),this},n.triggerEvent=function(o,a){this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.altKey=a.altKey,this.metaKey=a.metaKey;var i=ip(a.keyCode,a.key),l=i==="ctrl"||i==="shift"||i==="meta"||i==="alt",s={key:i,isToggle:l,inputEvent:a,keyCode:a.keyCode,ctrlKey:a.ctrlKey,altKey:a.altKey,shiftKey:a.shiftKey,metaKey:a.metaKey};this.trigger(o,s),this.trigger("".concat(o,".").concat(i),s);var d=lp(a,i);d.length>1&&this.trigger("".concat(o,".").concat(d.join(".")),s)},r}(yn);const nS=rS;var hs=function(t,r){return hs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])},hs(t,r)};function dp(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");hs(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var tt=function(){return tt=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},tt.apply(this,arguments)};function oS(t,r){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)r.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function aS(t,r,n,o){var a=arguments.length,i=a<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,n):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,r,n,o);else for(var s=t.length-1;s>=0;s--)(l=t[s])&&(i=(a<3?l(i):a>3?l(r,n,i):l(r,n))||i);return a>3&&i&&Object.defineProperty(r,n,i),i}function Eo(t,r,n){if(n||arguments.length===2)for(var o=0,a=r.length,i;o<a;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return t.concat(i||Array.prototype.slice.call(r))}function iS(t){if("touches"in t){var r=t.touches[0]||t.changedTouches[0];return{clientX:r.clientX,clientY:r.clientY}}else return{clientX:t.clientX,clientY:t.clientY}}function lS(t){if(typeof Map>"u")return t.filter(function(n,o){return t.indexOf(n)===o});var r=new Map;return t.filter(function(n){return r.has(n)?!1:(r.set(n,!0),!0)})}function sS(t,r,n){var o=wt(t);return o.elementFromPoint&&o.elementFromPoint(r,n)||null}function fp(t,r,n){var o=t.tag,a=t.children,i=t.attributes,l=t.className,s=t.style,d=r||wt(n).createElement(o);for(var c in i)d.setAttribute(c,i[c]);var f=d.children;if(a.forEach(function(p,h){fp(p,f[h],d)}),l&&l.split(/\s+/g).forEach(function(p){p&&!Qe(d,p)&&Ui(d,p)}),s){var u=d.style;for(var c in s)u[c]=s[c]}return!r&&n&&n.appendChild(d),d}function cS(t,r){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var a=r||{},i=a.className,l=i===void 0?"":i,s=a.style,d=s===void 0?{}:s,c=oS(a,["className","style"]);return{tag:t,className:l,style:d,attributes:c,children:n}}function ms(t,r,n){t!==r&&n(t,r)}function up(t,r,n){var o;n===void 0&&(n=t.data.boundArea);var a=t.distX,i=a===void 0?0:a,l=t.distY,s=l===void 0?0:l,d=t.data,c=d.startX,f=d.startY;if(r>0){var u=Math.sqrt((i*i+s*s)/(1+r*r)),p=r*u;i=(i>=0?1:-1)*p,s=(s>=0?1:-1)*u}var h=Math.abs(i),m=Math.abs(s),y=i<0?c-n.left:n.right-c,g=s<0?f-n.top:n.bottom-f;o=ji([h,m],[0,0],[y,g],!!r),h=o[0],m=o[1],i=(i>=0?1:-1)*h,s=(s>=0?1:-1)*m;var b=Math.min(0,i),w=Math.min(0,s),_=c+b,C=f+w;return{left:_,top:C,right:_+h,bottom:C+m,width:h,height:m}}function Xa(t){var r=t.getBoundingClientRect(),n=r.left,o=r.top,a=r.width,i=r.height;return{pos1:[n,o],pos2:[n+a,o],pos3:[n,o+i],pos4:[n+a,o+i]}}function pp(t,r,n){var o=gn(t,r),a=o.list,i=o.prevList,l=o.added,s=o.removed,d=o.maintained;return Eo(Eo(Eo([],l.map(function(c){return a[c]}),!0),s.map(function(c){return i[c]}),!0),n?d.map(function(c){var f=c[1];return a[f]}):[],!0)}function hp(t){for(var r=0,n=t.length,o=1;o<n;++o)r=Math.max(nr(t[o],t[o-1]),r);return r}var mp=af(`
372
372
  :host {
373
373
  position: fixed;
374
374
  display: none;
@@ -378,7 +378,7 @@ cursor: move;
378
378
  will-change: transform;
379
379
  z-index: 100;
380
380
  }
381
- `),gp="selecto-selection ".concat(mp.className),yp=["className","boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","continueSelectWithoutDeselect","toggleContinueSelect","toggleContinueSelectWithoutDeselect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside","rootContainer","dragCondition","clickBySelectEnd","checkOverflow","innerScrollOptions"];Eo(["dragContainer","cspNonce","preventClickEventOnDrag","preventClickEventOnDragStart","preventRightClick"],yp,!0);var dS=function(t){dp(r,t);function r(o){o===void 0&&(o={});var a=t.call(this)||this;a.selectedTargets=[],a.dragScroll=new Qd,a._onDragStart=function(s,d){var c=s.data,f=s.clientX,u=s.clientY,p=s.inputEvent,h=a.options,m=h.selectFromInside,y=h.selectByClick,g=h.rootContainer,b=h.boundContainer,w=h.preventDragFromInside,_=w===void 0?!0:w,C=h.clickBySelectEnd,S=h.dragCondition;if(S&&!S(s)){s.stop();return}c.data={};var x=At(a.container);c.innerWidth=x.innerWidth,c.innerHeight=x.innerHeight,a.findSelectableTargets(c),c.startSelectedTargets=a.selectedTargets,c.scaleMatrix=il(),c.containerX=0,c.containerY=0;var v=a.container,V={left:-1/0,top:-1/0,right:1/0,bottom:1/0};if(g){var $=a.container.getBoundingClientRect();c.containerX=$.left,c.containerY=$.top,c.scaleMatrix=U1(a.container,g)}if(b){var B=$t(b)&&"element"in b?et({left:!0,top:!0,bottom:!0,right:!0},b):{element:b,left:!0,top:!0,bottom:!0,right:!0},R=B.element,T=void 0;if(R){at(R)?T=wt(v).querySelector(R):R===!0?T=a.container:T=R;var k=T.getBoundingClientRect();B.left&&(V.left=k.left),B.top&&(V.top=k.top),B.right&&(V.right=k.right),B.bottom&&(V.bottom=k.bottom)}}c.boundArea=V;var O={left:f,top:u,right:f,bottom:u,width:0,height:0},N=[],D=y&&!C,I=!1;if(!m||D){var z=a._findElement(d||p.target,c.selectableTargets);I=!!z,D&&(N=z?[z]:[])}var M=!m&&I;if(M&&!y)return s.stop(),!1;var j=p.type,F=j==="mousedown"||j==="touchstart",G=!s.isClick&&F?a.emit("dragStart",et(et({},s),{data:c.data})):!0;if(!G)return s.stop(),!1;if(a.continueSelect?(N=pp(a.selectedTargets,N,a.continueSelectWithoutDeselect),c.startPassedTargets=a.selectedTargets):c.startPassedTargets=[],a._select(N,O,s,!0,M&&y&&!C&&_),c.startX=f,c.startY=u,c.selectFlag=!1,c.preventDragFromInside=!1,p.target){var H=ma(c.scaleMatrix,[f-c.containerX,u-c.containerY]);a.target.style.cssText+="position: ".concat(g?"absolute":"fixed",";")+"left:0px;top:0px;"+"transform: translate(".concat(H[0],"px, ").concat(H[1],"px)")}if(M&&y&&!C)p.preventDefault(),_&&(a._selectEnd(c.startSelectedTargets,c.startPassedTargets,O,s,!0),c.preventDragFromInside=!0);else{c.selectFlag=!0;var X=a.options,J=X.scrollOptions,P=X.innerScrollOptions,W=!1;if(P){for(var Q=s.inputEvent,re=Q.target,ne=null,Y=re;Y&&Y!==wt(v).body;){var Z=getComputedStyle(Y).overflow!=="visible";if(Z){ne=Y;break}Y=Y.parentElement}ne&&(c.innerScrollOptions=et({container:ne,checkScrollEvent:!0},P===!0?{}:P),a.dragScroll.dragStart(s,c.innerScrollOptions),W=!0)}!W&&J&&J.container&&a.dragScroll.dragStart(s,J),M&&y&&C&&(c.selectFlag=!1,s.preventDrag())}return!0},a._onDrag=function(s){if(s.data.selectFlag){var d=a.scrollOptions,c=s.data.innerScrollOptions,f=c||(d==null?void 0:d.container);if(f&&!s.isScroll&&a.dragScroll.drag(s,c||d))return}a._checkSelected(s)},a._onDragEnd=function(s){var d=s.data,c=s.inputEvent,f=up(s,a.options.ratio),u=d.selectFlag,p=a.container;if(c&&a.emit("dragEnd",et(et({isDouble:!!s.isDouble,isClick:!!s.isClick,isDrag:!1,isSelect:u},s),{data:d.data,rect:f})),a.target.style.cssText+="display: none;",u)d.selectFlag=!1,a.dragScroll.dragEnd();else if(a.selectByClick&&a.clickBySelectEnd){var h=a._findElement((c==null?void 0:c.target)||sS(p,s.clientX,s.clientY),d.selectableTargets);a._select(h?[h]:[],f,s)}d.preventDragFromInside||a._selectEnd(d.startSelectedTargets,d.startPassedTargets,f,s)},a._onKeyDown=function(s){var d=a.options,c=!1;if(!a._keydownContinueSelect){var f=a._sameCombiKey(s,d.toggleContinueSelect);a._keydownContinueSelect=f,c||(c=f)}if(!a._keydownContinueSelectWithoutDeselection){var f=a._sameCombiKey(s,d.toggleContinueSelectWithoutDeselect);a._keydownContinueSelectWithoutDeselection=f,c||(c=f)}c&&a.emit("keydown",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection})},a._onKeyUp=function(s){var d=a.options,c=!1;if(a._keydownContinueSelect){var f=a._sameCombiKey(s,d.toggleContinueSelect,!0);a._keydownContinueSelect=!f,c||(c=f)}if(a._keydownContinueSelectWithoutDeselection){var f=a._sameCombiKey(s,d.toggleContinueSelectWithoutDeselect,!0);a._keydownContinueSelectWithoutDeselection=!f,c||(c=f)}c&&a.emit("keyup",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection})},a._onBlur=function(){(a._keydownContinueSelect||a._keydownContinueSelectWithoutDeselection)&&(a._keydownContinueSelect=!1,a._keydownContinueSelectWithoutDeselection=!1,a.emit("keyup",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection}))},a._onDocumentSelectStart=function(s){var d=wt(a.container);if(a.gesto.isFlag()){var c=a.dragContainer;c===At(a.container)&&(c=d.documentElement);var f=Vr(c)?[c]:[].slice.call(c),u=s.target;f.some(function(p){if(p===u||p.contains(u))return s.preventDefault(),!0})}},a.target=o.portalContainer;var i=o.container;a.options=et({className:"",portalContainer:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,clickBySelectEnd:!1,hitRate:100,continueSelect:!1,continueSelectWithoutDeselect:!1,toggleContinueSelect:null,toggleContinueSelectWithoutDeselect:null,keyContainer:null,scrollOptions:null,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,dragCondition:null,rootContainer:null,checkOverflow:!1,innerScrollOptions:!1,getElementRect:Xa,cspNonce:"",ratio:0},o);var l=a.options.portalContainer;return l&&(i=l.parentElement),a.container=i||document.body,a.initElement(),a.initDragScroll(),a.setKeyController(),a}var n=r.prototype;return n.setSelectedTargets=function(o){var a=this.selectedTargets,i=gn(a,o),l=i.added,s=i.removed,d=i.prevList,c=i.list;return this.selectedTargets=o,{added:l.map(function(f){return c[f]}),removed:s.map(function(f){return d[f]}),beforeSelected:a,selected:o}},n.setSelectedTargetsByPoints=function(o,a){var i=Math.min(o[0],a[0]),l=Math.min(o[1],a[1]),s=Math.max(o[0],a[0]),d=Math.max(o[1],a[1]),c={left:i,top:l,right:s,bottom:d,width:s-i,height:d-l},f={ignoreClick:!0};this.findSelectableTargets(f);var u=this.hitTest(c,f,!0,null),p=this.setSelectedTargets(u);return et(et({},p),{rect:c})},n.selectTargetsByPoints=function(o,a){var i=new MouseEvent("mousedown",{clientX:o[0],clientY:o[1],cancelable:!0,bubbles:!0}),l=new MouseEvent("mousemove",{clientX:a[0],clientY:a[1],cancelable:!0,bubbles:!0}),s=new MouseEvent("mousemove",{clientX:a[0],clientY:a[1],cancelable:!0,bubbles:!0}),d=this.gesto,c=d.onDragStart(i);c!==!1&&(d.onDrag(l),d.onDragEnd(s))},n.getSelectedTargets=function(){return this.selectedTargets},n.triggerDragStart=function(o){return this.gesto.triggerDragStart(o),this},n.destroy=function(){var o;this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),this.dragScroll.dragEnd(),We(document,"selectstart",this._onDocumentSelectStart),this.options.portalContainer||(o=this.target.parentElement)===null||o===void 0||o.removeChild(this.target),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},n.getElementPoints=function(o){var a=this.getElementRect||Xa,i=a(o),l=[i.pos1,i.pos2,i.pos4,i.pos3];if(a!==Xa){var s=o.getBoundingClientRect();return dl(l,s)}return l},n.getSelectableElements=function(){var o=this.container,a=[];return this.options.selectableTargets.forEach(function(i){if(la(i)){var l=i();l&&a.push.apply(a,[].slice.call(l))}else if(Vr(i))a.push(i);else if($t(i))a.push(i.value||i.current);else{var s=[].slice.call(wt(o).querySelectorAll(i));a.push.apply(a,s)}}),a},n.checkScroll=function(){if(this.gesto.isFlag()){var o=this.scrollOptions,a=this.gesto.getEventData().innerScrollOptions,i=a||(o==null?void 0:o.container);i&&this.dragScroll.checkScroll(et({inputEvent:this.gesto.getCurrentEvent()},a||o))}},n.findSelectableTargets=function(o){var a=this;o===void 0&&(o=this.gesto.getEventData());var i=this.getSelectableElements(),l=i.map(function(u){return a.getElementPoints(u)});o.selectableTargets=i,o.selectablePoints=l,o.selectableParentMap=null;var s=this.options,d=s.checkOverflow||s.innerScrollOptions,c=wt(this.container);if(d){var f=new Map;o.selectableInnerScrollParentMap=f,o.selectableInnerScrollPathsList=i.map(function(u,p){for(var h=u.parentElement,m=[],y=[],g=function(){var b=f.get(h);if(!b){var w=getComputedStyle(h).overflow!=="visible";if(w){var _=Xa(h);b={parentElement:h,indexes:[],points:[_.pos1,_.pos2,_.pos4,_.pos3],paths:Eo([],y,!0)},m.push(h),m.forEach(function(C){f.set(C,b)}),m=[]}}b?(h=b.parentElement,f.get(h).indexes.push(p),y.push(h)):m.push(h),h=h.parentElement};h&&h!==c.body;)g();return y})}return s.checkOverflow||(o.selectableInners=i.map(function(){return!0})),this._refreshGroups(o),i},n.clickTarget=function(o,a){var i=iS(o),l=i.clientX,s=i.clientY,d={data:{selectFlag:!1},clientX:l,clientY:s,inputEvent:o,isClick:!0,isTrusted:!1,stop:function(){return!1}};return this._onDragStart(d,a)&&this._onDragEnd(d),this},n.setKeyController=function(){var o=this.options,a=o.keyContainer,i=o.toggleContinueSelect,l=o.toggleContinueSelectWithoutDeselect;this.keycon&&(this.keycon.destroy(),this.keycon=null),(i||l)&&(this.keycon=new nS(a||At(this.container)),this.keycon.keydown(this._onKeyDown).keyup(this._onKeyUp).on("blur",this._onBlur))},n.setClassName=function(o){this.options.className=o,this.target.setAttribute("class","".concat(gp," ").concat(o||""))},n.setKeyEvent=function(){var o=this.options,a=o.toggleContinueSelect,i=o.toggleContinueSelectWithoutDeselect;!a&&!i||this.keycon||this.setKeyController()},n.setKeyContainer=function(o){var a=this,i=this.options;ms(i.keyContainer,o,function(){i.keyContainer=o,a.setKeyController()})},n.getContinueSelect=function(){var o=this.options,a=o.continueSelect,i=o.toggleContinueSelect;return!i||!this._keydownContinueSelect?a:!a},n.getContinueSelectWithoutDeselect=function(){var o=this.options,a=o.continueSelectWithoutDeselect,i=o.toggleContinueSelectWithoutDeselect;return!i||!this._keydownContinueSelectWithoutDeselection?a:!a},n.setToggleContinueSelect=function(o){var a=this,i=this.options;ms(i.toggleContinueSelect,o,function(){i.toggleContinueSelect=o,a.setKeyEvent()})},n.setToggleContinueSelectWithoutDeselect=function(o){var a=this,i=this.options;ms(i.toggleContinueSelectWithoutDeselect,o,function(){i.toggleContinueSelectWithoutDeselect=o,a.setKeyEvent()})},n.setPreventDefault=function(o){this.gesto.options.preventDefault=o},n.setCheckInput=function(o){this.gesto.options.checkInput=o},n.initElement=function(){var o=this.options,a=o.dragContainer,i=o.checkInput,l=o.preventDefault,s=o.preventClickEventOnDragStart,d=o.preventClickEventOnDrag,c=o.preventClickEventByCondition,f=o.preventRightClick,u=f===void 0?!0:f,p=o.className,h=this.container;this.target=fp(cS("div",{className:"".concat(gp," ").concat(p||"")}),this.target,h);var m=this.target;this.dragContainer=typeof a=="string"?[].slice.call(wt(h).querySelectorAll(a)):a||this.target.parentNode,this.gesto=new of(this.dragContainer,{checkWindowBlur:!0,container:At(h),checkInput:i,preventDefault:l,preventClickEventOnDragStart:s,preventClickEventOnDrag:d,preventClickEventByCondition:c,preventRightClick:u}).on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd}),Xe(document,"selectstart",this._onDocumentSelectStart),this.injectResult=mp.inject(m,{nonce:this.options.cspNonce})},n.hitTest=function(o,a,i,l){var s=this.options,d=s.hitRate,c=s.selectByClick,f=o.left,u=o.top,p=o.right,h=o.bottom,m=a.innerGroups,y=a.innerWidth,g=a.innerHeight,b=l==null?void 0:l.clientX,w=l==null?void 0:l.clientY,_=a.ignoreClick,C=[[f,u],[p,u],[p,h],[f,h]],S=function(z,M){var j=Pr(typeof d=="function"?"".concat(d(M)):"".concat(d)),F=_?!1:ya([b,w],z);if(!i&&c&&F)return!0;var G=pl(C,z);if(!G.length)return!1;var H=so(G),X=0;if(H===0&&so(z)===0?(X=hp(z),H=hp(G)):X=so(z),j.unit==="px")return H>=j.value;var J=ca(Math.round(H/X*100),0,100);return J>=Math.min(100,j.value)},x=a.selectableTargets,v=a.selectablePoints,V=a.selectableInners;if(!m)return x.filter(function(z,M){return V[M]?S(v[M],x[M]):!1});for(var $=[],B=Math.floor(f/y),R=Math.floor(p/y),T=Math.floor(u/g),k=Math.floor(h/g),O=B;O<=R;++O){var N=m[O];if(N)for(var D=T;D<=k;++D){var I=N[D];I&&I.forEach(function(z){var M=v[z],j=V[z],F=x[z];j&&S(M,F)&&$.push(F)})}}return lS($)},n.initDragScroll=function(){var o=this;this.dragScroll.on("scrollDrag",function(a){var i=a.next;i(o.gesto.getCurrentEvent())}).on("scroll",function(a){var i=a.container,l=a.direction,s=o.gesto.getEventData().innerScrollOptions;s?o.emit("innerScroll",{container:i,direction:l}):o.emit("scroll",{container:i,direction:l})}).on("move",function(a){var i=a.offsetX,l=a.offsetY,s=a.inputEvent,d=o.gesto;if(!(!d||!d.isFlag())){var c=o.gesto.getEventData(),f=c.boundArea;c.startX-=i,c.startY-=l;var u=o.gesto.getEventData().innerScrollOptions,p=u==null?void 0:u.container,h=!1;if(p){var m=c.selectableInnerScrollParentMap,y=m.get(p);y&&(y.paths.forEach(function(g){var b=m.get(g);b.points.forEach(function(w){w[0]-=i,w[1]-=l})}),y.indexes.forEach(function(g){c.selectablePoints[g].forEach(function(b){b[0]-=i,b[1]-=l})}),h=!0)}h||c.selectablePoints.forEach(function(g){g.forEach(function(b){b[0]-=i,b[1]-=l})}),o._refreshGroups(c),f.left-=i,f.right-=i,f.top-=l,f.bottom-=l,o.gesto.scrollBy(i,l,s.inputEvent),o._checkSelected(o.gesto.getCurrentEvent())}})},n._select=function(o,a,i,l,s){s===void 0&&(s=!1);var d=i.inputEvent,c=i.data,f=this.setSelectedTargets(o),u=gn(c.startSelectedTargets,o),p=u.added,h=u.removed,m=u.prevList,y=u.list,g={startSelected:m,startAdded:p.map(function(b){return y[b]}),startRemoved:h.map(function(b){return m[b]})};l&&this.emit("selectStart",et(et(et({},f),g),{rect:a,inputEvent:d,data:c.data,isTrusted:i.isTrusted,isDragStartEnd:s})),(f.added.length||f.removed.length)&&this.emit("select",et(et(et({},f),g),{rect:a,inputEvent:d,data:c.data,isTrusted:i.isTrusted,isDragStartEnd:s}))},n._selectEnd=function(o,a,i,l,s){s===void 0&&(s=!1);var d=l.inputEvent,c=l.isDouble,f=l.data,u=d&&d.type,p=u==="mousedown"||u==="touchstart",h=gn(o,this.selectedTargets),m=h.added,y=h.removed,g=h.prevList,b=h.list,w=gn(a,this.selectedTargets),_=w.added,C=w.removed,S=w.prevList,x=w.list;this.emit("selectEnd",{startSelected:o,beforeSelected:a,selected:this.selectedTargets,added:m.map(function(v){return b[v]}),removed:y.map(function(v){return g[v]}),afterAdded:_.map(function(v){return x[v]}),afterRemoved:C.map(function(v){return S[v]}),isDragStart:p&&s,isDragStartEnd:p&&s,isClick:!!l.isClick,isDouble:!!c,rect:i,inputEvent:d,data:f.data,isTrusted:l.isTrusted})},n._checkSelected=function(o,a){a===void 0&&(a=up(o,this.options.ratio));var i=o.data,l=a.top,s=a.left,d=a.width,c=a.height,f=i.selectFlag,u=i.containerX,p=i.containerY,h=i.scaleMatrix,m=ma(h,[s-u,l-p]),y=ma(h,[d,c]),g=[];if(f){this.target.style.cssText+="display: block;left:0px;top:0px;"+"transform: translate(".concat(m[0],"px, ").concat(m[1],"px);")+"width:".concat(y[0],"px;height:").concat(y[1],"px;");var b=this.hitTest(a,i,!0,o);g=pp(i.startPassedTargets,b,this.continueSelect&&this.continueSelectWithoutDeselect)}var w=this.emit("drag",et(et({},o),{data:i.data,isSelect:f,rect:a}));if(w===!1){this.target.style.cssText+="display: none;",o.stop();return}f&&this._select(g,a,o)},n._sameCombiKey=function(o,a,i){if(!a)return!1;var l=lp(o.inputEvent,o.key),s=[].concat(a),d=Ue(s[0])?s:[s];if(i){var c=o.key;return d.some(function(f){return f.some(function(u){return u===c})})}return d.some(function(f){return f.every(function(u){return l.indexOf(u)>-1})})},n._findElement=function(o,a){for(var i=o;i&&!(a.indexOf(i)>-1);)i=i.parentElement;return i},n._refreshGroups=function(o){var a,i=o.innerWidth,l=o.innerHeight,s=o.selectablePoints;if(this.options.checkOverflow){var d=(a=this.gesto.getEventData().innerScrollOptions)===null||a===void 0?void 0:a.container,c=o.selectableInnerScrollParentMap,f=o.selectableInnerScrollPathsList;o.selectableInners=f.map(function(h,m){var y=!1;return h.every(function(g){if(y)return!0;if(g===d)return y=!0,!0;var b=c.get(g);if(b){var w=s[m],_=b.points,C=pl(w,_);if(!C.length)return!1}return!0})})}if(!i||!l)o.innerGroups=null;else{var u=o.selectablePoints,p={};u.forEach(function(h,m){var y=1/0,g=-1/0,b=1/0,w=-1/0;h.forEach(function(S){var x=Math.floor(S[0]/i),v=Math.floor(S[1]/l);y=Math.min(x,y),g=Math.max(x,g),b=Math.min(v,b),w=Math.max(v,w)});for(var _=y;_<=g;++_)for(var C=b;C<=w;++C)p[_]=p[_]||{},p[_][C]=p[_][C]||[],p[_][C].push(m)}),o.innerGroups=p}},r=aS([Ri(yp,function(o,a){var i={enumerable:!0,configurable:!0,get:function(){return this.options[a]}},l=Fi("get ".concat(a));o[l]?i.get=function(){return this[l]()}:i.get=function(){return this.options[a]};var s=Fi("set ".concat(a));o[s]?i.set=function(d){this[s](d)}:i.set=function(d){this.options[a]=d},Object.defineProperty(o,a,i)})],r),r}(yn),fS=function(t){dp(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r}(dS);const uS=fS;function je(t){const r=e.ref(null),n=e.computed(()=>JSON.parse(JSON.stringify(t)));return e.watch(n,(o,a)=>{(o.w!==a.w||o.h!==a.h)&&e.unref(r).refreshLayoutSize()},{deep:!0}),{customRef:r}}var pS=typeof global=="object"&&global&&global.Object===Object&&global;const bp=pS;var hS=typeof self=="object"&&self&&self.Object===Object&&self,mS=bp||hS||Function("return this")();const Qr=mS;var gS=Qr.Symbol;const On=gS;var _p=Object.prototype,yS=_p.hasOwnProperty,bS=_p.toString,Vo=On?On.toStringTag:void 0;function _S(t){var r=yS.call(t,Vo),n=t[Vo];try{t[Vo]=void 0;var o=!0}catch{}var a=bS.call(t);return o&&(r?t[Vo]=n:delete t[Vo]),a}var wS=Object.prototype,CS=wS.toString;function SS(t){return CS.call(t)}var xS="[object Null]",vS="[object Undefined]",wp=On?On.toStringTag:void 0;function ko(t){return t==null?t===void 0?vS:xS:wp&&wp in Object(t)?_S(t):SS(t)}function en(t){return t!=null&&typeof t=="object"}var ES="[object Symbol]";function Cp(t){return typeof t=="symbol"||en(t)&&ko(t)==ES}function VS(t,r){for(var n=-1,o=t==null?0:t.length,a=Array(o);++n<o;)a[n]=r(t[n],n,t);return a}var kS=Array.isArray;const qa=kS;var NS=1/0,Sp=On?On.prototype:void 0,xp=Sp?Sp.toString:void 0;function vp(t){if(typeof t=="string")return t;if(qa(t))return VS(t,vp)+"";if(Cp(t))return xp?xp.call(t):"";var r=t+"";return r=="0"&&1/t==-NS?"-0":r}var $S=/\s/;function DS(t){for(var r=t.length;r--&&$S.test(t.charAt(r)););return r}var BS=/^\s+/;function TS(t){return t&&t.slice(0,DS(t)+1).replace(BS,"")}function lr(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var Ep=0/0,OS=/^[-+]0x[0-9a-f]+$/i,IS=/^0b[01]+$/i,zS=/^0o[0-7]+$/i,RS=parseInt;function gs(t){if(typeof t=="number")return t;if(Cp(t))return Ep;if(lr(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=lr(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=TS(t);var n=IS.test(t);return n||zS.test(t)?RS(t.slice(2),n?2:8):OS.test(t)?Ep:+t}var Vp=1/0,MS=17976931348623157e292;function ys(t){if(!t)return t===0?t:0;if(t=gs(t),t===Vp||t===-Vp){var r=t<0?-1:1;return r*MS}return t===t?t:0}function AS(t){var r=ys(t),n=r%1;return r===r?n?r-n:r:0}function bs(t){return t}var LS="[object AsyncFunction]",FS="[object Function]",jS="[object GeneratorFunction]",PS="[object Proxy]";function _s(t){if(!lr(t))return!1;var r=ko(t);return r==FS||r==jS||r==LS||r==PS}var US=Qr["__core-js_shared__"];const ws=US;var kp=function(){var t=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function WS(t){return!!kp&&kp in t}var GS=Function.prototype,HS=GS.toString;function YS(t){if(t!=null){try{return HS.call(t)}catch{}try{return t+""}catch{}}return""}var XS=/[\\^$.*+?()[\]{}|]/g,qS=/^\[object .+?Constructor\]$/,JS=Function.prototype,KS=Object.prototype,ZS=JS.toString,QS=KS.hasOwnProperty,ex=RegExp("^"+ZS.call(QS).replace(XS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tx(t){if(!lr(t)||WS(t))return!1;var r=_s(t)?ex:qS;return r.test(YS(t))}function rx(t,r){return t==null?void 0:t[r]}function Cs(t,r){var n=rx(t,r);return tx(n)?n:void 0}var Np=Object.create,nx=function(){function t(){}return function(r){if(!lr(r))return{};if(Np)return Np(r);t.prototype=r;var n=new t;return t.prototype=void 0,n}}();const ox=nx;function ax(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function ix(t,r){var n=-1,o=t.length;for(r||(r=Array(o));++n<o;)r[n]=t[n];return r}var lx=800,sx=16,cx=Date.now;function dx(t){var r=0,n=0;return function(){var o=cx(),a=sx-(o-n);if(n=o,a>0){if(++r>=lx)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}function fx(t){return function(){return t}}var ux=function(){try{var t=Cs(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Ja=ux;var px=Ja?function(t,r){return Ja(t,"toString",{configurable:!0,enumerable:!1,value:fx(r),writable:!0})}:bs,hx=dx(px);const mx=hx;var gx=9007199254740991,yx=/^(?:0|[1-9]\d*)$/;function $p(t,r){var n=typeof t;return r=r??gx,!!r&&(n=="number"||n!="symbol"&&yx.test(t))&&t>-1&&t%1==0&&t<r}function Ss(t,r,n){r=="__proto__"&&Ja?Ja(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}function Ka(t,r){return t===r||t!==t&&r!==r}var bx=Object.prototype,_x=bx.hasOwnProperty;function wx(t,r,n){var o=t[r];(!(_x.call(t,r)&&Ka(o,n))||n===void 0&&!(r in t))&&Ss(t,r,n)}function Cx(t,r,n,o){var a=!n;n||(n={});for(var i=-1,l=r.length;++i<l;){var s=r[i],d=o?o(n[s],t[s],s,n,t):void 0;d===void 0&&(d=t[s]),a?Ss(n,s,d):wx(n,s,d)}return n}var Dp=Math.max;function Sx(t,r,n){return r=Dp(r===void 0?t.length-1:r,0),function(){for(var o=arguments,a=-1,i=Dp(o.length-r,0),l=Array(i);++a<i;)l[a]=o[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=o[a];return s[r]=n(l),ax(t,this,s)}}function xx(t,r){return mx(Sx(t,r,bs),t+"")}var vx=9007199254740991;function Bp(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vx}function xs(t){return t!=null&&Bp(t.length)&&!_s(t)}function Tp(t,r,n){if(!lr(n))return!1;var o=typeof r;return(o=="number"?xs(n)&&$p(r,n.length):o=="string"&&r in n)?Ka(n[r],t):!1}function Ex(t){return xx(function(r,n){var o=-1,a=n.length,i=a>1?n[a-1]:void 0,l=a>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(a--,i):void 0,l&&Tp(n[0],n[1],l)&&(i=a<3?void 0:i,a=1),r=Object(r);++o<a;){var s=n[o];s&&t(r,s,o,i)}return r})}var Vx=Object.prototype;function Op(t){var r=t&&t.constructor,n=typeof r=="function"&&r.prototype||Vx;return t===n}function kx(t,r){for(var n=-1,o=Array(t);++n<t;)o[n]=r(n);return o}var Nx="[object Arguments]";function Ip(t){return en(t)&&ko(t)==Nx}var zp=Object.prototype,$x=zp.hasOwnProperty,Dx=zp.propertyIsEnumerable,Bx=Ip(function(){return arguments}())?Ip:function(t){return en(t)&&$x.call(t,"callee")&&!Dx.call(t,"callee")};const vs=Bx;function Tx(){return!1}var Rp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mp=Rp&&typeof module=="object"&&module&&!module.nodeType&&module,Ox=Mp&&Mp.exports===Rp,Ap=Ox?Qr.Buffer:void 0,Ix=Ap?Ap.isBuffer:void 0,zx=Ix||Tx;const Lp=zx;var Rx="[object Arguments]",Mx="[object Array]",Ax="[object Boolean]",Lx="[object Date]",Fx="[object Error]",jx="[object Function]",Px="[object Map]",Ux="[object Number]",Wx="[object Object]",Gx="[object RegExp]",Hx="[object Set]",Yx="[object String]",Xx="[object WeakMap]",qx="[object ArrayBuffer]",Jx="[object DataView]",Kx="[object Float32Array]",Zx="[object Float64Array]",Qx="[object Int8Array]",ev="[object Int16Array]",tv="[object Int32Array]",rv="[object Uint8Array]",nv="[object Uint8ClampedArray]",ov="[object Uint16Array]",av="[object Uint32Array]",Ae={};Ae[Kx]=Ae[Zx]=Ae[Qx]=Ae[ev]=Ae[tv]=Ae[rv]=Ae[nv]=Ae[ov]=Ae[av]=!0,Ae[Rx]=Ae[Mx]=Ae[qx]=Ae[Ax]=Ae[Jx]=Ae[Lx]=Ae[Fx]=Ae[jx]=Ae[Px]=Ae[Ux]=Ae[Wx]=Ae[Gx]=Ae[Hx]=Ae[Yx]=Ae[Xx]=!1;function iv(t){return en(t)&&Bp(t.length)&&!!Ae[ko(t)]}function lv(t){return function(r){return t(r)}}var Fp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,No=Fp&&typeof module=="object"&&module&&!module.nodeType&&module,sv=No&&No.exports===Fp,Es=sv&&bp.process,cv=function(){try{var t=No&&No.require&&No.require("util").types;return t||Es&&Es.binding&&Es.binding("util")}catch{}}();const jp=cv;var Pp=jp&&jp.isTypedArray,dv=Pp?lv(Pp):iv;const Up=dv;var fv=Object.prototype,uv=fv.hasOwnProperty;function pv(t,r){var n=qa(t),o=!n&&vs(t),a=!n&&!o&&Lp(t),i=!n&&!o&&!a&&Up(t),l=n||o||a||i,s=l?kx(t.length,String):[],d=s.length;for(var c in t)(r||uv.call(t,c))&&!(l&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$p(c,d)))&&s.push(c);return s}function hv(t,r){return function(n){return t(r(n))}}function mv(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}var gv=Object.prototype,yv=gv.hasOwnProperty;function bv(t){if(!lr(t))return mv(t);var r=Op(t),n=[];for(var o in t)o=="constructor"&&(r||!yv.call(t,o))||n.push(o);return n}function Wp(t){return xs(t)?pv(t,!0):bv(t)}var _v=Cs(Object,"create");const $o=_v;function wv(){this.__data__=$o?$o(null):{},this.size=0}function Cv(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Sv="__lodash_hash_undefined__",xv=Object.prototype,vv=xv.hasOwnProperty;function Ev(t){var r=this.__data__;if($o){var n=r[t];return n===Sv?void 0:n}return vv.call(r,t)?r[t]:void 0}var Vv=Object.prototype,kv=Vv.hasOwnProperty;function Nv(t){var r=this.__data__;return $o?r[t]!==void 0:kv.call(r,t)}var $v="__lodash_hash_undefined__";function Dv(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$o&&r===void 0?$v:r,this}function tn(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}tn.prototype.clear=wv,tn.prototype.delete=Cv,tn.prototype.get=Ev,tn.prototype.has=Nv,tn.prototype.set=Dv;function Bv(){this.__data__=[],this.size=0}function Za(t,r){for(var n=t.length;n--;)if(Ka(t[n][0],r))return n;return-1}var Tv=Array.prototype,Ov=Tv.splice;function Iv(t){var r=this.__data__,n=Za(r,t);if(n<0)return!1;var o=r.length-1;return n==o?r.pop():Ov.call(r,n,1),--this.size,!0}function zv(t){var r=this.__data__,n=Za(r,t);return n<0?void 0:r[n][1]}function Rv(t){return Za(this.__data__,t)>-1}function Mv(t,r){var n=this.__data__,o=Za(n,t);return o<0?(++this.size,n.push([t,r])):n[o][1]=r,this}function yr(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}yr.prototype.clear=Bv,yr.prototype.delete=Iv,yr.prototype.get=zv,yr.prototype.has=Rv,yr.prototype.set=Mv;var Av=Cs(Qr,"Map");const Gp=Av;function Lv(){this.size=0,this.__data__={hash:new tn,map:new(Gp||yr),string:new tn}}function Fv(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function Qa(t,r){var n=t.__data__;return Fv(r)?n[typeof r=="string"?"string":"hash"]:n.map}function jv(t){var r=Qa(this,t).delete(t);return this.size-=r?1:0,r}function Pv(t){return Qa(this,t).get(t)}function Uv(t){return Qa(this,t).has(t)}function Wv(t,r){var n=Qa(this,t),o=n.size;return n.set(t,r),this.size+=n.size==o?0:1,this}function In(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}In.prototype.clear=Lv,In.prototype.delete=jv,In.prototype.get=Pv,In.prototype.has=Uv,In.prototype.set=Wv;function Gv(t){return t==null?"":vp(t)}var Hv=hv(Object.getPrototypeOf,Object);const Hp=Hv;var Yv="[object Object]",Xv=Function.prototype,qv=Object.prototype,Yp=Xv.toString,Jv=qv.hasOwnProperty,Kv=Yp.call(Object);function Xp(t){if(!en(t)||ko(t)!=Yv)return!1;var r=Hp(t);if(r===null)return!0;var n=Jv.call(r,"constructor")&&r.constructor;return typeof n=="function"&&n instanceof n&&Yp.call(n)==Kv}var Zv="Expected a function";function Qv(t,r){var n;if(typeof r!="function")throw new TypeError(Zv);return t=AS(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}function eE(){this.__data__=new yr,this.size=0}function tE(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}function rE(t){return this.__data__.get(t)}function nE(t){return this.__data__.has(t)}var oE=200;function aE(t,r){var n=this.__data__;if(n instanceof yr){var o=n.__data__;if(!Gp||o.length<oE-1)return o.push([t,r]),this.size=++n.size,this;n=this.__data__=new In(o)}return n.set(t,r),this.size=n.size,this}function zn(t){var r=this.__data__=new yr(t);this.size=r.size}zn.prototype.clear=eE,zn.prototype.delete=tE,zn.prototype.get=rE,zn.prototype.has=nE,zn.prototype.set=aE;var qp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jp=qp&&typeof module=="object"&&module&&!module.nodeType&&module,iE=Jp&&Jp.exports===qp,Kp=iE?Qr.Buffer:void 0,Zp=Kp?Kp.allocUnsafe:void 0;function lE(t,r){if(r)return t.slice();var n=t.length,o=Zp?Zp(n):new t.constructor(n);return t.copy(o),o}var sE=Qr.Uint8Array;const Qp=sE;function cE(t){var r=new t.constructor(t.byteLength);return new Qp(r).set(new Qp(t)),r}function dE(t,r){var n=r?cE(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function fE(t){return typeof t.constructor=="function"&&!Op(t)?ox(Hp(t)):{}}function uE(t){return function(r,n,o){for(var a=-1,i=Object(r),l=o(r),s=l.length;s--;){var d=l[t?s:++a];if(n(i[d],d,i)===!1)break}return r}}var pE=uE();const hE=pE;var mE=function(){return Qr.Date.now()};const Vs=mE;var gE="Expected a function",yE=Math.max,bE=Math.min;function _E(t,r,n){var o,a,i,l,s,d,c=0,f=!1,u=!1,p=!0;if(typeof t!="function")throw new TypeError(gE);r=gs(r)||0,lr(n)&&(f=!!n.leading,u="maxWait"in n,i=u?yE(gs(n.maxWait)||0,r):i,p="trailing"in n?!!n.trailing:p);function h(x){var v=o,V=a;return o=a=void 0,c=x,l=t.apply(V,v),l}function m(x){return c=x,s=setTimeout(b,r),f?h(x):l}function y(x){var v=x-d,V=x-c,$=r-v;return u?bE($,i-V):$}function g(x){var v=x-d,V=x-c;return d===void 0||v>=r||v<0||u&&V>=i}function b(){var x=Vs();if(g(x))return w(x);s=setTimeout(b,y(x))}function w(x){return s=void 0,p&&o?h(x):(o=a=void 0,l)}function _(){s!==void 0&&clearTimeout(s),c=0,o=d=a=s=void 0}function C(){return s===void 0?l:w(Vs())}function S(){var x=Vs(),v=g(x);if(o=arguments,a=this,d=x,v){if(s===void 0)return m(d);if(u)return clearTimeout(s),s=setTimeout(b,r),h(d)}return s===void 0&&(s=setTimeout(b,r)),l}return S.cancel=_,S.flush=C,S}function ks(t,r,n){(n!==void 0&&!Ka(t[r],n)||n===void 0&&!(r in t))&&Ss(t,r,n)}function wE(t){return en(t)&&xs(t)}function Ns(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}function CE(t){return Cx(t,Wp(t))}function SE(t,r,n,o,a,i,l){var s=Ns(t,n),d=Ns(r,n),c=l.get(d);if(c){ks(t,n,c);return}var f=i?i(s,d,n+"",t,r,l):void 0,u=f===void 0;if(u){var p=qa(d),h=!p&&Lp(d),m=!p&&!h&&Up(d);f=d,p||h||m?qa(s)?f=s:wE(s)?f=ix(s):h?(u=!1,f=lE(d,!0)):m?(u=!1,f=dE(d,!0)):f=[]:Xp(d)||vs(d)?(f=s,vs(s)?f=CE(s):(!lr(s)||_s(s))&&(f=fE(d))):u=!1}u&&(l.set(d,f),a(f,d,o,i,l),l.delete(d)),ks(t,n,f)}function eh(t,r,n,o,a){t!==r&&hE(r,function(i,l){if(a||(a=new zn),lr(i))SE(t,r,l,n,eh,o,a);else{var s=o?o(Ns(t,l),i,l+"",t,r,a):void 0;s===void 0&&(s=i),ks(t,l,s)}},Wp)}function th(t){return en(t)&&t.nodeType===1&&!Xp(t)}function xE(t,r){for(var n,o=-1,a=t.length;++o<a;){var i=r(t[o]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var vE=Ex(function(t,r,n){eh(t,r,n)});const rh=vE;function EE(t){return Qv(2,t)}var VE=Math.floor,kE=Math.random;function NE(t,r){return t+VE(kE()*(r-t+1))}var $E=parseFloat,DE=Math.min,BE=Math.random;function nh(t,r,n){if(n&&typeof n!="boolean"&&Tp(t,r,n)&&(r=n=void 0),n===void 0&&(typeof r=="boolean"?(n=r,r=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&r===void 0?(t=0,r=1):(t=ys(t),r===void 0?(r=t,t=0):r=ys(r)),t>r){var o=t;t=r,r=o}if(n||t%1||r%1){var a=BE();return DE(t+a*(r-t+$E("1e-"+((a+"").length-1))),r)}return NE(t,r)}function oh(t){return t&&t.length?xE(t,bs):0}var TE=0;function ah(t){var r=++TE;return Gv(t)+r}function OE(t){const r=`[DataV - ${t}]`;return{info(...n){console.log(`${r} ${n.join(" ")}`)},warn(...n){console.warn(`${r} ${n.join(" ")}`)},error(...n){console.error(`${r} ${n.join(" ")}`)}}}const $s=OE("useResize");function IE(t,r){const n=new MutationObserver(r);return n.observe(t,{attributes:!0,attributeFilter:["class","style"],attributeOldValue:!0}),n}function zE(t,r){const{clientWidth:n=0,clientHeight:o=0}=t||{};t?(!n||!o)&&$s.warn("Component width or height is 0px, rendering abnormality may occur!"):$s.warn("Failed to get dom node, component rendering may be abnormal!"),r.width=n,r.height=o}function RE(t){return th(t)?t:th(t.$el)?t.$el:null}function Le(){const t=e.ref(),r=[],n=e.reactive({width:0,height:0}),o=()=>{zE(t.value,n)},a=_E(o,100),i=EE(l=>{const s=RE(l);if(!s){$s.error("Bind Component Dom Ref Failed!");return}t.value=s});return e.onMounted(()=>{o();const l=IE(t.value,a);window.addEventListener("resize",a),r.push(()=>{l.disconnect()},()=>{window.removeEventListener("resize",a)})}),e.onUnmounted(()=>{r.forEach(l=>l())}),{domSize:n,autoBindRef:i,refreshLayoutSize:o}}function Ie(t){const r=t;return r.install=function(n){n.component(r.displayName||r.name,t)},t}const ih=t=>t,ME=(t,r)=>{const n=Math.abs(t[0]-r[0]),o=Math.abs(t[1]-r[1]);return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))};function Ut(t,r=[]){return rh(t,r)}function Bt(){return{color:{type:ih(Array),default:()=>[]},backgroundColor:{type:String,default:"transparent"}}}function Tt(t,r=[]){return rh(t,r)}function AE(t){let r=t;const n={},o=u=>{var p;return(p=n[u])!=null?p:0},a=u=>{var p;n[u]=((p=n[u])!=null?p:0)+1},i=u=>{let p=n[u]-1;p<=0&&(p=0),n[u]=p},l=u=>{r=u},s=(u,p=!0)=>`${p?".":""}${r||""}${u}`,d=u=>s(u,!1),c=(u,p)=>{const h=s(p);return`.__STYLED__ {${u.toString()}}`.replaceAll(".__STYLED__",h)};function f(u){return p=>{const h=document.createElement("style"),m=g=>{h.innerHTML=c(p,g),document.querySelector("head").appendChild(h)},y=()=>document.querySelector("head").removeChild(h);return g=>{const b=u,w=ah("style");return e.defineComponent({setup(_,{slots:C}){e.onMounted(()=>{o(w)===0&&m(g),a(w)}),e.onUnmounted(()=>{i(w),o(w)===0&&y()});const S=s(g,!1);return()=>e.createVNode(b,e.mergeProps(_,{class:S}),{default:()=>{var x;return[(x=C==null?void 0:C.default)==null?void 0:x.call(C)]}})}})}}}return f.setClassNamePrefix=l,f.getClassNameForBind=d,f.span=f((u,{slots:p})=>e.createVNode("span",u,[p==null?void 0:p.default()])),f.div=f((u,{slots:p})=>e.createVNode("div",u,[p==null?void 0:p.default()])),f.img=f(u=>e.createVNode("img",u,null)),f.svg=f((u,{slots:p})=>e.createVNode("svg",u,[p==null?void 0:p.default()])),f}const LE="dv-",me=AE(LE),Ot=me.div`
381
+ `),gp="selecto-selection ".concat(mp.className),yp=["className","boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","continueSelectWithoutDeselect","toggleContinueSelect","toggleContinueSelectWithoutDeselect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside","rootContainer","dragCondition","clickBySelectEnd","checkOverflow","innerScrollOptions"];Eo(["dragContainer","cspNonce","preventClickEventOnDrag","preventClickEventOnDragStart","preventRightClick"],yp,!0);var dS=function(t){dp(r,t);function r(o){o===void 0&&(o={});var a=t.call(this)||this;a.selectedTargets=[],a.dragScroll=new Qd,a._onDragStart=function(s,d){var c=s.data,f=s.clientX,u=s.clientY,p=s.inputEvent,h=a.options,m=h.selectFromInside,y=h.selectByClick,g=h.rootContainer,b=h.boundContainer,w=h.preventDragFromInside,_=w===void 0?!0:w,C=h.clickBySelectEnd,S=h.dragCondition;if(S&&!S(s)){s.stop();return}c.data={};var x=At(a.container);c.innerWidth=x.innerWidth,c.innerHeight=x.innerHeight,a.findSelectableTargets(c),c.startSelectedTargets=a.selectedTargets,c.scaleMatrix=il(),c.containerX=0,c.containerY=0;var v=a.container,V={left:-1/0,top:-1/0,right:1/0,bottom:1/0};if(g){var $=a.container.getBoundingClientRect();c.containerX=$.left,c.containerY=$.top,c.scaleMatrix=U1(a.container,g)}if(b){var B=$t(b)&&"element"in b?tt({left:!0,top:!0,bottom:!0,right:!0},b):{element:b,left:!0,top:!0,bottom:!0,right:!0},R=B.element,T=void 0;if(R){at(R)?T=wt(v).querySelector(R):R===!0?T=a.container:T=R;var k=T.getBoundingClientRect();B.left&&(V.left=k.left),B.top&&(V.top=k.top),B.right&&(V.right=k.right),B.bottom&&(V.bottom=k.bottom)}}c.boundArea=V;var O={left:f,top:u,right:f,bottom:u,width:0,height:0},N=[],D=y&&!C,I=!1;if(!m||D){var z=a._findElement(d||p.target,c.selectableTargets);I=!!z,D&&(N=z?[z]:[])}var M=!m&&I;if(M&&!y)return s.stop(),!1;var j=p.type,F=j==="mousedown"||j==="touchstart",G=!s.isClick&&F?a.emit("dragStart",tt(tt({},s),{data:c.data})):!0;if(!G)return s.stop(),!1;if(a.continueSelect?(N=pp(a.selectedTargets,N,a.continueSelectWithoutDeselect),c.startPassedTargets=a.selectedTargets):c.startPassedTargets=[],a._select(N,O,s,!0,M&&y&&!C&&_),c.startX=f,c.startY=u,c.selectFlag=!1,c.preventDragFromInside=!1,p.target){var H=ma(c.scaleMatrix,[f-c.containerX,u-c.containerY]);a.target.style.cssText+="position: ".concat(g?"absolute":"fixed",";")+"left:0px;top:0px;"+"transform: translate(".concat(H[0],"px, ").concat(H[1],"px)")}if(M&&y&&!C)p.preventDefault(),_&&(a._selectEnd(c.startSelectedTargets,c.startPassedTargets,O,s,!0),c.preventDragFromInside=!0);else{c.selectFlag=!0;var X=a.options,J=X.scrollOptions,P=X.innerScrollOptions,W=!1;if(P){for(var Q=s.inputEvent,re=Q.target,ne=null,Y=re;Y&&Y!==wt(v).body;){var Z=getComputedStyle(Y).overflow!=="visible";if(Z){ne=Y;break}Y=Y.parentElement}ne&&(c.innerScrollOptions=tt({container:ne,checkScrollEvent:!0},P===!0?{}:P),a.dragScroll.dragStart(s,c.innerScrollOptions),W=!0)}!W&&J&&J.container&&a.dragScroll.dragStart(s,J),M&&y&&C&&(c.selectFlag=!1,s.preventDrag())}return!0},a._onDrag=function(s){if(s.data.selectFlag){var d=a.scrollOptions,c=s.data.innerScrollOptions,f=c||(d==null?void 0:d.container);if(f&&!s.isScroll&&a.dragScroll.drag(s,c||d))return}a._checkSelected(s)},a._onDragEnd=function(s){var d=s.data,c=s.inputEvent,f=up(s,a.options.ratio),u=d.selectFlag,p=a.container;if(c&&a.emit("dragEnd",tt(tt({isDouble:!!s.isDouble,isClick:!!s.isClick,isDrag:!1,isSelect:u},s),{data:d.data,rect:f})),a.target.style.cssText+="display: none;",u)d.selectFlag=!1,a.dragScroll.dragEnd();else if(a.selectByClick&&a.clickBySelectEnd){var h=a._findElement((c==null?void 0:c.target)||sS(p,s.clientX,s.clientY),d.selectableTargets);a._select(h?[h]:[],f,s)}d.preventDragFromInside||a._selectEnd(d.startSelectedTargets,d.startPassedTargets,f,s)},a._onKeyDown=function(s){var d=a.options,c=!1;if(!a._keydownContinueSelect){var f=a._sameCombiKey(s,d.toggleContinueSelect);a._keydownContinueSelect=f,c||(c=f)}if(!a._keydownContinueSelectWithoutDeselection){var f=a._sameCombiKey(s,d.toggleContinueSelectWithoutDeselect);a._keydownContinueSelectWithoutDeselection=f,c||(c=f)}c&&a.emit("keydown",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection})},a._onKeyUp=function(s){var d=a.options,c=!1;if(a._keydownContinueSelect){var f=a._sameCombiKey(s,d.toggleContinueSelect,!0);a._keydownContinueSelect=!f,c||(c=f)}if(a._keydownContinueSelectWithoutDeselection){var f=a._sameCombiKey(s,d.toggleContinueSelectWithoutDeselect,!0);a._keydownContinueSelectWithoutDeselection=!f,c||(c=f)}c&&a.emit("keyup",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection})},a._onBlur=function(){(a._keydownContinueSelect||a._keydownContinueSelectWithoutDeselection)&&(a._keydownContinueSelect=!1,a._keydownContinueSelectWithoutDeselection=!1,a.emit("keyup",{keydownContinueSelect:a._keydownContinueSelect,keydownContinueSelectWithoutDeselection:a._keydownContinueSelectWithoutDeselection}))},a._onDocumentSelectStart=function(s){var d=wt(a.container);if(a.gesto.isFlag()){var c=a.dragContainer;c===At(a.container)&&(c=d.documentElement);var f=Vr(c)?[c]:[].slice.call(c),u=s.target;f.some(function(p){if(p===u||p.contains(u))return s.preventDefault(),!0})}},a.target=o.portalContainer;var i=o.container;a.options=tt({className:"",portalContainer:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,clickBySelectEnd:!1,hitRate:100,continueSelect:!1,continueSelectWithoutDeselect:!1,toggleContinueSelect:null,toggleContinueSelectWithoutDeselect:null,keyContainer:null,scrollOptions:null,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,dragCondition:null,rootContainer:null,checkOverflow:!1,innerScrollOptions:!1,getElementRect:Xa,cspNonce:"",ratio:0},o);var l=a.options.portalContainer;return l&&(i=l.parentElement),a.container=i||document.body,a.initElement(),a.initDragScroll(),a.setKeyController(),a}var n=r.prototype;return n.setSelectedTargets=function(o){var a=this.selectedTargets,i=gn(a,o),l=i.added,s=i.removed,d=i.prevList,c=i.list;return this.selectedTargets=o,{added:l.map(function(f){return c[f]}),removed:s.map(function(f){return d[f]}),beforeSelected:a,selected:o}},n.setSelectedTargetsByPoints=function(o,a){var i=Math.min(o[0],a[0]),l=Math.min(o[1],a[1]),s=Math.max(o[0],a[0]),d=Math.max(o[1],a[1]),c={left:i,top:l,right:s,bottom:d,width:s-i,height:d-l},f={ignoreClick:!0};this.findSelectableTargets(f);var u=this.hitTest(c,f,!0,null),p=this.setSelectedTargets(u);return tt(tt({},p),{rect:c})},n.selectTargetsByPoints=function(o,a){var i=new MouseEvent("mousedown",{clientX:o[0],clientY:o[1],cancelable:!0,bubbles:!0}),l=new MouseEvent("mousemove",{clientX:a[0],clientY:a[1],cancelable:!0,bubbles:!0}),s=new MouseEvent("mousemove",{clientX:a[0],clientY:a[1],cancelable:!0,bubbles:!0}),d=this.gesto,c=d.onDragStart(i);c!==!1&&(d.onDrag(l),d.onDragEnd(s))},n.getSelectedTargets=function(){return this.selectedTargets},n.triggerDragStart=function(o){return this.gesto.triggerDragStart(o),this},n.destroy=function(){var o;this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),this.dragScroll.dragEnd(),We(document,"selectstart",this._onDocumentSelectStart),this.options.portalContainer||(o=this.target.parentElement)===null||o===void 0||o.removeChild(this.target),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},n.getElementPoints=function(o){var a=this.getElementRect||Xa,i=a(o),l=[i.pos1,i.pos2,i.pos4,i.pos3];if(a!==Xa){var s=o.getBoundingClientRect();return dl(l,s)}return l},n.getSelectableElements=function(){var o=this.container,a=[];return this.options.selectableTargets.forEach(function(i){if(la(i)){var l=i();l&&a.push.apply(a,[].slice.call(l))}else if(Vr(i))a.push(i);else if($t(i))a.push(i.value||i.current);else{var s=[].slice.call(wt(o).querySelectorAll(i));a.push.apply(a,s)}}),a},n.checkScroll=function(){if(this.gesto.isFlag()){var o=this.scrollOptions,a=this.gesto.getEventData().innerScrollOptions,i=a||(o==null?void 0:o.container);i&&this.dragScroll.checkScroll(tt({inputEvent:this.gesto.getCurrentEvent()},a||o))}},n.findSelectableTargets=function(o){var a=this;o===void 0&&(o=this.gesto.getEventData());var i=this.getSelectableElements(),l=i.map(function(u){return a.getElementPoints(u)});o.selectableTargets=i,o.selectablePoints=l,o.selectableParentMap=null;var s=this.options,d=s.checkOverflow||s.innerScrollOptions,c=wt(this.container);if(d){var f=new Map;o.selectableInnerScrollParentMap=f,o.selectableInnerScrollPathsList=i.map(function(u,p){for(var h=u.parentElement,m=[],y=[],g=function(){var b=f.get(h);if(!b){var w=getComputedStyle(h).overflow!=="visible";if(w){var _=Xa(h);b={parentElement:h,indexes:[],points:[_.pos1,_.pos2,_.pos4,_.pos3],paths:Eo([],y,!0)},m.push(h),m.forEach(function(C){f.set(C,b)}),m=[]}}b?(h=b.parentElement,f.get(h).indexes.push(p),y.push(h)):m.push(h),h=h.parentElement};h&&h!==c.body;)g();return y})}return s.checkOverflow||(o.selectableInners=i.map(function(){return!0})),this._refreshGroups(o),i},n.clickTarget=function(o,a){var i=iS(o),l=i.clientX,s=i.clientY,d={data:{selectFlag:!1},clientX:l,clientY:s,inputEvent:o,isClick:!0,isTrusted:!1,stop:function(){return!1}};return this._onDragStart(d,a)&&this._onDragEnd(d),this},n.setKeyController=function(){var o=this.options,a=o.keyContainer,i=o.toggleContinueSelect,l=o.toggleContinueSelectWithoutDeselect;this.keycon&&(this.keycon.destroy(),this.keycon=null),(i||l)&&(this.keycon=new nS(a||At(this.container)),this.keycon.keydown(this._onKeyDown).keyup(this._onKeyUp).on("blur",this._onBlur))},n.setClassName=function(o){this.options.className=o,this.target.setAttribute("class","".concat(gp," ").concat(o||""))},n.setKeyEvent=function(){var o=this.options,a=o.toggleContinueSelect,i=o.toggleContinueSelectWithoutDeselect;!a&&!i||this.keycon||this.setKeyController()},n.setKeyContainer=function(o){var a=this,i=this.options;ms(i.keyContainer,o,function(){i.keyContainer=o,a.setKeyController()})},n.getContinueSelect=function(){var o=this.options,a=o.continueSelect,i=o.toggleContinueSelect;return!i||!this._keydownContinueSelect?a:!a},n.getContinueSelectWithoutDeselect=function(){var o=this.options,a=o.continueSelectWithoutDeselect,i=o.toggleContinueSelectWithoutDeselect;return!i||!this._keydownContinueSelectWithoutDeselection?a:!a},n.setToggleContinueSelect=function(o){var a=this,i=this.options;ms(i.toggleContinueSelect,o,function(){i.toggleContinueSelect=o,a.setKeyEvent()})},n.setToggleContinueSelectWithoutDeselect=function(o){var a=this,i=this.options;ms(i.toggleContinueSelectWithoutDeselect,o,function(){i.toggleContinueSelectWithoutDeselect=o,a.setKeyEvent()})},n.setPreventDefault=function(o){this.gesto.options.preventDefault=o},n.setCheckInput=function(o){this.gesto.options.checkInput=o},n.initElement=function(){var o=this.options,a=o.dragContainer,i=o.checkInput,l=o.preventDefault,s=o.preventClickEventOnDragStart,d=o.preventClickEventOnDrag,c=o.preventClickEventByCondition,f=o.preventRightClick,u=f===void 0?!0:f,p=o.className,h=this.container;this.target=fp(cS("div",{className:"".concat(gp," ").concat(p||"")}),this.target,h);var m=this.target;this.dragContainer=typeof a=="string"?[].slice.call(wt(h).querySelectorAll(a)):a||this.target.parentNode,this.gesto=new of(this.dragContainer,{checkWindowBlur:!0,container:At(h),checkInput:i,preventDefault:l,preventClickEventOnDragStart:s,preventClickEventOnDrag:d,preventClickEventByCondition:c,preventRightClick:u}).on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd}),Xe(document,"selectstart",this._onDocumentSelectStart),this.injectResult=mp.inject(m,{nonce:this.options.cspNonce})},n.hitTest=function(o,a,i,l){var s=this.options,d=s.hitRate,c=s.selectByClick,f=o.left,u=o.top,p=o.right,h=o.bottom,m=a.innerGroups,y=a.innerWidth,g=a.innerHeight,b=l==null?void 0:l.clientX,w=l==null?void 0:l.clientY,_=a.ignoreClick,C=[[f,u],[p,u],[p,h],[f,h]],S=function(z,M){var j=Pr(typeof d=="function"?"".concat(d(M)):"".concat(d)),F=_?!1:ya([b,w],z);if(!i&&c&&F)return!0;var G=pl(C,z);if(!G.length)return!1;var H=so(G),X=0;if(H===0&&so(z)===0?(X=hp(z),H=hp(G)):X=so(z),j.unit==="px")return H>=j.value;var J=ca(Math.round(H/X*100),0,100);return J>=Math.min(100,j.value)},x=a.selectableTargets,v=a.selectablePoints,V=a.selectableInners;if(!m)return x.filter(function(z,M){return V[M]?S(v[M],x[M]):!1});for(var $=[],B=Math.floor(f/y),R=Math.floor(p/y),T=Math.floor(u/g),k=Math.floor(h/g),O=B;O<=R;++O){var N=m[O];if(N)for(var D=T;D<=k;++D){var I=N[D];I&&I.forEach(function(z){var M=v[z],j=V[z],F=x[z];j&&S(M,F)&&$.push(F)})}}return lS($)},n.initDragScroll=function(){var o=this;this.dragScroll.on("scrollDrag",function(a){var i=a.next;i(o.gesto.getCurrentEvent())}).on("scroll",function(a){var i=a.container,l=a.direction,s=o.gesto.getEventData().innerScrollOptions;s?o.emit("innerScroll",{container:i,direction:l}):o.emit("scroll",{container:i,direction:l})}).on("move",function(a){var i=a.offsetX,l=a.offsetY,s=a.inputEvent,d=o.gesto;if(!(!d||!d.isFlag())){var c=o.gesto.getEventData(),f=c.boundArea;c.startX-=i,c.startY-=l;var u=o.gesto.getEventData().innerScrollOptions,p=u==null?void 0:u.container,h=!1;if(p){var m=c.selectableInnerScrollParentMap,y=m.get(p);y&&(y.paths.forEach(function(g){var b=m.get(g);b.points.forEach(function(w){w[0]-=i,w[1]-=l})}),y.indexes.forEach(function(g){c.selectablePoints[g].forEach(function(b){b[0]-=i,b[1]-=l})}),h=!0)}h||c.selectablePoints.forEach(function(g){g.forEach(function(b){b[0]-=i,b[1]-=l})}),o._refreshGroups(c),f.left-=i,f.right-=i,f.top-=l,f.bottom-=l,o.gesto.scrollBy(i,l,s.inputEvent),o._checkSelected(o.gesto.getCurrentEvent())}})},n._select=function(o,a,i,l,s){s===void 0&&(s=!1);var d=i.inputEvent,c=i.data,f=this.setSelectedTargets(o),u=gn(c.startSelectedTargets,o),p=u.added,h=u.removed,m=u.prevList,y=u.list,g={startSelected:m,startAdded:p.map(function(b){return y[b]}),startRemoved:h.map(function(b){return m[b]})};l&&this.emit("selectStart",tt(tt(tt({},f),g),{rect:a,inputEvent:d,data:c.data,isTrusted:i.isTrusted,isDragStartEnd:s})),(f.added.length||f.removed.length)&&this.emit("select",tt(tt(tt({},f),g),{rect:a,inputEvent:d,data:c.data,isTrusted:i.isTrusted,isDragStartEnd:s}))},n._selectEnd=function(o,a,i,l,s){s===void 0&&(s=!1);var d=l.inputEvent,c=l.isDouble,f=l.data,u=d&&d.type,p=u==="mousedown"||u==="touchstart",h=gn(o,this.selectedTargets),m=h.added,y=h.removed,g=h.prevList,b=h.list,w=gn(a,this.selectedTargets),_=w.added,C=w.removed,S=w.prevList,x=w.list;this.emit("selectEnd",{startSelected:o,beforeSelected:a,selected:this.selectedTargets,added:m.map(function(v){return b[v]}),removed:y.map(function(v){return g[v]}),afterAdded:_.map(function(v){return x[v]}),afterRemoved:C.map(function(v){return S[v]}),isDragStart:p&&s,isDragStartEnd:p&&s,isClick:!!l.isClick,isDouble:!!c,rect:i,inputEvent:d,data:f.data,isTrusted:l.isTrusted})},n._checkSelected=function(o,a){a===void 0&&(a=up(o,this.options.ratio));var i=o.data,l=a.top,s=a.left,d=a.width,c=a.height,f=i.selectFlag,u=i.containerX,p=i.containerY,h=i.scaleMatrix,m=ma(h,[s-u,l-p]),y=ma(h,[d,c]),g=[];if(f){this.target.style.cssText+="display: block;left:0px;top:0px;"+"transform: translate(".concat(m[0],"px, ").concat(m[1],"px);")+"width:".concat(y[0],"px;height:").concat(y[1],"px;");var b=this.hitTest(a,i,!0,o);g=pp(i.startPassedTargets,b,this.continueSelect&&this.continueSelectWithoutDeselect)}var w=this.emit("drag",tt(tt({},o),{data:i.data,isSelect:f,rect:a}));if(w===!1){this.target.style.cssText+="display: none;",o.stop();return}f&&this._select(g,a,o)},n._sameCombiKey=function(o,a,i){if(!a)return!1;var l=lp(o.inputEvent,o.key),s=[].concat(a),d=Ue(s[0])?s:[s];if(i){var c=o.key;return d.some(function(f){return f.some(function(u){return u===c})})}return d.some(function(f){return f.every(function(u){return l.indexOf(u)>-1})})},n._findElement=function(o,a){for(var i=o;i&&!(a.indexOf(i)>-1);)i=i.parentElement;return i},n._refreshGroups=function(o){var a,i=o.innerWidth,l=o.innerHeight,s=o.selectablePoints;if(this.options.checkOverflow){var d=(a=this.gesto.getEventData().innerScrollOptions)===null||a===void 0?void 0:a.container,c=o.selectableInnerScrollParentMap,f=o.selectableInnerScrollPathsList;o.selectableInners=f.map(function(h,m){var y=!1;return h.every(function(g){if(y)return!0;if(g===d)return y=!0,!0;var b=c.get(g);if(b){var w=s[m],_=b.points,C=pl(w,_);if(!C.length)return!1}return!0})})}if(!i||!l)o.innerGroups=null;else{var u=o.selectablePoints,p={};u.forEach(function(h,m){var y=1/0,g=-1/0,b=1/0,w=-1/0;h.forEach(function(S){var x=Math.floor(S[0]/i),v=Math.floor(S[1]/l);y=Math.min(x,y),g=Math.max(x,g),b=Math.min(v,b),w=Math.max(v,w)});for(var _=y;_<=g;++_)for(var C=b;C<=w;++C)p[_]=p[_]||{},p[_][C]=p[_][C]||[],p[_][C].push(m)}),o.innerGroups=p}},r=aS([Ri(yp,function(o,a){var i={enumerable:!0,configurable:!0,get:function(){return this.options[a]}},l=Fi("get ".concat(a));o[l]?i.get=function(){return this[l]()}:i.get=function(){return this.options[a]};var s=Fi("set ".concat(a));o[s]?i.set=function(d){this[s](d)}:i.set=function(d){this.options[a]=d},Object.defineProperty(o,a,i)})],r),r}(yn),fS=function(t){dp(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r}(dS);const uS=fS;function je(t){const r=e.ref(null),n=e.computed(()=>JSON.parse(JSON.stringify(t)));return e.watch(n,(o,a)=>{(o.w!==a.w||o.h!==a.h)&&e.unref(r).refreshLayoutSize()},{deep:!0}),{customRef:r}}var pS=typeof global=="object"&&global&&global.Object===Object&&global;const bp=pS;var hS=typeof self=="object"&&self&&self.Object===Object&&self,mS=bp||hS||Function("return this")();const Qr=mS;var gS=Qr.Symbol;const On=gS;var _p=Object.prototype,yS=_p.hasOwnProperty,bS=_p.toString,Vo=On?On.toStringTag:void 0;function _S(t){var r=yS.call(t,Vo),n=t[Vo];try{t[Vo]=void 0;var o=!0}catch{}var a=bS.call(t);return o&&(r?t[Vo]=n:delete t[Vo]),a}var wS=Object.prototype,CS=wS.toString;function SS(t){return CS.call(t)}var xS="[object Null]",vS="[object Undefined]",wp=On?On.toStringTag:void 0;function ko(t){return t==null?t===void 0?vS:xS:wp&&wp in Object(t)?_S(t):SS(t)}function en(t){return t!=null&&typeof t=="object"}var ES="[object Symbol]";function Cp(t){return typeof t=="symbol"||en(t)&&ko(t)==ES}function VS(t,r){for(var n=-1,o=t==null?0:t.length,a=Array(o);++n<o;)a[n]=r(t[n],n,t);return a}var kS=Array.isArray;const qa=kS;var NS=1/0,Sp=On?On.prototype:void 0,xp=Sp?Sp.toString:void 0;function vp(t){if(typeof t=="string")return t;if(qa(t))return VS(t,vp)+"";if(Cp(t))return xp?xp.call(t):"";var r=t+"";return r=="0"&&1/t==-NS?"-0":r}var $S=/\s/;function DS(t){for(var r=t.length;r--&&$S.test(t.charAt(r)););return r}var BS=/^\s+/;function TS(t){return t&&t.slice(0,DS(t)+1).replace(BS,"")}function lr(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var Ep=0/0,OS=/^[-+]0x[0-9a-f]+$/i,IS=/^0b[01]+$/i,zS=/^0o[0-7]+$/i,RS=parseInt;function gs(t){if(typeof t=="number")return t;if(Cp(t))return Ep;if(lr(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=lr(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=TS(t);var n=IS.test(t);return n||zS.test(t)?RS(t.slice(2),n?2:8):OS.test(t)?Ep:+t}var Vp=1/0,MS=17976931348623157e292;function ys(t){if(!t)return t===0?t:0;if(t=gs(t),t===Vp||t===-Vp){var r=t<0?-1:1;return r*MS}return t===t?t:0}function AS(t){var r=ys(t),n=r%1;return r===r?n?r-n:r:0}function bs(t){return t}var LS="[object AsyncFunction]",FS="[object Function]",jS="[object GeneratorFunction]",PS="[object Proxy]";function _s(t){if(!lr(t))return!1;var r=ko(t);return r==FS||r==jS||r==LS||r==PS}var US=Qr["__core-js_shared__"];const ws=US;var kp=function(){var t=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function WS(t){return!!kp&&kp in t}var GS=Function.prototype,HS=GS.toString;function YS(t){if(t!=null){try{return HS.call(t)}catch{}try{return t+""}catch{}}return""}var XS=/[\\^$.*+?()[\]{}|]/g,qS=/^\[object .+?Constructor\]$/,JS=Function.prototype,KS=Object.prototype,ZS=JS.toString,QS=KS.hasOwnProperty,ex=RegExp("^"+ZS.call(QS).replace(XS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tx(t){if(!lr(t)||WS(t))return!1;var r=_s(t)?ex:qS;return r.test(YS(t))}function rx(t,r){return t==null?void 0:t[r]}function Cs(t,r){var n=rx(t,r);return tx(n)?n:void 0}var Np=Object.create,nx=function(){function t(){}return function(r){if(!lr(r))return{};if(Np)return Np(r);t.prototype=r;var n=new t;return t.prototype=void 0,n}}();const ox=nx;function ax(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function ix(t,r){var n=-1,o=t.length;for(r||(r=Array(o));++n<o;)r[n]=t[n];return r}var lx=800,sx=16,cx=Date.now;function dx(t){var r=0,n=0;return function(){var o=cx(),a=sx-(o-n);if(n=o,a>0){if(++r>=lx)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}function fx(t){return function(){return t}}var ux=function(){try{var t=Cs(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Ja=ux;var px=Ja?function(t,r){return Ja(t,"toString",{configurable:!0,enumerable:!1,value:fx(r),writable:!0})}:bs,hx=dx(px);const mx=hx;var gx=9007199254740991,yx=/^(?:0|[1-9]\d*)$/;function $p(t,r){var n=typeof t;return r=r??gx,!!r&&(n=="number"||n!="symbol"&&yx.test(t))&&t>-1&&t%1==0&&t<r}function Ss(t,r,n){r=="__proto__"&&Ja?Ja(t,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[r]=n}function Ka(t,r){return t===r||t!==t&&r!==r}var bx=Object.prototype,_x=bx.hasOwnProperty;function wx(t,r,n){var o=t[r];(!(_x.call(t,r)&&Ka(o,n))||n===void 0&&!(r in t))&&Ss(t,r,n)}function Cx(t,r,n,o){var a=!n;n||(n={});for(var i=-1,l=r.length;++i<l;){var s=r[i],d=o?o(n[s],t[s],s,n,t):void 0;d===void 0&&(d=t[s]),a?Ss(n,s,d):wx(n,s,d)}return n}var Dp=Math.max;function Sx(t,r,n){return r=Dp(r===void 0?t.length-1:r,0),function(){for(var o=arguments,a=-1,i=Dp(o.length-r,0),l=Array(i);++a<i;)l[a]=o[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=o[a];return s[r]=n(l),ax(t,this,s)}}function xx(t,r){return mx(Sx(t,r,bs),t+"")}var vx=9007199254740991;function Bp(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vx}function xs(t){return t!=null&&Bp(t.length)&&!_s(t)}function Tp(t,r,n){if(!lr(n))return!1;var o=typeof r;return(o=="number"?xs(n)&&$p(r,n.length):o=="string"&&r in n)?Ka(n[r],t):!1}function Ex(t){return xx(function(r,n){var o=-1,a=n.length,i=a>1?n[a-1]:void 0,l=a>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(a--,i):void 0,l&&Tp(n[0],n[1],l)&&(i=a<3?void 0:i,a=1),r=Object(r);++o<a;){var s=n[o];s&&t(r,s,o,i)}return r})}var Vx=Object.prototype;function Op(t){var r=t&&t.constructor,n=typeof r=="function"&&r.prototype||Vx;return t===n}function kx(t,r){for(var n=-1,o=Array(t);++n<t;)o[n]=r(n);return o}var Nx="[object Arguments]";function Ip(t){return en(t)&&ko(t)==Nx}var zp=Object.prototype,$x=zp.hasOwnProperty,Dx=zp.propertyIsEnumerable,Bx=Ip(function(){return arguments}())?Ip:function(t){return en(t)&&$x.call(t,"callee")&&!Dx.call(t,"callee")};const vs=Bx;function Tx(){return!1}var Rp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mp=Rp&&typeof module=="object"&&module&&!module.nodeType&&module,Ox=Mp&&Mp.exports===Rp,Ap=Ox?Qr.Buffer:void 0,Ix=Ap?Ap.isBuffer:void 0,zx=Ix||Tx;const Lp=zx;var Rx="[object Arguments]",Mx="[object Array]",Ax="[object Boolean]",Lx="[object Date]",Fx="[object Error]",jx="[object Function]",Px="[object Map]",Ux="[object Number]",Wx="[object Object]",Gx="[object RegExp]",Hx="[object Set]",Yx="[object String]",Xx="[object WeakMap]",qx="[object ArrayBuffer]",Jx="[object DataView]",Kx="[object Float32Array]",Zx="[object Float64Array]",Qx="[object Int8Array]",ev="[object Int16Array]",tv="[object Int32Array]",rv="[object Uint8Array]",nv="[object Uint8ClampedArray]",ov="[object Uint16Array]",av="[object Uint32Array]",Ae={};Ae[Kx]=Ae[Zx]=Ae[Qx]=Ae[ev]=Ae[tv]=Ae[rv]=Ae[nv]=Ae[ov]=Ae[av]=!0,Ae[Rx]=Ae[Mx]=Ae[qx]=Ae[Ax]=Ae[Jx]=Ae[Lx]=Ae[Fx]=Ae[jx]=Ae[Px]=Ae[Ux]=Ae[Wx]=Ae[Gx]=Ae[Hx]=Ae[Yx]=Ae[Xx]=!1;function iv(t){return en(t)&&Bp(t.length)&&!!Ae[ko(t)]}function lv(t){return function(r){return t(r)}}var Fp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,No=Fp&&typeof module=="object"&&module&&!module.nodeType&&module,sv=No&&No.exports===Fp,Es=sv&&bp.process,cv=function(){try{var t=No&&No.require&&No.require("util").types;return t||Es&&Es.binding&&Es.binding("util")}catch{}}();const jp=cv;var Pp=jp&&jp.isTypedArray,dv=Pp?lv(Pp):iv;const Up=dv;var fv=Object.prototype,uv=fv.hasOwnProperty;function pv(t,r){var n=qa(t),o=!n&&vs(t),a=!n&&!o&&Lp(t),i=!n&&!o&&!a&&Up(t),l=n||o||a||i,s=l?kx(t.length,String):[],d=s.length;for(var c in t)(r||uv.call(t,c))&&!(l&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$p(c,d)))&&s.push(c);return s}function hv(t,r){return function(n){return t(r(n))}}function mv(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}var gv=Object.prototype,yv=gv.hasOwnProperty;function bv(t){if(!lr(t))return mv(t);var r=Op(t),n=[];for(var o in t)o=="constructor"&&(r||!yv.call(t,o))||n.push(o);return n}function Wp(t){return xs(t)?pv(t,!0):bv(t)}var _v=Cs(Object,"create");const $o=_v;function wv(){this.__data__=$o?$o(null):{},this.size=0}function Cv(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Sv="__lodash_hash_undefined__",xv=Object.prototype,vv=xv.hasOwnProperty;function Ev(t){var r=this.__data__;if($o){var n=r[t];return n===Sv?void 0:n}return vv.call(r,t)?r[t]:void 0}var Vv=Object.prototype,kv=Vv.hasOwnProperty;function Nv(t){var r=this.__data__;return $o?r[t]!==void 0:kv.call(r,t)}var $v="__lodash_hash_undefined__";function Dv(t,r){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$o&&r===void 0?$v:r,this}function tn(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}tn.prototype.clear=wv,tn.prototype.delete=Cv,tn.prototype.get=Ev,tn.prototype.has=Nv,tn.prototype.set=Dv;function Bv(){this.__data__=[],this.size=0}function Za(t,r){for(var n=t.length;n--;)if(Ka(t[n][0],r))return n;return-1}var Tv=Array.prototype,Ov=Tv.splice;function Iv(t){var r=this.__data__,n=Za(r,t);if(n<0)return!1;var o=r.length-1;return n==o?r.pop():Ov.call(r,n,1),--this.size,!0}function zv(t){var r=this.__data__,n=Za(r,t);return n<0?void 0:r[n][1]}function Rv(t){return Za(this.__data__,t)>-1}function Mv(t,r){var n=this.__data__,o=Za(n,t);return o<0?(++this.size,n.push([t,r])):n[o][1]=r,this}function yr(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}yr.prototype.clear=Bv,yr.prototype.delete=Iv,yr.prototype.get=zv,yr.prototype.has=Rv,yr.prototype.set=Mv;var Av=Cs(Qr,"Map");const Gp=Av;function Lv(){this.size=0,this.__data__={hash:new tn,map:new(Gp||yr),string:new tn}}function Fv(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function Qa(t,r){var n=t.__data__;return Fv(r)?n[typeof r=="string"?"string":"hash"]:n.map}function jv(t){var r=Qa(this,t).delete(t);return this.size-=r?1:0,r}function Pv(t){return Qa(this,t).get(t)}function Uv(t){return Qa(this,t).has(t)}function Wv(t,r){var n=Qa(this,t),o=n.size;return n.set(t,r),this.size+=n.size==o?0:1,this}function In(t){var r=-1,n=t==null?0:t.length;for(this.clear();++r<n;){var o=t[r];this.set(o[0],o[1])}}In.prototype.clear=Lv,In.prototype.delete=jv,In.prototype.get=Pv,In.prototype.has=Uv,In.prototype.set=Wv;function Gv(t){return t==null?"":vp(t)}var Hv=hv(Object.getPrototypeOf,Object);const Hp=Hv;var Yv="[object Object]",Xv=Function.prototype,qv=Object.prototype,Yp=Xv.toString,Jv=qv.hasOwnProperty,Kv=Yp.call(Object);function Xp(t){if(!en(t)||ko(t)!=Yv)return!1;var r=Hp(t);if(r===null)return!0;var n=Jv.call(r,"constructor")&&r.constructor;return typeof n=="function"&&n instanceof n&&Yp.call(n)==Kv}var Zv="Expected a function";function Qv(t,r){var n;if(typeof r!="function")throw new TypeError(Zv);return t=AS(t),function(){return--t>0&&(n=r.apply(this,arguments)),t<=1&&(r=void 0),n}}function eE(){this.__data__=new yr,this.size=0}function tE(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}function rE(t){return this.__data__.get(t)}function nE(t){return this.__data__.has(t)}var oE=200;function aE(t,r){var n=this.__data__;if(n instanceof yr){var o=n.__data__;if(!Gp||o.length<oE-1)return o.push([t,r]),this.size=++n.size,this;n=this.__data__=new In(o)}return n.set(t,r),this.size=n.size,this}function zn(t){var r=this.__data__=new yr(t);this.size=r.size}zn.prototype.clear=eE,zn.prototype.delete=tE,zn.prototype.get=rE,zn.prototype.has=nE,zn.prototype.set=aE;var qp=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jp=qp&&typeof module=="object"&&module&&!module.nodeType&&module,iE=Jp&&Jp.exports===qp,Kp=iE?Qr.Buffer:void 0,Zp=Kp?Kp.allocUnsafe:void 0;function lE(t,r){if(r)return t.slice();var n=t.length,o=Zp?Zp(n):new t.constructor(n);return t.copy(o),o}var sE=Qr.Uint8Array;const Qp=sE;function cE(t){var r=new t.constructor(t.byteLength);return new Qp(r).set(new Qp(t)),r}function dE(t,r){var n=r?cE(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function fE(t){return typeof t.constructor=="function"&&!Op(t)?ox(Hp(t)):{}}function uE(t){return function(r,n,o){for(var a=-1,i=Object(r),l=o(r),s=l.length;s--;){var d=l[t?s:++a];if(n(i[d],d,i)===!1)break}return r}}var pE=uE();const hE=pE;var mE=function(){return Qr.Date.now()};const Vs=mE;var gE="Expected a function",yE=Math.max,bE=Math.min;function _E(t,r,n){var o,a,i,l,s,d,c=0,f=!1,u=!1,p=!0;if(typeof t!="function")throw new TypeError(gE);r=gs(r)||0,lr(n)&&(f=!!n.leading,u="maxWait"in n,i=u?yE(gs(n.maxWait)||0,r):i,p="trailing"in n?!!n.trailing:p);function h(x){var v=o,V=a;return o=a=void 0,c=x,l=t.apply(V,v),l}function m(x){return c=x,s=setTimeout(b,r),f?h(x):l}function y(x){var v=x-d,V=x-c,$=r-v;return u?bE($,i-V):$}function g(x){var v=x-d,V=x-c;return d===void 0||v>=r||v<0||u&&V>=i}function b(){var x=Vs();if(g(x))return w(x);s=setTimeout(b,y(x))}function w(x){return s=void 0,p&&o?h(x):(o=a=void 0,l)}function _(){s!==void 0&&clearTimeout(s),c=0,o=d=a=s=void 0}function C(){return s===void 0?l:w(Vs())}function S(){var x=Vs(),v=g(x);if(o=arguments,a=this,d=x,v){if(s===void 0)return m(d);if(u)return clearTimeout(s),s=setTimeout(b,r),h(d)}return s===void 0&&(s=setTimeout(b,r)),l}return S.cancel=_,S.flush=C,S}function ks(t,r,n){(n!==void 0&&!Ka(t[r],n)||n===void 0&&!(r in t))&&Ss(t,r,n)}function wE(t){return en(t)&&xs(t)}function Ns(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}function CE(t){return Cx(t,Wp(t))}function SE(t,r,n,o,a,i,l){var s=Ns(t,n),d=Ns(r,n),c=l.get(d);if(c){ks(t,n,c);return}var f=i?i(s,d,n+"",t,r,l):void 0,u=f===void 0;if(u){var p=qa(d),h=!p&&Lp(d),m=!p&&!h&&Up(d);f=d,p||h||m?qa(s)?f=s:wE(s)?f=ix(s):h?(u=!1,f=lE(d,!0)):m?(u=!1,f=dE(d,!0)):f=[]:Xp(d)||vs(d)?(f=s,vs(s)?f=CE(s):(!lr(s)||_s(s))&&(f=fE(d))):u=!1}u&&(l.set(d,f),a(f,d,o,i,l),l.delete(d)),ks(t,n,f)}function eh(t,r,n,o,a){t!==r&&hE(r,function(i,l){if(a||(a=new zn),lr(i))SE(t,r,l,n,eh,o,a);else{var s=o?o(Ns(t,l),i,l+"",t,r,a):void 0;s===void 0&&(s=i),ks(t,l,s)}},Wp)}function th(t){return en(t)&&t.nodeType===1&&!Xp(t)}function xE(t,r){for(var n,o=-1,a=t.length;++o<a;){var i=r(t[o]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var vE=Ex(function(t,r,n){eh(t,r,n)});const rh=vE;function EE(t){return Qv(2,t)}var VE=Math.floor,kE=Math.random;function NE(t,r){return t+VE(kE()*(r-t+1))}var $E=parseFloat,DE=Math.min,BE=Math.random;function nh(t,r,n){if(n&&typeof n!="boolean"&&Tp(t,r,n)&&(r=n=void 0),n===void 0&&(typeof r=="boolean"?(n=r,r=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&r===void 0?(t=0,r=1):(t=ys(t),r===void 0?(r=t,t=0):r=ys(r)),t>r){var o=t;t=r,r=o}if(n||t%1||r%1){var a=BE();return DE(t+a*(r-t+$E("1e-"+((a+"").length-1))),r)}return NE(t,r)}function oh(t){return t&&t.length?xE(t,bs):0}var TE=0;function ah(t){var r=++TE;return Gv(t)+r}function OE(t){const r=`[DataV - ${t}]`;return{info(...n){console.log(`${r} ${n.join(" ")}`)},warn(...n){console.warn(`${r} ${n.join(" ")}`)},error(...n){console.error(`${r} ${n.join(" ")}`)}}}const $s=OE("useResize");function IE(t,r){const n=new MutationObserver(r);return n.observe(t,{attributes:!0,attributeFilter:["class","style"],attributeOldValue:!0}),n}function zE(t,r){const{clientWidth:n=0,clientHeight:o=0}=t||{};t?(!n||!o)&&$s.warn("Component width or height is 0px, rendering abnormality may occur!"):$s.warn("Failed to get dom node, component rendering may be abnormal!"),r.width=n,r.height=o}function RE(t){return th(t)?t:th(t.$el)?t.$el:null}function Le(){const t=e.ref(),r=[],n=e.reactive({width:0,height:0}),o=()=>{zE(t.value,n)},a=_E(o,100),i=EE(l=>{const s=RE(l);if(!s){$s.error("Bind Component Dom Ref Failed!");return}t.value=s});return e.onMounted(()=>{o();const l=IE(t.value,a);window.addEventListener("resize",a),r.push(()=>{l.disconnect()},()=>{window.removeEventListener("resize",a)})}),e.onUnmounted(()=>{r.forEach(l=>l())}),{domSize:n,autoBindRef:i,refreshLayoutSize:o}}function Ie(t){const r=t;return r.install=function(n){n.component(r.displayName||r.name,t)},t}const ih=t=>t,ME=(t,r)=>{const n=Math.abs(t[0]-r[0]),o=Math.abs(t[1]-r[1]);return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))};function Ut(t,r=[]){return rh(t,r)}function Bt(){return{color:{type:ih(Array),default:()=>[]},backgroundColor:{type:String,default:"transparent"}}}function Tt(t,r=[]){return rh(t,r)}function AE(t){let r=t;const n={},o=u=>{var p;return(p=n[u])!=null?p:0},a=u=>{var p;n[u]=((p=n[u])!=null?p:0)+1},i=u=>{let p=n[u]-1;p<=0&&(p=0),n[u]=p},l=u=>{r=u},s=(u,p=!0)=>`${p?".":""}${r||""}${u}`,d=u=>s(u,!1),c=(u,p)=>{const h=s(p);return`.__STYLED__ {${u.toString()}}`.replaceAll(".__STYLED__",h)};function f(u){return p=>{const h=document.createElement("style"),m=g=>{h.innerHTML=c(p,g),document.querySelector("head").appendChild(h)},y=()=>document.querySelector("head").removeChild(h);return g=>{const b=u,w=ah("style");return e.defineComponent({setup(_,{slots:C}){e.onMounted(()=>{o(w)===0&&m(g),a(w)}),e.onUnmounted(()=>{i(w),o(w)===0&&y()});const S=s(g,!1);return()=>e.createVNode(b,e.mergeProps(_,{class:S}),{default:()=>{var x;return[(x=C==null?void 0:C.default)==null?void 0:x.call(C)]}})}})}}}return f.setClassNamePrefix=l,f.getClassNameForBind=d,f.span=f((u,{slots:p})=>e.createVNode("span",u,[p==null?void 0:p.default()])),f.div=f((u,{slots:p})=>e.createVNode("div",u,[p==null?void 0:p.default()])),f.img=f(u=>e.createVNode("img",u,null)),f.svg=f((u,{slots:p})=>e.createVNode("svg",u,[p==null?void 0:p.default()])),f}const LE="dv-",me=AE(LE),Ot=me.div`
382
382
  position: relative;
383
383
  width: 100%;
384
384
  height: 100%;
@@ -875,7 +875,7 @@ ${u} div ,${u} span,${u} a,${u} * {
875
875
  <body>
876
876
  ${(y=document.getElementById("preview-content"))==null?void 0:y.innerHTML}
877
877
  </body>
878
- </html>`,m=new Blob([h],{type:"application/msword;charset=utf-8"});JD.saveAs(m,`${e.unref(s).filename}.doc`),l.value=!1},f=e.ref(""),u=async()=>{await new Promise(async h=>{var m;f.value=document.title,document.title=e.unref(s).filename,(m=document.getElementById("printButton"))==null||m.click(),l.value=!1,h(!0)})};return r({init:async(h,m)=>{const y=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 1)",customClass:"preview-loading"});s.value={type:h,content:m.reportContent,filename:m.reportName},await new Promise(b=>{setTimeout(()=>{l.value=!0,b(!0)},100)});const g=[];e.nextTick(async()=>{const b=document.getElementById("preview-content");(function v(V){V.forEach($=>{g.push($),$.childNodes&&v($.childNodes)})})(b.childNodes);const w=await De(n).listIndicatorsApply({reportId:m.id},!1),_=g.filter(v=>v.className==="editor-indicator"),C=[...new Set(_.map(v=>v.dataset.id))],S=await De(n).mapEchartsData(C.toString(),!1),x=[];for(let v=0;v<_.length;v+=1){const V=_[v],$=w.data.find(B=>B.id==V.dataset.id);if(V.dataset.charttype==7){$.indicatorsType=="MODEL_INDICATORS"?(await o($.indicatorsId??$.id,$.echartsType,$.formConfJson),_[v].innerHTML=a(_[v].getAttribute("data-singleValueKey"))):_[v].innerHTML=S.data[V.dataset.id].config;const B=_[v].getAttribute("data-fontsize"),R=_[v].getAttribute("data-bold"),T=_[v].getAttribute("data-color");B&&(_[v].style.fontSize=B),R&&(_[v].style.fontWeight=R=="true"?"bold":"normal"),T&&(_[v].style.color=T)}else{const B=_[v].getAttribute("data-width")||400;let R=i(($==null?void 0:$.coverUrl)||_[v].getAttribute("data-src"));if(x.includes(R))continue;R&&await new Promise(T=>{const k=new Image;k.src=R,k.crossOrigin="anonymous",k.onload=()=>{const O=document.createElement("canvas");O.width=k.width,O.height=k.height,O.getContext("2d").drawImage(k,0,0,k.width,k.height),x.push(R),R=O.toDataURL("image/png"),T(!0)},k.onerror=()=>{T(!0)}}),_[v].innerHTML=`<img width=${B} src="${R}" crossorigin="anonymous" />`}}h==="DOWNLOAD_WORD"&&c(),h==="DOWNLOAD_PDF"&&await u(),setTimeout(()=>y.close(),100)})}}),(h,m)=>{const y=e.resolveComponent("AppDrawer"),g=e.resolveDirective("print");return e.openBlock(),e.createBlock(y,{modelValue:e.unref(l),"onUpdate:modelValue":m[1]||(m[1]=b=>e.isRef(l)?l.value=b:null),withHeader:!1,size:"100%"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:"preview-content",class:e.normalizeClass(e.unref(s).type),innerHTML:e.unref(s).content},null,10,KD),e.createElementVNode("i",{class:"ri-close-line ri-2x fixed right-5 top-5 text-color-danger cursor-pointer",onClick:m[0]||(m[0]=b=>l.value=!1)}),e.unref(s).type=="DOWNLOAD_PDF"?e.withDirectives((e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,id:"printButton",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(" 导出PDF ")]),_:1})),[[g,e.unref(d)]]):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])}}}),$R="",ZD={class:"mt-3"},QD={class:"mt-3"},eB={class:"menu-title"},tB={key:0,class:"badge"},rB=e.defineComponent({__name:"designLeft",emits:["click","success"],setup(t,{expose:r,emit:n}){const o=e.ref([]),a=e.ref(""),i=n,{proxy:l}=e.getCurrentInstance();De(l).listReportIndicatorsMenu({}).then(f=>{o.value=Object.keys(f.data).map(u=>({name:u,children:f.data[u]})),i("success")});const s=(f,u)=>{i("click",f,u)},d=f=>{f.id&&s("add",f)},c=(f,u)=>f?u.name.includes(f):!0;return r({list:o}),(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"指标库"}),e.createElementVNode("div",ZD,[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"请输入指标名称"},null,8,["modelValue"])]),e.createElementVNode("div",QD,[e.createVNode(e.unref(E.ElTree),{ref:"tree",data:e.unref(o),"default-expand-all":"","highlight-current":!0,"filter-node-method":c,indent:0,onNodeClick:d},{default:e.withCtx(({node:h,data:m})=>[e.createElementVNode("div",eB,[m.count?(e.openBlock(),e.createElementBlock("span",tB,[e.createTextVNode(e.toDisplayString(m.title||m.name)+" ",1),e.createElementVNode("span",null,e.toDisplayString(m.count),1)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"font-bold":h.level==1})},e.toDisplayString(m.title||m.name),3)),m.children?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:2,type:"primary",onClick:e.withModifiers(y=>s("add",m),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(" 配置 ")]),_:2},1032,["onClick"]))])]),_:1},8,["data"])])],64)}}}),DR="",nB=Be(rB,[["__scopeId","data-v-07266c39"]]),_r=t=>(e.pushScopeId("data-v-884e5eeb"),t=t(),e.popScopeId(),t),oB={class:"p-3 overflow-hidden h-full w-full flex-col flex items-start"},aB={class:"mt-3 mb-3 flex items-center whitespace-nowrap w-full"},iB=_r(()=>e.createElementVNode("span",{class:"mr-3"},"报告名称:",-1)),lB={class:"w-80"},sB={class:"flex-1 items-center justify-end flex"},cB=_r(()=>e.createElementVNode("i",{class:"ri-book-open-line mr-2"},null,-1)),dB=_r(()=>e.createElementVNode("i",{class:"ri-file-pdf-line ml-3 mr-2"},null,-1)),fB=_r(()=>e.createElementVNode("i",{class:"ri-file-word-line ml-3 mr-2"},null,-1)),uB={class:"editor flex-1 w-full h-full overflow-hidden relative",style:{border:"1px solid #eee"}},pB={key:0,class:"indicator-toolbar"},hB=_r(()=>e.createElementVNode("span",{class:"mr-2"},"字体大小:",-1)),mB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),gB=_r(()=>e.createElementVNode("span",{class:"ml-2"},"加粗:",-1)),yB={class:"ml-2 cursor-pointer"},bB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),_B=_r(()=>e.createElementVNode("span",{class:"ml-2"},"字体颜色:",-1)),wB={class:"ml-2"},um="simple",CB=e.defineComponent({__name:"designMain",props:{reportObj:{default:{}},editorRef:{default:null},modelValue:{default:""}},emits:["update:modelValue","editor-success"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref({fontSize:"",bold:!1,color:""}),l=e.ref({}),s=[{value:"12px"},{value:"14px"},{value:"16px"},{value:"18px"},{value:"20px"},{value:"22px"},{value:"24px"}],d={excludeKeys:["code","codeSelectLang","codeBlock","insertVideo","uploadVideo","editVideoSize","insertImage","header3","fullScreen"],insertKeys:{index:5,keys:["fontSize"]}},c={placeholder:"请输入内容...",EXTEND_CONF:{indicatorConfig:{clickIndicator:(p,h)=>{o("update:modelValue",p),l.value=h,i.value={fontSize:h.fontSize,bold:h.bold=="true",color:h.color||""};const m=document.getElementById(p);m&&(document.getElementById("useReportcontainer").scrollTop=m.offsetTop-20)}}}},f=(p,h)=>{const m={[p]:String(h)};tt.SlateTransforms.setNodes(n.editorRef,m,{at:tt.DomEditor.findPath(n.editorRef,e.unref(l))})},u=p=>{o("editor-success",p)};return(p,h)=>{var y;const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock("div",oB,[e.createVNode(m,{title:"指标报告撰写",class:"w-full"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3}),e.createElementVNode("div",aB,[iB,e.createElementVNode("div",lB,[e.createVNode(e.unref(E.ElInput),{modelValue:p.reportObj.reportName,"onUpdate:modelValue":h[0]||(h[0]=g=>p.reportObj.reportName=g),placeholder:"请输入报告名称"},null,8,["modelValue"])]),e.createElementVNode("div",sB,[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[1]||(h[1]=g=>e.unref(a).$baseEventBus.emit("editor","PREVIEW"))},{default:e.withCtx(()=>[cB,e.createTextVNode(" 预览 ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[2]||(h[2]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_PDF"))},{default:e.withCtx(()=>[dB,e.createTextVNode(" 导出pdf ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[3]||(h[3]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_WORD"))},{default:e.withCtx(()=>[fB,e.createTextVNode(" 导出word ")]),_:1})])]),e.createElementVNode("div",uB,[e.createVNode(e.unref(sc.Toolbar),{class:"w-full",editor:p.editorRef,defaultConfig:d,mode:um},null,8,["editor"]),e.createVNode(e.unref(sc.Editor),{style:{height:"90%","overflow-y":"hidden","border-top":"1px solid #eee"},modelValue:p.reportObj.reportContent,"onUpdate:modelValue":h[4]||(h[4]=g=>p.reportObj.reportContent=g),defaultConfig:c,mode:um,onOnCreated:u},null,8,["modelValue"]),p.modelValue&&((y=e.unref(l))==null?void 0:y.chartType)=="7"?(e.openBlock(),e.createElementBlock("div",pB,[hB,e.createVNode(e.unref(E.ElSelect),{size:"small",style:{width:"80px"},modelValue:e.unref(i).fontSize,"onUpdate:modelValue":h[5]||(h[5]=g=>e.unref(i).fontSize=g),teleported:!1,clearable:!1,onChange:h[6]||(h[6]=g=>f("fontSize",g))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,g=>e.createVNode(e.unref(E.ElOption),{label:g.value,value:g.value,key:g.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),mB,gB,e.createElementVNode("div",yB,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(i).bold,"onUpdate:modelValue":h[7]||(h[7]=g=>e.unref(i).bold=g),onChange:h[8]||(h[8]=g=>f("bold",g))},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElRadio),{value:!0,label:!0},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1}),e.createVNode(e.unref(E.ElRadio),{value:!1,label:!0},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1})]),_:1},8,["modelValue"])]),bB,_B,e.createElementVNode("div",wB,[e.createVNode(e.unref(E.ElColorPicker),{predefine:e.unref(a).$globalPreColor,onChange:h[9]||(h[9]=g=>f("color",g)),modelValue:e.unref(i).color,"onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(i).color=g)},null,8,["predefine","modelValue"])])])):e.createCommentVNode("",!0)])])}}}),BR="",SB=Be(CB,[["__scopeId","data-v-884e5eeb"]]),xB={class:"mt-3"},vB=["id"],EB={class:"flex justify-between"},VB={class:"title"},kB=["onClick"],NB=["onClick"],$B={class:"text-color-warning text-xs mt-3"},DB=e.defineComponent({__name:"designRight",props:{reportObj:{default:{}},editorRef:{default:null},indicatorsId:{default:""}},emits:["click","success"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{getModelIndicatorsData:i,setSingleValue:l}=mt(),s=n,d=e.ref([]),c=e.ref(!0),f=async()=>{c.value=!0;const p=await De(a).listIndicatorsApply({reportId:o.reportObj.id},!1);d.value=p.data,c.value=!1,s("success"),e.nextTick(()=>{(async function h(m){for(let y=0;y<m.length;y+=1){const g=m[y];if(g.type=="indicator"){const b=p.data.find(_=>_.id==g.id);if(!b)return;const w={subtitle:b.title,content:b.indicatorsName};b.coverUrl&&(w.src=w$(b.coverUrl)),b.echartsType=="7"&&(b.indicatorsType=="MODEL_INDICATORS"?(await i(b.indicatorsId??b.id,b.echartsType,b.formConfJson),w.singleValue=l(g.singleValueKey??"")):w.singleValue=b.singleValue),tt.SlateTransforms.setNodes(o.editorRef,w,{at:tt.DomEditor.findPath(o.editorRef,g)})}g.children&&await h(g.children)}})(o.editorRef.children)})},u=async(p,h)=>{s("click",p,h)};return f(),r({init:f,list:d}),(p,h)=>{const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(m,{title:"指标使用库"}),e.createElementVNode("div",xB,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(c),animated:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),y=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{active:p.indicatorsId==y.id}]),id:y.id,key:y.id},[e.createElementVNode("div",EB,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:y.indicatorsName,placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",VB,e.toDisplayString(y.indicatorsName),1)]),_:2},1032,["content"]),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:e.withModifiers(g=>u("edit",y),["stop"])},"编辑",8,kB),e.createElementVNode("button",{onClick:e.withModifiers(g=>u("insert",y),["stop"])},"插入光标",8,NB)])]),e.createElementVNode("div",$B,e.toDisplayString(y.title),1)],10,vB))),128))]),_:1},8,["loading"])])],64)}}}),TR="",BB=Be(DB,[["__scopeId","data-v-83f04927"]]),TB=e.defineComponent({__name:"designForm",props:{reportObj:{default:{}}},emits:["success"],setup(t,{expose:r,emit:n}){const o=t,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d,dynamicSearchParamsTitle:c}=i.$globalHooks.useDynamicSearch(),{base64ToBlob:f,chartJsonFormat:u,echartsTypeList:p}=i.$globalUtils,h=n,{option:m,formatChart:y}=mt(),g=e.ref(!1),b=e.ref(""),w=e.ref(null),_=e.ref(""),C=e.ref(""),S=e.ref([]),x=e.ref({}),v=e.ref({type:"",value:""}),V=e.ref(!1),$=async()=>{if(V.value=!0,e.unref(B)=="MODEL_INDICATORS"){a.getChartData.params.params=d(l.value);const O=e.unref(R).find(N=>N.type==e.unref(_));await y(O==null?void 0:O.code),V.value=!1,e.unref(v).type=_.value,e.unref(v).value=m.value}else{const O=d(e.unref(l)),N=await De(i).pullEchartsDataVO({indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,params:O,echartsType:e.unref(_),targetClient:"WEB"});if(!N)return;V.value=!1,e.unref(v).type=_.value;try{e.unref(v).value=u(N.data.config)}catch{e.unref(v).value=N.data.config}}},B=e.ref(""),R=e.ref({}),T=async(O,N)=>{var I,z;C.value=O,S.value=[];let D;if(B.value=N.indicatorsType??N.type??"INDICATORS",e.unref(B)=="MODEL_INDICATORS"){D=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${N.indicatorsId??N.id}`);const M=JSON.parse(D.data.sortArgsJson??"{}"),j=Object.keys(e.unref(M)).map(F=>({field:F,type:M[F]=="ascending"?"asc":"desc"}));a.setChartData({x:JSON.parse(D.data.groupArgsJson),y:JSON.parse(D.data.aggArgsJson),params:{aggArgsJson:D.data.aggArgsJson,groupArgsJson:D.data.groupArgsJson,sortArgsJson:JSON.stringify(j),modelIndicatorsId:N.indicatorsId??N.id,params:d(s(JSON.parse(N.formConfJson??((I=e.unref(D))==null?void 0:I.formConfJson)??"[]"))),pageSize:D.data.pageSize,modelId:D.data.modelId}})}else D=await De(i).getIndicatorsPanelConf(N.indicatorsId??N.id);D&&(g.value=!0,x.value=N,e.unref(B)=="MODEL_INDICATORS"?(R.value=D.data.echarts,S.value=D.data.echarts.map(M=>M.type)):S.value=D.data.views,_.value=O=="add"?S.value[0]:N.echartsType,b.value=N.indicatorsName??N.name,l.value=O=="add"?s(JSON.parse(((z=D.data)==null?void 0:z.formConfJson)??"[]")):JSON.parse(N.formConfJson),$())},k=async()=>{var I;const O=e.unref(w).$refs.echart;if(O&&!O.getDataURL()){i.$message.warning("图片未生成完毕,请重新保存");return}const N={echartsType:e.unref(v).type,indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,reportId:o.reportObj.id,paramsJson:JSON.stringify(d(e.unref(l))),formConfJson:JSON.stringify(e.unref(l)),title:`${(I=p[e.unref(_)])==null?void 0:I.name} ${c({showTitle:!1})}`,indicatorsType:e.unref(B)};if(e.unref(C)=="edit"&&(N.id=e.unref(x).id),!!await De(i).saveIndicatorsApply(N)){if(e.unref(C)=="edit"&&O){const z=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});await new Promise(M=>{e.nextTick(async()=>{const j=f(O.getDataURL());await De(i).updateIndicatorsApplyImage(j,N.id),M(!0)})}),z.close()}i.$message.success("操作成功"),g.value=!1,h("success")}};return r({init:T}),(O,N)=>{const D=e.resolveComponent("AppDynamicSearch"),I=e.resolveComponent("AppChart"),z=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(z,{modelValue:e.unref(g),"onUpdate:modelValue":N[2]||(N[2]=M=>e.isRef(g)?g.value=M:null),title:e.unref(b),size:"632px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)=="add"?"生成报告使用指标":"完成"),1)]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:N[1]||(N[1]=M=>g.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.unref(l).length>0?(e.openBlock(),e.createBlock(D,{key:0,form:e.unref(l),onSuccess:$},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElRadioGroup),{onChange:$,modelValue:e.unref(_),"onUpdate:modelValue":N[0]||(N[0]=M=>e.isRef(_)?_.value=M:null),class:"mb-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),M=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:M,value:M,label:M,class:"mr-3"},{default:e.withCtx(()=>{var j;return[e.createTextVNode(e.toDisplayString((j=e.unref(p)[M])==null?void 0:j.name),1)]}),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"]),e.createVNode(I,{ref_key:"appChartRef",ref:w,type:e.unref(v).type,options:e.unref(v).value,loading:e.unref(V)},null,8,["type","options","loading"])]),_:1},8,["modelValue","title"])}}}),OB={key:0,class:"chart"},IB=e.defineComponent({__name:"design",emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),{base64ToBlob:a,chartJsonFormat:i,resetUrl:l}=o.$globalUtils,s=e.ref(!1),d=e.ref({reportContent:""}),c=e.ref(""),f=e.ref(null),u=e.ref(null),p=e.ref(!1),h=e.ref(null),m=e.ref(null),y=e.ref(null),g=e.ref(null),b=e.ref(null),w=e.ref(null),_=n,{option:C,getModelIndicatorsData:S,setSingleValue:x}=mt(),v=T=>{const k=[];(function N(D){var I,z,M;D&&(k.push((D==null?void 0:D.className)??((I=D==null?void 0:D.target)==null?void 0:I.className)??""),(D!=null&&D.parentNode||(z=D.target)!=null&&z.parentNode)&&N((D==null?void 0:D.parentNode)||((M=D.target)==null?void 0:M.parentNode)))})(T);const O=k.toString();O.indexOf("indicator")==-1&&O.indexOf("el-color")==-1&&(c.value="")};e.watch(s,T=>{var k;T||(document.removeEventListener("click",v),f&&((k=f.value)==null||k.destroy()),f.value=null,p.value=!1)});const V=async T=>{f.value=null,s.value=!0,d.value=JSON.parse(JSON.stringify(T)),setTimeout(()=>{p.value=!0},100)},$=async(T,k)=>{switch(T){case"add":case"edit":e.unref(g).init(T,k);break;case"insert":{u.value={};let O;switch(k.indicatorsType=="MODEL_INDICATORS"?(await S(k.indicatorsId??k.id,k.echartsType,k.formConfJson),O={data:{[k.id]:{config:C.value,dataList:JSON.stringify(C.value.dataset.source)}}}):O=await De(o).mapEchartsData(k.id),String(k.echartsType)){case"8":{const N=JSON.parse(O.data[k.id].dataList);if(N.length==0){o.$message.warning("暂无数据");return}const D={type:"table",width:"100%",children:[]};if(k.indicatorsType=="MODEL_INDICATORS"){const I=O.data[k.id].config;D.children.push(...I.dataset.dimensions.map(z=>({type:"table-cell",isHeader:!0,children:[{text:z}]}))),D.children.push(...N.map(z=>({type:"table-row",children:I.dataset.dimensions.map(M=>{let j=z[M];const F=I.customSeriesData[M];if(F){const{prefix:G,toFixed:H,suffix:X}=F;j=`${G}${isNaN(j)?j:Number(j).toFixed(H)}${X}`}return{type:"table-cell",children:[{text:j,color:(F==null?void 0:F.color)??""}]}})})))}else D.children=[{type:"table-row",children:Object.keys(N[0]).map(I=>({type:"table-cell",isHeader:!0,children:[{text:I}]}))},...N.map(I=>({type:"table-row",children:Object.keys(I).map(z=>({type:"table-cell",children:[{text:I[z]}]}))}))];tt.DomEditor.isSelectedEmptyParagraph(f.value)&&tt.SlateTransforms.removeNodes(f.value,{mode:"highest"}),tt.SlateTransforms.insertNodes(f.value,D,{mode:"highest"}),f.value.deselect()}break;case"7":{const N=O.data[k.id].config,D={type:"indicator",content:k.indicatorsName,singleValue:N,id:k.id,indicatorsType:k.indicatorsType||"INDICATORS",chartType:k.echartsType,subtitle:k.title,children:[{text:""}]};if(k.indicatorsType=="MODEL_INDICATORS"){const I=e.ref("");e.unref(C).dataset.dimensions.length==1?I.value=e.unref(C).dataset.dimensions[0]:await new Promise(z=>{E.ElMessageBox({title:"选择数据",showConfirmButton:!1,message:()=>e.h("div",{style:{width:"396px"}},[e.h(E.ElSelect,{class:"w-full mt-5",modelValue:I.value,placeholder:"请选择数据","onUpdate:modelValue":M=>{I.value=M}},{default:()=>e.unref(C).dataset.dimensions.map(M=>e.h(E.ElOption,{label:M,value:M,key:M}))}),e.h("div",{class:"mt-5 flex justify-end"},[e.h(E.ElButton,{type:"primary",onclick:async()=>{if(e.unref(I)==""){o.$message.warning("请选择数据");return}z(!0),E.ElMessageBox.close()}},{default:()=>"提交"}),e.h(E.ElButton,{onclick:async()=>E.ElMessageBox.close()},{default:()=>"关闭"})])])})}),D.singleValueKey=I.value,D.singleValue=x(I.value)}f.value.restoreSelection(),f.value.insertNode(D)}break;default:{const N=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});let D=l(k.coverUrl||"");if(!D){try{u.value=i(O.data[k.id].config)}catch{u.value=O.data[k.id].config}await new Promise(I=>{e.nextTick(()=>{e.unref(w).chart.on("finished",async()=>{const z=a(e.unref(w).getDataURL()),M=await De(o).updateIndicatorsApplyImage(z,k.id);D=l(M.data),I(!0)})})})}f.value.insertNode({type:"indicator",content:k.indicatorsName,indicatorsType:k.indicatorsType||"INDICATORS",id:k.id,chartType:k.echartsType,subtitle:k.title,src:D,children:[{text:""}]}),k.coverUrl=D,u.value=null,N.close()}break}}break;case"submit":{if(!await De(o).reportSubmit({id:e.unref(d).id,reportContent:f.value.getHtml(),reportName:e.unref(d).reportName,indicatorsNum:e.unref(y).list.length}))return;window.frames.length==parent.frames.length&&o.$message.success("操作成功"),_("success"),s.value=!1}break;case"close":s.value=!1;break}},B=T=>{f.value=Object.seal(T),document.addEventListener("click",v,!0)},R=()=>{const T=e.unref(m),k=e.unref(y);T.list.length>0&&k.list.length>0&&T.list.forEach(O=>{O.value=k.list.filter(N=>N.indicatorsId==O.indicatorsId).length})};return o.$baseEventBus.on("editor",T=>{e.nextTick(()=>{e.unref(b).init(T,e.unref(d))})}),r({init:V}),(T,k)=>{const O=e.resolveComponent("v-chart"),N=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(N,{modelValue:e.unref(s),"onUpdate:modelValue":k[4]||(k[4]=D=>e.isRef(s)?s.value=D:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElContainer),{class:"designBody"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElAside),{width:"310px",class:"p-3"},{default:e.withCtx(()=>[e.createVNode(nB,{ref_key:"designLeftRef",ref:m,onClick:$,onSuccess:R},null,512)]),_:1}),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createBlock(SB,{key:0,ref_key:"designMainRef",ref:h,onEditorSuccess:B,editorRef:e.unref(f),reportObj:e.unref(d),modelValue:e.unref(c),"onUpdate:modelValue":k[2]||(k[2]=D=>e.isRef(c)?c.value=D:null)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:k[0]||(k[0]=D=>$("submit",{}))},{default:e.withCtx(()=>[e.createTextVNode("保存报告")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"warning",onClick:k[1]||(k[1]=D=>$("close",{}))},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})])]),_:1},8,["editorRef","reportObj","modelValue"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(E.ElAside),{width:"310px",id:"useReportcontainer",class:"p-3",style:{"border-left":"1px solid #ebeef5"}},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(BB,{key:0,ref_key:"designRightRef",ref:y,onClick:$,reportObj:e.unref(d),editorRef:e.unref(f),onSuccess:R,indicatorsId:e.unref(c)},null,8,["reportObj","editorRef","indicatorsId"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(u)?(e.openBlock(),e.createElementBlock("div",OB,[e.createVNode(O,{ref_key:"echartsRef",ref:w,option:e.unref(u),autoresize:""},null,8,["option"])])):e.createCommentVNode("",!0),e.createVNode(TB,{ref_key:"designFormRef",ref:g,reportObj:e.unref(d),onSuccess:k[3]||(k[3]=D=>e.unref(y).init())},null,8,["reportObj"]),e.createVNode(fm,{ref_key:"previewRef",ref:b,type:"design"},null,512)]),_:1},8,["modelValue"])}}}),OR="",zB=Be(IB,[["__scopeId","data-v-a5619b8c"]]),RB=t=>(e.pushScopeId("data-v-6a766735"),t=t(),e.popScopeId(),t),MB={key:1,class:"flex flex-wrap pt-3 pb-7"},AB={class:"reportName line-clamp-2"},LB={class:"auth"},FB={class:"times"},jB=["onClick"],PB={class:"w-full flex justify-center mt-5"},UB=RB(()=>e.createElementVNode("div",{class:"h-px bg-gray-200 w-full mt-2"},null,-1)),WB={class:"flex w-full justify-center mt-2"},GB=e.defineComponent({__name:"index",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=e.ref(null),a=e.ref(null),i=e.ref(null),l=e.reactive([]),s=e.reactive([{name:"报告名称",type:Rr.Text,fieldName:"reportName",value:""}]),d=e.ref([{label:"预览",icon:"ri-eye-line",type:"primary",key:"PREVIEW",show:!1},{label:"编辑",icon:"ri-edit-line",type:"primary",key:"EDIT",show:!1},{label:"PDF",icon:"ri-file-pdf-line",type:"warning",key:"DOWNLOAD_PDF",show:!1},{label:"WORD",icon:"ri-file-word-2-line",type:"primary",key:"DOWNLOAD_WORD",show:!1},{label:"复制",icon:"ri-file-copy-line",type:"primary",key:"COPY",show:!1},{label:"删除",icon:"ri-delete-bin-line",type:"danger",key:"DEL",show:!1}]),c=e.ref([]);De(r).getCurrFunc("INDICATORS_REPORT").then(p=>{c.value=p.data,p.data.includes("CREATE")&&l.push({name:"新增报告",key:"add",type:"primary",icon:"ri-add-line"}),e.unref(d).forEach(h=>{h.show=p.data.includes(h.key)})});const f=e.reactive([{label:"报告名称",prop:"reportName"},{label:"报告使用库",prop:"indicatorsNum",slot:!0},{label:"撰写人",prop:"createUserName"},{label:"撰写时间",prop:"createTime"},{label:"操作",prop:"action",slot:!0,width:"410px"}]),u=async p=>{const{type:h,row:m}=p;switch(h){case"zb":e.unref(o).init(m);break;case"add":r.$basePrompt({content:"新增指标报告",placeholder:"请输入报告名称",inputType:"input",beforeCloseFunc:async(y,g,b)=>{if(y!="confirm"){b();return}const w=await De(r).reportSubmit({reportName:g.inputValue});w&&(r.$message.success("操作成功"),e.unref(n).getData(),e.unref(a).init({id:w.data,reportName:g.inputValue,reportContent:""}),b())}});break;case"DEL":r.$baseConfirm({content:"是否确定删除",callConfirm:async()=>{await De(r).reportRemove(m.id)&&(r.$message.success("删除成功"),e.unref(n).getData())}});break;case"COPY":r.$baseConfirm({content:"是否确定复制",callConfirm:async()=>{await De(r).reportCopy(m.id)&&(r.$message.success("操作成功"),e.unref(n).getData())}});break;case"EDIT":e.unref(a).init(m);break;case"DOWNLOAD_PDF":case"PREVIEW":case"DOWNLOAD_WORD":e.nextTick(()=>{e.unref(i).init(h,m)});break}};return(p,h)=>{const m=e.resolveComponent("AppEmpty"),y=e.resolveComponent("AppList");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(y,{url:`/api/ace-data-center/indicators-report/list?descs=create_time&projectId=${e.unref(r).$baseGetCurrentProjectId}`,tableData:e.unref(f),searchForm:e.unref(s),searchBtns:e.unref(l),listType:"custom",onBtnClick:u,ref_key:"appListRef",ref:n},{"list-slot":e.withCtx(({list:g,loading:b})=>[e.createVNode(e.unref(E.ElSkeleton),{loading:b,animated:""},{default:e.withCtx(()=>[g.length==0?(e.openBlock(),e.createBlock(m,{key:0,description:"暂无数据"})):(e.openBlock(),e.createElementBlock("div",MB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"items"},[e.createElementVNode("div",AB,e.toDisplayString(w.reportName),1),e.createElementVNode("div",LB,"作者:"+e.toDisplayString(w.createUserName),1),e.createElementVNode("div",FB,e.toDisplayString(w.createTime),1),e.unref(c).includes("VIEW_INDICATOR")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tags",onClick:e.withModifiers(_=>u({type:"zb",row:w,index:-1}),["stop"])},[e.createTextVNode(" 查看指标库: "),e.createElementVNode("span",null,e.toDisplayString(w.indicatorsNum||0),1)],8,jB)):e.createCommentVNode("",!0),e.createElementVNode("div",PB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_.icon},[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:0,class:"inline-flex items-center ml-3 mr-3",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-1 text-base"])},null,2),e.createTextVNode(" "+e.toDisplayString(_.label),1)]),_:2},1032,["type","onClick"])):e.createCommentVNode("",!0)],64))),128))]),UB,e.createElementVNode("footer",WB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>!["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElTooltip),{content:_.label,key:_.icon},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElLink),{class:"inline-flex items-center",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-2 ml-2 text-lg"])},null,2)]),_:2},1032,["type","onClick"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)],64))),256))])]))),128))]))]),_:2},1032,["loading"])]),_:1},8,["url","tableData","searchForm","searchBtns"]),e.createVNode(qD,{ref_key:"useIndicatorsRef",ref:o},null,512),e.createVNode(zB,{ref_key:"designRef",ref:a,onSuccess:h[0]||(h[0]=g=>e.unref(n).getData())},null,512),e.createVNode(fm,{ref_key:"previewRef",ref:i},null,512)])}}}),IR="",HB=Be(GB,[["__scopeId","data-v-6a766735"]]);function pm(t,r,n,o,a){const i=r===void 0?void 0:r.key;return{sel:t,data:r,children:n,text:o,elm:a,key:i}}const hm=Array.isArray;function Qs(t){return typeof t=="string"||typeof t=="number"||t instanceof String||t instanceof Number}function mm(t,r,n){if(t.ns="http://www.w3.org/2000/svg",n!=="foreignObject"&&r!==void 0)for(let o=0;o<r.length;++o){const a=r[o];if(typeof a=="string")continue;const i=a.data;i!==void 0&&mm(i,a.children,a.sel)}}function nn(t,r,n){let o={},a,i,l;if(n!==void 0?(r!==null&&(o=r),hm(n)?a=n:Qs(n)?i=n.toString():n&&n.sel&&(a=[n])):r!=null&&(hm(r)?a=r:Qs(r)?i=r.toString():r&&r.sel?a=[r]:o=r),a!==void 0)for(l=0;l<a.length;++l)Qs(a[l])&&(a[l]=pm(void 0,void 0,void 0,a[l],void 0));return t.startsWith("svg")&&(t.length===3||t[3]==="."||t[3]==="#")&&mm(o,a,t),pm(t,o,a,i,void 0)}const YB=(t,r,n)=>{const o=tt.DomEditor.isNodeSelected(n,t),{id:a}=tt.DomEditor.findKey(n,t),{content:i="",chartType:l="",id:s="",singleValue:d="",singleValueKey:c="",subtitle:f="",src:u="",fontSize:p="16px",bold:h="",color:m="",indicatorsType:y="INDICATORS",width:g=400}=t,{EXTEND_CONF:{indicatorConfig:b}}=n.getConfig(),{clickIndicator:w}=b,_=[];return u?(_.push(nn("img.editor-indicator-img",{props:{src:u},style:{},dataset:{id:s}})),o&&_.push(nn("input.indicator-img-range",{type:"range",style:{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",zIndex:"99"},min:300,max:550,value:g,on:{input(C){const S={id:s,chartType:l,subtitle:f,singleValue:d,singleValueKey:c,width:C.target.value};tt.SlateTransforms.setNodes(n,S,{at:tt.DomEditor.findPath(n,t)})}}}))):_.push(d||i),_.push(nn("span.indicator-tooltip",{style:{position:"absolute",background:"#fff",border:"1px solid var(--g-border-color)",lineHeight:"25px",padding:"0 5px",color:"orange",fontSize:"12px",left:"0px",top:"-30px",zIndex:"88",display:"none",whiteSpace:"nowrap",fontWeight:"normal"},dataset:{id:s}},[nn("span",{style:{color:"#000",fontWeight:"bold"}},`${i}:`),nn("span",{},f),nn("span",{style:{color:"#000"}},c?`(${c})`:"")])),nn("span.editor-indicator",{id:`editor-indicator-${a}`,props:{contentEditable:!1},dataset:{id:s,chartType:l,subtitle:f,width:g,singleValue:d,singleValueKey:c,src:u,fontSize:p,color:m,indicatorsType:y,bold:h},style:{width:`${l=="7"?null:g}px`,marginLeft:"3px",marginRight:"3px",display:"inline-block",cursor:"pointer",backgroundColor:"var(--w-e-textarea-slight-bg-color)",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"0 3px",fontSize:p,fontWeight:h=="true"?"bold":"normal",color:m},on:{click(C){C.preventDefault(),w&&w(s,t)}}},_)},XB=t=>{const{chartType:r="",id:n="",type:o,subtitle:a,singleValue:i="",singleValueKey:l="",content:s="",src:d="",fontSize:c="16px",bold:f=!1,color:u="",indicatorsType:p="INDICATORS",width:h=400}=t;return`<span
878
+ </html>`,m=new Blob([h],{type:"application/msword;charset=utf-8"});JD.saveAs(m,`${e.unref(s).filename}.doc`),l.value=!1},f=e.ref(""),u=async()=>{await new Promise(async h=>{var m;f.value=document.title,document.title=e.unref(s).filename,(m=document.getElementById("printButton"))==null||m.click(),l.value=!1,h(!0)})};return r({init:async(h,m)=>{const y=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 1)",customClass:"preview-loading"});s.value={type:h,content:m.reportContent,filename:m.reportName},await new Promise(b=>{setTimeout(()=>{l.value=!0,b(!0)},100)});const g=[];e.nextTick(async()=>{const b=document.getElementById("preview-content");(function v(V){V.forEach($=>{g.push($),$.childNodes&&v($.childNodes)})})(b.childNodes);const w=await De(n).listIndicatorsApply({reportId:m.id},!1),_=g.filter(v=>v.className==="editor-indicator"),C=[...new Set(_.map(v=>v.dataset.id))],S=await De(n).mapEchartsData(C.toString(),!1),x=[];for(let v=0;v<_.length;v+=1){const V=_[v],$=w.data.find(B=>B.id==V.dataset.id);if(V.dataset.charttype==7){$.indicatorsType=="MODEL_INDICATORS"?(await o($.indicatorsId??$.id,$.echartsType,$.formConfJson),_[v].innerHTML=a(_[v].getAttribute("data-singleValueKey"))):_[v].innerHTML=S.data[V.dataset.id].config;const B=_[v].getAttribute("data-fontsize"),R=_[v].getAttribute("data-bold"),T=_[v].getAttribute("data-color");B&&(_[v].style.fontSize=B),R&&(_[v].style.fontWeight=R=="true"?"bold":"normal"),T&&(_[v].style.color=T)}else{const B=_[v].getAttribute("data-width")||400;let R=i(($==null?void 0:$.coverUrl)||_[v].getAttribute("data-src"));if(x.includes(R))continue;R&&await new Promise(T=>{const k=new Image;k.src=R,k.crossOrigin="anonymous",k.onload=()=>{const O=document.createElement("canvas");O.width=k.width,O.height=k.height,O.getContext("2d").drawImage(k,0,0,k.width,k.height),x.push(R),R=O.toDataURL("image/png"),T(!0)},k.onerror=()=>{T(!0)}}),_[v].innerHTML=`<img width=${B} src="${R}" crossorigin="anonymous" />`}}h==="DOWNLOAD_WORD"&&c(),h==="DOWNLOAD_PDF"&&await u(),setTimeout(()=>y.close(),100)})}}),(h,m)=>{const y=e.resolveComponent("AppDrawer"),g=e.resolveDirective("print");return e.openBlock(),e.createBlock(y,{modelValue:e.unref(l),"onUpdate:modelValue":m[1]||(m[1]=b=>e.isRef(l)?l.value=b:null),withHeader:!1,size:"100%"},{default:e.withCtx(()=>[e.createElementVNode("div",{id:"preview-content",class:e.normalizeClass(e.unref(s).type),innerHTML:e.unref(s).content},null,10,KD),e.createElementVNode("i",{class:"ri-close-line ri-2x fixed right-5 top-5 text-color-danger cursor-pointer",onClick:m[0]||(m[0]=b=>l.value=!1)}),e.unref(s).type=="DOWNLOAD_PDF"?e.withDirectives((e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,id:"printButton",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(" 导出PDF ")]),_:1})),[[g,e.unref(d)]]):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])}}}),$R="",ZD={class:"mt-3"},QD={class:"mt-3"},eB={class:"menu-title"},tB={key:0,class:"badge"},rB=e.defineComponent({__name:"designLeft",emits:["click","success"],setup(t,{expose:r,emit:n}){const o=e.ref([]),a=e.ref(""),i=n,{proxy:l}=e.getCurrentInstance();De(l).listReportIndicatorsMenu({}).then(f=>{o.value=Object.keys(f.data).map(u=>({name:u,children:f.data[u]})),i("success")});const s=(f,u)=>{i("click",f,u)},d=f=>{f.id&&s("add",f)},c=(f,u)=>f?u.name.includes(f):!0;return r({list:o}),(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"指标库"}),e.createElementVNode("div",ZD,[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"请输入指标名称"},null,8,["modelValue"])]),e.createElementVNode("div",QD,[e.createVNode(e.unref(E.ElTree),{ref:"tree",data:e.unref(o),"default-expand-all":"","highlight-current":!0,"filter-node-method":c,indent:0,onNodeClick:d},{default:e.withCtx(({node:h,data:m})=>[e.createElementVNode("div",eB,[m.count?(e.openBlock(),e.createElementBlock("span",tB,[e.createTextVNode(e.toDisplayString(m.title||m.name)+" ",1),e.createElementVNode("span",null,e.toDisplayString(m.count),1)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass({"font-bold":h.level==1})},e.toDisplayString(m.title||m.name),3)),m.children?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:2,type:"primary",onClick:e.withModifiers(y=>s("add",m),["stop"])},{default:e.withCtx(()=>[e.createTextVNode(" 配置 ")]),_:2},1032,["onClick"]))])]),_:1},8,["data"])])],64)}}}),DR="",nB=Be(rB,[["__scopeId","data-v-07266c39"]]),_r=t=>(e.pushScopeId("data-v-884e5eeb"),t=t(),e.popScopeId(),t),oB={class:"p-3 overflow-hidden h-full w-full flex-col flex items-start"},aB={class:"mt-3 mb-3 flex items-center whitespace-nowrap w-full"},iB=_r(()=>e.createElementVNode("span",{class:"mr-3"},"报告名称:",-1)),lB={class:"w-80"},sB={class:"flex-1 items-center justify-end flex"},cB=_r(()=>e.createElementVNode("i",{class:"ri-book-open-line mr-2"},null,-1)),dB=_r(()=>e.createElementVNode("i",{class:"ri-file-pdf-line ml-3 mr-2"},null,-1)),fB=_r(()=>e.createElementVNode("i",{class:"ri-file-word-line ml-3 mr-2"},null,-1)),uB={class:"editor flex-1 w-full h-full overflow-hidden relative",style:{border:"1px solid #eee"}},pB={key:0,class:"indicator-toolbar"},hB=_r(()=>e.createElementVNode("span",{class:"mr-2"},"字体大小:",-1)),mB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),gB=_r(()=>e.createElementVNode("span",{class:"ml-2"},"加粗:",-1)),yB={class:"ml-2 cursor-pointer"},bB=_r(()=>e.createElementVNode("span",{class:"ml-2 mr-2 text-color-info"},"|",-1)),_B=_r(()=>e.createElementVNode("span",{class:"ml-2"},"字体颜色:",-1)),wB={class:"ml-2"},um="simple",CB=e.defineComponent({__name:"designMain",props:{reportObj:{default:{}},editorRef:{default:null},modelValue:{default:""}},emits:["update:modelValue","editor-success"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref({fontSize:"",bold:!1,color:""}),l=e.ref({}),s=[{value:"12px"},{value:"14px"},{value:"16px"},{value:"18px"},{value:"20px"},{value:"22px"},{value:"24px"}],d={excludeKeys:["code","codeSelectLang","codeBlock","insertVideo","uploadVideo","editVideoSize","insertImage","header3","fullScreen"],insertKeys:{index:5,keys:["fontSize"]}},c={placeholder:"请输入内容...",EXTEND_CONF:{indicatorConfig:{clickIndicator:(p,h)=>{o("update:modelValue",p),l.value=h,i.value={fontSize:h.fontSize,bold:h.bold=="true",color:h.color||""};const m=document.getElementById(p);m&&(document.getElementById("useReportcontainer").scrollTop=m.offsetTop-20)}}}},f=(p,h)=>{const m={[p]:String(h)};qe.SlateTransforms.setNodes(n.editorRef,m,{at:qe.DomEditor.findPath(n.editorRef,e.unref(l))})},u=p=>{o("editor-success",p)};return(p,h)=>{var y;const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock("div",oB,[e.createVNode(m,{title:"指标报告撰写",class:"w-full"},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default",{},void 0,!0)]),_:3}),e.createElementVNode("div",aB,[iB,e.createElementVNode("div",lB,[e.createVNode(e.unref(E.ElInput),{modelValue:p.reportObj.reportName,"onUpdate:modelValue":h[0]||(h[0]=g=>p.reportObj.reportName=g),placeholder:"请输入报告名称"},null,8,["modelValue"])]),e.createElementVNode("div",sB,[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[1]||(h[1]=g=>e.unref(a).$baseEventBus.emit("editor","PREVIEW"))},{default:e.withCtx(()=>[cB,e.createTextVNode(" 预览 ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[2]||(h[2]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_PDF"))},{default:e.withCtx(()=>[dB,e.createTextVNode(" 导出pdf ")]),_:1}),e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:h[3]||(h[3]=g=>e.unref(a).$baseEventBus.emit("editor","DOWNLOAD_WORD"))},{default:e.withCtx(()=>[fB,e.createTextVNode(" 导出word ")]),_:1})])]),e.createElementVNode("div",uB,[e.createVNode(e.unref(sc.Toolbar),{class:"w-full",editor:p.editorRef,defaultConfig:d,mode:um},null,8,["editor"]),e.createVNode(e.unref(sc.Editor),{style:{height:"90%","overflow-y":"hidden","border-top":"1px solid #eee"},modelValue:p.reportObj.reportContent,"onUpdate:modelValue":h[4]||(h[4]=g=>p.reportObj.reportContent=g),defaultConfig:c,mode:um,onOnCreated:u},null,8,["modelValue"]),p.modelValue&&((y=e.unref(l))==null?void 0:y.chartType)=="7"?(e.openBlock(),e.createElementBlock("div",pB,[hB,e.createVNode(e.unref(E.ElSelect),{size:"small",style:{width:"80px"},modelValue:e.unref(i).fontSize,"onUpdate:modelValue":h[5]||(h[5]=g=>e.unref(i).fontSize=g),teleported:!1,clearable:!1,onChange:h[6]||(h[6]=g=>f("fontSize",g))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,g=>e.createVNode(e.unref(E.ElOption),{label:g.value,value:g.value,key:g.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),mB,gB,e.createElementVNode("div",yB,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(i).bold,"onUpdate:modelValue":h[7]||(h[7]=g=>e.unref(i).bold=g),onChange:h[8]||(h[8]=g=>f("bold",g))},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElRadio),{value:!0,label:!0},{default:e.withCtx(()=>[e.createTextVNode("是")]),_:1}),e.createVNode(e.unref(E.ElRadio),{value:!1,label:!0},{default:e.withCtx(()=>[e.createTextVNode("否")]),_:1})]),_:1},8,["modelValue"])]),bB,_B,e.createElementVNode("div",wB,[e.createVNode(e.unref(E.ElColorPicker),{predefine:e.unref(a).$globalPreColor,onChange:h[9]||(h[9]=g=>f("color",g)),modelValue:e.unref(i).color,"onUpdate:modelValue":h[10]||(h[10]=g=>e.unref(i).color=g)},null,8,["predefine","modelValue"])])])):e.createCommentVNode("",!0)])])}}}),BR="",SB=Be(CB,[["__scopeId","data-v-884e5eeb"]]),xB={class:"mt-3"},vB=["id"],EB={class:"flex justify-between"},VB={class:"title"},kB=["onClick"],NB=["onClick"],$B={class:"text-color-warning text-xs mt-3"},DB=e.defineComponent({__name:"designRight",props:{reportObj:{default:{}},editorRef:{default:null},indicatorsId:{default:""}},emits:["click","success"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{getModelIndicatorsData:i,setSingleValue:l}=mt(),s=n,d=e.ref([]),c=e.ref(!0),f=async()=>{c.value=!0;const p=await De(a).listIndicatorsApply({reportId:o.reportObj.id},!1);d.value=p.data,c.value=!1,s("success"),e.nextTick(()=>{(async function h(m){for(let y=0;y<m.length;y+=1){const g=m[y];if(g.type=="indicator"){const b=p.data.find(_=>_.id==g.id);if(!b)return;const w={subtitle:b.title,content:b.indicatorsName};b.coverUrl&&(w.src=w$(b.coverUrl)),b.echartsType=="7"&&(b.indicatorsType=="MODEL_INDICATORS"?(await i(b.indicatorsId??b.id,b.echartsType,b.formConfJson),w.singleValue=l(g.singleValueKey??"")):w.singleValue=b.singleValue),qe.SlateTransforms.setNodes(o.editorRef,w,{at:qe.DomEditor.findPath(o.editorRef,g)})}g.children&&await h(g.children)}})(o.editorRef.children)})},u=async(p,h)=>{s("click",p,h)};return f(),r({init:f,list:d}),(p,h)=>{const m=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(m,{title:"指标使用库"}),e.createElementVNode("div",xB,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(c),animated:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),y=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{active:p.indicatorsId==y.id}]),id:y.id,key:y.id},[e.createElementVNode("div",EB,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:y.indicatorsName,placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",VB,e.toDisplayString(y.indicatorsName),1)]),_:2},1032,["content"]),e.createElementVNode("div",null,[e.createElementVNode("button",{onClick:e.withModifiers(g=>u("edit",y),["stop"])},"编辑",8,kB),e.createElementVNode("button",{onClick:e.withModifiers(g=>u("insert",y),["stop"])},"插入光标",8,NB)])]),e.createElementVNode("div",$B,e.toDisplayString(y.title),1)],10,vB))),128))]),_:1},8,["loading"])])],64)}}}),TR="",BB=Be(DB,[["__scopeId","data-v-83f04927"]]),TB=e.defineComponent({__name:"designForm",props:{reportObj:{default:{}}},emits:["success"],setup(t,{expose:r,emit:n}){const o=t,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d,dynamicSearchParamsTitle:c}=i.$globalHooks.useDynamicSearch(),{base64ToBlob:f,chartJsonFormat:u,echartsTypeList:p}=i.$globalUtils,h=n,{option:m,formatChart:y}=mt(),g=e.ref(!1),b=e.ref(""),w=e.ref(null),_=e.ref(""),C=e.ref(""),S=e.ref([]),x=e.ref({}),v=e.ref({type:"",value:""}),V=e.ref(!1),$=async()=>{if(V.value=!0,e.unref(B)=="MODEL_INDICATORS"){a.getChartData.params.params=d(l.value);const O=e.unref(R).find(N=>N.type==e.unref(_));await y(O==null?void 0:O.code),V.value=!1,e.unref(v).type=_.value,e.unref(v).value=m.value}else{const O=d(e.unref(l)),N=await De(i).pullEchartsDataVO({indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,params:O,echartsType:e.unref(_),targetClient:"WEB"});if(!N)return;V.value=!1,e.unref(v).type=_.value;try{e.unref(v).value=u(N.data.config)}catch{e.unref(v).value=N.data.config}}},B=e.ref(""),R=e.ref({}),T=async(O,N)=>{var I,z;C.value=O,S.value=[];let D;if(B.value=N.indicatorsType??N.type??"INDICATORS",e.unref(B)=="MODEL_INDICATORS"){D=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${N.indicatorsId??N.id}`);const M=JSON.parse(D.data.sortArgsJson??"{}"),j=Object.keys(e.unref(M)).map(F=>({field:F,type:M[F]=="ascending"?"asc":"desc"}));a.setChartData({x:JSON.parse(D.data.groupArgsJson),y:JSON.parse(D.data.aggArgsJson),params:{aggArgsJson:D.data.aggArgsJson,groupArgsJson:D.data.groupArgsJson,sortArgsJson:JSON.stringify(j),modelIndicatorsId:N.indicatorsId??N.id,params:d(s(JSON.parse(N.formConfJson??((I=e.unref(D))==null?void 0:I.formConfJson)??"[]"))),pageSize:D.data.pageSize,modelId:D.data.modelId}})}else D=await De(i).getIndicatorsPanelConf(N.indicatorsId??N.id);D&&(g.value=!0,x.value=N,e.unref(B)=="MODEL_INDICATORS"?(R.value=D.data.echarts,S.value=D.data.echarts.map(M=>M.type)):S.value=D.data.views,_.value=O=="add"?S.value[0]:N.echartsType,b.value=N.indicatorsName??N.name,l.value=O=="add"?s(JSON.parse(((z=D.data)==null?void 0:z.formConfJson)??"[]")):JSON.parse(N.formConfJson),$())},k=async()=>{var I;const O=e.unref(w).$refs.echart;if(O&&!O.getDataURL()){i.$message.warning("图片未生成完毕,请重新保存");return}const N={echartsType:e.unref(v).type,indicatorsId:e.unref(x).indicatorsId??e.unref(x).id,reportId:o.reportObj.id,paramsJson:JSON.stringify(d(e.unref(l))),formConfJson:JSON.stringify(e.unref(l)),title:`${(I=p[e.unref(_)])==null?void 0:I.name} ${c({showTitle:!1})}`,indicatorsType:e.unref(B)};if(e.unref(C)=="edit"&&(N.id=e.unref(x).id),!!await De(i).saveIndicatorsApply(N)){if(e.unref(C)=="edit"&&O){const z=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});await new Promise(M=>{e.nextTick(async()=>{const j=f(O.getDataURL());await De(i).updateIndicatorsApplyImage(j,N.id),M(!0)})}),z.close()}i.$message.success("操作成功"),g.value=!1,h("success")}};return r({init:T}),(O,N)=>{const D=e.resolveComponent("AppDynamicSearch"),I=e.resolveComponent("AppChart"),z=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(z,{modelValue:e.unref(g),"onUpdate:modelValue":N[2]||(N[2]=M=>e.isRef(g)?g.value=M:null),title:e.unref(b),size:"632px"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(C)=="add"?"生成报告使用指标":"完成"),1)]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:N[1]||(N[1]=M=>g.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.unref(l).length>0?(e.openBlock(),e.createBlock(D,{key:0,form:e.unref(l),onSuccess:$},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElRadioGroup),{onChange:$,modelValue:e.unref(_),"onUpdate:modelValue":N[0]||(N[0]=M=>e.isRef(_)?_.value=M:null),class:"mb-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),M=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:M,value:M,label:M,class:"mr-3"},{default:e.withCtx(()=>{var j;return[e.createTextVNode(e.toDisplayString((j=e.unref(p)[M])==null?void 0:j.name),1)]}),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"]),e.createVNode(I,{ref_key:"appChartRef",ref:w,type:e.unref(v).type,options:e.unref(v).value,loading:e.unref(V)},null,8,["type","options","loading"])]),_:1},8,["modelValue","title"])}}}),OB={key:0,class:"chart"},IB=e.defineComponent({__name:"design",emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),{base64ToBlob:a,chartJsonFormat:i,resetUrl:l}=o.$globalUtils,s=e.ref(!1),d=e.ref({reportContent:""}),c=e.ref(""),f=e.ref(null),u=e.ref(null),p=e.ref(!1),h=e.ref(null),m=e.ref(null),y=e.ref(null),g=e.ref(null),b=e.ref(null),w=e.ref(null),_=n,{option:C,getModelIndicatorsData:S,setSingleValue:x}=mt(),v=T=>{const k=[];(function N(D){var I,z,M;D&&(k.push((D==null?void 0:D.className)??((I=D==null?void 0:D.target)==null?void 0:I.className)??""),(D!=null&&D.parentNode||(z=D.target)!=null&&z.parentNode)&&N((D==null?void 0:D.parentNode)||((M=D.target)==null?void 0:M.parentNode)))})(T);const O=k.toString();O.indexOf("indicator")==-1&&O.indexOf("el-color")==-1&&(c.value="")};e.watch(s,T=>{var k;T||(document.removeEventListener("click",v),f&&((k=f.value)==null||k.destroy()),f.value=null,p.value=!1)});const V=async T=>{f.value=null,s.value=!0,d.value=JSON.parse(JSON.stringify(T)),setTimeout(()=>{p.value=!0},100)},$=async(T,k)=>{switch(T){case"add":case"edit":e.unref(g).init(T,k);break;case"insert":{u.value={};let O;switch(k.indicatorsType=="MODEL_INDICATORS"?(await S(k.indicatorsId??k.id,k.echartsType,k.formConfJson),O={data:{[k.id]:{config:C.value,dataList:JSON.stringify(C.value.dataset.source)}}}):O=await De(o).mapEchartsData(k.id),String(k.echartsType)){case"8":{const N=JSON.parse(O.data[k.id].dataList);if(N.length==0){o.$message.warning("暂无数据");return}const D={type:"table",width:"100%",children:[]};if(k.indicatorsType=="MODEL_INDICATORS"){const I=O.data[k.id].config;D.children.push(...I.dataset.dimensions.map(z=>({type:"table-cell",isHeader:!0,children:[{text:z}]}))),D.children.push(...N.map(z=>({type:"table-row",children:I.dataset.dimensions.map(M=>{let j=z[M];const F=I.customSeriesData[M];if(F){const{prefix:G,toFixed:H,suffix:X}=F;j=`${G}${isNaN(j)?j:Number(j).toFixed(H)}${X}`}return{type:"table-cell",children:[{text:j,color:(F==null?void 0:F.color)??""}]}})})))}else D.children=[{type:"table-row",children:Object.keys(N[0]).map(I=>({type:"table-cell",isHeader:!0,children:[{text:I}]}))},...N.map(I=>({type:"table-row",children:Object.keys(I).map(z=>({type:"table-cell",children:[{text:I[z]}]}))}))];qe.DomEditor.isSelectedEmptyParagraph(f.value)&&qe.SlateTransforms.removeNodes(f.value,{mode:"highest"}),qe.SlateTransforms.insertNodes(f.value,D,{mode:"highest"}),f.value.deselect()}break;case"7":{const N=O.data[k.id].config,D={type:"indicator",content:k.indicatorsName,singleValue:N,id:k.id,indicatorsType:k.indicatorsType||"INDICATORS",chartType:k.echartsType,subtitle:k.title,children:[{text:""}]};if(k.indicatorsType=="MODEL_INDICATORS"){const I=e.ref("");e.unref(C).dataset.dimensions.length==1?I.value=e.unref(C).dataset.dimensions[0]:await new Promise(z=>{E.ElMessageBox({title:"选择数据",showConfirmButton:!1,message:()=>e.h("div",{style:{width:"396px"}},[e.h(E.ElSelect,{class:"w-full mt-5",modelValue:I.value,placeholder:"请选择数据","onUpdate:modelValue":M=>{I.value=M}},{default:()=>e.unref(C).dataset.dimensions.map(M=>e.h(E.ElOption,{label:M,value:M,key:M}))}),e.h("div",{class:"mt-5 flex justify-end"},[e.h(E.ElButton,{type:"primary",onclick:async()=>{if(e.unref(I)==""){o.$message.warning("请选择数据");return}z(!0),E.ElMessageBox.close()}},{default:()=>"提交"}),e.h(E.ElButton,{onclick:async()=>E.ElMessageBox.close()},{default:()=>"关闭"})])])})}),D.singleValueKey=I.value,D.singleValue=x(I.value)}f.value.restoreSelection(),f.value.insertNode(D)}break;default:{const N=E.ElLoading.service({lock:!0,text:"数据处理中",background:"rgba(0, 0, 0, 0.7)",customClass:"ajax-loading"});let D=l(k.coverUrl||"");if(!D){try{u.value=i(O.data[k.id].config)}catch{u.value=O.data[k.id].config}await new Promise(I=>{e.nextTick(()=>{e.unref(w).chart.on("finished",async()=>{const z=a(e.unref(w).getDataURL()),M=await De(o).updateIndicatorsApplyImage(z,k.id);D=l(M.data),I(!0)})})})}f.value.insertNode({type:"indicator",content:k.indicatorsName,indicatorsType:k.indicatorsType||"INDICATORS",id:k.id,chartType:k.echartsType,subtitle:k.title,src:D,children:[{text:""}]}),k.coverUrl=D,u.value=null,N.close()}break}}break;case"submit":{if(!await De(o).reportSubmit({id:e.unref(d).id,reportContent:f.value.getHtml(),reportName:e.unref(d).reportName,indicatorsNum:e.unref(y).list.length}))return;window.frames.length==parent.frames.length&&o.$message.success("操作成功"),_("success"),s.value=!1}break;case"close":s.value=!1;break}},B=T=>{f.value=Object.seal(T),document.addEventListener("click",v,!0)},R=()=>{const T=e.unref(m),k=e.unref(y);T.list.length>0&&k.list.length>0&&T.list.forEach(O=>{O.value=k.list.filter(N=>N.indicatorsId==O.indicatorsId).length})};return o.$baseEventBus.on("editor",T=>{e.nextTick(()=>{e.unref(b).init(T,e.unref(d))})}),r({init:V}),(T,k)=>{const O=e.resolveComponent("v-chart"),N=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(N,{modelValue:e.unref(s),"onUpdate:modelValue":k[4]||(k[4]=D=>e.isRef(s)?s.value=D:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElContainer),{class:"designBody"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElAside),{width:"310px",class:"p-3"},{default:e.withCtx(()=>[e.createVNode(nB,{ref_key:"designLeftRef",ref:m,onClick:$,onSuccess:R},null,512)]),_:1}),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createBlock(SB,{key:0,ref_key:"designMainRef",ref:h,onEditorSuccess:B,editorRef:e.unref(f),reportObj:e.unref(d),modelValue:e.unref(c),"onUpdate:modelValue":k[2]||(k[2]=D=>e.isRef(c)?c.value=D:null)},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:k[0]||(k[0]=D=>$("submit",{}))},{default:e.withCtx(()=>[e.createTextVNode("保存报告")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"warning",onClick:k[1]||(k[1]=D=>$("close",{}))},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})])]),_:1},8,["editorRef","reportObj","modelValue"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(E.ElAside),{width:"310px",id:"useReportcontainer",class:"p-3",style:{"border-left":"1px solid #ebeef5"}},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(BB,{key:0,ref_key:"designRightRef",ref:y,onClick:$,reportObj:e.unref(d),editorRef:e.unref(f),onSuccess:R,indicatorsId:e.unref(c)},null,8,["reportObj","editorRef","indicatorsId"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.unref(u)?(e.openBlock(),e.createElementBlock("div",OB,[e.createVNode(O,{ref_key:"echartsRef",ref:w,option:e.unref(u),autoresize:""},null,8,["option"])])):e.createCommentVNode("",!0),e.createVNode(TB,{ref_key:"designFormRef",ref:g,reportObj:e.unref(d),onSuccess:k[3]||(k[3]=D=>e.unref(y).init())},null,8,["reportObj"]),e.createVNode(fm,{ref_key:"previewRef",ref:b,type:"design"},null,512)]),_:1},8,["modelValue"])}}}),OR="",zB=Be(IB,[["__scopeId","data-v-a5619b8c"]]),RB=t=>(e.pushScopeId("data-v-6a766735"),t=t(),e.popScopeId(),t),MB={key:1,class:"flex flex-wrap pt-3 pb-7"},AB={class:"reportName line-clamp-2"},LB={class:"auth"},FB={class:"times"},jB=["onClick"],PB={class:"w-full flex justify-center mt-5"},UB=RB(()=>e.createElementVNode("div",{class:"h-px bg-gray-200 w-full mt-2"},null,-1)),WB={class:"flex w-full justify-center mt-2"},GB=e.defineComponent({__name:"index",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=e.ref(null),a=e.ref(null),i=e.ref(null),l=e.reactive([]),s=e.reactive([{name:"报告名称",type:Rr.Text,fieldName:"reportName",value:""}]),d=e.ref([{label:"预览",icon:"ri-eye-line",type:"primary",key:"PREVIEW",show:!1},{label:"编辑",icon:"ri-edit-line",type:"primary",key:"EDIT",show:!1},{label:"PDF",icon:"ri-file-pdf-line",type:"warning",key:"DOWNLOAD_PDF",show:!1},{label:"WORD",icon:"ri-file-word-2-line",type:"primary",key:"DOWNLOAD_WORD",show:!1},{label:"复制",icon:"ri-file-copy-line",type:"primary",key:"COPY",show:!1},{label:"删除",icon:"ri-delete-bin-line",type:"danger",key:"DEL",show:!1}]),c=e.ref([]);De(r).getCurrFunc("INDICATORS_REPORT").then(p=>{c.value=p.data,p.data.includes("CREATE")&&l.push({name:"新增报告",key:"add",type:"primary",icon:"ri-add-line"}),e.unref(d).forEach(h=>{h.show=p.data.includes(h.key)})});const f=e.reactive([{label:"报告名称",prop:"reportName"},{label:"报告使用库",prop:"indicatorsNum",slot:!0},{label:"撰写人",prop:"createUserName"},{label:"撰写时间",prop:"createTime"},{label:"操作",prop:"action",slot:!0,width:"410px"}]),u=async p=>{const{type:h,row:m}=p;switch(h){case"zb":e.unref(o).init(m);break;case"add":r.$basePrompt({content:"新增指标报告",placeholder:"请输入报告名称",inputType:"input",beforeCloseFunc:async(y,g,b)=>{if(y!="confirm"){b();return}const w=await De(r).reportSubmit({reportName:g.inputValue});w&&(r.$message.success("操作成功"),e.unref(n).getData(),e.unref(a).init({id:w.data,reportName:g.inputValue,reportContent:""}),b())}});break;case"DEL":r.$baseConfirm({content:"是否确定删除",callConfirm:async()=>{await De(r).reportRemove(m.id)&&(r.$message.success("删除成功"),e.unref(n).getData())}});break;case"COPY":r.$baseConfirm({content:"是否确定复制",callConfirm:async()=>{await De(r).reportCopy(m.id)&&(r.$message.success("操作成功"),e.unref(n).getData())}});break;case"EDIT":e.unref(a).init(m);break;case"DOWNLOAD_PDF":case"PREVIEW":case"DOWNLOAD_WORD":e.nextTick(()=>{e.unref(i).init(h,m)});break}};return(p,h)=>{const m=e.resolveComponent("AppEmpty"),y=e.resolveComponent("AppList");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(y,{url:`/api/ace-data-center/indicators-report/list?descs=create_time&projectId=${e.unref(r).$baseGetCurrentProjectId}`,tableData:e.unref(f),searchForm:e.unref(s),searchBtns:e.unref(l),listType:"custom",onBtnClick:u,ref_key:"appListRef",ref:n},{"list-slot":e.withCtx(({list:g,loading:b})=>[e.createVNode(e.unref(E.ElSkeleton),{loading:b,animated:""},{default:e.withCtx(()=>[g.length==0?(e.openBlock(),e.createBlock(m,{key:0,description:"暂无数据"})):(e.openBlock(),e.createElementBlock("div",MB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"items"},[e.createElementVNode("div",AB,e.toDisplayString(w.reportName),1),e.createElementVNode("div",LB,"作者:"+e.toDisplayString(w.createUserName),1),e.createElementVNode("div",FB,e.toDisplayString(w.createTime),1),e.unref(c).includes("VIEW_INDICATOR")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tags",onClick:e.withModifiers(_=>u({type:"zb",row:w,index:-1}),["stop"])},[e.createTextVNode(" 查看指标库: "),e.createElementVNode("span",null,e.toDisplayString(w.indicatorsNum||0),1)],8,jB)):e.createCommentVNode("",!0),e.createElementVNode("div",PB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_.icon},[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElLink),{key:0,class:"inline-flex items-center ml-3 mr-3",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-1 text-base"])},null,2),e.createTextVNode(" "+e.toDisplayString(_.label),1)]),_:2},1032,["type","onClick"])):e.createCommentVNode("",!0)],64))),128))]),UB,e.createElementVNode("footer",WB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).filter(_=>!["EDIT","COPY"].includes(_.key)),_=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[_.show?(e.openBlock(),e.createBlock(e.unref(E.ElTooltip),{content:_.label,key:_.icon},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElLink),{class:"inline-flex items-center",type:_.type,onClick:e.withModifiers(C=>u({type:_.key,row:w,index:-1}),["stop"])},{default:e.withCtx(()=>[e.createElementVNode("i",{class:e.normalizeClass([_.icon,"mr-2 ml-2 text-lg"])},null,2)]),_:2},1032,["type","onClick"])]),_:2},1032,["content"])):e.createCommentVNode("",!0)],64))),256))])]))),128))]))]),_:2},1032,["loading"])]),_:1},8,["url","tableData","searchForm","searchBtns"]),e.createVNode(qD,{ref_key:"useIndicatorsRef",ref:o},null,512),e.createVNode(zB,{ref_key:"designRef",ref:a,onSuccess:h[0]||(h[0]=g=>e.unref(n).getData())},null,512),e.createVNode(fm,{ref_key:"previewRef",ref:i},null,512)])}}}),IR="",HB=Be(GB,[["__scopeId","data-v-6a766735"]]);function pm(t,r,n,o,a){const i=r===void 0?void 0:r.key;return{sel:t,data:r,children:n,text:o,elm:a,key:i}}const hm=Array.isArray;function Qs(t){return typeof t=="string"||typeof t=="number"||t instanceof String||t instanceof Number}function mm(t,r,n){if(t.ns="http://www.w3.org/2000/svg",n!=="foreignObject"&&r!==void 0)for(let o=0;o<r.length;++o){const a=r[o];if(typeof a=="string")continue;const i=a.data;i!==void 0&&mm(i,a.children,a.sel)}}function nn(t,r,n){let o={},a,i,l;if(n!==void 0?(r!==null&&(o=r),hm(n)?a=n:Qs(n)?i=n.toString():n&&n.sel&&(a=[n])):r!=null&&(hm(r)?a=r:Qs(r)?i=r.toString():r&&r.sel?a=[r]:o=r),a!==void 0)for(l=0;l<a.length;++l)Qs(a[l])&&(a[l]=pm(void 0,void 0,void 0,a[l],void 0));return t.startsWith("svg")&&(t.length===3||t[3]==="."||t[3]==="#")&&mm(o,a,t),pm(t,o,a,i,void 0)}const YB=(t,r,n)=>{const o=qe.DomEditor.isNodeSelected(n,t),{id:a}=qe.DomEditor.findKey(n,t),{content:i="",chartType:l="",id:s="",singleValue:d="",singleValueKey:c="",subtitle:f="",src:u="",fontSize:p="16px",bold:h="",color:m="",indicatorsType:y="INDICATORS",width:g=400}=t,{EXTEND_CONF:{indicatorConfig:b}}=n.getConfig(),{clickIndicator:w}=b,_=[];return u?(_.push(nn("img.editor-indicator-img",{props:{src:u},style:{},dataset:{id:s}})),o&&_.push(nn("input.indicator-img-range",{type:"range",style:{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",zIndex:"99"},min:300,max:550,value:g,on:{input(C){const S={id:s,chartType:l,subtitle:f,singleValue:d,singleValueKey:c,width:C.target.value};qe.SlateTransforms.setNodes(n,S,{at:qe.DomEditor.findPath(n,t)})}}}))):_.push(d||i),_.push(nn("span.indicator-tooltip",{style:{position:"absolute",background:"#fff",border:"1px solid var(--g-border-color)",lineHeight:"25px",padding:"0 5px",color:"orange",fontSize:"12px",left:"0px",top:"-30px",zIndex:"88",display:"none",whiteSpace:"nowrap",fontWeight:"normal"},dataset:{id:s}},[nn("span",{style:{color:"#000",fontWeight:"bold"}},`${i}:`),nn("span",{},f),nn("span",{style:{color:"#000"}},c?`(${c})`:"")])),nn("span.editor-indicator",{id:`editor-indicator-${a}`,props:{contentEditable:!1},dataset:{id:s,chartType:l,subtitle:f,width:g,singleValue:d,singleValueKey:c,src:u,fontSize:p,color:m,indicatorsType:y,bold:h},style:{width:`${l=="7"?null:g}px`,marginLeft:"3px",marginRight:"3px",display:"inline-block",cursor:"pointer",backgroundColor:"var(--w-e-textarea-slight-bg-color)",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"0 3px",fontSize:p,fontWeight:h=="true"?"bold":"normal",color:m},on:{click(C){C.preventDefault(),w&&w(s,t)}}},_)},XB=t=>{const{chartType:r="",id:n="",type:o,subtitle:a,singleValue:i="",singleValueKey:l="",content:s="",src:d="",fontSize:c="16px",bold:f=!1,color:u="",indicatorsType:p="INDICATORS",width:h=400}=t;return`<span
879
879
  class="editor-indicator"
880
880
  data-w-e-type="indicator"
881
881
  data-w-e-is-void
@@ -893,4 +893,4 @@ ${u} div ,${u} span,${u} a,${u} * {
893
893
  data-bold="${f}"
894
894
  data-color="${u}"
895
895
  data-src="${d}"
896
- >${s}</span>`},qB=t=>{const r=t.getAttribute("data-chartType")||"",n=t.getAttribute("data-id")||"",o=t.getAttribute("data-content")||"",a=t.getAttribute("data-singleValue")||"",i=t.getAttribute("data-singleValueKey")||"",l=t.getAttribute("data-subtitle")||"",s=t.getAttribute("data-width")||"",d=t.getAttribute("data-fontSize")||"",c=t.getAttribute("data-bold")||"",f=t.getAttribute("data-color")||"",u=t.getAttribute("data-src")||"",p=t.getAttribute("data-indicatorsType")||"";return{type:"indicator",id:n,chartType:r,subtitle:l,content:o,width:s,src:u,fontSize:d,bold:c,singleValue:a,singleValueKey:i,color:f,indicatorsType:p,children:[{text:o}]}};function JB(t){const{insertText:r,isInline:n,isVoid:o}=t,a=t;return a.insertText=i=>{if(tt.DomEditor.getSelectedElems(a).some(d=>a.isVoid(d))){r(i);return}r(i)},a.isInline=i=>tt.DomEditor.getNodeType(i)==="indicator"?!0:n(i),a.isVoid=i=>tt.DomEditor.getNodeType(i)==="indicator"?!0:o(i),a}const KB={editorPlugin:JB,renderElems:[{type:"indicator",renderElem:YB}],elemsToHtml:[{type:"indicator",elemToHtml:XB}],parseElemsHtml:[{selector:'span[data-w-e-type="indicator"]',parseElemHtml:qB}]},ec=t=>(e.pushScopeId("data-v-93fa2d08"),t=t(),e.popScopeId(),t),ZB={class:"flex-1 border border-solid border-gray-200 p-2"},QB={class:"flex justify-end"},eT=ec(()=>e.createElementVNode("div",{class:"h-px mt-2 mb-2 bg-gray-200"},null,-1)),tT={class:"max-h-80 overflow-y-auto"},rT=ec(()=>e.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),nT=ec(()=>e.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),oT=e.defineComponent({__name:"customSearch",props:{dynamicSearchForm:{default:()=>[]},customSearchVisible:{type:Boolean,default:!1}},emits:["update:customSearchVisible","dynamicSearchFormUpdate","success"],setup(t,{expose:r,emit:n}){var w;const o=t,a=n;e.watch(()=>o.customSearchVisible,_=>{_&&e.nextTick(()=>{g()})});const{proxy:i}=e.getCurrentInstance(),l=e.inject("modelEle"),s=e.ref([]),d=e.ref([]);i.$baseHttp.get(`/api/ace-data-center/model/detail?id=${(w=e.unref(l))==null?void 0:w.id}`).then(_=>{s.value=_.data.listModelAttribute.map(C=>({name:C.attributeComment,key:C.attributeCode,dataType:C.dataType,checked:!1,type:"",value:"",minValue:"",maxValue:"",defaultRule:"",dictId:"",options:""}))});const c=e.ref([]);i.$baseHttp.get(`/api/ace-data-center/custom-dic/options?projectId=${i.$baseGetCurrentProjectId}`).then(_=>{c.value=_.data});const f={yymmddSingle:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddRange:[{name:"近一周",value:"week"}],yymmSingle:[{name:"当月",value:"month"}],yymmRange:[{name:"近两月",value:"two-month"}],yySingle:[{name:"当年",value:"year"}],yyRange:[{name:"近两年",value:"two-year"}]},u=_=>{let C="date",S="YYYY-MM-DD";return["yyRange","yySingle"].includes(_)&&(C="year",S="YYYY"),["yymmRange","yymmSingle"].includes(_)&&(C="month",S="YYYY-MM"),{type:C,format:S}},p=(_,C,S)=>_=="gt"?C.getTime()>on(S||"").valueOf():C.getTime()<on(S||"").valueOf(),h=(_,C,S)=>{if(_[C]==""||_[S]=="")return;const x=Number(_[C]),v=Number(_[S]);(C=="minValue"?x>v:x<v)&&(_[C]=_[S])},m=_=>{_.value="",_.options=[],_.dictId&&i.$baseHttp.get(`/api/ace-data-center/custom-dic/readDict/${_.dictId}`).then(C=>{_.options=C.data??[]})},y=_=>{_.value="",_.minValue="",_.maxValue="",_.defaultRule="",_.dictId="",_.options=[]},g=()=>{d.value=JSON.parse(JSON.stringify(e.unref(s))),e.unref(d).forEach(_=>{const C=o.dynamicSearchForm.find(S=>S.key==_.key);C&&(_.checked=!0,Object.keys(C).forEach(S=>{_[S]=C[S]})),["varchar","text"].includes(_.dataType)&&!C&&(_.type="stringSingle")})},b=()=>{a("dynamicSearchFormUpdate",d.value.filter(_=>_.checked&&_.type)),a("update:customSearchVisible",!1)};return r({init:g}),(_,C)=>(e.openBlock(),e.createElementBlock("div",ZB,[e.createElementVNode("div",QB,[e.createVNode(e.unref(E.ElButton),{type:"primary",size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-3",size:"small",onClick:C[0]||(C[0]=S=>a("update:customSearchVisible",!1))},{default:e.withCtx(()=>[e.createTextVNode(" 关闭 ")]),_:1})]),eT,e.createElementVNode("div",tT,[e.createVNode(e.unref(E.ElForm),{inline:"",size:"small"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(S,x)=>(e.openBlock(),e.createElementBlock("div",{key:x},[e.createVNode(e.unref(E.ElFormItem),{label:""},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElCheckbox),{modelValue:S.checked,"onUpdate:modelValue":v=>S.checked=v,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e.createVNode(e.unref(E.ElFormItem),{label:"名称:"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElInput),{modelValue:S.name,"onUpdate:modelValue":v=>S.name=v,modelModifiers:{trim:!0},size:"small",placeholder:"请输入名称",clearable:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e.createVNode(e.unref(E.ElFormItem),{label:"类型:"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElSelect),{size:"small",clearable:"",teleported:!1,modelValue:S.type,"onUpdate:modelValue":v=>S.type=v,modelModifiers:{trim:!0},onChange:v=>y(S),placeholder:"类型"},{default:e.withCtx(()=>[["date","datetime"].includes(S.dataType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(E.ElOption),{label:"年·区间",value:"yyRange"}),e.createVNode(e.unref(E.ElOption),{label:"年·单值",value:"yySingle"}),e.createVNode(e.unref(E.ElOption),{label:"年月·区间",value:"yymmRange"}),e.createVNode(e.unref(E.ElOption),{label:"年月·单值",value:"yymmSingle"}),e.createVNode(e.unref(E.ElOption),{label:"年月日·区间",value:"yymmddRange"}),e.createVNode(e.unref(E.ElOption),{label:"年月日·单值",value:"yymmddSingle"})],64)):["int","decimal","double"].includes(S.dataType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(E.ElOption),{label:"数值·区间",value:"numberRange"}),e.createVNode(e.unref(E.ElOption),{label:"数值·单值",value:"numberSingle"}),e.createVNode(e.unref(E.ElOption),{label:"下拉框·字典",value:"select"})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(e.unref(E.ElOption),{label:"字符串",value:"stringSingle"}),e.createVNode(e.unref(E.ElOption),{label:"下拉框·字典",value:"select"})],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),S.type?(e.openBlock(),e.createBlock(e.unref(E.ElFormItem),{key:0,label:"默认值:"},{default:e.withCtx(()=>[f[S.type]?(e.openBlock(),e.createBlock(e.unref(E.ElSelect),{key:0,size:"small",clearable:"",style:{"margin-right":"10px"},teleported:!1,modelValue:S.defaultRule,"onUpdate:modelValue":v=>S.defaultRule=v,modelModifiers:{trim:!0},placeholder:"默认值"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f[S.type],v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.name,value:v.value,key:v.value},null,8,["label","value"]))),128)),e.createVNode(e.unref(E.ElOption),{label:"自定义",value:"custom"})]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),S.type.endsWith("Range")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[["yyRange","yymmRange","yymmddRange"].includes(S.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(E.ElDatePicker),{size:"small",teleported:!1,modelValue:S.minValue,"onUpdate:modelValue":v=>S.minValue=v,clearable:"",placeholder:"开始","disabled-date":v=>p("gt",v,S.maxValue),type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"]),rT,e.createVNode(e.unref(E.ElDatePicker),{size:"small",teleported:!1,modelValue:S.maxValue,"onUpdate:modelValue":v=>S.maxValue=v,clearable:"",placeholder:"结束","disabled-date":v=>p("lt",v,S.minValue),type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(E.ElInput),{size:"small",modelValue:S.minValue,"onUpdate:modelValue":v=>S.minValue=v,modelModifiers:{trim:!0},max:S.maxValue,clearable:!1,onBlur:v=>h(S,"minValue","maxValue"),type:"number",placeholder:"最小值"},null,8,["modelValue","onUpdate:modelValue","max","onBlur"]),nT,e.createVNode(e.unref(E.ElInput),{size:"small",modelValue:S.maxValue,"onUpdate:modelValue":v=>S.maxValue=v,modelModifiers:{trim:!0},min:S.minValue,clearable:!1,onBlur:v=>h(S,"maxValue","minValue"),type:"number",placeholder:"最大值"},null,8,["modelValue","onUpdate:modelValue","min","onBlur"])],64))],64)):e.createCommentVNode("",!0),S.type.includes("Single")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[["yySingle","yymmSingle","yymmddSingle"].includes(S.type)?(e.openBlock(),e.createBlock(e.unref(E.ElDatePicker),{key:0,size:"small",teleported:!1,modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,clearable:"",placeholder:"请输入"+S.name,type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","placeholder","type","value-format"])):(e.openBlock(),e.createBlock(e.unref(E.ElInput),{key:1,size:"small",modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,modelModifiers:{trim:!0},teleported:!1,clearable:"",type:S.type=="numberSingle"?"number":"",placeholder:"请输入"+S.name},null,8,["modelValue","onUpdate:modelValue","type","placeholder"]))],64)):e.createCommentVNode("",!0),S.type=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createVNode(e.unref(E.ElSelect),{size:"small",teleported:!1,style:{"margin-right":"10px"},modelValue:S.dictId,"onUpdate:modelValue":v=>S.dictId=v,placeholder:"字典值",clearable:"",onChange:v=>m(S)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.label,value:v.code,key:v.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),e.createVNode(e.unref(E.ElSelect),{size:"small",teleported:!1,modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,placeholder:"请选择",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.options,v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.name,value:v.code,key:v.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):e.createCommentVNode("",!0)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),_:1})])]))}}),zR="",gm=Be(oT,[["__scopeId","data-v-93fa2d08"]]),aT={class:"field"},iT={class:"field-container h-full flex-1 flex items-center justify-center cursor-pointer overflow-hidden"},lT=["onClick"],sT={class:"field-label whitespace-nowrap text-ellipsis overflow-hidden"},cT={key:0,class:"flex items-center h-full"},dT={class:"mr-5"},fT=["onClick"],uT={key:0,class:"field-add"},pT=["onClick"],hT=e.defineComponent({__name:"model-table-dimension",props:{loading:{type:Boolean,default:!0},iconMap:{default:()=>{}},calendarType:{default:()=>{}},modelValue:{default:()=>[]},list:{default:()=>[]}},emits:["success","update:modelValue"],setup(t,{emit:r}){const n=t,o=r;e.inject("chartList");const a=e.ref(""),i=e.computed(()=>n.list.filter(f=>f.columnComment.indexOf(e.unref(a))>=0)),l=f=>{o("update:modelValue",[f]),o("success")},s=f=>{o("update:modelValue",[...n.modelValue,f]),o("success")},d=f=>{o("update:modelValue",n.modelValue.filter(u=>u.identifier!==f.identifier)),o("success")},c=(f,u)=>{const p=n.modelValue.find(h=>h.identifier==u.identifier);p.dateFormatType=f,u.dateFormatType=f,o("success")};return(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"计算维度",class:"mt-4 mb-2"}),e.createVNode(e.unref(E.ElSkeleton),{loading:f.loading,animated:""},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"搜索字段",class:"mb-2"},null,8,["modelValue"]),e.createElementVNode("div",aT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),h=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["field-item",{active:f.modelValue.some(m=>m.identifier==h.identifier)}]),key:h.identifier},[e.createElementVNode("div",iT,[e.createElementVNode("div",{class:"flex flex-1 items-center overflow-hidden",onClick:m=>l(h)},[e.createElementVNode("i",{class:e.normalizeClass([f.iconMap[h.dataType],"mr-2"])},null,2),e.createElementVNode("span",sT,e.toDisplayString(h.columnComment),1)],8,lT),f.modelValue.some(m=>m.identifier==h.identifier)?(e.openBlock(),e.createElementBlock("div",cT,[["date","datetime"].includes(h.dataType)?(e.openBlock(),e.createBlock(e.unref(E.ElDropdown),{key:0,trigger:"hover",onCommand:m=>c(m,h)},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(E.ElDropdownMenu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.calendarType,(m,y)=>(e.openBlock(),e.createBlock(e.unref(E.ElDropdownItem),{command:y,key:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",dT,e.toDisplayString(f.calendarType[h.dateFormatType]),1)]),_:2},1032,["onCommand"])):e.createCommentVNode("",!0),e.createElementVNode("i",{class:"ri-close-line cursor-pointer",onClick:e.withModifiers(m=>d(h),["stop"])},null,8,fT)])):e.createCommentVNode("",!0)]),!f.modelValue.some(m=>m.identifier==h.identifier)&&f.modelValue.length?(e.openBlock(),e.createElementBlock("div",uT,[e.createElementVNode("i",{class:"ri-add-line cursor-pointer text-gray-800",onClick:e.withModifiers(m=>s(h),["stop"])},null,8,pT)])):e.createCommentVNode("",!0)],2))),128))])]),_:1},8,["loading"])],64)}}}),RR="",mT=Be(hT,[["__scopeId","data-v-1be11605"]]),tc=t=>(e.pushScopeId("data-v-3643599f"),t=t(),e.popScopeId(),t),gT={class:"mb-2"},yT=tc(()=>e.createElementVNode("div",{class:"font-bold mb-2"},"公式名称:",-1)),bT={class:"mb-4 mt-4 relative"},_T={class:"font-bold mb-2"},wT={class:"text-color-primary ml-2"},CT={key:0,class:"selection el-popper is-light el-popover","data-popper-placement":"bottom"},ST=tc(()=>e.createElementVNode("div",null,"选择变量",-1)),xT={class:"mt-2"},vT=tc(()=>e.createElementVNode("span",{class:"el-popper__arrow","data-popper-arrow":""},null,-1)),ET="0123456789+-*/@.()",VT=e.defineComponent({__name:"model-exp",props:{options:{default:()=>[]}},emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),a=e.ref(!1),i=t,l=n,s=e.ref(""),d=e.ref(null),c=T=>{const{key:k}=T;switch(k){case"Enter":T.preventDefault();break;case"@":case"Process":h();break}};let f=null;const u=()=>{const T=e.unref(d).innerHTML;let k=v(T);k=k.map(N=>$(N)?V(N):N.data.split("").filter(D=>ET.includes(D)).join(""));const O=k.join("");if(T!==O){const N=B(T,O);e.unref(d).innerHTML=O,R(e.unref(d),N)}clearTimeout(f),f=setTimeout(async()=>{C()},500)},p=e.ref(!1),h=()=>{p.value=!0},m=T=>{const{identifier:k,columnComment:O}=T;p.value=!1;const N=`<div contenteditable="false">${O}<span>${k}</span></div>`;w("@",N)},y=e.ref(null),g=T=>{if(y.value=T,s.value="",a.value=!0,T){const k=JSON.parse(JSON.stringify(T.data));let O=k.exp??"";s.value=k.comment,k.identifier.split(",").forEach(N=>{const D=new RegExp(N,"g"),I=i.options.find(z=>z.identifier==N);if(I){const z=`<div contenteditable="false">${I.columnComment}<span>${N}</span></div>`;O=O.replace(D,(M,j,F)=>{const G=M.length,H=F.slice(j-1,G+j+1);return H.startsWith("_")||H.endsWith("_")?N:z})}}),e.nextTick(()=>{e.unref(d).innerHTML=O.replace(/@/g,""),setTimeout(()=>{C()},100)})}},b=()=>{var T,k;if(!((T=e.unref(_))!=null&&T.exp)){o.$message.warning("公式不能为空");return}if(e.unref(s)==""){o.$message.warning("公式名称不能为空");return}l("success",{...e.unref(_),aggType:"exp",comment:e.unref(s),showLabel:e.unref(s)},((k=e.unref(y))==null?void 0:k.index)??""),a.value=!1},w=(T,k="")=>{if(!e.unref(d))return;let O=e.unref(d).innerHTML;O.includes(T)&&(O=O.replace(new RegExp(T,"g"),k),e.unref(d).innerHTML=O),C()},_=e.ref({}),C=()=>{let T="";const k=[],O=e.unref(d).innerHTML.replace(/\sdata-spm-anchor-id=".*?"/g,"");x({text:O,prefix:'<div contenteditable="false">',suffix:"</div>"}).forEach(D=>{const[I,z]=x({text:D,prefix:"<span>",suffix:"</span>"});z?(T+=`@${z}`,k.push(z)):T+=I}),_.value={exp:T,identifier:k.toString()}},S=T=>{p.value=!1,T&&w("@")};e.onMounted(()=>window.addEventListener("click",S)),e.onBeforeUnmount(()=>window.removeEventListener("click",S)),r({init:g});const x=({text:T,prefix:k,suffix:O})=>T.replace(new RegExp(k,"g"),",").replace(new RegExp(O,"g"),",").split(",").filter(N=>!!N),v=T=>{const k=document.createElement("div");return k.innerHTML=T,[...k.childNodes]},V=T=>{let k=document.createElement("div");k.appendChild(T);let O=k.innerHTML;return k=T=null,O},$=T=>Object.prototype.toString.call(T)==="[object HTMLDivElement]",B=(T,k)=>{const O=T.split(""),N=k.split(""),D=Math.max(O.length,N.length);let I=0;for(let z=0;z<D&&O[z]==N[z];z++)I++;return I},R=(T,k)=>{const O=document.createRange(),N=window.getSelection();let D=0,I=0;const z=v(T.innerHTML);for(let M=0;M<z.length;M++){const j=z[M];if($(j))k-=V(j).length;else if(k>j.length)k-=j.length;else{I=k;break}D++}O.selectNodeContents(T),O.collapse(!1),T.childNodes[D]&&O.setStart(T.childNodes[D],I),O.collapse(!0),N.removeAllRanges(),N.addRange(O)};return(T,k)=>{const O=e.resolveComponent("AppDialog");return e.openBlock(),e.createBlock(O,{modelValue:e.unref(a),"onUpdate:modelValue":k[2]||(k[2]=N=>e.isRef(a)?a.value=N:null),title:"计算公式",size:800},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:k[1]||(k[1]=N=>a.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",gT,[yT,e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(s),"onUpdate:modelValue":k[0]||(k[0]=N=>e.isRef(s)?s.value=N:null),placeholder:"请输入公式名称"},null,8,["modelValue"])]),e.createElementVNode("div",bT,[e.createElementVNode("div",_T,[e.createTextVNode(" 公式: "),e.createElementVNode("span",wT,e.toDisplayString(e.unref(_).exp),1)]),e.createElementVNode("div",{ref_key:"formulaRef",ref:d,class:"formula flex-1",contenteditable:"",placeholder:"请输入表达式 输入「@」后选择指标",style:{"ime-mode":"disabled"},onKeydown:e.withModifiers(c,["stop"]),onKeyup:u},null,544),e.unref(p)?(e.openBlock(),e.createElementBlock("div",CT,[ST,e.createElementVNode("div",xT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,N=>(e.openBlock(),e.createBlock(e.unref(E.ElTag),{class:"m-2 cursor-pointer",onClick:D=>m(N),key:N.identifier,type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.columnComment),1)]),_:2},1032,["onClick"]))),128))]),vT])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),MR="",kT=Be(VT,[["__scopeId","data-v-3643599f"]]),rc=t=>(e.pushScopeId("data-v-6234eeff"),t=t(),e.popScopeId(),t),NT={key:0},$T=rc(()=>e.createElementVNode("div",{class:"text-sm mb-2 indicators-title"},[e.createElementVNode("i",{class:"ri-table-line mr-1"}),e.createTextVNode(" 基本指标 ")],-1)),DT=["onClick"],BT=rc(()=>e.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),TT={key:1},OT={class:"text-sm mb-2 indicators-title flex items-center"},IT={class:"max-h-96 overflow-y-auto"},zT=["onClick"],RT={class:"field-label"},MT=rc(()=>e.createElementVNode("i",{class:"ri-add-fill"},null,-1)),AT=e.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance();e.inject("chartList");const i=e.ref(!1),l=e.ref(1),s=e.ref(null),d=e.ref([{label:"行数",value:"count",tip:"数据的总行数"},{label:"总和",value:"sum",tip:"列的所有值的总和"},{label:"平均值",value:"avg",tip:"列的所有值的平均值"},{label:"最少",value:"min",tip:"列的最小值"},{label:"最大",value:"max",tip:"列的最大值"},{label:"计算公式",value:"exp",tip:"可手动输入计算公式"}]);e.watch(i,m=>{m&&(u.value={},l.value=1)});const c=m=>{o("update:modelValue",n.modelValue.filter(y=>y.showLabel!==m.showLabel))},f=(m,y)=>{m.aggType=="exp"&&e.unref(s).init({data:m,index:y})},u=e.ref({}),p=m=>{if(m.value==="count"){if(n.modelValue.some(y=>y.aggType==m.value)){a.$message.warning("存在重复数据");return}o("update:modelValue",[...n.modelValue,{identifier:1,aggType:m.value,showLabel:m.label}]),i.value=!1;return}if(m.value=="exp"){e.unref(s).init();return}l.value=2,u.value=m},h=m=>{var y,g;if(n.modelValue.some(b=>{var w;return b.identifier==m.identifier&&b.aggType==((w=e.unref(u))==null?void 0:w.value)})){a.$message.warning("存在重复数据");return}i.value=!1,o("update:modelValue",[...n.modelValue,{identifier:m.identifier,comment:m.columnComment,aggType:(y=e.unref(u))==null?void 0:y.value,showLabel:m.columnComment+((g=e.unref(u))==null?void 0:g.label)}])};return(m,y)=>{const g=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(g,{title:"汇总方式",class:"mb-2"}),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.modelValue,(b,w)=>(e.openBlock(),e.createBlock(e.unref(E.ElTag),{key:b.value,class:e.normalizeClass(["m-1",[b.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:_=>f(b,w),onClose:_=>c(b),type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),e.createVNode(e.unref(E.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:e.unref(i),"onUpdate:visible":y[1]||(y[1]=b=>e.isRef(i)?i.value=b:null)},{reference:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:e.withCtx(()=>[MT,e.createTextVNode(" "+e.toDisplayString(m.modelValue.length?"":"添加度量"),1)]),_:1})]),default:e.withCtx(()=>[e.unref(l)==1?(e.openBlock(),e.createElementBlock("div",NT,[$T,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),b=>(e.openBlock(),e.createElementBlock("div",{onClick:w=>p(b),key:b.value,class:e.normalizeClass([{active:e.unref(u).value==b.value},"indicators-item"])},[e.createTextVNode(e.toDisplayString(b.label)+" ",1),e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:b.tip,placement:"top"},{default:e.withCtx(()=>[BT]),_:2},1032,["content"])],10,DT))),128))])):e.createCommentVNode("",!0),e.unref(l)==2?(e.openBlock(),e.createElementBlock("div",TT,[e.createElementVNode("div",OT,[e.createElementVNode("i",{class:"ri-arrow-left-s-line text-xl mr-1 cursor-pointer",onClick:y[0]||(y[0]=b=>l.value=1)}),e.createTextVNode(" "+e.toDisplayString(e.unref(u).label),1)]),e.createElementVNode("div",IT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.list,b=>(e.openBlock(),e.createElementBlock("div",{onClick:w=>h(b),key:b.identifier,class:"indicators-item"},[e.createElementVNode("div",null,[e.createElementVNode("i",{class:e.normalizeClass([m.iconMap[b.dataType],"mr-2"])},null,2),e.createElementVNode("span",RT,e.toDisplayString(b.columnComment),1)])],8,zT))),128))])])):e.createCommentVNode("",!0)]),_:1},8,["visible"]),e.createVNode(kT,{ref_key:"modelPercentRef",ref:s,options:n.list,onSuccess:y[2]||(y[2]=(b,w)=>w?n.modelValue[w]=b:o("update:modelValue",[...n.modelValue,b]))},null,8,["options"])])],64)}}}),AR="",LT=Be(AT,[["__scopeId","data-v-6234eeff"]]),ym=e.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(t){const{proxy:r}=e.getCurrentInstance(),{echartsTypeList:n}=r.$globalUtils,o=e.inject("chartList"),a=i=>{r.$baseEventBus.emit("model-chart-click",i)};return(i,l)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),s=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:i.type==s.type?"primary":"",key:s.type,onClick:d=>a(s)},{default:e.withCtx(()=>{var d;return[e.createElementVNode("i",{class:e.normalizeClass((d=e.unref(n)[s.type])==null?void 0:d.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),ai=t=>(e.pushScopeId("data-v-fb1bbe3f"),t=t(),e.popScopeId(),t),FT={class:"w-full h-full flex"},jT={class:"flex-1 flex flex-col overflow-hidden"},PT={class:"flex-1 flex flex-col pr-3 pb-3 overflow-y-auto"},UT={key:0,class:"flex items-center pannel justify-center relative h-14"},WT={class:"absolute left-5 top-3"},GT=ai(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1)),HT=ai(()=>e.createElementVNode("i",{class:"ri-table-line"},null,-1)),YT={class:"absolute right-5 top-4 flex items-center"},XT=ai(()=>e.createElementVNode("i",{class:"ri-settings-2-line mr-1"},null,-1)),qT={class:"ml-2 mr-2"},JT={class:"flex flex-col"},KT={class:"flex-1 overflow-y-auto"},ZT={key:0,class:"flex items-center pannel justify-center h-14"},QT=ai(()=>e.createElementVNode("i",{class:"ri-save-line mr-1"},null,-1)),eO=e.defineComponent({__name:"table-widget",props:{modelValue:{default:""},title:{default:""},sortHtml:{default:""},indicatorsId:{default:""},resultTitle:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue","update:title","update:sortHtml","update:resultTitle","update:indicatorsId","update:dynamicSearchForm","success"],setup(t,{expose:r,emit:n}){const o=t,a=n,i=Re(),{proxy:l}=e.getCurrentInstance(),{setFormValue:s,getFormValue:d}=l.$globalHooks.useForm(),{dynamicSearchForm:c,dynamicSearchFormat:f,dynamicSearchParams:u}=l.$globalHooks.useDynamicSearch(),p=e.inject("modelEle"),h=e.inject("getListModelIndicators");e.inject("chartList");const m={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},y={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年"},g=e.ref(!1),b=e.ref(!0),w=e.ref(0),_=e.ref([]),C=e.ref([]),S=e.ref([]),x=e.ref([]),v=e.ref(!0),V=e.ref(!0),$=async P=>{var Q,re;v.value=!0,V.value=!1;const W=JSON.parse((P==null?void 0:P.groupArgsJson)??"[]");x.value=JSON.parse((P==null?void 0:P.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"行数"}])),W.length||(v.value=!1),w.value=(P==null?void 0:P.pageSize)??20,I.value=JSON.parse((P==null?void 0:P.sortArgsJson)??"{}"),P!=null&&P.formConfJson?(c.value=f(JSON.parse(P.formConfJson??"[]")),a("update:dynamicSearchForm",c.value)):await De(l).getFormJsonConfig((Q=e.unref(p))==null?void 0:Q.id).then(ne=>{var Y;c.value=f(JSON.parse(((Y=ne.data)==null?void 0:Y.formConfJson)??"[]"))}),a("update:dynamicSearchForm",c.value),s(P,j),l.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:l.$baseGetCurrentProjectId,modelId:(re=e.unref(p))==null?void 0:re.id,serialId:new Date().getTime()}).then(ne=>{b.value=!1,_.value=ne.data.filter(Y=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(Y.columnComment)).map(Y=>({...Y,dateFormatType:["date","datetime"].includes(Y.dataType)?"day":""})),S.value=ne.data.filter(Y=>["ADDABLE","SEMIADDABLE"].includes(Y.quantityType)),W.forEach(Y=>{const Z=_.value.find(ye=>ye.identifier==Y.identifier);Z&&(C.value.push({...Z,dataType:Y.dataType,dateFormatType:Y.dateFormatType}),Z.dateFormatType=Y.dateFormatType)}),v.value=!1,setTimeout(()=>{V.value=!0},1e3)})};e.watch([x,C],()=>{e.unref(V)&&(I.value={}),N()},{deep:!0});let B=null;const R=e.ref(null),T=e.ref(!1),k=e.ref([]),O=e.ref([]),N=async()=>{clearTimeout(B),B=setTimeout(async()=>{var ne,Y;O.value=[],i.setChartData([]);const P=D(),W=Object.keys(e.unref(I)).map(Z=>({field:Z,type:e.unref(I)[Z]=="ascending"?"asc":"desc"})),Q={aggArgsJson:JSON.stringify(e.unref(x)),groupArgsJson:JSON.stringify(P),sortArgsJson:JSON.stringify(W),params:u(e.unref(c)),pageSize:e.unref(w),modelId:(ne=e.unref(p))==null?void 0:ne.id};if(o.indicatorsId&&(Q.modelIndicatorsId=o.indicatorsId),a("update:title",`${e.unref(x).length}个指标:${e.unref(x).length?"根据":""}${P.map(Z=>Z.showLabel).toString()}${e.unref(x).length?"分组的":""}${e.unref(x).filter((Z,ye)=>ye<3).map(Z=>Z.showLabel).toString()}${e.unref(x).length>3?"...":""}`),!e.unref(x).length||e.unref(v)){k.value=[];return}T.value=!0;const re=await l.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Q);R.value=Q,T.value=!1,re&&(k.value=((Y=re.data)==null?void 0:Y.records)??[],i.setChartData({x:P,y:e.unref(x),params:Q}),e.unref(k).length&&Object.keys(e.unref(k)[0]).forEach(Z=>{O.value.push({label:Z,prop:Z,sortable:"custom"})}))})},D=()=>e.unref(C).map(P=>({identifier:P.identifier,comment:P.columnComment,showLabel:P.columnComment+(y[P.dateFormatType]??""),dateFormatType:P.dateFormatType||null})),I=e.ref({}),z=({column:P})=>{e.unref(I)[P.property]&&(P.order=e.unref(I)[P.property])};e.watch(I,P=>{const W=Object.keys(P).map(Q=>`${Q}${P[Q]=="descending"?"降序":"升序"}`);a("update:sortHtml",W.length?`<span class="text-color-warning">排序:${W.toString()}</span>`:"")},{deep:!0});const M=P=>{const{prop:W,order:Q}=P;!Q||e.unref(I)[W]===Q?delete e.unref(I)[W]:e.unref(I)[W]=Q,N()};De(l).loadIndicatorsMenu().then(P=>{j.find(W=>W.fieldName=="tags").options=Object.keys(P.data).map(W=>({label:W,value:W}))});const j=e.reactive([{name:"名称",type:Rr.Text,fieldName:"name",value:"",required:!0},{name:"描述",type:Rr.Textarea,fieldName:"remark",value:""},{name:"标签",type:Rr.Select,fieldName:"tags",value:"",options:[],multiple:!0,allowCreate:!0,required:!0,placeholder:"请选择标签或输入标签"},{name:"code",type:Rr.Text,fieldName:"code",value:"",hide:!0}]),F=e.ref(!1),G=()=>{j.find(P=>P.fieldName=="remark").value=o.title,F.value=!0},H=async()=>{var ne;const{params:P,error:W}=d(j);if(W.length>0)return;const Q=D();if(!Q.length||!e.unref(x).length){l.$message.warning("计算维度或汇总方式不能为空");return}P.code||(P.code=li()),P.groupArgsJson=JSON.stringify(Q),P.aggArgsJson=JSON.stringify(e.unref(x)),P.modelId=(ne=e.unref(p))==null?void 0:ne.id,P.projectId=l.$baseGetCurrentProjectId,P.pageSize=e.unref(w),P.formConfJson=JSON.stringify(e.unref(c)),P.sortArgsJson=JSON.stringify(e.unref(I)),o.indicatorsId&&(P.id=o.indicatorsId),F.value=!1;const re=await l.$baseHttp.post(`/api/ace-data-center/model-indicators/${o.indicatorsId?"update":"save"}`,P,{header:{loading:!0}});re&&(o.indicatorsId||a("update:indicatorsId",re.data),a("update:resultTitle",P.name),l.$message.success("操作成功"),s(P,j),h())},X=()=>{a("update:modelValue","chart")},J=()=>{l.$baseExportExcel({title:o.title,url:"/api/ace-data-center/model-indicators/debug",header:e.unref(O),customParams:e.unref(R)})};return r({init:$,dynamicSearchForm:c,handlePopupForm:G,handleSubmit:H}),(P,W)=>{var ie,ce;const Q=e.resolveComponent("AppDynamicSearch"),re=e.resolveComponent("AppTable"),ne=e.resolveComponent("AppEmpty"),Y=e.resolveComponent("AppDynamicList"),Z=e.resolveComponent("AppForm"),ye=e.resolveComponent("AppDialog");return e.openBlock(),e.createElementBlock("div",FT,[e.createElementVNode("div",jT,[e.createElementVNode("div",PT,[e.unref(x).length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Q,{form:e.unref(c),onSuccess:W[0]||(W[0]=oe=>N())},null,8,["form"]),e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(T),animated:""},{default:e.withCtx(()=>[e.unref(O).length?(e.openBlock(),e.createBlock(re,{key:0,tableData:e.unref(O),list:e.unref(k),loading:!1,headerCellClassName:z,onSortChange:M},null,8,["tableData","list"])):(e.openBlock(),e.createBlock(ne,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(e.openBlock(),e.createBlock(Y,{key:1,id:(ie=e.unref(p))==null?void 0:ie.id,title:(ce=e.unref(p))==null?void 0:ce.modelName,showPageIndex:!0},null,8,["id","title"]))]),e.unref(x).length?(e.openBlock(),e.createElementBlock("div",UT,[e.createElementVNode("div",WT,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:e.unref(g)},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{disabled:P.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:W[1]||(W[1]=oe=>{P.indicatorsId||(g.value=!0)}),onMouseleave:W[2]||(W[2]=oe=>g.value=!1),onClick:X},{default:e.withCtx(()=>[e.createTextVNode(" 图表配置 "),GT]),_:1},8,["disabled"])]),_:1},8,["visible"])]),e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary"},{default:e.withCtx(()=>[HT]),_:1}),e.createVNode(ym)]),_:1}),e.createElementVNode("div",YT,[e.createVNode(e.unref(E.ElLink),{type:"primary"},{default:e.withCtx(()=>[XT,e.createTextVNode(" 显示前 "),e.createElementVNode("div",qT,[e.createVNode(e.unref(E.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:e.unref(w),"onUpdate:modelValue":W[3]||(W[3]=oe=>e.isRef(w)?w.value=oe:null),onChange:W[4]||(W[4]=oe=>N()),min:1,max:9999999},null,8,["modelValue"])]),e.createTextVNode(" 条聚合数据 ")]),_:1}),e.unref(O).length?(e.openBlock(),e.createElementBlock("i",{key:0,class:"ri-download-2-line ml-2 text-color-warning cursor-pointer",onClick:J})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createElementVNode("aside",JT,[e.createElementVNode("div",KT,[e.createVNode(LT,{list:e.unref(S),modelValue:e.unref(x),"onUpdate:modelValue":W[5]||(W[5]=oe=>e.isRef(x)?x.value=oe:null),iconMap:m},null,8,["list","modelValue"]),e.withDirectives(e.createElementVNode("div",null,[e.createVNode(mT,{loading:e.unref(b),list:e.unref(_),iconMap:m,calendarType:y,modelValue:e.unref(C),"onUpdate:modelValue":W[6]||(W[6]=oe=>e.isRef(C)?C.value=oe:null)},null,8,["loading","list","modelValue"])],512),[[e.vShow,e.unref(x).length]])]),e.unref(x).length?(e.openBlock(),e.createElementBlock("div",ZT,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:G},{default:e.withCtx(()=>[QT,e.createTextVNode(" 完 成 ")]),_:1})])):e.createCommentVNode("",!0),e.createVNode(ye,{modelValue:e.unref(F),"onUpdate:modelValue":W[8]||(W[8]=oe=>e.isRef(F)?F.value=oe:null),title:"保存指标",size:800},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:H},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:W[7]||(W[7]=oe=>F.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.createVNode(Z,{form:e.unref(j),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),LR="",tO=Be(eO,[["__scopeId","data-v-fb1bbe3f"]]),bm=t=>(e.pushScopeId("data-v-cc083189"),t=t(),e.popScopeId(),t),rO={class:"chart-container flex flex-wrap"},nO=["onClick"],oO=["onClick"],aO=[bm(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1))],iO={key:0,class:"success setting"},lO=[bm(()=>e.createElementVNode("i",{class:"ri-check-line ml-1"},null,-1))],sO={class:"label"},cO=e.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(t,{emit:r}){const{proxy:n}=e.getCurrentInstance(),{echartsTypeList:o}=n.$globalUtils,a=[{...o[3],key:"3"},...Object.keys(o).filter(c=>c!="3").map(c=>({...o[c],key:c}))],i=e.inject("chartList"),l=r,s=c=>{l("update:modelValue",String(c))},d=c=>{l("update:modelValue",String(c)),l("click-chart-setting")};return(c,f)=>(e.openBlock(),e.createElementBlock("div",rO,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,u=>{var p;return e.createElementVNode("div",{class:"items",key:u.key,onClick:h=>s(u.key)},[e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:c.modelValue==u.key}])},[e.createElementVNode("i",{class:e.normalizeClass(u.icon)},null,2),e.createElementVNode("div",{class:"setting",onClick:e.withModifiers(h=>d(u.key),["stop"])},aO,8,oO),(p=e.unref(i))!=null&&p.some(h=>h.type==u.key)?(e.openBlock(),e.createElementBlock("div",iO,lO)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",sO,e.toDisplayString(u.name),1)],8,nO)}),64))]))}}),PR="",dO=Be(cO,[["__scopeId","data-v-cc083189"]]),fO=e.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{chartJsonToStringFormat:i}=a.$globalUtils,l=e.ref(""),s=e.inject("indicatorsId"),d=e.inject("getListModelIndicators"),c=e.inject("getChartWidgetList"),f=e.computed(()=>({3:Zh,2:em,1:Qh,4:nm,5:tm,6:rm,7:om,8:am})[o.type]??null),u=e.ref(!1),p=()=>{l.value="data",u.value=!0},h=async()=>{await a.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:e.unref(s),echartsType:o.type,echartsConfig:i({...o.option,customSeriesData:window.customSeriesData,dataset:{...o.option.dataset,source:[]}})},{headers:{loading:!0}})&&(a.$message.success("操作成功"),c(),d(),u.value=!1)},m=()=>{u.value=!1};return r({init:p,handleSubmit:h}),(y,g)=>{const b=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(b,{modelValue:e.unref(u),"onUpdate:modelValue":g[3]||(g[3]=w=>e.isRef(u)?u.value=w:null),withHeader:!1,modal:!1,direction:"ltr",size:"300px",modalClass:"ace-modal-drawer"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:g[1]||(g[1]=w=>h())},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:g[2]||(g[2]=w=>m())},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(E.ElCollapse),{accordion:"",modelValue:e.unref(l),"onUpdate:modelValue":g[0]||(g[0]=w=>e.isRef(l)?l.value=w:null)},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(e.unref(f),{key:0,option:o.option,type:y.type},null,8,["option","type"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),UR="",uO=Be(fO,[["__scopeId","data-v-f0a33bc5"]]),nc=t=>(e.pushScopeId("data-v-35fb2412"),t=t(),e.popScopeId(),t),pO={class:"w-full h-full flex"},hO={class:"flex-1"},mO={key:0,class:"flex items-center pannel justify-center h-14"},gO=nc(()=>e.createElementVNode("i",{class:"ri-save-line mr-1"},null,-1)),yO={class:"flex-1 flex flex-col overflow-hidden"},bO={class:"flex-1 flex flex-col pl-3 pb-3"},_O={class:"flex items-center pannel justify-center relative h-14"},wO={key:0,class:"absolute left-5 top-3"},CO=nc(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1)),SO=nc(()=>e.createElementVNode("i",{class:"ri-table-line"},null,-1)),xO=e.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(t,{expose:r,emit:n}){const o=n,{proxy:a}=e.getCurrentInstance(),i=e.inject("chartList"),{option:l,formatChart:s}=mt(),d=e.ref(""),c=e.ref(null),f=e.ref(!1),u=()=>{if(e.unref(d)==""){a.$message.warning("请选择图表");return}const y=setInterval(()=>{e.unref(f)&&(e.unref(c).init(),clearInterval(y))},20)};e.watch(d,async y=>{var b;if(l.value={},f.value=!1,y==""){f.value=!0;return}const g=(b=e.unref(i))==null?void 0:b.find(w=>w.type==y);await s((g==null?void 0:g.code)??"",y),f.value=!0});const p=e.ref(!1);a.$baseEventBus.on("model-chart-click",async y=>{p.value=!0,o("update:modelValue","chart"),d.value=y.type,setTimeout(()=>{p.value=!1},100)});const h=()=>{if(e.unref(i).length>0){e.unref(p)||(d.value=e.unref(i)[0].type),f.value=!0;return}d.value="3"},m=()=>{d.value="",o("update:modelValue","table")};return r({init:h}),(y,g)=>{var _;const b=e.resolveComponent("AppDynamicSearch"),w=e.resolveComponent("AppCustomChart");return e.openBlock(),e.createElementBlock("div",pO,[e.createElementVNode("aside",null,[e.createElementVNode("div",hO,[e.createVNode(dO,{modelValue:e.unref(d),"onUpdate:modelValue":g[0]||(g[0]=C=>e.isRef(d)?d.value=C:null),onClickChartSetting:u},null,8,["modelValue"])]),(_=e.unref(i))!=null&&_.some(C=>C.type==e.unref(d))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mO,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:g[1]||(g[1]=C=>e.unref(c).handleSubmit())},{default:e.withCtx(()=>[gO,e.createTextVNode(" 保 存 ")]),_:1})]))]),e.createElementVNode("div",yO,[e.createElementVNode("div",bO,[e.createVNode(e.unref(E.ElSkeleton),{loading:!e.unref(f),animated:""},{default:e.withCtx(()=>[e.createVNode(b,{form:y.dynamicSearchForm,search:!1,disabled:""},null,8,["form"]),e.createVNode(w,{option:e.unref(l),chartType:e.unref(d)},null,8,["option","chartType"])]),_:1},8,["loading"])]),e.createElementVNode("div",_O,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",wO,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",style:{padding:"0 10px"}},{default:e.withCtx(()=>[e.createTextVNode("可视化")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"",style:{padding:"0 10px"},onClick:u},{default:e.withCtx(()=>[CO]),_:1})]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"",onClick:m},{default:e.withCtx(()=>[SO]),_:1}),e.createVNode(ym,{type:e.unref(d)},null,8,["type"])]),_:1})])]),e.createVNode(uO,{ref_key:"modelChartSettingRef",ref:c,option:e.unref(l),type:e.unref(d),onClose:m},null,8,["option","type"])])}}}),WR="",vO=Be(xO,[["__scopeId","data-v-35fb2412"]]),_m=t=>(e.pushScopeId("data-v-67eeb431"),t=t(),e.popScopeId(),t),EO={class:"design"},VO={class:"design-header"},kO={class:"flex-1"},NO={class:"text-xs text-color-info mt-2"},$O=["innerHTML"],DO={class:"flex"},BO={class:"mr-2"},TO=_m(()=>e.createElementVNode("i",{class:"ri-settings-2-line mr-1"},null,-1)),OO=_m(()=>e.createElementVNode("i",{class:"ri-close-line mr-1"},null,-1)),IO={class:"design-container flex-1 overflow-hidden p-3 flex"},zO=e.defineComponent({__name:"index",emits:["close"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),a=e.ref(!1),i=e.ref(!1),l=e.ref(),s=e.ref(null),d=e.ref(null),c=e.ref(null),f=e.ref([]),u=e.ref("0个指标"),p=e.ref(""),h=e.ref(""),m=e.ref([]),y=n;e.watch(a,v=>{v||o.$baseEventBus.off("model-chart-click")}),e.provide("indicatorsId",h);const g=e.inject("modelEle"),b=e.ref(""),w=async v=>{var $;let V={};l.value="table",h.value=v,m.value=[],f.value=[],e.unref(h)&&(V=await _(),C()),a.value=!0,b.value=($=V==null?void 0:V.data)==null?void 0:$.name,e.nextTick(()=>{e.unref(s).init((V==null?void 0:V.data)??{})})};e.watch(l,v=>{v=="chart"&&e.unref(d).init()});const _=async()=>await o.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${e.unref(h)}`,{headers:{loading:!0}}),C=async()=>{o.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${e.unref(h)}`).then(v=>{m.value=v.data})};e.provide("getChartWidgetList",C),e.provide("chartList",m);const S=()=>{o.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{a.value=!1,e.unref(h)&&y("close")}})},x=v=>{f.value=v,e.unref(s).dynamicSearchForm=v,e.unref(s).handleSubmit()};return r({init:w}),(v,V)=>{const $=e.resolveComponent("AppHeader"),B=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(B,{modelValue:e.unref(a),"onUpdate:modelValue":V[11]||(V[11]=R=>e.isRef(a)?a.value=R:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:e.withCtx(()=>{var R,T;return[e.createElementVNode("div",EO,[e.createElementVNode("div",VO,[e.createElementVNode("div",kO,[e.createVNode($,{title:e.unref(l)=="table"?e.unref(u):`${e.unref(b)}【${e.unref(u)}】`},e.createSlots({_:2},[e.unref(m).length?{name:"left",fn:e.withCtx(()=>[e.createElementVNode("i",{onClick:V[0]||(V[0]=k=>e.unref(s).handlePopupForm()),class:"ri-edit-box-line ml-2 text-color-primary cursor-pointer text-base"})]),key:"0"}:void 0]),1032,["title"]),e.createElementVNode("div",NO,[e.createTextVNode(" 模型数据 / "+e.toDisplayString((R=e.unref(g))==null?void 0:R.modelName)+" ["+e.toDisplayString((T=e.unref(g))==null?void 0:T.modelCode)+"] ",1),e.createElementVNode("span",{class:"ml-2",innerHTML:e.unref(p)},null,8,$O)])]),e.createElementVNode("div",DO,[e.withDirectives(e.createElementVNode("div",BO,[e.createVNode(e.unref(E.ElPopover),{placement:"bottom",visible:e.unref(i),"onUpdate:visible":V[2]||(V[2]=k=>e.isRef(i)?i.value=k:null),trigger:"click",width:"900px",teleported:!1},{reference:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"warning"},{default:e.withCtx(()=>[TO,e.createTextVNode(" 筛选配置 ")]),_:1})]),default:e.withCtx(()=>[e.createVNode(gm,{ref_key:"customSearchRef",ref:c,customSearchVisible:e.unref(i),"onUpdate:customSearchVisible":V[1]||(V[1]=k=>e.isRef(i)?i.value=k:null),onDynamicSearchFormUpdate:x,dynamicSearchForm:e.unref(f)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[e.vShow,e.unref(l)=="table"&&e.unref(u)!="0个指标:"]]),e.createVNode(e.unref(E.ElButton),{onClick:S},{default:e.withCtx(()=>[OO,e.createTextVNode(" 关闭 ")]),_:1})])]),e.createElementVNode("div",IO,[e.withDirectives(e.createVNode(tO,{ref_key:"tableWidgetRef",ref:s,modelValue:e.unref(l),"onUpdate:modelValue":V[3]||(V[3]=k=>e.isRef(l)?l.value=k:null),indicatorsId:e.unref(h),"onUpdate:indicatorsId":V[4]||(V[4]=k=>e.isRef(h)?h.value=k:null),title:e.unref(u),"onUpdate:title":V[5]||(V[5]=k=>e.isRef(u)?u.value=k:null),resultTitle:e.unref(b),"onUpdate:resultTitle":V[6]||(V[6]=k=>e.isRef(b)?b.value=k:null),sortHtml:e.unref(p),"onUpdate:sortHtml":V[7]||(V[7]=k=>e.isRef(p)?p.value=k:null),dynamicSearchForm:e.unref(f),"onUpdate:dynamicSearchForm":V[8]||(V[8]=k=>e.isRef(f)?f.value=k:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[e.vShow,e.unref(l)=="table"]]),e.withDirectives(e.createVNode(vO,{ref_key:"chartWidgetRef",ref:d,dynamicSearchForm:e.unref(f),"onUpdate:dynamicSearchForm":V[9]||(V[9]=k=>e.isRef(f)?f.value=k:null),modelValue:e.unref(l),"onUpdate:modelValue":V[10]||(V[10]=k=>e.isRef(l)?l.value=k:null)},null,8,["dynamicSearchForm","modelValue"]),[[e.vShow,e.unref(l)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),GR="",wm=Be(zO,[["__scopeId","data-v-67eeb431"]]),RO=e.createElementVNode("i",{class:"ri-search-line"},null,-1),MO={class:"mt-3"},AO={key:0,class:"ri-checkbox-circle-fill text-base mr-1 text-color-success -ml-5"},LO={key:1,class:"ri-error-warning-fill mr-1 text-base text-color-warning -ml-5"},FO=e.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),i=e.ref(""),l=e.ref(null),s=e.ref(null),d=n;e.watch(i,h=>{e.unref(s).filter(h)});const c=(h,m)=>h?m.name.includes(h):!0,f=e.ref(!1),u=()=>{l.value=[],f.value=!0,De(a).loadIndicatorsMenu().then(h=>{l.value=Object.keys(h.data).map(y=>({name:y,id:y,children:h.data[y]}));let m;f.value=!1,e.unref(l).length&&e.nextTick(()=>{var y;o.tempId?m=e.unref(s).getNode(o.tempId):m=e.unref(s).getNode((y=e.unref(l)[0].children[0])==null?void 0:y.id),m&&(p(m==null?void 0:m.data),e.unref(s).setCurrentKey(m==null?void 0:m.data.id))})})};u();const p=h=>{Array.isArray(h.children)||d("node-click",h)};return r({init:u}),(h,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(E.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:e.unref(i),"onUpdate:modelValue":m[0]||(m[0]=y=>e.isRef(i)?i.value=y:null)},{prefix:e.withCtx(()=>[RO]),_:1},8,["modelValue"]),e.createElementVNode("div",MO,[e.unref(f)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:"",count:2})):(e.openBlock(),e.createBlock(e.unref(E.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:s,data:e.unref(l),"node-key":"id","default-expand-all":"","highlight-current":"","filter-node-method":c,onNodeClick:p},{default:e.withCtx(({node:y,data:g})=>[Array.isArray(g.children)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.normal?(e.openBlock(),e.createElementBlock("i",AO)):(e.openBlock(),e.createElementBlock("i",LO))],64)),e.createElementVNode("span",{class:e.normalizeClass({"font-bold":y.level==1})},e.toDisplayString(g.name),3)]),_:1},8,["data"]))])],64))}}),jO={class:"rule-list"},PO={key:0,class:"flex items-center"},UO=e.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),WO={key:1,class:"flex items-center"},GO=e.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),Cm=e.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(!1),o=e.ref(""),a=e.ref([]),i=d=>{o.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${d}`,n.value=!0},l=d=>{e.unref(a).length==0&&Object.keys(d.data[0]).forEach(c=>{if(c==="pageIndex"){a.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}a.value.push({label:c,prop:c})})},s=()=>{r.$baseExportExcel({title:"数据列表",url:e.unref(o),method:"get",header:e.unref(a)})};return(d,c)=>{const f=e.resolveComponent("AppHeader"),u=e.resolveComponent("AppList"),p=e.resolveComponent("AppDrawer");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",jO,[d.ruleList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(f,{title:"智能诊断",class:"mb-5"}),e.createVNode(e.unref(E.ElAlert),{type:"warning",closable:!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.ruleList,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:"mt-0 text-sm"},[+h.rows>0?(e.openBlock(),e.createElementBlock("div",PO,[UO,e.createTextVNode(" "+e.toDisplayString(h.ruleName)+" 【异常数据"+e.toDisplayString(h.rows>99?"99+":h.rows)+"】 ",1),e.createVNode(e.unref(E.ElLink),{class:"ml-2",type:"primary",onClick:m=>i(h.id)},{default:e.withCtx(()=>[e.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(e.openBlock(),e.createElementBlock("div",WO,[GO,e.createTextVNode(" "+e.toDisplayString(h.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):e.createCommentVNode("",!0)]),e.createVNode(p,{modelValue:e.unref(n),"onUpdate:modelValue":c[1]||(c[1]=h=>e.isRef(n)?n.value=h:null),title:"数据列表"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-3",onClick:s},{default:e.withCtx(()=>[e.createTextVNode("导 出")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:c[0]||(c[0]=h=>n.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("关 闭")]),_:1})]),default:e.withCtx(()=>[e.createVNode(u,{tableData:e.unref(a),url:e.unref(o),onSuccess:l},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),HO={key:1,class:"animated fadeIn"},YO={class:"ml-2 mt-5 mb-5 flex items-center moudle-1"},XO={key:0,class:"ri-error-warning-fill text-xl mr-1 text-color-warning"},qO={key:1,class:"ri-checkbox-circle-fill text-xl mr-1 text-color-success"},JO={class:"ml-1"},KO={class:"flex items-center select-type"},ZO=["onClick"],QO={class:"mt-5 mb-5"},eI=e.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(t,{emit:r}){const n=t;e.watch(()=>n.indicatorsId,()=>h());const o=r,{proxy:a}=e.getCurrentInstance(),{dynamicSearchForm:i,dynamicSearchFormat:l,dynamicSearchParams:s}=a.$globalHooks.useDynamicSearch(),{chartJsonFormat:d,echartsTypeList:c}=a.$globalUtils,f=e.ref(!0),u=e.ref([]),p=e.ref(null),h=async()=>{var x,v,V;f.value=!0,i.value=[],b.value={type:"",value:""},m.value=[],y.value="",C();const S=await De(a).detailAndTask(n.indicatorsId);p.value=S.data,(v=(x=S.data)==null?void 0:x.echartsDataVO)!=null&&v.config&&g(),(V=S==null?void 0:S.data)!=null&&V.formConfJson&&(i.value=l(JSON.parse(S==null?void 0:S.data.formConfJson))),f.value=!1},m=e.ref([]),y=e.ref(""),g=async()=>{var x;m.value=[],y.value="";const S=await De(a).getEchartDetail({indicatorsId:n.indicatorsId});S&&(Object.keys(((x=S.data)==null?void 0:x.clientEchartsType)??{}).forEach(v=>{var V;Object.values((V=S.data)==null?void 0:V.clientEchartsType[v]).forEach($=>{var B,R;m.value.push({client:v,label:(B=c[$])==null?void 0:B.name,icon:(R=c[$])==null?void 0:R.icon,value:`${v}_${$}`})})}),e.unref(m).length>0&&(y.value=e.unref(m)[0].value,_(e.unref(y))))},b=e.ref({type:"",value:""}),w=e.ref(!1),_=async(S,x=!1)=>{var B;y.value=S,x&&(w.value=!0);const v=s(e.unref(i)),V=S.split("_"),$=await De(a).pullEchartsDataVO({indicatorsId:n.indicatorsId,loadType:((B=e.unref(p))==null?void 0:B.loadType)??3,params:v,targetClient:V[0],echartsType:V[1]});if($){w.value=!1,e.unref(b).type=V[1];try{e.unref(b).value=d($.data.config)}catch{e.unref(b).value=$.data.config}}},C=async()=>{var x;u.value=[];const S=await De(a).getRule({current:1,size:100,businessType:"indicators",businessId:n.indicatorsId});u.value=((x=S.data)==null?void 0:x.records)??[],o("rule-success",u.value)};return h(),(S,x)=>{const v=e.resolveComponent("AppResourceVisitor"),V=e.resolveComponent("AppHeader"),$=e.resolveComponent("AppDynamicSearch"),B=e.resolveComponent("AppChart");return e.unref(f)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:""})):(e.openBlock(),e.createElementBlock("div",HO,[e.createVNode(V,{title:"指标计算"},{default:e.withCtx(()=>[e.createVNode(v,{businessType:"INDICATORS",businessld:n.indicatorsId},null,8,["businessld"])]),_:1}),e.createElementVNode("div",YO,[e.unref(u).some(R=>R.rows>0)?(e.openBlock(),e.createElementBlock("i",XO)):(e.openBlock(),e.createElementBlock("i",qO)),e.createElementVNode("span",JO,e.toDisplayString(e.unref(p).remark),1)]),e.createVNode(V,{title:"指标数据"},{default:e.withCtx(()=>[e.createElementVNode("div",KO,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),R=>(e.openBlock(),e.createElementBlock("span",{onClick:T=>_(R.value,!0),class:e.normalizeClass(["flex items-center cursor-pointer",[R.value==e.unref(y)?"text-color-primary":"text-gray-600"]]),key:R.value},[e.createElementVNode("i",{class:e.normalizeClass([R.icon,"mr-1"])},null,2),e.createTextVNode(" "+e.toDisplayString(R.label),1)],10,ZO))),128))])]),_:1}),e.createElementVNode("div",QO,[e.unref(i).length>0?(e.openBlock(),e.createBlock($,{key:0,form:e.unref(i),onSuccess:x[0]||(x[0]=R=>_(e.unref(y),!0)),class:"mb-0"},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(B,{type:e.unref(b).type,options:e.unref(b).value,loading:e.unref(w)},null,8,["type","options","loading"])]),e.createVNode(Cm,{ruleList:e.unref(u)},null,8,["ruleList"])]))}}}),HR="",Sm=Be(eI,[["__scopeId","data-v-7b034d4e"]]),tI={class:"h-full"},rI=e.defineComponent({__name:"relation",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],a=(i,l,s="#00f6ff")=>i.map((d,c)=>{switch(d&&d.title&&(d.name=d.title),l==1&&(s=o.find((f,u)=>u==c%10)),(l===0||l===1)&&(d.label={position:"inside"}),l){case 0:d.symbolSize=70;break;case 1:d.symbolSize=50;break;default:d.symbolSize=10;break}return d.lineStyle={color:s},d.children?(d.itemStyle={borderColor:s,color:s},d.children=a(d.children,l+1,s)):d.itemStyle={color:"transparent",borderColor:s},d});return De(r).indicatorsRelationTree().then(i=>{if(!i.data.length){n.value={};return}n.value={type:"tree",toolbox:{show:!0,iconStyle:{borderColor:"#03ceda"},feature:{restore:{}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"rgba(0,0,0,.8)",borderWidth:.5,textStyle:{fontSize:10,color:"#fff"}},series:[{type:"tree",hoverAnimation:!0,data:a([i==null?void 0:i.data[0]],0),top:10,bottom:10,left:10,right:10,layout:"radial",symbol:"circle",symbolSize:10,nodePadding:20,animationDurationUpdate:750,expandAndCollapse:!0,initialTreeDepth:2,roam:!0,focusNodeAdjacency:!0,itemStyle:{borderWidth:1},label:{color:"#000",fontSize:10,fontFamily:"SourceHanSansCN",position:"inside",rotate:0},lineStyle:{width:1,curveness:.5}}]}}),(i,l)=>{const s=e.resolveComponent("v-chart"),d=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",tI,[e.createVNode(s,{option:e.unref(n),autoresize:""},null,8,["option"])])),[[d,!e.unref(n)]])}}}),nI=e.createElementVNode("div",{class:"font-bold mt-8 mb-2"},"数据分析",-1),oI=e.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null}},setup(t,{expose:r}){const n=t,o=Re(),{proxy:a}=e.getCurrentInstance(),{dynamicSearchForm:i,dynamicSearchFormat:l,dynamicSearchParams:s}=a.$globalHooks.useDynamicSearch(),d=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:c}=ni(),f=e.computed(()=>n.search.find(y=>d.includes(y.type))),u=e.computed(()=>{const y=e.unref(f)?Object.values(s([e.unref(f)])).every(g=>g==""):!1;return n.search.filter(g=>d.includes(g.type)).length==1&&!y}),p=e.ref("");e.watch(p,()=>h());const h=async()=>{var k;if(!e.unref(u)||e.unref(p)=="")return;const y=JSON.parse(JSON.stringify((k=o.getChartData)==null?void 0:k.params)),g=JSON.parse(JSON.stringify(n.search)),b=g.find(O=>d.includes(O.type)),w=n.originSearch.find(O=>d.includes(O.type)),C=JSON.parse((y==null?void 0:y.groupArgsJson)??"[]").find(O=>O.comment==n.option.dataShow.x);y.groupArgsJson=JSON.stringify([C]);const S=C.dateFormatType;switch(b.type){case"yymmSingle":b.value=on(b.value).subtract(1,e.unref(p)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":b.value=on(b.value).subtract(1,e.unref(p)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":b.value=on(b.value).subtract(1,"year").format("YYYY");break}y.params=s(g);const v=n.option.dataset.dimensions;v.length>=3&&n.option.dataset.dimensions.pop();const V=await a.$baseHttp.post("/api/ace-data-center/model-indicators/debug",y),$=v[0],B=n.option.dataShow.y.filter(O=>!n.option.dataShow.hide.includes(O));e.unref(b.type).includes("Range")?(n.option.dataset.dimensions[1]=`${w!=null&&w.minValue?`${w==null?void 0:w.minValue}~`:""}${(w==null?void 0:w.maxValue)??""}${B}`,n.option.dataset.dimensions.push(`${b.minValue?`${b.minValue}~`:""}${(b==null?void 0:b.maxValue)??""}${B}`)):(n.option.dataset.dimensions[1]=`${w==null?void 0:w.value}${B}`,n.option.dataset.dimensions[2]=`${b.value}${B}`,n.option.dataset.dimensions[3]="增长率");const R=n.option.series[0];n.option.series=[],V.data.records.forEach(O=>{m(O,$,S)});const T=JSON.parse(JSON.stringify(n.option.dataset.temp_source));T.forEach((O,N)=>{m(O,$,S);let D=null;O[n.option.dataset.dimensions[1]]=O[B],S?(D=V.data.records.find(M=>M[$]==O[$]),D||(["year"].includes(S)&&(D=V.data.records.find(M=>M[$].indexOf(b.value)>=0),O[$]=$),["day","month"].includes(S)&&(D=V.data.records.find(M=>M[$].split("-").at(-1)==O[$].split("-").at(-1))))):D=V.data.records.find(M=>M[$]==O[$]),D||(D={[B]:0}),D&&(O[n.option.dataset.dimensions[2]]=D[B]);const I=O[n.option.dataset.dimensions[1]]??0,z=O[n.option.dataset.dimensions[2]]??0;O.增长率=!I||!z?0:((I-z)/z*100).toFixed(2)}),n.option.dataset.source=T,setTimeout(()=>{const{yAxis:O,xAxis:N}=n.option;let D="yAxis";!Array.isArray(O)&&O.type!="value"&&(D="xAxis"),n.option.series=[R,R,{...c,name:"增长率",[`${D}Index`]:1}],n.option[D]=[Array.isArray(n.option[D])?n.option[D][0]:n.option[D],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:D=="xAxis"?"start":"end"}],console.log(n.option)})},m=(y,g,b)=>{if(!(!b||(y[g]??"")=="")&&["day"].includes(b)){const w=y[g].split("-").filter((_,C)=>C==0?"":_);y[g]=w.join("-")}};return r({init:h,type:p}),(y,g)=>e.unref(u)&&y.option?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[nI,e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(p),"onUpdate:modelValue":g[0]||(g[0]=b=>e.isRef(p)?p.value=b:null)},{default:e.withCtx(()=>{var b;return[e.createVNode(e.unref(E.ElRadio),{label:"TB",value:"TB"},{default:e.withCtx(()=>[e.createTextVNode("同比")]),_:1}),e.createVNode(e.unref(E.ElRadio),{label:"HB",value:"HB",disabled:!["yymmSingle","yymmddSingle"].includes((b=e.unref(f))==null?void 0:b.type)},{default:e.withCtx(()=>[e.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])],64)):e.createCommentVNode("",!0)}}),xm=t=>(e.pushScopeId("data-v-3f95981f"),t=t(),e.popScopeId(),t),aI={key:2,class:"chart-preview flex"},iI=xm(()=>e.createElementVNode("div",{class:"font-bold mb-2"},"分析指标",-1)),lI=xm(()=>e.createElementVNode("div",{class:"font-bold mt-8 mb-2"},"指标维度",-1)),sI={class:"flex-1 flex flex-col overflow-hidden"},cI={class:"flex-1"},dI={class:"flex justify-center change-btns"},fI=e.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(t,{emit:r}){const n=t,o=r,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d}=i.$globalHooks.useDynamicSearch(),{echartsTypeList:c,isMobile:f}=i.$globalUtils,u=e.ref(null),p=e.ref(""),h=e.ref([]),m=e.ref(n.dynamicSearchForm),y=e.ref(!1),{option:g,formatChart:b,chartType:w,setChartData:_,changeChartSeries:C,chartDataParams:S}=mt(),x={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年"};e.onMounted(async()=>{await i.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${n.result.id}`).then(T=>{h.value=T.data,T.data.length&&(p.value=T.data[0].code,w.value=T.data[0].type)})}),e.watch(p,async()=>{B()});const v=T=>{p.value!=T.code&&(g.value={},w.value=T.type,p.value=T.code,e.unref(u)&&(e.unref(u).type=""))},V=e.ref(""),$=e.ref(""),B=async()=>{var T,k,O,N;m.value=JSON.parse(JSON.stringify(n.dynamicSearchForm)),y.value=!0,g.value={},V.value="",$.value=["2"].includes(e.unref(w))?"":[],n.chartData&&(S.value=n.chartData),await b(e.unref(p)),V.value=(T=e.unref(g))==null?void 0:T.dataShow.x,Array.isArray((k=e.unref(g))==null?void 0:k.dataShow.y)?$.value=(O=e.unref(g))==null?void 0:O.dataShow.y.filter(D=>{var I;return!(((I=e.unref(g))==null?void 0:I.dataShow.hide)??[]).includes(D)}):$.value=(N=e.unref(g))==null?void 0:N.dataShow.y,f&&["1","3","5"].includes(e.unref(w))&&!e.unref(g).dataZoom&&(g.value.grid.bottom="10%",g.value.dataZoom=[{type:"slider",backgroundColor:"#eef8fd",fillerColor:"#14b1f8",borderColor:"#eef8fd",startValue:0,endValue:3,filterMode:"",showDetail:!1,width:"90%",height:10,handleSize:30,left:"5%",bottom:25},{type:"inside",zoomOnMouseWheel:!1,moveOnMouseWheel:!0,moveOnMouseMove:!0}]),setTimeout(()=>{y.value=!1},10)};e.watch([V,$],async([T,k],[O,N])=>{var D;e.unref(y)||(e.unref(g).dataShow.x=T,e.unref(g).dataShow.y=k,Array.isArray(k)&&(e.unref(g).dataShow.hide=(D=e.unref(g))==null?void 0:D.dataShow.y.filter(I=>a.getChartData.y.includes(I.showLabel))),(T!=O||["2","7"].includes(e.unref(w)))&&(g.value.dataset.source=await _(e.unref(w),T,["2","7"].includes(e.unref(w))?k:null),g.value.dataset.temp_source=JSON.parse(JSON.stringify(g.value.dataset.source)),m.value=JSON.parse(JSON.stringify(n.dynamicSearchForm)),e.unref(u)&&(e.unref(u).type="")),["xAxis","yAxis"].forEach(I=>{Array.isArray(g.value[I])&&(g.value[I]=g.value[I].filter(z=>z.name!="增长率"))}),C())},{deep:!0});const R=()=>{a.getChartData.params.params=d(n.dynamicSearchForm),B(),o("search-success",a.getChartData.params.params)};return(T,k)=>{var I;const O=e.resolveComponent("AppDynamicSearch"),N=e.resolveComponent("AppEmpty"),D=e.resolveComponent("AppCustomChart");return e.openBlock(),e.createElementBlock("div",null,[n.dynamicSearchForm.length?(e.openBlock(),e.createBlock(O,{key:0,form:n.dynamicSearchForm,onSuccess:R},null,8,["form"])):e.createCommentVNode("",!0),e.unref(h).length?(e.openBlock(),e.createElementBlock("div",aI,[e.createElementVNode("aside",null,[e.createVNode(e.unref(E.ElSkeleton),{loading:!((I=e.unref(g))!=null&&I.dataShow),animated:""},{default:e.withCtx(()=>[iI,e.createElementVNode("div",null,[["2"].includes(e.unref(w))?(e.openBlock(),e.createBlock(e.unref(E.ElRadioGroup),{key:0,modelValue:e.unref($),"onUpdate:modelValue":k[0]||(k[0]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.y,z=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):["8"].includes(e.unref(w))?(e.openBlock(),e.createBlock(e.unref(E.ElCheckboxGroup),{key:1,modelValue:e.unref($),"onUpdate:modelValue":k[1]||(k[1]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([...e.unref(a).getChartData.y,...e.unref(a).getChartData.x.map(z=>({...z,showLabel:z.comment}))],z=>(e.openBlock(),e.createBlock(e.unref(E.ElCheckbox),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):(e.openBlock(),e.createBlock(e.unref(E.ElCheckboxGroup),{key:2,modelValue:e.unref($),"onUpdate:modelValue":k[2]||(k[2]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.y,z=>(e.openBlock(),e.createBlock(e.unref(E.ElCheckbox),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]))]),["8"].includes(e.unref(w))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lI,e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(V),"onUpdate:modelValue":k[3]||(k[3]=z=>e.isRef(V)?V.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.x,z=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:z.comment,label:z.comment,value:z.comment},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z.comment)+" ",1),x[z.dateFormatType]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" ("+e.toDisplayString(x[z.dateFormatType])+") ",1)],64)):e.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])],64)),["3","1"].includes(e.unref(w))&&e.unref(g).dataShow.y.filter(z=>!e.unref(g).dataShow.hide.includes(z)).length==1?(e.openBlock(),e.createBlock(oI,{key:1,ref_key:"yoyRef",ref:u,option:e.unref(g),search:e.unref(m),originSearch:e.unref(l),chartType:e.unref(w)},null,8,["option","search","originSearch","chartType"])):e.createCommentVNode("",!0)]),_:1},8,["loading"])]),e.createElementVNode("div",sI,[e.createElementVNode("div",cI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(y),animated:""},{default:e.withCtx(()=>[e.createVNode(D,{option:e.unref(g),chartType:e.unref(w)},null,8,["option","chartType"])]),_:1},8,["loading"])]),e.createElementVNode("div",dI,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),z=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(p)==z.code?"primary":"",key:z.type,onClick:M=>v(z)},{default:e.withCtx(()=>{var M;return[e.createElementVNode("i",{class:e.normalizeClass((M=e.unref(c)[z.type])==null?void 0:M.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(e.openBlock(),e.createBlock(N,{key:1,description:"暂无数据"}))])}}}),YR="",uI=Be(fI,[["__scopeId","data-v-3f95981f"]]),pI=["hidden"],hI={class:"flex mb-5 moudle-1"},mI={class:"flex-1"},gI={class:"mt-5 flex items-center"},yI={key:0,class:"ri-error-warning-fill text-xl mr-1 text-color-warning"},bI={key:1,class:"ri-checkbox-circle-fill text-xl mr-1 text-color-success"},_I={class:"ml-1"},wI=e.createElementVNode("div",{class:"w-10"},null,-1),CI={class:"flex-1"},SI={class:"mt-5 items-center"},xI=e.createElementVNode("i",{class:"ri-database-2-fill text-xl mr-1 text-color-primary"},null,-1),vI=e.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),EI={class:"mt-4 mb-4"},VI={class:"sjzl"},kI=e.createElementVNode("div",{class:"font-bold mt-2 mb-2"},"数据总览",-1),NI={class:"mt-2 flex"},$I={key:1,class:"w-full"},vm=e.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(t,{expose:r,emit:n}){const o=t,a=n;e.watch(()=>o.indicatorsId,()=>S());const{proxy:i}=e.getCurrentInstance(),l=Re(),{dynamicSearchForm:s,dynamicSearchFormat:d,dynamicSearchParams:c}=i.$globalHooks.useDynamicSearch(),{isMobile:f}=i.$globalUtils,u=e.ref(!0),p=e.ref(!1),h=e.ref(!1),m=e.ref([]),y=e.ref({}),g=e.ref(null),b=e.ref([]),w=e.ref([]),_=e.ref({}),C=({column:M})=>{e.unref(_)[M.property]&&(M.order=e.unref(_)[M.property])},S=async()=>{u.value=!0,l.setChartData({}),B();const M=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${o.indicatorsId}`);g.value=M.data,u.value=!1,_.value=JSON.parse(M.data.sortArgsJson??"{}"),s.value=d(JSON.parse(M.data.formConfJson??"[]")),V()},x=e.ref(!1),v=e.ref(!1),V=async(M="")=>{var H,X,J,P,W,Q,re,ne,Y;M!="sort"&&(w.value=[],x.value=!0),v.value=!0;const j=Object.keys(e.unref(_)).map(Z=>({field:Z,type:e.unref(_)[Z]=="ascending"?"asc":"desc"})),F={aggArgsJson:(H=e.unref(g))==null?void 0:H.aggArgsJson,groupArgsJson:(X=e.unref(g))==null?void 0:X.groupArgsJson,sortArgsJson:JSON.stringify(j),params:e.unref(N)??c(d(JSON.parse(((J=e.unref(g))==null?void 0:J.formConfJson)??"[]"))),modelIndicatorsId:(P=e.unref(g))==null?void 0:P.id,pageSize:(W=e.unref(g))==null?void 0:W.pageSize,modelId:(Q=e.unref(g))==null?void 0:Q.modelId},G=await i.$baseHttp.post("/api/ace-data-center/model-indicators/debug",F);G&&(b.value=((re=G.data)==null?void 0:re.records)??[],x.value=!1,v.value=!1,y.value={x:JSON.parse((ne=e.unref(g))==null?void 0:ne.groupArgsJson),y:JSON.parse((Y=e.unref(g))==null?void 0:Y.aggArgsJson),params:F},l.setChartData(y.value),e.unref(b).length&&M!="sort"&&(Object.keys(e.unref(b)[0]).forEach(Z=>{w.value.push({label:Z,prop:Z,sortable:"custom"})}),w.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},$=M=>{const{prop:j,order:F}=M;!F||e.unref(_)[j]===F?delete e.unref(_)[j]:e.unref(_)[j]=F,V("sort")},B=async()=>{var j;m.value=[];const M=await De(i).getRule({current:1,size:100,businessType:"indicators",businessId:o.indicatorsId});m.value=((j=M.data)==null?void 0:j.records)??[],a("rule-success",m.value)},R=e.ref(null),T=M=>{R.value=M,p.value=!0},k=M=>{M.modelIndicatorsId=e.unref(g).id,M.row=e.unref(R)},O=()=>{h.value=!0},N=e.ref(null),D=M=>{N.value=M,V()};e.watch(p,M=>z(M)),e.watch(h,M=>z(M));const I=e.ref(!1),z=M=>{self!=top&&(I.value=M,window.parent.postMessage(M?"model-indicators-open":"model-indicators-close","*"))};return S(),r({init:S,result:g}),(M,j)=>{const F=e.resolveComponent("AppResourceVisitor"),G=e.resolveComponent("AppHeader"),H=e.resolveComponent("AppTable"),X=e.resolveComponent("AppEmpty"),J=e.resolveComponent("AppDynamicList"),P=e.resolveComponent("AppDrawer");return e.unref(u)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:""})):(e.openBlock(),e.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:e.unref(I)},[e.createElementVNode("div",hI,[e.createElementVNode("div",mI,[e.createVNode(G,{title:"指标计算"},{default:e.withCtx(()=>[e.createVNode(F,{businessType:"MODEL_INDICATORS",businessld:o.indicatorsId},null,8,["businessld"])]),_:1}),e.createElementVNode("div",gI,[e.unref(m).some(W=>W.rows>0)?(e.openBlock(),e.createElementBlock("i",yI)):(e.openBlock(),e.createElementBlock("i",bI)),e.createElementVNode("span",_I,e.toDisplayString(e.unref(g).remark),1)])]),wI,e.createElementVNode("div",CI,[e.createVNode(G,{title:"数据来源"}),e.createElementVNode("div",SI,[xI,e.createTextVNode(" 重构仓模型数据 | "+e.toDisplayString(e.unref(g).modelName)+"【 ",1),e.createElementVNode("span",{class:"text-color-primary cursor-pointer",onClick:O},e.toDisplayString(e.unref(g).modelCode),1),e.createTextVNode(" 】 ")])])]),e.createVNode(G,{title:"指标数据"},{left:e.withCtx(()=>[M.modelIndicatorsRules.includes("RELATED_INDICATORS")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-color-warning ml-4 cursor-pointer",onClick:j[0]||(j[0]=W=>a("click-design",o.indicatorsId))},[vI,e.createTextVNode(" 编辑指标 ")])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",EI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(v),animated:""},{default:e.withCtx(()=>[e.createVNode(uI,{dynamicSearchForm:e.unref(s),result:e.unref(g),chartData:e.unref(y),onSearchSuccess:D},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])]),e.createElementVNode("div",VI,[kI,e.createElementVNode("div",NI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(x),animated:""},{default:e.withCtx(()=>[e.unref(w).length?(e.openBlock(),e.createBlock(H,{key:0,maxHeight:"400px",tableData:e.unref(w),list:e.unref(b),loading:!1,headerCellClassName:C,onSortChange:$},{button:e.withCtx(({row:W})=>[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:Q=>T(W)},{default:e.withCtx(()=>[e.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(e.openBlock(),e.createElementBlock("div",$I,[e.createVNode(X,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])])]),e.createVNode(Cm,{ruleList:e.unref(m)},null,8,["ruleList"]),e.createVNode(P,{modelValue:e.unref(p),"onUpdate:modelValue":j[1]||(j[1]=W=>e.isRef(p)?p.value=W:null),title:"查看明细",size:"90%"},{default:e.withCtx(()=>[e.createVNode(G,{title:"统计:",class:"mb-2"}),e.createVNode(H,{height:null,tableData:Object.keys(e.unref(R)).map(W=>({label:W,prop:W})),list:[e.unref(R)],loading:!1},null,8,["tableData","list"]),e.createVNode(G,{title:"钻取明细:",class:"mb-2 mt-4"}),e.createVNode(J,{id:e.unref(g).modelId,title:e.unref(g).modelName,isDownLoad:e.unref(f),url:"/api/ace-data-center/model-indicators/drilling",paramsFunc:k},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),e.createVNode(P,{modelValue:e.unref(h),"onUpdate:modelValue":j[2]||(j[2]=W=>e.isRef(h)?h.value=W:null),title:"模型数据",size:"90%"},{default:e.withCtx(()=>[e.createVNode(J,{id:e.unref(g).modelId,title:e.unref(g).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,pI))}}}),DI=e.createElementVNode("i",{class:"ri-search-line"},null,-1),BI={class:"mt-3"},TI={key:1,class:"ri-edit-circle-fill text-base -ml-5 mr-1 text-color-primary"},OI=e.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),i=e.ref(""),l=e.ref(null),s=n;e.watch(i,m=>{e.unref(l).filter(m)});const d=(m,y)=>m?y.modelName.includes(m):!0,c=e.ref([]),f=e.ref([]),u=e.ref(!0),p=()=>{Promise.all([De(a).loadModelMenu({modelLayer:"ODS"}),De(a).loadModelMenu({modelLayer:"DWD"})]).then(m=>{const y=m[0].data,g=m[1].data;c.value=Object.keys(y).map(b=>({modelName:b,id:b,children:y[b]})),f.value=Object.keys(g).map(b=>({modelName:b,id:b,children:g[b]})),u.value=!1})};p();const h=m=>{if(m.modelCode){if(o.type=="ODS"){s("node-click",m);return}Array.isArray(m.children)||s("node-click",m)}};return r({init:p}),(m,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(E.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:e.unref(i),"onUpdate:modelValue":y[0]||(y[0]=g=>e.isRef(i)?i.value=g:null)},{prefix:e.withCtx(()=>[DI]),_:1},8,["modelValue"]),e.createElementVNode("div",BI,[e.unref(u)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:"",count:2})):(e.openBlock(),e.createBlock(e.unref(E.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:l,data:m.type=="ODS"?e.unref(c):e.unref(f),"default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":d,onNodeClick:h},{default:e.withCtx(({node:g,data:b})=>[g.level!=1||m.type=="ODS"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[b.modelCode&&b.openForm!=2?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ri-checkbox-circle-fill -ml-5 mr-1 text-base",[b.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.openForm==2?(e.openBlock(),e.createElementBlock("i",TI)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass({"font-bold":g.level==1})},e.toDisplayString(b.modelName),3),e.renderSlot(m.$slots,"default",{element:b})]),_:3},8,["data"]))])],64))}}),II={class:"mb-3"},zI={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},RI=e.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(t,{expose:r,emit:n}){const o=n,{proxy:a}=e.getCurrentInstance(),i=e.ref(!1),l=e.ref(),s=e.ref([{label:"源数据",value:"ODS",rule:"VIEW_ODS",disabled:!0},{label:"整合数据",value:"DWD",rule:"VIEW_DWD",disabled:!0}]);De(a).getCurrFunc("MODEL").then(u=>{e.unref(s).forEach(p=>{p.disabled=!u.data.includes(p.rule),!e.unref(l)&&!p.disabled&&(l.value=p.value)})});const d=u=>{l.value=u},c=()=>{i.value=!0},f=u=>{o("click-node",u),i.value=!1};return r({init:c}),(u,p)=>{const h=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(h,{modelValue:e.unref(i),"onUpdate:modelValue":p[0]||(p[0]=m=>e.isRef(i)?i.value=m:null),title:"选择要分析的数据",size:"400px"},{default:e.withCtx(()=>[e.createElementVNode("div",II,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),m=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(l)==m.value?"primary":"",key:m.value,disabled:m.disabled,onClick:y=>d(m.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),e.createElementVNode("div",zI,[e.createVNode(OI,{ref:"menuRef",type:e.unref(l),onNodeClick:f},null,8,["type"])])]),_:1},8,["modelValue"])}}}),MI={class:"flex flex-1 justify-end"},AI=e.createElementVNode("i",{class:"ri-add-circle-line mr-1"},null,-1),LI={key:0,class:"h-full flex items-center justify-center"},FI=e.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(t,{emit:r}){var _,C;const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref(null),l=e.ref(null),s=e.ref(null),d=e.ref(null),c=e.ref(n.element??{});e.provide("modelEle",c),e.provide("getListModelIndicators",()=>{});const f=e.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),u=e.ref(e.unref(f)[0].value),p=e.ref(((_=n==null?void 0:n.element)==null?void 0:_.id)??"");De(a).getCurrFunc("INDICATORS").then(S=>{e.unref(f).find(x=>x.value=="zbqj").disabled=!S.data.includes("INDICATORS_VIEW")});const h=e.ref([]);De(a).getCurrFunc("MODEL_INDICATORS").then(S=>{h.value=S.data});const m=e.ref(((C=n==null?void 0:n.element)==null?void 0:C.businessType)??""),y=S=>{p.value=S.id,m.value=S.type},g=S=>{c.value=S,e.unref(i).init()},b=S=>{var x,v,V;c.value={id:(x=e.unref(s).result)==null?void 0:x.modelId,modelName:(v=e.unref(s).result)==null?void 0:v.modelName,modelCode:(V=e.unref(s).result)==null?void 0:V.modelCode},e.unref(i).init(S)},w=()=>{e.unref(p)&&(o("close-design",e.unref(p)),e.unref(s)&&e.unref(s).init()),e.unref(l)&&e.unref(l).init()};return(S,x)=>{const v=e.resolveComponent("AppEmpty");return e.openBlock(),e.createBlock(e.unref(E.ElContainer),{class:"app-body-container"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElHeader),{style:{height:"auto",padding:"0"},class:"mb-3 flex items-center w-full"},{default:e.withCtx(()=>[S.isCustom?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElButtonGroup),{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),V=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(u)==V.value?"primary":"",key:V.value,disabled:V.disabled,onClick:$=>u.value=V.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),e.createElementVNode("div",MI,[e.unref(h).includes("STATISTICAL_ANALYSIS")?(e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,type:"primary",onClick:x[0]||(x[0]=V=>e.unref(d).init())},{default:e.withCtx(()=>[AI,e.createTextVNode(" 新增指标 ")]),_:1})):e.createCommentVNode("",!0)])]),_:1}),e.withDirectives(e.createVNode(e.unref(E.ElContainer),{class:"overflow-hidden"},{default:e.withCtx(()=>[S.isCustom?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElAside),{key:0,class:"pr-5 mr-5"},{default:e.withCtx(()=>[e.createVNode(FO,{onNodeClick:y,tempId:S.tempId,ref_key:"menuRef",ref:l},null,8,["tempId"])]),_:1})),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(m)=="INDICATORS"?(e.openBlock(),e.createBlock(Sm,{key:0,indicatorsId:e.unref(p)},null,8,["indicatorsId"])):e.createCommentVNode("",!0),e.unref(m)=="MODEL_INDICATORS"?(e.openBlock(),e.createBlock(vm,{key:1,onClickDesign:b,modelIndicatorsRules:e.unref(h),indicatorsId:e.unref(p),ref_key:"modelIndicatorsRef",ref:s},null,8,["modelIndicatorsRules","indicatorsId"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",LI,[e.createVNode(v,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[e.vShow,e.unref(u)=="zbfx"]]),e.unref(u)=="zbqj"?(e.openBlock(),e.createBlock(e.unref(E.ElMain),{key:0},{default:e.withCtx(()=>[e.createVNode(rI)]),_:1})):e.createCommentVNode("",!0),e.createVNode(wm,{ref_key:"designRef",ref:i,onClose:w},null,512),e.createVNode(RI,{ref_key:"modelIndicatorsAddRef",ref:d,onClickNode:g},null,512)]),_:1})}}});return{aceComponentsLib:{install(t,r){if(process.env.NODE_ENV==="development"){const n=Rt.createPinia();t.use(n)}if(console.log("ace-component-lib"),t.use(cc),t.component("aceBigScreen",UD),t.component("aceBigScreenPreview",GD),t.component("aceIndicatorReport",HB),tt.Boot.registerModule(KB),t.component("aceIndicator",FI),t.component("aceIndicatorPreview",vm),t.component("aceIndicatorSystemPreview",Sm),t.component("aceIndicatorDesign",wm),t.component("aceIndicatorCustomSearch",gm),r!=null&&r.components)for(const[n,o]of Object.entries(r.components)){const a=n.replace(".vue","").split("/").at(-1);t.component(a,o.default)}r!=null&&r.exportExcel&&(t.config.globalProperties.$baseExportExcel=r.exportExcel),r!=null&&r.projectId&&(t.config.globalProperties.$baseGetCurrentProjectId=r.projectId),r!=null&&r.utils&&(t.config.globalProperties.$globalUtils=r.utils),r!=null&&r.predefineColors&&(t.config.globalProperties.$globalPreColor=r.predefineColors),r!=null&&r.hooks&&(t.config.globalProperties.$globalHooks=r.hooks)}}}});
896
+ >${s}</span>`},qB=t=>{const r=t.getAttribute("data-chartType")||"",n=t.getAttribute("data-id")||"",o=t.getAttribute("data-content")||"",a=t.getAttribute("data-singleValue")||"",i=t.getAttribute("data-singleValueKey")||"",l=t.getAttribute("data-subtitle")||"",s=t.getAttribute("data-width")||"",d=t.getAttribute("data-fontSize")||"",c=t.getAttribute("data-bold")||"",f=t.getAttribute("data-color")||"",u=t.getAttribute("data-src")||"",p=t.getAttribute("data-indicatorsType")||"";return{type:"indicator",id:n,chartType:r,subtitle:l,content:o,width:s,src:u,fontSize:d,bold:c,singleValue:a,singleValueKey:i,color:f,indicatorsType:p,children:[{text:o}]}};function JB(t){const{insertText:r,isInline:n,isVoid:o}=t,a=t;return a.insertText=i=>{if(qe.DomEditor.getSelectedElems(a).some(d=>a.isVoid(d))){r(i);return}r(i)},a.isInline=i=>qe.DomEditor.getNodeType(i)==="indicator"?!0:n(i),a.isVoid=i=>qe.DomEditor.getNodeType(i)==="indicator"?!0:o(i),a}const KB={editorPlugin:JB,renderElems:[{type:"indicator",renderElem:YB}],elemsToHtml:[{type:"indicator",elemToHtml:XB}],parseElemsHtml:[{selector:'span[data-w-e-type="indicator"]',parseElemHtml:qB}]},ec=t=>(e.pushScopeId("data-v-93fa2d08"),t=t(),e.popScopeId(),t),ZB={class:"flex-1 border border-solid border-gray-200 p-2"},QB={class:"flex justify-end"},eT=ec(()=>e.createElementVNode("div",{class:"h-px mt-2 mb-2 bg-gray-200"},null,-1)),tT={class:"max-h-80 overflow-y-auto"},rT=ec(()=>e.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),nT=ec(()=>e.createElementVNode("span",{class:"ml-2 mr-2"},"~",-1)),oT=e.defineComponent({__name:"customSearch",props:{dynamicSearchForm:{default:()=>[]},customSearchVisible:{type:Boolean,default:!1}},emits:["update:customSearchVisible","dynamicSearchFormUpdate","success"],setup(t,{expose:r,emit:n}){var w;const o=t,a=n;e.watch(()=>o.customSearchVisible,_=>{_&&e.nextTick(()=>{g()})});const{proxy:i}=e.getCurrentInstance(),l=e.inject("modelEle"),s=e.ref([]),d=e.ref([]);i.$baseHttp.get(`/api/ace-data-center/model/detail?id=${(w=e.unref(l))==null?void 0:w.id}`).then(_=>{s.value=_.data.listModelAttribute.map(C=>({name:C.attributeComment,key:C.attributeCode,dataType:C.dataType,checked:!1,type:"",value:"",minValue:"",maxValue:"",defaultRule:"",dictId:"",options:""}))});const c=e.ref([]);i.$baseHttp.get(`/api/ace-data-center/custom-dic/options?projectId=${i.$baseGetCurrentProjectId}`).then(_=>{c.value=_.data});const f={yymmddSingle:[{name:"当日",value:"today"},{name:"昨天",value:"yesterday"}],yymmddRange:[{name:"近一周",value:"week"}],yymmSingle:[{name:"当月",value:"month"}],yymmRange:[{name:"近两月",value:"two-month"}],yySingle:[{name:"当年",value:"year"}],yyRange:[{name:"近两年",value:"two-year"}]},u=_=>{let C="date",S="YYYY-MM-DD";return["yyRange","yySingle"].includes(_)&&(C="year",S="YYYY"),["yymmRange","yymmSingle"].includes(_)&&(C="month",S="YYYY-MM"),{type:C,format:S}},p=(_,C,S)=>_=="gt"?C.getTime()>on(S||"").valueOf():C.getTime()<on(S||"").valueOf(),h=(_,C,S)=>{if(_[C]==""||_[S]=="")return;const x=Number(_[C]),v=Number(_[S]);(C=="minValue"?x>v:x<v)&&(_[C]=_[S])},m=_=>{_.value="",_.options=[],_.dictId&&i.$baseHttp.get(`/api/ace-data-center/custom-dic/readDict/${_.dictId}`).then(C=>{_.options=C.data??[]})},y=_=>{_.value="",_.minValue="",_.maxValue="",_.defaultRule="",_.dictId="",_.options=[]},g=()=>{d.value=JSON.parse(JSON.stringify(e.unref(s))),e.unref(d).forEach(_=>{const C=o.dynamicSearchForm.find(S=>S.key==_.key);C&&(_.checked=!0,Object.keys(C).forEach(S=>{_[S]=C[S]})),["varchar","text"].includes(_.dataType)&&!C&&(_.type="stringSingle")})},b=()=>{a("dynamicSearchFormUpdate",d.value.filter(_=>_.checked&&_.type)),a("update:customSearchVisible",!1)};return r({init:g}),(_,C)=>(e.openBlock(),e.createElementBlock("div",ZB,[e.createElementVNode("div",QB,[e.createVNode(e.unref(E.ElButton),{type:"primary",size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-3",size:"small",onClick:C[0]||(C[0]=S=>a("update:customSearchVisible",!1))},{default:e.withCtx(()=>[e.createTextVNode(" 关闭 ")]),_:1})]),eT,e.createElementVNode("div",tT,[e.createVNode(e.unref(E.ElForm),{inline:"",size:"small"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(S,x)=>(e.openBlock(),e.createElementBlock("div",{key:x},[e.createVNode(e.unref(E.ElFormItem),{label:""},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElCheckbox),{modelValue:S.checked,"onUpdate:modelValue":v=>S.checked=v,size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e.createVNode(e.unref(E.ElFormItem),{label:"名称:"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElInput),{modelValue:S.name,"onUpdate:modelValue":v=>S.name=v,modelModifiers:{trim:!0},size:"small",placeholder:"请输入名称",clearable:""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e.createVNode(e.unref(E.ElFormItem),{label:"类型:"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElSelect),{size:"small",clearable:"",teleported:!1,modelValue:S.type,"onUpdate:modelValue":v=>S.type=v,modelModifiers:{trim:!0},onChange:v=>y(S),placeholder:"类型"},{default:e.withCtx(()=>[["date","datetime"].includes(S.dataType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(E.ElOption),{label:"年·区间",value:"yyRange"}),e.createVNode(e.unref(E.ElOption),{label:"年·单值",value:"yySingle"}),e.createVNode(e.unref(E.ElOption),{label:"年月·区间",value:"yymmRange"}),e.createVNode(e.unref(E.ElOption),{label:"年月·单值",value:"yymmSingle"}),e.createVNode(e.unref(E.ElOption),{label:"年月日·区间",value:"yymmddRange"}),e.createVNode(e.unref(E.ElOption),{label:"年月日·单值",value:"yymmddSingle"})],64)):["int","decimal","double"].includes(S.dataType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(E.ElOption),{label:"数值·区间",value:"numberRange"}),e.createVNode(e.unref(E.ElOption),{label:"数值·单值",value:"numberSingle"}),e.createVNode(e.unref(E.ElOption),{label:"下拉框·字典",value:"select"})],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(e.unref(E.ElOption),{label:"字符串",value:"stringSingle"}),e.createVNode(e.unref(E.ElOption),{label:"下拉框·字典",value:"select"})],64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),S.type?(e.openBlock(),e.createBlock(e.unref(E.ElFormItem),{key:0,label:"默认值:"},{default:e.withCtx(()=>[f[S.type]?(e.openBlock(),e.createBlock(e.unref(E.ElSelect),{key:0,size:"small",clearable:"",style:{"margin-right":"10px"},teleported:!1,modelValue:S.defaultRule,"onUpdate:modelValue":v=>S.defaultRule=v,modelModifiers:{trim:!0},placeholder:"默认值"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f[S.type],v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.name,value:v.value,key:v.value},null,8,["label","value"]))),128)),e.createVNode(e.unref(E.ElOption),{label:"自定义",value:"custom"})]),_:2},1032,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),S.type.endsWith("Range")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[["yyRange","yymmRange","yymmddRange"].includes(S.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(E.ElDatePicker),{size:"small",teleported:!1,modelValue:S.minValue,"onUpdate:modelValue":v=>S.minValue=v,clearable:"",placeholder:"开始","disabled-date":v=>p("gt",v,S.maxValue),type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"]),rT,e.createVNode(e.unref(E.ElDatePicker),{size:"small",teleported:!1,modelValue:S.maxValue,"onUpdate:modelValue":v=>S.maxValue=v,clearable:"",placeholder:"结束","disabled-date":v=>p("lt",v,S.minValue),type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","disabled-date","type","value-format"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(E.ElInput),{size:"small",modelValue:S.minValue,"onUpdate:modelValue":v=>S.minValue=v,modelModifiers:{trim:!0},max:S.maxValue,clearable:!1,onBlur:v=>h(S,"minValue","maxValue"),type:"number",placeholder:"最小值"},null,8,["modelValue","onUpdate:modelValue","max","onBlur"]),nT,e.createVNode(e.unref(E.ElInput),{size:"small",modelValue:S.maxValue,"onUpdate:modelValue":v=>S.maxValue=v,modelModifiers:{trim:!0},min:S.minValue,clearable:!1,onBlur:v=>h(S,"maxValue","minValue"),type:"number",placeholder:"最大值"},null,8,["modelValue","onUpdate:modelValue","min","onBlur"])],64))],64)):e.createCommentVNode("",!0),S.type.includes("Single")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[["yySingle","yymmSingle","yymmddSingle"].includes(S.type)?(e.openBlock(),e.createBlock(e.unref(E.ElDatePicker),{key:0,size:"small",teleported:!1,modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,clearable:"",placeholder:"请输入"+S.name,type:u(S.type).type,"value-format":u(S.type).format},null,8,["modelValue","onUpdate:modelValue","placeholder","type","value-format"])):(e.openBlock(),e.createBlock(e.unref(E.ElInput),{key:1,size:"small",modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,modelModifiers:{trim:!0},teleported:!1,clearable:"",type:S.type=="numberSingle"?"number":"",placeholder:"请输入"+S.name},null,8,["modelValue","onUpdate:modelValue","type","placeholder"]))],64)):e.createCommentVNode("",!0),S.type=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createVNode(e.unref(E.ElSelect),{size:"small",teleported:!1,style:{"margin-right":"10px"},modelValue:S.dictId,"onUpdate:modelValue":v=>S.dictId=v,placeholder:"字典值",clearable:"",onChange:v=>m(S)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.label,value:v.code,key:v.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),e.createVNode(e.unref(E.ElSelect),{size:"small",teleported:!1,modelValue:S.value,"onUpdate:modelValue":v=>S.value=v,placeholder:"请选择",clearable:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.options,v=>(e.openBlock(),e.createBlock(e.unref(E.ElOption),{label:v.name,value:v.code,key:v.code},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):e.createCommentVNode("",!0)]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),_:1})])]))}}),zR="",gm=Be(oT,[["__scopeId","data-v-93fa2d08"]]),aT={class:"field"},iT={class:"field-container h-full flex-1 flex items-center justify-center cursor-pointer overflow-hidden"},lT=["onClick"],sT={class:"field-label whitespace-nowrap text-ellipsis overflow-hidden"},cT={key:0,class:"flex items-center h-full"},dT={class:"mr-5"},fT=["onClick"],uT={key:0,class:"field-add"},pT=["onClick"],hT=e.defineComponent({__name:"model-table-dimension",props:{loading:{type:Boolean,default:!0},iconMap:{default:()=>{}},calendarType:{default:()=>{}},modelValue:{default:()=>[]},list:{default:()=>[]}},emits:["success","update:modelValue"],setup(t,{emit:r}){const n=t,o=r;e.inject("chartList");const a=e.ref(""),i=e.computed(()=>n.list.filter(f=>f.columnComment.indexOf(e.unref(a))>=0)),l=f=>{o("update:modelValue",[f]),o("success")},s=f=>{o("update:modelValue",[...n.modelValue,f]),o("success")},d=f=>{o("update:modelValue",n.modelValue.filter(u=>u.identifier!==f.identifier)),o("success")},c=(f,u)=>{const p=n.modelValue.find(h=>h.identifier==u.identifier);p.dateFormatType=f,u.dateFormatType=f,o("success")};return(f,u)=>{const p=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,{title:"计算维度",class:"mt-4 mb-2"}),e.createVNode(e.unref(E.ElSkeleton),{loading:f.loading,animated:""},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(a),"onUpdate:modelValue":u[0]||(u[0]=h=>e.isRef(a)?a.value=h:null),placeholder:"搜索字段",class:"mb-2"},null,8,["modelValue"]),e.createElementVNode("div",aT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),h=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["field-item",{active:f.modelValue.some(m=>m.identifier==h.identifier)}]),key:h.identifier},[e.createElementVNode("div",iT,[e.createElementVNode("div",{class:"flex flex-1 items-center overflow-hidden",onClick:m=>l(h)},[e.createElementVNode("i",{class:e.normalizeClass([f.iconMap[h.dataType],"mr-2"])},null,2),e.createElementVNode("span",sT,e.toDisplayString(h.columnComment),1)],8,lT),f.modelValue.some(m=>m.identifier==h.identifier)?(e.openBlock(),e.createElementBlock("div",cT,[["date","datetime"].includes(h.dataType)?(e.openBlock(),e.createBlock(e.unref(E.ElDropdown),{key:0,trigger:"hover",onCommand:m=>c(m,h)},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(E.ElDropdownMenu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.calendarType,(m,y)=>(e.openBlock(),e.createBlock(e.unref(E.ElDropdownItem),{command:y,key:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("span",dT,e.toDisplayString(f.calendarType[h.dateFormatType]),1)]),_:2},1032,["onCommand"])):e.createCommentVNode("",!0),e.createElementVNode("i",{class:"ri-close-line cursor-pointer",onClick:e.withModifiers(m=>d(h),["stop"])},null,8,fT)])):e.createCommentVNode("",!0)]),!f.modelValue.some(m=>m.identifier==h.identifier)&&f.modelValue.length?(e.openBlock(),e.createElementBlock("div",uT,[e.createElementVNode("i",{class:"ri-add-line cursor-pointer text-gray-800",onClick:e.withModifiers(m=>s(h),["stop"])},null,8,pT)])):e.createCommentVNode("",!0)],2))),128))])]),_:1},8,["loading"])],64)}}}),RR="",mT=Be(hT,[["__scopeId","data-v-1be11605"]]),tc=t=>(e.pushScopeId("data-v-3643599f"),t=t(),e.popScopeId(),t),gT={class:"mb-2"},yT=tc(()=>e.createElementVNode("div",{class:"font-bold mb-2"},"公式名称:",-1)),bT={class:"mb-4 mt-4 relative"},_T={class:"font-bold mb-2"},wT={class:"text-color-primary ml-2"},CT={key:0,class:"selection el-popper is-light el-popover","data-popper-placement":"bottom"},ST=tc(()=>e.createElementVNode("div",null,"选择变量",-1)),xT={class:"mt-2"},vT=tc(()=>e.createElementVNode("span",{class:"el-popper__arrow","data-popper-arrow":""},null,-1)),ET="0123456789+-*/@.()",VT=e.defineComponent({__name:"model-exp",props:{options:{default:()=>[]}},emits:["success"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),a=e.ref(!1),i=t,l=n,s=e.ref(""),d=e.ref(null),c=T=>{const{key:k}=T;switch(k){case"Enter":T.preventDefault();break;case"@":case"Process":h();break}};let f=null;const u=()=>{const T=e.unref(d).innerHTML;let k=v(T);k=k.map(N=>$(N)?V(N):N.data.split("").filter(D=>ET.includes(D)).join(""));const O=k.join("");if(T!==O){const N=B(T,O);e.unref(d).innerHTML=O,R(e.unref(d),N)}clearTimeout(f),f=setTimeout(async()=>{C()},500)},p=e.ref(!1),h=()=>{p.value=!0},m=T=>{const{identifier:k,columnComment:O}=T;p.value=!1;const N=`<div contenteditable="false">${O}<span>${k}</span></div>`;w("@",N)},y=e.ref(null),g=T=>{if(y.value=T,s.value="",a.value=!0,T){const k=JSON.parse(JSON.stringify(T.data));let O=k.exp??"";s.value=k.comment,k.identifier.split(",").forEach(N=>{const D=new RegExp(N,"g"),I=i.options.find(z=>z.identifier==N);if(I){const z=`<div contenteditable="false">${I.columnComment}<span>${N}</span></div>`;O=O.replace(D,(M,j,F)=>{const G=M.length,H=F.slice(j-1,G+j+1);return H.startsWith("_")||H.endsWith("_")?N:z})}}),e.nextTick(()=>{e.unref(d).innerHTML=O.replace(/@/g,""),setTimeout(()=>{C()},100)})}},b=()=>{var T,k;if(!((T=e.unref(_))!=null&&T.exp)){o.$message.warning("公式不能为空");return}if(e.unref(s)==""){o.$message.warning("公式名称不能为空");return}l("success",{...e.unref(_),aggType:"exp",comment:e.unref(s),showLabel:e.unref(s)},((k=e.unref(y))==null?void 0:k.index)??""),a.value=!1},w=(T,k="")=>{if(!e.unref(d))return;let O=e.unref(d).innerHTML;O.includes(T)&&(O=O.replace(new RegExp(T,"g"),k),e.unref(d).innerHTML=O),C()},_=e.ref({}),C=()=>{let T="";const k=[],O=e.unref(d).innerHTML.replace(/\sdata-spm-anchor-id=".*?"/g,"");x({text:O,prefix:'<div contenteditable="false">',suffix:"</div>"}).forEach(D=>{const[I,z]=x({text:D,prefix:"<span>",suffix:"</span>"});z?(T+=`@${z}`,k.push(z)):T+=I}),_.value={exp:T,identifier:k.toString()}},S=T=>{p.value=!1,T&&w("@")};e.onMounted(()=>window.addEventListener("click",S)),e.onBeforeUnmount(()=>window.removeEventListener("click",S)),r({init:g});const x=({text:T,prefix:k,suffix:O})=>T.replace(new RegExp(k,"g"),",").replace(new RegExp(O,"g"),",").split(",").filter(N=>!!N),v=T=>{const k=document.createElement("div");return k.innerHTML=T,[...k.childNodes]},V=T=>{let k=document.createElement("div");k.appendChild(T);let O=k.innerHTML;return k=T=null,O},$=T=>Object.prototype.toString.call(T)==="[object HTMLDivElement]",B=(T,k)=>{const O=T.split(""),N=k.split(""),D=Math.max(O.length,N.length);let I=0;for(let z=0;z<D&&O[z]==N[z];z++)I++;return I},R=(T,k)=>{const O=document.createRange(),N=window.getSelection();let D=0,I=0;const z=v(T.innerHTML);for(let M=0;M<z.length;M++){const j=z[M];if($(j))k-=V(j).length;else if(k>j.length)k-=j.length;else{I=k;break}D++}O.selectNodeContents(T),O.collapse(!1),T.childNodes[D]&&O.setStart(T.childNodes[D],I),O.collapse(!0),N.removeAllRanges(),N.addRange(O)};return(T,k)=>{const O=e.resolveComponent("AppDialog");return e.openBlock(),e.createBlock(O,{modelValue:e.unref(a),"onUpdate:modelValue":k[2]||(k[2]=N=>e.isRef(a)?a.value=N:null),title:"计算公式",size:800},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:k[1]||(k[1]=N=>a.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",gT,[yT,e.createVNode(e.unref(E.ElInput),{modelValue:e.unref(s),"onUpdate:modelValue":k[0]||(k[0]=N=>e.isRef(s)?s.value=N:null),placeholder:"请输入公式名称"},null,8,["modelValue"])]),e.createElementVNode("div",bT,[e.createElementVNode("div",_T,[e.createTextVNode(" 公式: "),e.createElementVNode("span",wT,e.toDisplayString(e.unref(_).exp),1)]),e.createElementVNode("div",{ref_key:"formulaRef",ref:d,class:"formula flex-1",contenteditable:"",placeholder:"请输入表达式 输入「@」后选择指标",style:{"ime-mode":"disabled"},onKeydown:e.withModifiers(c,["stop"]),onKeyup:u},null,544),e.unref(p)?(e.openBlock(),e.createElementBlock("div",CT,[ST,e.createElementVNode("div",xT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,N=>(e.openBlock(),e.createBlock(e.unref(E.ElTag),{class:"m-2 cursor-pointer",onClick:D=>m(N),key:N.identifier,type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.columnComment),1)]),_:2},1032,["onClick"]))),128))]),vT])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),MR="",kT=Be(VT,[["__scopeId","data-v-3643599f"]]),rc=t=>(e.pushScopeId("data-v-6234eeff"),t=t(),e.popScopeId(),t),NT={key:0},$T=rc(()=>e.createElementVNode("div",{class:"text-sm mb-2 indicators-title"},[e.createElementVNode("i",{class:"ri-table-line mr-1"}),e.createTextVNode(" 基本指标 ")],-1)),DT=["onClick"],BT=rc(()=>e.createElementVNode("i",{class:"ri-lightbulb-line"},null,-1)),TT={key:1},OT={class:"text-sm mb-2 indicators-title flex items-center"},IT={class:"max-h-96 overflow-y-auto"},zT=["onClick"],RT={class:"field-label"},MT=rc(()=>e.createElementVNode("i",{class:"ri-add-fill"},null,-1)),AT=e.defineComponent({__name:"model-table-summary",props:{modelValue:{default:()=>[]},iconMap:{default:()=>{}},list:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:r}){const n=t,o=r,{proxy:a}=e.getCurrentInstance();e.inject("chartList");const i=e.ref(!1),l=e.ref(1),s=e.ref(null),d=e.ref([{label:"行数",value:"count",tip:"数据的总行数"},{label:"总和",value:"sum",tip:"列的所有值的总和"},{label:"平均值",value:"avg",tip:"列的所有值的平均值"},{label:"最少",value:"min",tip:"列的最小值"},{label:"最大",value:"max",tip:"列的最大值"},{label:"计算公式",value:"exp",tip:"可手动输入计算公式"}]);e.watch(i,m=>{m&&(u.value={},l.value=1)});const c=m=>{o("update:modelValue",n.modelValue.filter(y=>y.showLabel!==m.showLabel))},f=(m,y)=>{m.aggType=="exp"&&e.unref(s).init({data:m,index:y})},u=e.ref({}),p=m=>{if(m.value==="count"){if(n.modelValue.some(y=>y.aggType==m.value)){a.$message.warning("存在重复数据");return}o("update:modelValue",[...n.modelValue,{identifier:1,aggType:m.value,showLabel:m.label}]),i.value=!1;return}if(m.value=="exp"){e.unref(s).init();return}l.value=2,u.value=m},h=m=>{var y,g;if(n.modelValue.some(b=>{var w;return b.identifier==m.identifier&&b.aggType==((w=e.unref(u))==null?void 0:w.value)})){a.$message.warning("存在重复数据");return}i.value=!1,o("update:modelValue",[...n.modelValue,{identifier:m.identifier,comment:m.columnComment,aggType:(y=e.unref(u))==null?void 0:y.value,showLabel:m.columnComment+((g=e.unref(u))==null?void 0:g.label)}])};return(m,y)=>{const g=e.resolveComponent("AppHeader");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(g,{title:"汇总方式",class:"mb-2"}),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.modelValue,(b,w)=>(e.openBlock(),e.createBlock(e.unref(E.ElTag),{key:b.value,class:e.normalizeClass(["m-1",[b.aggType=="exp"?"cursor-pointer":""]]),closable:!0,onClick:_=>f(b,w),onClose:_=>c(b),type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.showLabel),1)]),_:2},1032,["onClick","class","onClose"]))),128)),e.createVNode(e.unref(E.ElPopover),{trigger:"click",width:"300px",placement:"top-start",visible:e.unref(i),"onUpdate:visible":y[1]||(y[1]=b=>e.isRef(i)?i.value=b:null)},{reference:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-1",size:"small"},{default:e.withCtx(()=>[MT,e.createTextVNode(" "+e.toDisplayString(m.modelValue.length?"":"添加度量"),1)]),_:1})]),default:e.withCtx(()=>[e.unref(l)==1?(e.openBlock(),e.createElementBlock("div",NT,[$T,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),b=>(e.openBlock(),e.createElementBlock("div",{onClick:w=>p(b),key:b.value,class:e.normalizeClass([{active:e.unref(u).value==b.value},"indicators-item"])},[e.createTextVNode(e.toDisplayString(b.label)+" ",1),e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:b.tip,placement:"top"},{default:e.withCtx(()=>[BT]),_:2},1032,["content"])],10,DT))),128))])):e.createCommentVNode("",!0),e.unref(l)==2?(e.openBlock(),e.createElementBlock("div",TT,[e.createElementVNode("div",OT,[e.createElementVNode("i",{class:"ri-arrow-left-s-line text-xl mr-1 cursor-pointer",onClick:y[0]||(y[0]=b=>l.value=1)}),e.createTextVNode(" "+e.toDisplayString(e.unref(u).label),1)]),e.createElementVNode("div",IT,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.list,b=>(e.openBlock(),e.createElementBlock("div",{onClick:w=>h(b),key:b.identifier,class:"indicators-item"},[e.createElementVNode("div",null,[e.createElementVNode("i",{class:e.normalizeClass([m.iconMap[b.dataType],"mr-2"])},null,2),e.createElementVNode("span",RT,e.toDisplayString(b.columnComment),1)])],8,zT))),128))])])):e.createCommentVNode("",!0)]),_:1},8,["visible"]),e.createVNode(kT,{ref_key:"modelPercentRef",ref:s,options:n.list,onSuccess:y[2]||(y[2]=(b,w)=>w?n.modelValue[w]=b:o("update:modelValue",[...n.modelValue,b]))},null,8,["options"])])],64)}}}),AR="",LT=Be(AT,[["__scopeId","data-v-6234eeff"]]),ym=e.defineComponent({__name:"chart-list-widget",props:{type:{default:""}},setup(t){const{proxy:r}=e.getCurrentInstance(),{echartsTypeList:n}=r.$globalUtils,o=e.inject("chartList"),a=i=>{r.$baseEventBus.emit("model-chart-click",i)};return(i,l)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),s=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:i.type==s.type?"primary":"",key:s.type,onClick:d=>a(s)},{default:e.withCtx(()=>{var d;return[e.createElementVNode("i",{class:e.normalizeClass((d=e.unref(n)[s.type])==null?void 0:d.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))}}),ai=t=>(e.pushScopeId("data-v-fb1bbe3f"),t=t(),e.popScopeId(),t),FT={class:"w-full h-full flex"},jT={class:"flex-1 flex flex-col overflow-hidden"},PT={class:"flex-1 flex flex-col pr-3 pb-3 overflow-y-auto"},UT={key:0,class:"flex items-center pannel justify-center relative h-14"},WT={class:"absolute left-5 top-3"},GT=ai(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1)),HT=ai(()=>e.createElementVNode("i",{class:"ri-table-line"},null,-1)),YT={class:"absolute right-5 top-4 flex items-center"},XT=ai(()=>e.createElementVNode("i",{class:"ri-settings-2-line mr-1"},null,-1)),qT={class:"ml-2 mr-2"},JT={class:"flex flex-col"},KT={class:"flex-1 overflow-y-auto"},ZT={key:0,class:"flex items-center pannel justify-center h-14"},QT=ai(()=>e.createElementVNode("i",{class:"ri-save-line mr-1"},null,-1)),eO=e.defineComponent({__name:"table-widget",props:{modelValue:{default:""},title:{default:""},sortHtml:{default:""},indicatorsId:{default:""},resultTitle:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue","update:title","update:sortHtml","update:resultTitle","update:indicatorsId","update:dynamicSearchForm","success"],setup(t,{expose:r,emit:n}){const o=t,a=n,i=Re(),{proxy:l}=e.getCurrentInstance(),{setFormValue:s,getFormValue:d}=l.$globalHooks.useForm(),{dynamicSearchForm:c,dynamicSearchFormat:f,dynamicSearchParams:u}=l.$globalHooks.useDynamicSearch(),p=e.inject("modelEle"),h=e.inject("getListModelIndicators");e.inject("chartList");const m={varchar:"ri-text",date:"ri-calendar-2-line",datetime:"ri-calendar-2-line",int:"ri-hashtag",decimal:"ri-hashtag"},y={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年"},g=e.ref(!1),b=e.ref(!0),w=e.ref(0),_=e.ref([]),C=e.ref([]),S=e.ref([]),x=e.ref([]),v=e.ref(!0),V=e.ref(!0),$=async P=>{var Q,re;v.value=!0,V.value=!1;const W=JSON.parse((P==null?void 0:P.groupArgsJson)??"[]");x.value=JSON.parse((P==null?void 0:P.aggArgsJson)??JSON.stringify([{identifier:1,aggType:"count",showLabel:"行数"}])),W.length||(v.value=!1),w.value=(P==null?void 0:P.pageSize)??20,I.value=JSON.parse((P==null?void 0:P.sortArgsJson)??"{}"),P!=null&&P.formConfJson?(c.value=f(JSON.parse(P.formConfJson??"[]")),a("update:dynamicSearchForm",c.value)):await De(l).getFormJsonConfig((Q=e.unref(p))==null?void 0:Q.id).then(ne=>{var Y;c.value=f(JSON.parse(((Y=ne.data)==null?void 0:Y.formConfJson)??"[]"))}),a("update:dynamicSearchForm",c.value),s(P,j),l.$baseHttp.post("/api/ace-data-center/aidc/modelAnalysis",{projectId:l.$baseGetCurrentProjectId,modelId:(re=e.unref(p))==null?void 0:re.id,serialId:new Date().getTime()}).then(ne=>{b.value=!1,_.value=ne.data.filter(Y=>!["创建时间","创建人","所属项目","创建部门","标签"].includes(Y.columnComment)).map(Y=>({...Y,dateFormatType:["date","datetime"].includes(Y.dataType)?"day":""})),S.value=ne.data.filter(Y=>["ADDABLE","SEMIADDABLE"].includes(Y.quantityType)),W.forEach(Y=>{const Z=_.value.find(ye=>ye.identifier==Y.identifier);Z&&(C.value.push({...Z,dataType:Y.dataType,dateFormatType:Y.dateFormatType}),Z.dateFormatType=Y.dateFormatType)}),v.value=!1,setTimeout(()=>{V.value=!0},1e3)})};e.watch([x,C],()=>{e.unref(V)&&(I.value={}),N()},{deep:!0});let B=null;const R=e.ref(null),T=e.ref(!1),k=e.ref([]),O=e.ref([]),N=async()=>{clearTimeout(B),B=setTimeout(async()=>{var ne,Y;O.value=[],i.setChartData([]);const P=D(),W=Object.keys(e.unref(I)).map(Z=>({field:Z,type:e.unref(I)[Z]=="ascending"?"asc":"desc"})),Q={aggArgsJson:JSON.stringify(e.unref(x)),groupArgsJson:JSON.stringify(P),sortArgsJson:JSON.stringify(W),params:u(e.unref(c)),pageSize:e.unref(w),modelId:(ne=e.unref(p))==null?void 0:ne.id};if(o.indicatorsId&&(Q.modelIndicatorsId=o.indicatorsId),a("update:title",`${e.unref(x).length}个指标:${e.unref(x).length?"根据":""}${P.map(Z=>Z.showLabel).toString()}${e.unref(x).length?"分组的":""}${e.unref(x).filter((Z,ye)=>ye<3).map(Z=>Z.showLabel).toString()}${e.unref(x).length>3?"...":""}`),!e.unref(x).length||e.unref(v)){k.value=[];return}T.value=!0;const re=await l.$baseHttp.post("/api/ace-data-center/model-indicators/debug",Q);R.value=Q,T.value=!1,re&&(k.value=((Y=re.data)==null?void 0:Y.records)??[],i.setChartData({x:P,y:e.unref(x),params:Q}),e.unref(k).length&&Object.keys(e.unref(k)[0]).forEach(Z=>{O.value.push({label:Z,prop:Z,sortable:"custom"})}))})},D=()=>e.unref(C).map(P=>({identifier:P.identifier,comment:P.columnComment,showLabel:P.columnComment+(y[P.dateFormatType]??""),dateFormatType:P.dateFormatType||null})),I=e.ref({}),z=({column:P})=>{e.unref(I)[P.property]&&(P.order=e.unref(I)[P.property])};e.watch(I,P=>{const W=Object.keys(P).map(Q=>`${Q}${P[Q]=="descending"?"降序":"升序"}`);a("update:sortHtml",W.length?`<span class="text-color-warning">排序:${W.toString()}</span>`:"")},{deep:!0});const M=P=>{const{prop:W,order:Q}=P;!Q||e.unref(I)[W]===Q?delete e.unref(I)[W]:e.unref(I)[W]=Q,N()};De(l).loadIndicatorsMenu().then(P=>{j.find(W=>W.fieldName=="tags").options=Object.keys(P.data).map(W=>({label:W,value:W}))});const j=e.reactive([{name:"名称",type:Rr.Text,fieldName:"name",value:"",required:!0},{name:"描述",type:Rr.Textarea,fieldName:"remark",value:""},{name:"标签",type:Rr.Select,fieldName:"tags",value:"",options:[],multiple:!0,allowCreate:!0,required:!0,placeholder:"请选择标签或输入标签"},{name:"code",type:Rr.Text,fieldName:"code",value:"",hide:!0}]),F=e.ref(!1),G=()=>{j.find(P=>P.fieldName=="remark").value=o.title,F.value=!0},H=async()=>{var ne;const{params:P,error:W}=d(j);if(W.length>0)return;const Q=D();if(!Q.length||!e.unref(x).length){l.$message.warning("计算维度或汇总方式不能为空");return}P.code||(P.code=li()),P.groupArgsJson=JSON.stringify(Q),P.aggArgsJson=JSON.stringify(e.unref(x)),P.modelId=(ne=e.unref(p))==null?void 0:ne.id,P.projectId=l.$baseGetCurrentProjectId,P.pageSize=e.unref(w),P.formConfJson=JSON.stringify(e.unref(c)),P.sortArgsJson=JSON.stringify(e.unref(I)),o.indicatorsId&&(P.id=o.indicatorsId),F.value=!1;const re=await l.$baseHttp.post(`/api/ace-data-center/model-indicators/${o.indicatorsId?"update":"save"}`,P,{header:{loading:!0}});re&&(o.indicatorsId||a("update:indicatorsId",re.data),a("update:resultTitle",P.name),l.$message.success("操作成功"),s(P,j),h())},X=()=>{a("update:modelValue","chart")},J=()=>{l.$baseExportExcel({title:o.title,url:"/api/ace-data-center/model-indicators/debug",header:e.unref(O),customParams:e.unref(R)})};return r({init:$,dynamicSearchForm:c,handlePopupForm:G,handleSubmit:H}),(P,W)=>{var ie,ce;const Q=e.resolveComponent("AppDynamicSearch"),re=e.resolveComponent("AppTable"),ne=e.resolveComponent("AppEmpty"),Y=e.resolveComponent("AppDynamicList"),Z=e.resolveComponent("AppForm"),ye=e.resolveComponent("AppDialog");return e.openBlock(),e.createElementBlock("div",FT,[e.createElementVNode("div",jT,[e.createElementVNode("div",PT,[e.unref(x).length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Q,{form:e.unref(c),onSuccess:W[0]||(W[0]=oe=>N())},null,8,["form"]),e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(T),animated:""},{default:e.withCtx(()=>[e.unref(O).length?(e.openBlock(),e.createBlock(re,{key:0,tableData:e.unref(O),list:e.unref(k),loading:!1,headerCellClassName:z,onSortChange:M},null,8,["tableData","list"])):(e.openBlock(),e.createBlock(ne,{key:1,description:"暂无数据",class:"mt-4"}))]),_:1},8,["loading"])],64)):(e.openBlock(),e.createBlock(Y,{key:1,id:(ie=e.unref(p))==null?void 0:ie.id,title:(ce=e.unref(p))==null?void 0:ce.modelName,showPageIndex:!0},null,8,["id","title"]))]),e.unref(x).length?(e.openBlock(),e.createElementBlock("div",UT,[e.createElementVNode("div",WT,[e.createVNode(e.unref(E.ElTooltip),{effect:"dark",content:"保存汇总配置后可设置",placement:"top",visible:e.unref(g)},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{disabled:P.indicatorsId=="",type:"warning",style:{padding:"0 10px"},onMouseenter:W[1]||(W[1]=oe=>{P.indicatorsId||(g.value=!0)}),onMouseleave:W[2]||(W[2]=oe=>g.value=!1),onClick:X},{default:e.withCtx(()=>[e.createTextVNode(" 图表配置 "),GT]),_:1},8,["disabled"])]),_:1},8,["visible"])]),e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary"},{default:e.withCtx(()=>[HT]),_:1}),e.createVNode(ym)]),_:1}),e.createElementVNode("div",YT,[e.createVNode(e.unref(E.ElLink),{type:"primary"},{default:e.withCtx(()=>[XT,e.createTextVNode(" 显示前 "),e.createElementVNode("div",qT,[e.createVNode(e.unref(E.ElInputNumber),{size:"small",style:{width:"100px"},modelValue:e.unref(w),"onUpdate:modelValue":W[3]||(W[3]=oe=>e.isRef(w)?w.value=oe:null),onChange:W[4]||(W[4]=oe=>N()),min:1,max:9999999},null,8,["modelValue"])]),e.createTextVNode(" 条聚合数据 ")]),_:1}),e.unref(O).length?(e.openBlock(),e.createElementBlock("i",{key:0,class:"ri-download-2-line ml-2 text-color-warning cursor-pointer",onClick:J})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createElementVNode("aside",JT,[e.createElementVNode("div",KT,[e.createVNode(LT,{list:e.unref(S),modelValue:e.unref(x),"onUpdate:modelValue":W[5]||(W[5]=oe=>e.isRef(x)?x.value=oe:null),iconMap:m},null,8,["list","modelValue"]),e.withDirectives(e.createElementVNode("div",null,[e.createVNode(mT,{loading:e.unref(b),list:e.unref(_),iconMap:m,calendarType:y,modelValue:e.unref(C),"onUpdate:modelValue":W[6]||(W[6]=oe=>e.isRef(C)?C.value=oe:null)},null,8,["loading","list","modelValue"])],512),[[e.vShow,e.unref(x).length]])]),e.unref(x).length?(e.openBlock(),e.createElementBlock("div",ZT,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:G},{default:e.withCtx(()=>[QT,e.createTextVNode(" 完 成 ")]),_:1})])):e.createCommentVNode("",!0),e.createVNode(ye,{modelValue:e.unref(F),"onUpdate:modelValue":W[8]||(W[8]=oe=>e.isRef(F)?F.value=oe:null),title:"保存指标",size:800},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{class:"ml-3",type:"primary",onClick:H},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:W[7]||(W[7]=oe=>F.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1})]),default:e.withCtx(()=>[e.createVNode(Z,{form:e.unref(j),col:1},null,8,["form"])]),_:1},8,["modelValue"])])])}}}),LR="",tO=Be(eO,[["__scopeId","data-v-fb1bbe3f"]]),bm=t=>(e.pushScopeId("data-v-cc083189"),t=t(),e.popScopeId(),t),rO={class:"chart-container flex flex-wrap"},nO=["onClick"],oO=["onClick"],aO=[bm(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1))],iO={key:0,class:"success setting"},lO=[bm(()=>e.createElementVNode("i",{class:"ri-check-line ml-1"},null,-1))],sO={class:"label"},cO=e.defineComponent({__name:"model-chart-menu",props:{modelValue:{default:""}},emits:["click-chart-setting","update:modelValue"],setup(t,{emit:r}){const{proxy:n}=e.getCurrentInstance(),{echartsTypeList:o}=n.$globalUtils,a=[{...o[3],key:"3"},...Object.keys(o).filter(c=>c!="3").map(c=>({...o[c],key:c}))],i=e.inject("chartList"),l=r,s=c=>{l("update:modelValue",String(c))},d=c=>{l("update:modelValue",String(c)),l("click-chart-setting")};return(c,f)=>(e.openBlock(),e.createElementBlock("div",rO,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,u=>{var p;return e.createElementVNode("div",{class:"items",key:u.key,onClick:h=>s(u.key)},[e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:c.modelValue==u.key}])},[e.createElementVNode("i",{class:e.normalizeClass(u.icon)},null,2),e.createElementVNode("div",{class:"setting",onClick:e.withModifiers(h=>d(u.key),["stop"])},aO,8,oO),(p=e.unref(i))!=null&&p.some(h=>h.type==u.key)?(e.openBlock(),e.createElementBlock("div",iO,lO)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",sO,e.toDisplayString(u.name),1)],8,nO)}),64))]))}}),PR="",dO=Be(cO,[["__scopeId","data-v-cc083189"]]),fO=e.defineComponent({__name:"model-chart-setting",props:{option:{default:{}},type:{default:""}},emits:["close"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),{chartJsonToStringFormat:i}=a.$globalUtils,l=e.ref(""),s=e.inject("indicatorsId"),d=e.inject("getListModelIndicators"),c=e.inject("getChartWidgetList"),f=e.computed(()=>({3:Zh,2:em,1:Qh,4:nm,5:tm,6:rm,7:om,8:am})[o.type]??null),u=e.ref(!1),p=()=>{l.value="data",u.value=!0},h=async()=>{await a.$baseHttp.post("/api/ace-data-center/model-indicators-echarts/save",{modelIndicatorsId:e.unref(s),echartsType:o.type,echartsConfig:i({...o.option,customSeriesData:window.customSeriesData,dataset:{...o.option.dataset,source:[]}})},{headers:{loading:!0}})&&(a.$message.success("操作成功"),c(),d(),u.value=!1)},m=()=>{u.value=!1};return r({init:p,handleSubmit:h}),(y,g)=>{const b=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(b,{modelValue:e.unref(u),"onUpdate:modelValue":g[3]||(g[3]=w=>e.isRef(u)?u.value=w:null),withHeader:!1,modal:!1,direction:"ltr",size:"300px",modalClass:"ace-modal-drawer"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:g[1]||(g[1]=w=>h())},{default:e.withCtx(()=>[e.createTextVNode("保存")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:g[2]||(g[2]=w=>m())},{default:e.withCtx(()=>[e.createTextVNode("关闭")]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(E.ElCollapse),{accordion:"",modelValue:e.unref(l),"onUpdate:modelValue":g[0]||(g[0]=w=>e.isRef(l)?l.value=w:null)},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createBlock(e.unref(f),{key:0,option:o.option,type:y.type},null,8,["option","type"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])}}}),UR="",uO=Be(fO,[["__scopeId","data-v-f0a33bc5"]]),nc=t=>(e.pushScopeId("data-v-35fb2412"),t=t(),e.popScopeId(),t),pO={class:"w-full h-full flex"},hO={class:"flex-1"},mO={key:0,class:"flex items-center pannel justify-center h-14"},gO=nc(()=>e.createElementVNode("i",{class:"ri-save-line mr-1"},null,-1)),yO={class:"flex-1 flex flex-col overflow-hidden"},bO={class:"flex-1 flex flex-col pl-3 pb-3"},_O={class:"flex items-center pannel justify-center relative h-14"},wO={key:0,class:"absolute left-5 top-3"},CO=nc(()=>e.createElementVNode("i",{class:"ri-settings-2-line ml-1"},null,-1)),SO=nc(()=>e.createElementVNode("i",{class:"ri-table-line"},null,-1)),xO=e.defineComponent({__name:"chart-widget",props:{modelValue:{default:""},dynamicSearchForm:{default:()=>[]}},emits:["update:modelValue"],setup(t,{expose:r,emit:n}){const o=n,{proxy:a}=e.getCurrentInstance(),i=e.inject("chartList"),{option:l,formatChart:s}=mt(),d=e.ref(""),c=e.ref(null),f=e.ref(!1),u=()=>{if(e.unref(d)==""){a.$message.warning("请选择图表");return}const y=setInterval(()=>{e.unref(f)&&(e.unref(c).init(),clearInterval(y))},20)};e.watch(d,async y=>{var b;if(l.value={},f.value=!1,y==""){f.value=!0;return}const g=(b=e.unref(i))==null?void 0:b.find(w=>w.type==y);await s((g==null?void 0:g.code)??"",y),f.value=!0});const p=e.ref(!1);a.$baseEventBus.on("model-chart-click",async y=>{p.value=!0,o("update:modelValue","chart"),d.value=y.type,setTimeout(()=>{p.value=!1},100)});const h=()=>{if(e.unref(i).length>0){e.unref(p)||(d.value=e.unref(i)[0].type),f.value=!0;return}d.value="3"},m=()=>{d.value="",o("update:modelValue","table")};return r({init:h}),(y,g)=>{var _;const b=e.resolveComponent("AppDynamicSearch"),w=e.resolveComponent("AppCustomChart");return e.openBlock(),e.createElementBlock("div",pO,[e.createElementVNode("aside",null,[e.createElementVNode("div",hO,[e.createVNode(dO,{modelValue:e.unref(d),"onUpdate:modelValue":g[0]||(g[0]=C=>e.isRef(d)?d.value=C:null),onClickChartSetting:u},null,8,["modelValue"])]),(_=e.unref(i))!=null&&_.some(C=>C.type==e.unref(d))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mO,[e.createVNode(e.unref(E.ElButton),{type:"primary",onClick:g[1]||(g[1]=C=>e.unref(c).handleSubmit())},{default:e.withCtx(()=>[gO,e.createTextVNode(" 保 存 ")]),_:1})]))]),e.createElementVNode("div",yO,[e.createElementVNode("div",bO,[e.createVNode(e.unref(E.ElSkeleton),{loading:!e.unref(f),animated:""},{default:e.withCtx(()=>[e.createVNode(b,{form:y.dynamicSearchForm,search:!1,disabled:""},null,8,["form"]),e.createVNode(w,{option:e.unref(l),chartType:e.unref(d)},null,8,["option","chartType"])]),_:1},8,["loading"])]),e.createElementVNode("div",_O,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",wO,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",style:{padding:"0 10px"}},{default:e.withCtx(()=>[e.createTextVNode("可视化")]),_:1}),e.createVNode(e.unref(E.ElButton),{type:"",style:{padding:"0 10px"},onClick:u},{default:e.withCtx(()=>[CO]),_:1})]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"",onClick:m},{default:e.withCtx(()=>[SO]),_:1}),e.createVNode(ym,{type:e.unref(d)},null,8,["type"])]),_:1})])]),e.createVNode(uO,{ref_key:"modelChartSettingRef",ref:c,option:e.unref(l),type:e.unref(d),onClose:m},null,8,["option","type"])])}}}),WR="",vO=Be(xO,[["__scopeId","data-v-35fb2412"]]),_m=t=>(e.pushScopeId("data-v-67eeb431"),t=t(),e.popScopeId(),t),EO={class:"design"},VO={class:"design-header"},kO={class:"flex-1"},NO={class:"text-xs text-color-info mt-2"},$O=["innerHTML"],DO={class:"flex"},BO={class:"mr-2"},TO=_m(()=>e.createElementVNode("i",{class:"ri-settings-2-line mr-1"},null,-1)),OO=_m(()=>e.createElementVNode("i",{class:"ri-close-line mr-1"},null,-1)),IO={class:"design-container flex-1 overflow-hidden p-3 flex"},zO=e.defineComponent({__name:"index",emits:["close"],setup(t,{expose:r,emit:n}){const{proxy:o}=e.getCurrentInstance(),a=e.ref(!1),i=e.ref(!1),l=e.ref(),s=e.ref(null),d=e.ref(null),c=e.ref(null),f=e.ref([]),u=e.ref("0个指标"),p=e.ref(""),h=e.ref(""),m=e.ref([]),y=n;e.watch(a,v=>{v||o.$baseEventBus.off("model-chart-click")}),e.provide("indicatorsId",h);const g=e.inject("modelEle"),b=e.ref(""),w=async v=>{var $;let V={};l.value="table",h.value=v,m.value=[],f.value=[],e.unref(h)&&(V=await _(),C()),a.value=!0,b.value=($=V==null?void 0:V.data)==null?void 0:$.name,e.nextTick(()=>{e.unref(s).init((V==null?void 0:V.data)??{})})};e.watch(l,v=>{v=="chart"&&e.unref(d).init()});const _=async()=>await o.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${e.unref(h)}`,{headers:{loading:!0}}),C=async()=>{o.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${e.unref(h)}`).then(v=>{m.value=v.data})};e.provide("getChartWidgetList",C),e.provide("chartList",m);const S=()=>{o.$baseConfirm({content:"是否确定关闭",callConfirm:async()=>{a.value=!1,e.unref(h)&&y("close")}})},x=v=>{f.value=v,e.unref(s).dynamicSearchForm=v,e.unref(s).handleSubmit()};return r({init:w}),(v,V)=>{const $=e.resolveComponent("AppHeader"),B=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(B,{modelValue:e.unref(a),"onUpdate:modelValue":V[11]||(V[11]=R=>e.isRef(a)?a.value=R:null),withHeader:!1,size:"100%",modalClass:"ace-modal-drawer"},{default:e.withCtx(()=>{var R,T;return[e.createElementVNode("div",EO,[e.createElementVNode("div",VO,[e.createElementVNode("div",kO,[e.createVNode($,{title:e.unref(l)=="table"?e.unref(u):`${e.unref(b)}【${e.unref(u)}】`},e.createSlots({_:2},[e.unref(m).length?{name:"left",fn:e.withCtx(()=>[e.createElementVNode("i",{onClick:V[0]||(V[0]=k=>e.unref(s).handlePopupForm()),class:"ri-edit-box-line ml-2 text-color-primary cursor-pointer text-base"})]),key:"0"}:void 0]),1032,["title"]),e.createElementVNode("div",NO,[e.createTextVNode(" 模型数据 / "+e.toDisplayString((R=e.unref(g))==null?void 0:R.modelName)+" ["+e.toDisplayString((T=e.unref(g))==null?void 0:T.modelCode)+"] ",1),e.createElementVNode("span",{class:"ml-2",innerHTML:e.unref(p)},null,8,$O)])]),e.createElementVNode("div",DO,[e.withDirectives(e.createElementVNode("div",BO,[e.createVNode(e.unref(E.ElPopover),{placement:"bottom",visible:e.unref(i),"onUpdate:visible":V[2]||(V[2]=k=>e.isRef(i)?i.value=k:null),trigger:"click",width:"900px",teleported:!1},{reference:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"warning"},{default:e.withCtx(()=>[TO,e.createTextVNode(" 筛选配置 ")]),_:1})]),default:e.withCtx(()=>[e.createVNode(gm,{ref_key:"customSearchRef",ref:c,customSearchVisible:e.unref(i),"onUpdate:customSearchVisible":V[1]||(V[1]=k=>e.isRef(i)?i.value=k:null),onDynamicSearchFormUpdate:x,dynamicSearchForm:e.unref(f)},null,8,["customSearchVisible","dynamicSearchForm"])]),_:1},8,["visible"])],512),[[e.vShow,e.unref(l)=="table"&&e.unref(u)!="0个指标:"]]),e.createVNode(e.unref(E.ElButton),{onClick:S},{default:e.withCtx(()=>[OO,e.createTextVNode(" 关闭 ")]),_:1})])]),e.createElementVNode("div",IO,[e.withDirectives(e.createVNode(tO,{ref_key:"tableWidgetRef",ref:s,modelValue:e.unref(l),"onUpdate:modelValue":V[3]||(V[3]=k=>e.isRef(l)?l.value=k:null),indicatorsId:e.unref(h),"onUpdate:indicatorsId":V[4]||(V[4]=k=>e.isRef(h)?h.value=k:null),title:e.unref(u),"onUpdate:title":V[5]||(V[5]=k=>e.isRef(u)?u.value=k:null),resultTitle:e.unref(b),"onUpdate:resultTitle":V[6]||(V[6]=k=>e.isRef(b)?b.value=k:null),sortHtml:e.unref(p),"onUpdate:sortHtml":V[7]||(V[7]=k=>e.isRef(p)?p.value=k:null),dynamicSearchForm:e.unref(f),"onUpdate:dynamicSearchForm":V[8]||(V[8]=k=>e.isRef(f)?f.value=k:null)},null,8,["modelValue","indicatorsId","title","resultTitle","sortHtml","dynamicSearchForm"]),[[e.vShow,e.unref(l)=="table"]]),e.withDirectives(e.createVNode(vO,{ref_key:"chartWidgetRef",ref:d,dynamicSearchForm:e.unref(f),"onUpdate:dynamicSearchForm":V[9]||(V[9]=k=>e.isRef(f)?f.value=k:null),modelValue:e.unref(l),"onUpdate:modelValue":V[10]||(V[10]=k=>e.isRef(l)?l.value=k:null)},null,8,["dynamicSearchForm","modelValue"]),[[e.vShow,e.unref(l)=="chart"]])])])]}),_:1},8,["modelValue"])}}}),GR="",wm=Be(zO,[["__scopeId","data-v-67eeb431"]]),RO=e.createElementVNode("i",{class:"ri-search-line"},null,-1),MO={class:"mt-3"},AO={key:0,class:"ri-checkbox-circle-fill text-base mr-1 text-color-success -ml-5"},LO={key:1,class:"ri-error-warning-fill mr-1 text-base text-color-warning -ml-5"},FO=e.defineComponent({__name:"menu",props:{tempId:{default:""}},emits:["node-click"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),i=e.ref(""),l=e.ref(null),s=e.ref(null),d=n;e.watch(i,h=>{e.unref(s).filter(h)});const c=(h,m)=>h?m.name.includes(h):!0,f=e.ref(!1),u=()=>{l.value=[],f.value=!0,De(a).loadIndicatorsMenu().then(h=>{l.value=Object.keys(h.data).map(y=>({name:y,id:y,children:h.data[y]}));let m;f.value=!1,e.unref(l).length&&e.nextTick(()=>{var y;o.tempId?m=e.unref(s).getNode(o.tempId):m=e.unref(s).getNode((y=e.unref(l)[0].children[0])==null?void 0:y.id),m&&(p(m==null?void 0:m.data),e.unref(s).setCurrentKey(m==null?void 0:m.data.id))})})};u();const p=h=>{Array.isArray(h.children)||d("node-click",h)};return r({init:u}),(h,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(E.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:e.unref(i),"onUpdate:modelValue":m[0]||(m[0]=y=>e.isRef(i)?i.value=y:null)},{prefix:e.withCtx(()=>[RO]),_:1},8,["modelValue"]),e.createElementVNode("div",MO,[e.unref(f)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:"",count:2})):(e.openBlock(),e.createBlock(e.unref(E.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:s,data:e.unref(l),"node-key":"id","default-expand-all":"","highlight-current":"","filter-node-method":c,onNodeClick:p},{default:e.withCtx(({node:y,data:g})=>[Array.isArray(g.children)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.normal?(e.openBlock(),e.createElementBlock("i",AO)):(e.openBlock(),e.createElementBlock("i",LO))],64)),e.createElementVNode("span",{class:e.normalizeClass({"font-bold":y.level==1})},e.toDisplayString(g.name),3)]),_:1},8,["data"]))])],64))}}),jO={class:"rule-list"},PO={key:0,class:"flex items-center"},UO=e.createElementVNode("i",{class:"ri-error-warning-fill text-2xl text-color-warning mr-2"},null,-1),WO={key:1,class:"flex items-center"},GO=e.createElementVNode("i",{class:"ri-checkbox-circle-fill text-2xl text-color-success mr-2"},null,-1),Cm=e.defineComponent({__name:"rule",props:{ruleList:{default:()=>[]}},setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(!1),o=e.ref(""),a=e.ref([]),i=d=>{o.value=`/api/ace-data-center/rule/ruleDataView?ruleId=${d}`,n.value=!0},l=d=>{e.unref(a).length==0&&Object.keys(d.data[0]).forEach(c=>{if(c==="pageIndex"){a.value.unshift({label:"序号",prop:"pageIndex",width:"80px"});return}a.value.push({label:c,prop:c})})},s=()=>{r.$baseExportExcel({title:"数据列表",url:e.unref(o),method:"get",header:e.unref(a)})};return(d,c)=>{const f=e.resolveComponent("AppHeader"),u=e.resolveComponent("AppList"),p=e.resolveComponent("AppDrawer");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",jO,[d.ruleList.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(f,{title:"智能诊断",class:"mb-5"}),e.createVNode(e.unref(E.ElAlert),{type:"warning",closable:!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.ruleList,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:"mt-0 text-sm"},[+h.rows>0?(e.openBlock(),e.createElementBlock("div",PO,[UO,e.createTextVNode(" "+e.toDisplayString(h.ruleName)+" 【异常数据"+e.toDisplayString(h.rows>99?"99+":h.rows)+"】 ",1),e.createVNode(e.unref(E.ElLink),{class:"ml-2",type:"primary",onClick:m=>i(h.id)},{default:e.withCtx(()=>[e.createTextVNode("查看明细")]),_:2},1032,["onClick"])])):(e.openBlock(),e.createElementBlock("div",WO,[GO,e.createTextVNode(" "+e.toDisplayString(h.ruleName)+" 【未检测到异常数据】 ",1)]))]))),128))]),_:1})],64)):e.createCommentVNode("",!0)]),e.createVNode(p,{modelValue:e.unref(n),"onUpdate:modelValue":c[1]||(c[1]=h=>e.isRef(n)?n.value=h:null),title:"数据列表"},{footer:e.withCtx(()=>[e.createVNode(e.unref(E.ElButton),{type:"primary",class:"ml-3",onClick:s},{default:e.withCtx(()=>[e.createTextVNode("导 出")]),_:1}),e.createVNode(e.unref(E.ElButton),{class:"ml-3",onClick:c[0]||(c[0]=h=>n.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("关 闭")]),_:1})]),default:e.withCtx(()=>[e.createVNode(u,{tableData:e.unref(a),url:e.unref(o),onSuccess:l},null,8,["tableData","url"])]),_:1},8,["modelValue"])],64)}}}),HO={key:1,class:"animated fadeIn"},YO={class:"ml-2 mt-5 mb-5 flex items-center moudle-1"},XO={key:0,class:"ri-error-warning-fill text-xl mr-1 text-color-warning"},qO={key:1,class:"ri-checkbox-circle-fill text-xl mr-1 text-color-success"},JO={class:"ml-1"},KO={class:"flex items-center select-type"},ZO=["onClick"],QO={class:"mt-5 mb-5"},eI=e.defineComponent({__name:"analysis",props:{indicatorsId:{default:""}},emits:["rule-success"],setup(t,{emit:r}){const n=t;e.watch(()=>n.indicatorsId,()=>h());const o=r,{proxy:a}=e.getCurrentInstance(),{dynamicSearchForm:i,dynamicSearchFormat:l,dynamicSearchParams:s}=a.$globalHooks.useDynamicSearch(),{chartJsonFormat:d,echartsTypeList:c}=a.$globalUtils,f=e.ref(!0),u=e.ref([]),p=e.ref(null),h=async()=>{var x,v,V;f.value=!0,i.value=[],b.value={type:"",value:""},m.value=[],y.value="",C();const S=await De(a).detailAndTask(n.indicatorsId);p.value=S.data,(v=(x=S.data)==null?void 0:x.echartsDataVO)!=null&&v.config&&g(),(V=S==null?void 0:S.data)!=null&&V.formConfJson&&(i.value=l(JSON.parse(S==null?void 0:S.data.formConfJson))),f.value=!1},m=e.ref([]),y=e.ref(""),g=async()=>{var x;m.value=[],y.value="";const S=await De(a).getEchartDetail({indicatorsId:n.indicatorsId});S&&(Object.keys(((x=S.data)==null?void 0:x.clientEchartsType)??{}).forEach(v=>{var V;Object.values((V=S.data)==null?void 0:V.clientEchartsType[v]).forEach($=>{var B,R;m.value.push({client:v,label:(B=c[$])==null?void 0:B.name,icon:(R=c[$])==null?void 0:R.icon,value:`${v}_${$}`})})}),e.unref(m).length>0&&(y.value=e.unref(m)[0].value,_(e.unref(y))))},b=e.ref({type:"",value:""}),w=e.ref(!1),_=async(S,x=!1)=>{var B;y.value=S,x&&(w.value=!0);const v=s(e.unref(i)),V=S.split("_"),$=await De(a).pullEchartsDataVO({indicatorsId:n.indicatorsId,loadType:((B=e.unref(p))==null?void 0:B.loadType)??3,params:v,targetClient:V[0],echartsType:V[1]});if($){w.value=!1,e.unref(b).type=V[1];try{e.unref(b).value=d($.data.config)}catch{e.unref(b).value=$.data.config}}},C=async()=>{var x;u.value=[];const S=await De(a).getRule({current:1,size:100,businessType:"indicators",businessId:n.indicatorsId});u.value=((x=S.data)==null?void 0:x.records)??[],o("rule-success",u.value)};return h(),(S,x)=>{const v=e.resolveComponent("AppResourceVisitor"),V=e.resolveComponent("AppHeader"),$=e.resolveComponent("AppDynamicSearch"),B=e.resolveComponent("AppChart");return e.unref(f)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:""})):(e.openBlock(),e.createElementBlock("div",HO,[e.createVNode(V,{title:"指标计算"},{default:e.withCtx(()=>[e.createVNode(v,{businessType:"INDICATORS",businessld:n.indicatorsId},null,8,["businessld"])]),_:1}),e.createElementVNode("div",YO,[e.unref(u).some(R=>R.rows>0)?(e.openBlock(),e.createElementBlock("i",XO)):(e.openBlock(),e.createElementBlock("i",qO)),e.createElementVNode("span",JO,e.toDisplayString(e.unref(p).remark),1)]),e.createVNode(V,{title:"指标数据"},{default:e.withCtx(()=>[e.createElementVNode("div",KO,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),R=>(e.openBlock(),e.createElementBlock("span",{onClick:T=>_(R.value,!0),class:e.normalizeClass(["flex items-center cursor-pointer",[R.value==e.unref(y)?"text-color-primary":"text-gray-600"]]),key:R.value},[e.createElementVNode("i",{class:e.normalizeClass([R.icon,"mr-1"])},null,2),e.createTextVNode(" "+e.toDisplayString(R.label),1)],10,ZO))),128))])]),_:1}),e.createElementVNode("div",QO,[e.unref(i).length>0?(e.openBlock(),e.createBlock($,{key:0,form:e.unref(i),onSuccess:x[0]||(x[0]=R=>_(e.unref(y),!0)),class:"mb-0"},null,8,["form"])):e.createCommentVNode("",!0),e.createVNode(B,{type:e.unref(b).type,options:e.unref(b).value,loading:e.unref(w)},null,8,["type","options","loading"])]),e.createVNode(Cm,{ruleList:e.unref(u)},null,8,["ruleList"])]))}}}),HR="",Sm=Be(eI,[["__scopeId","data-v-7b034d4e"]]),tI={class:"h-full"},rI=e.defineComponent({__name:"relation",setup(t){const{proxy:r}=e.getCurrentInstance(),n=e.ref(null),o=["#00ADD0","#FFA12F","#B62AFF","#604BFF","#6E35FF","#002AFF","#20C0F4","#95F300","#04FDB8","#AF5AFF"],a=(i,l,s="#00f6ff")=>i.map((d,c)=>{switch(d&&d.title&&(d.name=d.title),l==1&&(s=o.find((f,u)=>u==c%10)),(l===0||l===1)&&(d.label={position:"inside"}),l){case 0:d.symbolSize=70;break;case 1:d.symbolSize=50;break;default:d.symbolSize=10;break}return d.lineStyle={color:s},d.children?(d.itemStyle={borderColor:s,color:s},d.children=a(d.children,l+1,s)):d.itemStyle={color:"transparent",borderColor:s},d});return De(r).indicatorsRelationTree().then(i=>{if(!i.data.length){n.value={};return}n.value={type:"tree",toolbox:{show:!0,iconStyle:{borderColor:"#03ceda"},feature:{restore:{}}},tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:"rgba(0,0,0,.8)",borderWidth:.5,textStyle:{fontSize:10,color:"#fff"}},series:[{type:"tree",hoverAnimation:!0,data:a([i==null?void 0:i.data[0]],0),top:10,bottom:10,left:10,right:10,layout:"radial",symbol:"circle",symbolSize:10,nodePadding:20,animationDurationUpdate:750,expandAndCollapse:!0,initialTreeDepth:2,roam:!0,focusNodeAdjacency:!0,itemStyle:{borderWidth:1},label:{color:"#000",fontSize:10,fontFamily:"SourceHanSansCN",position:"inside",rotate:0},lineStyle:{width:1,curveness:.5}}]}}),(i,l)=>{const s=e.resolveComponent("v-chart"),d=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",tI,[e.createVNode(s,{option:e.unref(n),autoresize:""},null,8,["option"])])),[[d,!e.unref(n)]])}}}),nI=e.createElementVNode("div",{class:"font-bold mt-8 mb-2"},"数据分析",-1),oI=e.defineComponent({__name:"yoy",props:{search:{default:()=>[]},originSearch:{default:()=>[]},chartType:{default:""},option:{default:null}},setup(t,{expose:r}){const n=t,o=Re(),{proxy:a}=e.getCurrentInstance(),{dynamicSearchForm:i,dynamicSearchFormat:l,dynamicSearchParams:s}=a.$globalHooks.useDynamicSearch(),d=["yySingle","yymmSingle","yymmddSingle"],{seriesItem:c}=ni(),f=e.computed(()=>n.search.find(y=>d.includes(y.type))),u=e.computed(()=>{const y=e.unref(f)?Object.values(s([e.unref(f)])).every(g=>g==""):!1;return n.search.filter(g=>d.includes(g.type)).length==1&&!y}),p=e.ref("");e.watch(p,()=>h());const h=async()=>{var k;if(!e.unref(u)||e.unref(p)=="")return;const y=JSON.parse(JSON.stringify((k=o.getChartData)==null?void 0:k.params)),g=JSON.parse(JSON.stringify(n.search)),b=g.find(O=>d.includes(O.type)),w=n.originSearch.find(O=>d.includes(O.type)),C=JSON.parse((y==null?void 0:y.groupArgsJson)??"[]").find(O=>O.comment==n.option.dataShow.x);y.groupArgsJson=JSON.stringify([C]);const S=C.dateFormatType;switch(b.type){case"yymmSingle":b.value=on(b.value).subtract(1,e.unref(p)=="TB"?"year":"month").format("YYYY-MM");break;case"yymmddSingle":b.value=on(b.value).subtract(1,e.unref(p)=="TB"?"year":"day").format("YYYY-MM-DD");break;case"yySingle":b.value=on(b.value).subtract(1,"year").format("YYYY");break}y.params=s(g);const v=n.option.dataset.dimensions;v.length>=3&&n.option.dataset.dimensions.pop();const V=await a.$baseHttp.post("/api/ace-data-center/model-indicators/debug",y),$=v[0],B=n.option.dataShow.y.filter(O=>!n.option.dataShow.hide.includes(O));e.unref(b.type).includes("Range")?(n.option.dataset.dimensions[1]=`${w!=null&&w.minValue?`${w==null?void 0:w.minValue}~`:""}${(w==null?void 0:w.maxValue)??""}${B}`,n.option.dataset.dimensions.push(`${b.minValue?`${b.minValue}~`:""}${(b==null?void 0:b.maxValue)??""}${B}`)):(n.option.dataset.dimensions[1]=`${w==null?void 0:w.value}${B}`,n.option.dataset.dimensions[2]=`${b.value}${B}`,n.option.dataset.dimensions[3]="增长率");const R=n.option.series[0];n.option.series=[],V.data.records.forEach(O=>{m(O,$,S)});const T=JSON.parse(JSON.stringify(n.option.dataset.temp_source));T.forEach((O,N)=>{m(O,$,S);let D=null;O[n.option.dataset.dimensions[1]]=O[B],S?(D=V.data.records.find(M=>M[$]==O[$]),D||(["year"].includes(S)&&(D=V.data.records.find(M=>M[$].indexOf(b.value)>=0),O[$]=$),["day","month"].includes(S)&&(D=V.data.records.find(M=>M[$].split("-").at(-1)==O[$].split("-").at(-1))))):D=V.data.records.find(M=>M[$]==O[$]),D||(D={[B]:0}),D&&(O[n.option.dataset.dimensions[2]]=D[B]);const I=O[n.option.dataset.dimensions[1]]??0,z=O[n.option.dataset.dimensions[2]]??0;O.增长率=!I||!z?0:((I-z)/z*100).toFixed(2)}),n.option.dataset.source=T,setTimeout(()=>{const{yAxis:O,xAxis:N}=n.option;let D="yAxis";!Array.isArray(O)&&O.type!="value"&&(D="xAxis"),n.option.series=[R,R,{...c,name:"增长率",[`${D}Index`]:1}],n.option[D]=[Array.isArray(n.option[D])?n.option[D][0]:n.option[D],{type:"value",name:"增长率",nameGap:20,splitLine:!1,nameLocation:D=="xAxis"?"start":"end"}],console.log(n.option)})},m=(y,g,b)=>{if(!(!b||(y[g]??"")=="")&&["day"].includes(b)){const w=y[g].split("-").filter((_,C)=>C==0?"":_);y[g]=w.join("-")}};return r({init:h,type:p}),(y,g)=>e.unref(u)&&y.option?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[nI,e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(p),"onUpdate:modelValue":g[0]||(g[0]=b=>e.isRef(p)?p.value=b:null)},{default:e.withCtx(()=>{var b;return[e.createVNode(e.unref(E.ElRadio),{label:"TB",value:"TB"},{default:e.withCtx(()=>[e.createTextVNode("同比")]),_:1}),e.createVNode(e.unref(E.ElRadio),{label:"HB",value:"HB",disabled:!["yymmSingle","yymmddSingle"].includes((b=e.unref(f))==null?void 0:b.type)},{default:e.withCtx(()=>[e.createTextVNode(" 环比 ")]),_:1},8,["disabled"])]}),_:1},8,["modelValue"])])],64)):e.createCommentVNode("",!0)}}),xm=t=>(e.pushScopeId("data-v-3f95981f"),t=t(),e.popScopeId(),t),aI={key:2,class:"chart-preview flex"},iI=xm(()=>e.createElementVNode("div",{class:"font-bold mb-2"},"分析指标",-1)),lI=xm(()=>e.createElementVNode("div",{class:"font-bold mt-8 mb-2"},"指标维度",-1)),sI={class:"flex-1 flex flex-col overflow-hidden"},cI={class:"flex-1"},dI={class:"flex justify-center change-btns"},fI=e.defineComponent({__name:"IndicatorsView",props:{dynamicSearchForm:{default:()=>[]},result:{default:()=>{}},chartData:{default:null}},emits:["search-success"],setup(t,{emit:r}){const n=t,o=r,a=Re(),{proxy:i}=e.getCurrentInstance(),{dynamicSearchForm:l,dynamicSearchFormat:s,dynamicSearchParams:d}=i.$globalHooks.useDynamicSearch(),{echartsTypeList:c,isMobile:f}=i.$globalUtils,u=e.ref(null),p=e.ref(""),h=e.ref([]),m=e.ref(n.dynamicSearchForm),y=e.ref(!1),{option:g,formatChart:b,chartType:w,setChartData:_,changeChartSeries:C,chartDataParams:S}=mt(),x={day:"按日",week:"按周",month:"按月",quarter:"按季度",year:"按年"};e.onMounted(async()=>{await i.$baseHttp.post(`/api/ace-data-center/model-indicators-echarts/getEchartsTypes/${n.result.id}`).then(T=>{h.value=T.data,T.data.length&&(p.value=T.data[0].code,w.value=T.data[0].type)})}),e.watch(p,async()=>{B()});const v=T=>{p.value!=T.code&&(g.value={},w.value=T.type,p.value=T.code,e.unref(u)&&(e.unref(u).type=""))},V=e.ref(""),$=e.ref(""),B=async()=>{var T,k,O,N;m.value=JSON.parse(JSON.stringify(n.dynamicSearchForm)),y.value=!0,g.value={},V.value="",$.value=["2"].includes(e.unref(w))?"":[],n.chartData&&(S.value=n.chartData),await b(e.unref(p)),V.value=(T=e.unref(g))==null?void 0:T.dataShow.x,Array.isArray((k=e.unref(g))==null?void 0:k.dataShow.y)?$.value=(O=e.unref(g))==null?void 0:O.dataShow.y.filter(D=>{var I;return!(((I=e.unref(g))==null?void 0:I.dataShow.hide)??[]).includes(D)}):$.value=(N=e.unref(g))==null?void 0:N.dataShow.y,f&&["1","3","5"].includes(e.unref(w))&&!e.unref(g).dataZoom&&(g.value.grid.bottom="10%",g.value.dataZoom=[{type:"slider",backgroundColor:"#eef8fd",fillerColor:"#14b1f8",borderColor:"#eef8fd",startValue:0,endValue:3,filterMode:"",showDetail:!1,width:"90%",height:10,handleSize:30,left:"5%",bottom:25},{type:"inside",zoomOnMouseWheel:!1,moveOnMouseWheel:!0,moveOnMouseMove:!0}]),setTimeout(()=>{y.value=!1},10)};e.watch([V,$],async([T,k],[O,N])=>{var D;e.unref(y)||(e.unref(g).dataShow.x=T,e.unref(g).dataShow.y=k,Array.isArray(k)&&(e.unref(g).dataShow.hide=(D=e.unref(g))==null?void 0:D.dataShow.y.filter(I=>a.getChartData.y.includes(I.showLabel))),(T!=O||["2","7"].includes(e.unref(w)))&&(g.value.dataset.source=await _(e.unref(w),T,["2","7"].includes(e.unref(w))?k:null),g.value.dataset.temp_source=JSON.parse(JSON.stringify(g.value.dataset.source)),m.value=JSON.parse(JSON.stringify(n.dynamicSearchForm)),e.unref(u)&&(e.unref(u).type="")),["xAxis","yAxis"].forEach(I=>{Array.isArray(g.value[I])&&(g.value[I]=g.value[I].filter(z=>z.name!="增长率"))}),C())},{deep:!0});const R=()=>{a.getChartData.params.params=d(n.dynamicSearchForm),B(),o("search-success",a.getChartData.params.params)};return(T,k)=>{var I;const O=e.resolveComponent("AppDynamicSearch"),N=e.resolveComponent("AppEmpty"),D=e.resolveComponent("AppCustomChart");return e.openBlock(),e.createElementBlock("div",null,[n.dynamicSearchForm.length?(e.openBlock(),e.createBlock(O,{key:0,form:n.dynamicSearchForm,onSuccess:R},null,8,["form"])):e.createCommentVNode("",!0),e.unref(h).length?(e.openBlock(),e.createElementBlock("div",aI,[e.createElementVNode("aside",null,[e.createVNode(e.unref(E.ElSkeleton),{loading:!((I=e.unref(g))!=null&&I.dataShow),animated:""},{default:e.withCtx(()=>[iI,e.createElementVNode("div",null,[["2"].includes(e.unref(w))?(e.openBlock(),e.createBlock(e.unref(E.ElRadioGroup),{key:0,modelValue:e.unref($),"onUpdate:modelValue":k[0]||(k[0]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.y,z=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):["8"].includes(e.unref(w))?(e.openBlock(),e.createBlock(e.unref(E.ElCheckboxGroup),{key:1,modelValue:e.unref($),"onUpdate:modelValue":k[1]||(k[1]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([...e.unref(a).getChartData.y,...e.unref(a).getChartData.x.map(z=>({...z,showLabel:z.comment}))],z=>(e.openBlock(),e.createBlock(e.unref(E.ElCheckbox),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):(e.openBlock(),e.createBlock(e.unref(E.ElCheckboxGroup),{key:2,modelValue:e.unref($),"onUpdate:modelValue":k[2]||(k[2]=z=>e.isRef($)?$.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.y,z=>(e.openBlock(),e.createBlock(e.unref(E.ElCheckbox),{key:z.showLabel,label:z.showLabel,value:z.showLabel},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]))]),["8"].includes(e.unref(w))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lI,e.createElementVNode("div",null,[e.createVNode(e.unref(E.ElRadioGroup),{modelValue:e.unref(V),"onUpdate:modelValue":k[3]||(k[3]=z=>e.isRef(V)?V.value=z:null)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a).getChartData.x,z=>(e.openBlock(),e.createBlock(e.unref(E.ElRadio),{key:z.comment,label:z.comment,value:z.comment},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z.comment)+" ",1),x[z.dateFormatType]?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" ("+e.toDisplayString(x[z.dateFormatType])+") ",1)],64)):e.createCommentVNode("",!0)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])],64)),["3","1"].includes(e.unref(w))&&e.unref(g).dataShow.y.filter(z=>!e.unref(g).dataShow.hide.includes(z)).length==1?(e.openBlock(),e.createBlock(oI,{key:1,ref_key:"yoyRef",ref:u,option:e.unref(g),search:e.unref(m),originSearch:e.unref(l),chartType:e.unref(w)},null,8,["option","search","originSearch","chartType"])):e.createCommentVNode("",!0)]),_:1},8,["loading"])]),e.createElementVNode("div",sI,[e.createElementVNode("div",cI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(y),animated:""},{default:e.withCtx(()=>[e.createVNode(D,{option:e.unref(g),chartType:e.unref(w)},null,8,["option","chartType"])]),_:1},8,["loading"])]),e.createElementVNode("div",dI,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),z=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(p)==z.code?"primary":"",key:z.type,onClick:M=>v(z)},{default:e.withCtx(()=>{var M;return[e.createElementVNode("i",{class:e.normalizeClass((M=e.unref(c)[z.type])==null?void 0:M.icon)},null,2)]}),_:2},1032,["type","onClick"]))),128))]),_:1})])])])):(e.openBlock(),e.createBlock(N,{key:1,description:"暂无数据"}))])}}}),YR="",uI=Be(fI,[["__scopeId","data-v-3f95981f"]]),pI=["hidden"],hI={class:"flex mb-5 moudle-1"},mI={class:"flex-1"},gI={class:"mt-5 flex items-center"},yI={key:0,class:"ri-error-warning-fill text-xl mr-1 text-color-warning"},bI={key:1,class:"ri-checkbox-circle-fill text-xl mr-1 text-color-success"},_I={class:"ml-1"},wI=e.createElementVNode("div",{class:"w-10"},null,-1),CI={class:"flex-1"},SI={class:"mt-5 items-center"},xI=e.createElementVNode("i",{class:"ri-database-2-fill text-xl mr-1 text-color-primary"},null,-1),vI=e.createElementVNode("i",{class:"ri-edit-box-line"},null,-1),EI={class:"mt-4 mb-4"},VI={class:"sjzl"},kI=e.createElementVNode("div",{class:"font-bold mt-2 mb-2"},"数据总览",-1),NI={class:"mt-2 flex"},$I={key:1,class:"w-full"},vm=e.defineComponent({__name:"modelIndicators",props:{indicatorsId:{default:""},modelIndicatorsRules:{default:()=>[]}},emits:["click-design","rule-success"],setup(t,{expose:r,emit:n}){const o=t,a=n;e.watch(()=>o.indicatorsId,()=>S());const{proxy:i}=e.getCurrentInstance(),l=Re(),{dynamicSearchForm:s,dynamicSearchFormat:d,dynamicSearchParams:c}=i.$globalHooks.useDynamicSearch(),{isMobile:f}=i.$globalUtils,u=e.ref(!0),p=e.ref(!1),h=e.ref(!1),m=e.ref([]),y=e.ref({}),g=e.ref(null),b=e.ref([]),w=e.ref([]),_=e.ref({}),C=({column:M})=>{e.unref(_)[M.property]&&(M.order=e.unref(_)[M.property])},S=async()=>{u.value=!0,l.setChartData({}),B();const M=await i.$baseHttp.get(`/api/ace-data-center/model-indicators/detail?id=${o.indicatorsId}`);g.value=M.data,u.value=!1,_.value=JSON.parse(M.data.sortArgsJson??"{}"),s.value=d(JSON.parse(M.data.formConfJson??"[]")),V()},x=e.ref(!1),v=e.ref(!1),V=async(M="")=>{var H,X,J,P,W,Q,re,ne,Y;M!="sort"&&(w.value=[],x.value=!0),v.value=!0;const j=Object.keys(e.unref(_)).map(Z=>({field:Z,type:e.unref(_)[Z]=="ascending"?"asc":"desc"})),F={aggArgsJson:(H=e.unref(g))==null?void 0:H.aggArgsJson,groupArgsJson:(X=e.unref(g))==null?void 0:X.groupArgsJson,sortArgsJson:JSON.stringify(j),params:e.unref(N)??c(d(JSON.parse(((J=e.unref(g))==null?void 0:J.formConfJson)??"[]"))),modelIndicatorsId:(P=e.unref(g))==null?void 0:P.id,pageSize:(W=e.unref(g))==null?void 0:W.pageSize,modelId:(Q=e.unref(g))==null?void 0:Q.modelId},G=await i.$baseHttp.post("/api/ace-data-center/model-indicators/debug",F);G&&(b.value=((re=G.data)==null?void 0:re.records)??[],x.value=!1,v.value=!1,y.value={x:JSON.parse((ne=e.unref(g))==null?void 0:ne.groupArgsJson),y:JSON.parse((Y=e.unref(g))==null?void 0:Y.aggArgsJson),params:F},l.setChartData(y.value),e.unref(b).length&&M!="sort"&&(Object.keys(e.unref(b)[0]).forEach(Z=>{w.value.push({label:Z,prop:Z,sortable:"custom"})}),w.value.push({label:"操作",prop:"button",width:"120px",fixed:"right",slot:!0})))},$=M=>{const{prop:j,order:F}=M;!F||e.unref(_)[j]===F?delete e.unref(_)[j]:e.unref(_)[j]=F,V("sort")},B=async()=>{var j;m.value=[];const M=await De(i).getRule({current:1,size:100,businessType:"indicators",businessId:o.indicatorsId});m.value=((j=M.data)==null?void 0:j.records)??[],a("rule-success",m.value)},R=e.ref(null),T=M=>{R.value=M,p.value=!0},k=M=>{M.modelIndicatorsId=e.unref(g).id,M.row=e.unref(R)},O=()=>{h.value=!0},N=e.ref(null),D=M=>{N.value=M,V()};e.watch(p,M=>z(M)),e.watch(h,M=>z(M));const I=e.ref(!1),z=M=>{self!=top&&(I.value=M,window.parent.postMessage(M?"model-indicators-open":"model-indicators-close","*"))};return S(),r({init:S,result:g}),(M,j)=>{const F=e.resolveComponent("AppResourceVisitor"),G=e.resolveComponent("AppHeader"),H=e.resolveComponent("AppTable"),X=e.resolveComponent("AppEmpty"),J=e.resolveComponent("AppDynamicList"),P=e.resolveComponent("AppDrawer");return e.unref(u)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:""})):(e.openBlock(),e.createElementBlock("div",{key:1,class:"animated fadeIn",hidden:e.unref(I)},[e.createElementVNode("div",hI,[e.createElementVNode("div",mI,[e.createVNode(G,{title:"指标计算"},{default:e.withCtx(()=>[e.createVNode(F,{businessType:"MODEL_INDICATORS",businessld:o.indicatorsId},null,8,["businessld"])]),_:1}),e.createElementVNode("div",gI,[e.unref(m).some(W=>W.rows>0)?(e.openBlock(),e.createElementBlock("i",yI)):(e.openBlock(),e.createElementBlock("i",bI)),e.createElementVNode("span",_I,e.toDisplayString(e.unref(g).remark),1)])]),wI,e.createElementVNode("div",CI,[e.createVNode(G,{title:"数据来源"}),e.createElementVNode("div",SI,[xI,e.createTextVNode(" 重构仓模型数据 | "+e.toDisplayString(e.unref(g).modelName)+"【 ",1),e.createElementVNode("span",{class:"text-color-primary cursor-pointer",onClick:O},e.toDisplayString(e.unref(g).modelCode),1),e.createTextVNode(" 】 ")])])]),e.createVNode(G,{title:"指标数据"},{left:e.withCtx(()=>[M.modelIndicatorsRules.includes("RELATED_INDICATORS")?(e.openBlock(),e.createElementBlock("div",{key:0,class:"text-color-warning ml-4 cursor-pointer",onClick:j[0]||(j[0]=W=>a("click-design",o.indicatorsId))},[vI,e.createTextVNode(" 编辑指标 ")])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",EI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(v),animated:""},{default:e.withCtx(()=>[e.createVNode(uI,{dynamicSearchForm:e.unref(s),result:e.unref(g),chartData:e.unref(y),onSearchSuccess:D},null,8,["dynamicSearchForm","result","chartData"])]),_:1},8,["loading"])]),e.createElementVNode("div",VI,[kI,e.createElementVNode("div",NI,[e.createVNode(e.unref(E.ElSkeleton),{loading:e.unref(x),animated:""},{default:e.withCtx(()=>[e.unref(w).length?(e.openBlock(),e.createBlock(H,{key:0,maxHeight:"400px",tableData:e.unref(w),list:e.unref(b),loading:!1,headerCellClassName:C,onSortChange:$},{button:e.withCtx(({row:W})=>[e.createVNode(e.unref(E.ElLink),{type:"primary",onClick:Q=>T(W)},{default:e.withCtx(()=>[e.createTextVNode("查看明细")]),_:2},1032,["onClick"])]),_:1},8,["tableData","list"])):(e.openBlock(),e.createElementBlock("div",$I,[e.createVNode(X,{description:"暂无数据",class:"mt-4"})]))]),_:1},8,["loading"])])]),e.createVNode(Cm,{ruleList:e.unref(m)},null,8,["ruleList"]),e.createVNode(P,{modelValue:e.unref(p),"onUpdate:modelValue":j[1]||(j[1]=W=>e.isRef(p)?p.value=W:null),title:"查看明细",size:"90%"},{default:e.withCtx(()=>[e.createVNode(G,{title:"统计:",class:"mb-2"}),e.createVNode(H,{height:null,tableData:Object.keys(e.unref(R)).map(W=>({label:W,prop:W})),list:[e.unref(R)],loading:!1},null,8,["tableData","list"]),e.createVNode(G,{title:"钻取明细:",class:"mb-2 mt-4"}),e.createVNode(J,{id:e.unref(g).modelId,title:e.unref(g).modelName,isDownLoad:e.unref(f),url:"/api/ace-data-center/model-indicators/drilling",paramsFunc:k},null,8,["id","title","isDownLoad"])]),_:1},8,["modelValue"]),e.createVNode(P,{modelValue:e.unref(h),"onUpdate:modelValue":j[2]||(j[2]=W=>e.isRef(h)?h.value=W:null),title:"模型数据",size:"90%"},{default:e.withCtx(()=>[e.createVNode(J,{id:e.unref(g).modelId,title:e.unref(g).modelName},null,8,["id","title"])]),_:1},8,["modelValue"])],8,pI))}}}),DI=e.createElementVNode("i",{class:"ri-search-line"},null,-1),BI={class:"mt-3"},TI={key:1,class:"ri-edit-circle-fill text-base -ml-5 mr-1 text-color-primary"},OI=e.defineComponent({__name:"modelMenu",props:{type:{default:""}},emits:["node-click","change-type"],setup(t,{expose:r,emit:n}){const o=t,{proxy:a}=e.getCurrentInstance(),i=e.ref(""),l=e.ref(null),s=n;e.watch(i,m=>{e.unref(l).filter(m)});const d=(m,y)=>m?y.modelName.includes(m):!0,c=e.ref([]),f=e.ref([]),u=e.ref(!0),p=()=>{Promise.all([De(a).loadModelMenu({modelLayer:"ODS"}),De(a).loadModelMenu({modelLayer:"DWD"})]).then(m=>{const y=m[0].data,g=m[1].data;c.value=Object.keys(y).map(b=>({modelName:b,id:b,children:y[b]})),f.value=Object.keys(g).map(b=>({modelName:b,id:b,children:g[b]})),u.value=!1})};p();const h=m=>{if(m.modelCode){if(o.type=="ODS"){s("node-click",m);return}Array.isArray(m.children)||s("node-click",m)}};return r({init:p}),(m,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(E.ElInput),{placeholder:"请输入内容",clearable:"",modelValue:e.unref(i),"onUpdate:modelValue":y[0]||(y[0]=g=>e.isRef(i)?i.value=g:null)},{prefix:e.withCtx(()=>[DI]),_:1},8,["modelValue"]),e.createElementVNode("div",BI,[e.unref(u)?(e.openBlock(),e.createBlock(e.unref(E.ElSkeleton),{key:0,animated:"",count:2})):(e.openBlock(),e.createBlock(e.unref(E.ElTree),{key:1,class:"animated fadeIn",ref_key:"treeRef",ref:l,data:m.type=="ODS"?e.unref(c):e.unref(f),"default-expand-all":"","node-key":"id","highlight-current":"","filter-node-method":d,onNodeClick:h},{default:e.withCtx(({node:g,data:b})=>[g.level!=1||m.type=="ODS"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[b.modelCode&&b.openForm!=2?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["ri-checkbox-circle-fill -ml-5 mr-1 text-base",[b.publishStatus==2?"text-color-success":"text-color-info"]])},null,2)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.openForm==2?(e.openBlock(),e.createElementBlock("i",TI)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass({"font-bold":g.level==1})},e.toDisplayString(b.modelName),3),e.renderSlot(m.$slots,"default",{element:b})]),_:3},8,["data"]))])],64))}}),II={class:"mb-3"},zI={style:{height:"calc(100vh - 100px)"},class:"overflow-y-auto"},RI=e.defineComponent({__name:"modelIndicatorsAdd",emits:["click-node"],setup(t,{expose:r,emit:n}){const o=n,{proxy:a}=e.getCurrentInstance(),i=e.ref(!1),l=e.ref(),s=e.ref([{label:"源数据",value:"ODS",rule:"VIEW_ODS",disabled:!0},{label:"整合数据",value:"DWD",rule:"VIEW_DWD",disabled:!0}]);De(a).getCurrFunc("MODEL").then(u=>{e.unref(s).forEach(p=>{p.disabled=!u.data.includes(p.rule),!e.unref(l)&&!p.disabled&&(l.value=p.value)})});const d=u=>{l.value=u},c=()=>{i.value=!0},f=u=>{o("click-node",u),i.value=!1};return r({init:c}),(u,p)=>{const h=e.resolveComponent("AppDrawer");return e.openBlock(),e.createBlock(h,{modelValue:e.unref(i),"onUpdate:modelValue":p[0]||(p[0]=m=>e.isRef(i)?i.value=m:null),title:"选择要分析的数据",size:"400px"},{default:e.withCtx(()=>[e.createElementVNode("div",II,[e.createVNode(e.unref(E.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),m=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(l)==m.value?"primary":"",key:m.value,disabled:m.disabled,onClick:y=>d(m.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})]),e.createElementVNode("div",zI,[e.createVNode(OI,{ref:"menuRef",type:e.unref(l),onNodeClick:f},null,8,["type"])])]),_:1},8,["modelValue"])}}}),MI={class:"flex flex-1 justify-end"},AI=e.createElementVNode("i",{class:"ri-add-circle-line mr-1"},null,-1),LI={key:0,class:"h-full flex items-center justify-center"},FI=e.defineComponent({__name:"index",props:{isCustom:{type:Boolean,default:!1},element:{default:null},tempId:{default:""}},emits:["close-design"],setup(t,{emit:r}){var _,C;const n=t,o=r,{proxy:a}=e.getCurrentInstance(),i=e.ref(null),l=e.ref(null),s=e.ref(null),d=e.ref(null),c=e.ref(n.element??{});e.provide("modelEle",c),e.provide("getListModelIndicators",()=>{});const f=e.ref([{label:"指标分析",value:"zbfx"},{label:"指标全景",value:"zbqj",disabled:!0}]),u=e.ref(e.unref(f)[0].value),p=e.ref(((_=n==null?void 0:n.element)==null?void 0:_.id)??"");De(a).getCurrFunc("INDICATORS").then(S=>{e.unref(f).find(x=>x.value=="zbqj").disabled=!S.data.includes("INDICATORS_VIEW")});const h=e.ref([]);De(a).getCurrFunc("MODEL_INDICATORS").then(S=>{h.value=S.data});const m=e.ref(((C=n==null?void 0:n.element)==null?void 0:C.businessType)??""),y=S=>{p.value=S.id,m.value=S.type},g=S=>{c.value=S,e.unref(i).init()},b=S=>{var x,v,V;c.value={id:(x=e.unref(s).result)==null?void 0:x.modelId,modelName:(v=e.unref(s).result)==null?void 0:v.modelName,modelCode:(V=e.unref(s).result)==null?void 0:V.modelCode},e.unref(i).init(S)},w=()=>{e.unref(p)&&(o("close-design",e.unref(p)),e.unref(s)&&e.unref(s).init()),e.unref(l)&&e.unref(l).init()};return(S,x)=>{const v=e.resolveComponent("AppEmpty");return e.openBlock(),e.createBlock(e.unref(E.ElContainer),{class:"app-body-container"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ElHeader),{style:{height:"auto",padding:"0"},class:"mb-3 flex items-center w-full"},{default:e.withCtx(()=>[S.isCustom?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElButtonGroup),{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),V=>(e.openBlock(),e.createBlock(e.unref(E.ElButton),{type:e.unref(u)==V.value?"primary":"",key:V.value,disabled:V.disabled,onClick:$=>u.value=V.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.label),1)]),_:2},1032,["type","disabled","onClick"]))),128))]),_:1})),e.createElementVNode("div",MI,[e.unref(h).includes("STATISTICAL_ANALYSIS")?(e.openBlock(),e.createBlock(e.unref(E.ElButton),{key:0,type:"primary",onClick:x[0]||(x[0]=V=>e.unref(d).init())},{default:e.withCtx(()=>[AI,e.createTextVNode(" 新增指标 ")]),_:1})):e.createCommentVNode("",!0)])]),_:1}),e.withDirectives(e.createVNode(e.unref(E.ElContainer),{class:"overflow-hidden"},{default:e.withCtx(()=>[S.isCustom?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(E.ElAside),{key:0,class:"pr-5 mr-5"},{default:e.withCtx(()=>[e.createVNode(FO,{onNodeClick:y,tempId:S.tempId||e.unref(p),ref_key:"menuRef",ref:l},null,8,["tempId"])]),_:1})),e.createVNode(e.unref(E.ElMain),null,{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(m)=="INDICATORS"?(e.openBlock(),e.createBlock(Sm,{key:0,indicatorsId:e.unref(p)},null,8,["indicatorsId"])):e.createCommentVNode("",!0),e.unref(m)=="MODEL_INDICATORS"?(e.openBlock(),e.createBlock(vm,{key:1,onClickDesign:b,modelIndicatorsRules:e.unref(h),indicatorsId:e.unref(p),ref_key:"modelIndicatorsRef",ref:s},null,8,["modelIndicatorsRules","indicatorsId"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",LI,[e.createVNode(v,{description:"请选择对应指标"})]))]),_:1})]),_:1},512),[[e.vShow,e.unref(u)=="zbfx"]]),e.unref(u)=="zbqj"?(e.openBlock(),e.createBlock(e.unref(E.ElMain),{key:0},{default:e.withCtx(()=>[e.createVNode(rI)]),_:1})):e.createCommentVNode("",!0),e.createVNode(wm,{ref_key:"designRef",ref:i,onClose:w},null,512),e.createVNode(RI,{ref_key:"modelIndicatorsAddRef",ref:d,onClickNode:g},null,512)]),_:1})}}});return{aceComponentsLib:{install(t,r){if(process.env.NODE_ENV==="development"){const n=Rt.createPinia();t.use(n)}if(console.log("ace-component-lib"),t.use(cc),t.component("aceBigScreen",UD),t.component("aceBigScreenPreview",GD),t.component("aceIndicatorReport",HB),qe.Boot&&qe.Boot.registerModule(KB),t.component("aceIndicator",FI),t.component("aceIndicatorPreview",vm),t.component("aceIndicatorSystemPreview",Sm),t.component("aceIndicatorDesign",wm),t.component("aceIndicatorCustomSearch",gm),r!=null&&r.components)for(const[n,o]of Object.entries(r.components)){const a=n.replace(".vue","").split("/").at(-1);t.component(a,o.default)}r!=null&&r.exportExcel&&(t.config.globalProperties.$baseExportExcel=r.exportExcel),r!=null&&r.projectId&&(t.config.globalProperties.$baseGetCurrentProjectId=r.projectId),r!=null&&r.utils&&(t.config.globalProperties.$globalUtils=r.utils),r!=null&&r.predefineColors&&(t.config.globalProperties.$globalPreColor=r.predefineColors),r!=null&&r.hooks&&(t.config.globalProperties.$globalHooks=r.hooks)}}}});