From 880306b934627924b66b3dcaacd7e2333309be44 Mon Sep 17 00:00:00 2001 From: chenshenhai Date: Sun, 24 Mar 2024 13:48:59 +0800 Subject: [PATCH] feat: update pages --- docs/index.html | 4 +- .../{index.983JxlAr.js => index.KdKJbizB.js} | 2 +- docs/js/lib/draw.-FdgEikp.js | 52 ++++++++++++ docs/js/lib/draw.Q3HpuYqJ.js | 52 ------------ package.json | 4 +- pnpm-lock.yaml | 84 +++++++++---------- 6 files changed, 99 insertions(+), 99 deletions(-) rename docs/js/{index.983JxlAr.js => index.KdKJbizB.js} (99%) create mode 100644 docs/js/lib/draw.-FdgEikp.js delete mode 100644 docs/js/lib/draw.Q3HpuYqJ.js diff --git a/docs/index.html b/docs/index.html index ce56348..9a67e9c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,10 +9,10 @@ padding: 0; } - + - + diff --git a/docs/js/index.983JxlAr.js b/docs/js/index.KdKJbizB.js similarity index 99% rename from docs/js/index.983JxlAr.js rename to docs/js/index.KdKJbizB.js index a6cd06c..77fadfc 100644 --- a/docs/js/index.983JxlAr.js +++ b/docs/js/index.KdKJbizB.js @@ -1,4 +1,4 @@ -import{r as Z,c as o2}from"./lib/react.dwzOUFZb.js";import{S as s2}from"./lib/draw.Q3HpuYqJ.js";import"./lib/antd.mAE7kg8m.js";(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))C(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const F of l.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&C(F)}).observe(document,{childList:!0,subtree:!0});function v(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function C(n){if(n.ep)return;n.ep=!0;const l=v(n);fetch(n.href,l)}})();var k1={exports:{}},Q={};/** +import{r as Z,c as o2}from"./lib/react.dwzOUFZb.js";import{S as s2}from"./lib/draw.-FdgEikp.js";import"./lib/antd.mAE7kg8m.js";(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))C(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const F of l.addedNodes)F.tagName==="LINK"&&F.rel==="modulepreload"&&C(F)}).observe(document,{childList:!0,subtree:!0});function v(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function C(n){if(n.ep)return;n.ep=!0;const l=v(n);fetch(n.href,l)}})();var k1={exports:{}},Q={};/** * @license React * react-jsx-dev-runtime.development.js * diff --git a/docs/js/lib/draw.-FdgEikp.js b/docs/js/lib/draw.-FdgEikp.js new file mode 100644 index 0000000..b8cf5ae --- /dev/null +++ b/docs/js/lib/draw.-FdgEikp.js @@ -0,0 +1,52 @@ +import{r as T,R as l,e as va,g as jh}from"./react.dwzOUFZb.js";import{c as be,A as kh,t as cl,S as Kd,a as Ke,I as le,D as _i,B as Je,b as dn,T as Bh,F as J,R as me,C as K,d as it,P as Jd,m as ai,E as ma,e as Fh,f as _r,g as Hh,h as Vh,M as Wh,i as Gh}from"./antd.mAE7kg8m.js";let Ti="idraw-studio";function dl(e){Ti=e}function ul(){return Ti}function qd(e){return(...t)=>[Ti,e,...t].join("-")}function ii(...e){return[Ti,...e].join("-")}const Yh={locale:"en-US",Header:{},ElementDetail:{basicAttributes:"Basic",borderAttribute:"Border",contentAttribute:"Content",shadowAttribute:"Shadow",x:"X",y:"Y",w:"W",h:"H",background:"Background",solid:"Solid",dash:"Dash",inside:"Inside",outside:"Outside",centerLine:"Center",gradient:"Gradient",opacity:"Opacity",mixedBorderWidth:"Mixed",mixedBorderRadius:"Mixed",overflow:"Overflow",hidden:"Hidden",visible:"Visible",deepResizeInGroup:"Deep resize in group"},Menu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"}},Uh={locale:"zh-CN",Header:{},ElementDetail:{basicAttributes:"基础",borderAttribute:"边框",contentAttribute:"内容",shadowAttribute:"阴影",x:"X",y:"Y",w:"宽",h:"高",background:"背景色",solid:"实线",dash:"虚线",inside:"内线",outside:"外线",centerLine:"中线",gradient:"渐变",opacity:"透明度",mixedBorderWidth:"混合边框",mixedBorderRadius:"混合圆角",overflow:"溢出",hidden:"隐藏",visible:"可视",deepResizeInGroup:"组内尺寸关联调整"},Menu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"}},fl={"en-US":Yh,"zh-CN":Uh},Po="en-US",Xh=e=>{const{localeCode:t}=T.useContext(ce);return[T.useMemo(()=>{const a=(fl[t||Po]||fl[Po])[e];return Object.assign({},a)},[t,e])]},Zh=e=>{const{themeMode:t}=e,n="theme",r=ii(n),a=ii(n,"dark"),i=be({[r]:!0,[a]:t==="dark"});return{themeMode:t,className:i}},eu=e=>(e!=null&&e.topPrefix&&typeof(e==null?void 0:e.topPrefix)=="string"&&dl(e.topPrefix),Object.assign({topPrefix:ul(),createPrefixName:qd,generateClassName:ii,getClassNameTopPrefix:ul,setClassNameTopPrefix:dl,localeCode:Po},e||{})),ce=T.createContext(eu()),Qh=e=>{const{children:t,topPrefix:n,localeCode:r,container:a,themeMode:i}=e,o=eu({topPrefix:n,localeCode:r}),[s,c]=T.useState(o),{className:d}=Zh({themeMode:i});return T.useEffect(()=>{c(Object.assign(Object.assign({},s),{localeCode:r,container:a}))},[r,a]),l.createElement(ce.Provider,{value:Object.assign({},s)},l.createElement(kh,{theme:{algorithm:i==="dark"?cl.darkAlgorithm:cl.defaultAlgorithm}},l.createElement("div",{className:d},t)))};class hl extends l.PureComponent{render(){const{children:t,className:n,split:r,style:a,size:i,eleRef:o}=this.props,s=["Pane",r,n];let c={flex:1,position:"relative",outline:"none"};return i!==void 0&&(r==="vertical"?c.width=i:(c.height=i,c.display="flex"),c.flex="none"),c=Object.assign({},c,a||{}),l.createElement("div",{ref:o,className:s.join(" "),style:c},t)}}const Kh="base-split-pane",Jh=()=>{const{generateClassName:e}=T.useContext(ce);return{modClassName:e(Kh)}};function qh(e){const{modClassName:t}=Jh(),{className:n,onClick:r,onDoubleClick:a,onMouseDown:i,onTouchEnd:o,onTouchStart:s,resizerClassName:c=t,split:d,style:u}=e,f=[c,d,n];return T.useMemo(()=>l.createElement("span",{role:"presentation",className:f.join(" "),style:u,onMouseDown:h=>i(h),onTouchStart:h=>{h.preventDefault(),s(h)},onTouchEnd:h=>{h.preventDefault(),o(h)},onClick:h=>{r&&(h.preventDefault(),r(h))},onDoubleClick:h=>{a&&(h.preventDefault(),a(h))}}),[])}const e0="xxxxx";function pl(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch{}}function gl(e,t,n,r){if(typeof r=="number"){const a=typeof t=="number"?t:0,i=typeof n=="number"&&n>=0?n:1/0;return Math.max(a,Math.min(i,r))}return e!==void 0?e:t}function t0(e){return l.Children.toArray(e).filter(t=>t)}class oi extends l.Component{constructor(t){super(t),this.onMouseDown=this.onMouseDown.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this);const{size:n,defaultSize:r,minSize:a,maxSize:i,primary:o}=t,s=n!==void 0?n:gl(r,a,i,null);this.state={active:!1,resized:!1,pane1Size:o==="first"?s:void 0,pane2Size:o==="second"?s:void 0,instanceProps:{size:n}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(oi.getSizeUpdate(this.props,this.state))}static getDerivedStateFromProps(t,n){return oi.getSizeUpdate(t,n)}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}onMouseDown(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchStart(n)}onTouchStart(t){const{allowResize:n,onDragStarted:r,split:a}=this.props;if(n){pl(document,window);const i=a==="vertical"?t.touches[0].clientX:t.touches[0].clientY;typeof r=="function"&&r(),this.setState({active:!0,position:i})}}onMouseMove(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchMove(n)}onTouchMove(t){const{allowResize:n,maxSize:r,minSize:a,onChange:i,split:o,step:s}=this.props,{active:c,position:d}=this.state;if(n&&c){pl(document,window);const u=this.props.primary==="first",f=u?this.pane1:this.pane2,h=u?this.pane2:this.pane1;if(f){const p=f,v=h;if(p.getBoundingClientRect){const g=p.getBoundingClientRect().width,m=p.getBoundingClientRect().height,y=o==="vertical"?t.touches[0].clientX:t.touches[0].clientY,b=o==="vertical"?g:m;let E=d-y;if(s){if(Math.abs(E)S&&(w=-w);let $=r;if(r!==void 0&&r<=0){const H=this.splitPane;o==="vertical"?$=H.getBoundingClientRect().width+r:$=H.getBoundingClientRect().height+r}let D=b-w;const B=d-E;D$?D=$:this.setState({position:B,resized:!0}),i&&i(D),this.setState({draggedSize:D,[u?"pane1Size":"pane2Size"]:D})}}}}onMouseUp(){const{allowResize:t,onDragFinished:n}=this.props,{active:r,draggedSize:a}=this.state;t&&r&&(typeof n=="function"&&n(a),this.setState({active:!1}))}static getSizeUpdate(t,n){const r={},{instanceProps:a}=n;if(a.size===t.size&&t.size!==void 0)return{};const i=t.size!==void 0?t.size:gl(t.defaultSize,t.minSize,t.maxSize,n.draggedSize);t.size!==void 0&&(r.draggedSize=i);const o=t.primary==="first";return r[o?"pane1Size":"pane2Size"]=i,r[o?"pane2Size":"pane1Size"]=void 0,r.instanceProps={size:t.size},r}render(){const{allowResize:t,children:n,className:r,onResizerClick:a,onResizerDoubleClick:i,paneClassName:o,pane1ClassName:s,pane2ClassName:c,paneStyle:d,pane1Style:u,pane2Style:f,resizerClassName:h,resizerStyle:p,split:v,style:g}=this.props,{pane1Size:m,pane2Size:y}=this.state,b=t?"":"disabled",E=h&&`${h} ${e0}`,w=t0(n),C=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);v==="vertical"?Object.assign(C,{flexDirection:"row",left:0,right:0}):Object.assign(C,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const S=["SplitPane",r,v,b],$=Object.assign(Object.assign({},d),u),D=Object.assign(Object.assign({},d),f),B=["Pane1",o,s].join(" "),H=["Pane2",o,c].join(" ");return l.createElement("div",{className:S.join(" "),ref:G=>{this.splitPane=G},style:C},l.createElement(hl,{className:B,key:"pane1",eleRef:G=>{this.pane1=G},size:m,split:v,style:$},w[0]),l.createElement(qh,{className:b,onClick:a,onDoubleClick:i,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:E,split:v,style:p||{}}),l.createElement(hl,{className:H,key:"pane2",eleRef:G=>{this.pane2=G},size:y,split:v,style:D},w[1]))}}var n0=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a({iconClassName:ii(r0)}),ae=e=>{const{className:t,style:n,children:r}=e,a=n0(e,["className","style","children"]),{iconClassName:i}=a0();return T.useMemo(()=>l.createElement("span",Object.assign({className:be([i,t]),style:n},a),r),[i,n,t])},i0=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M516.266667 938.666667h-38.4c-234.666667-21.333333-405.333333-230.4-384-465.066667 17.066667-204.8 179.2-366.933333 384-384 17.066667 0 34.133333 8.533333 42.666666 21.333333 8.533333 12.8 8.533333 34.133333-4.266666 46.933334-85.333333 115.2-59.733333 273.066667 55.466666 358.4 89.6 68.266667 213.333333 68.266667 302.933334 0 12.8-8.533333 29.866667-12.8 46.933333-4.266667 12.8 8.533333 21.333333 25.6 21.333333 42.666667-8.533333 115.2-64 217.6-153.6 290.133333-81.066667 59.733333-174.933333 93.866667-273.066666 93.866667zM396.8 187.733333c-123.733333 42.666667-213.333333 153.6-221.866667 290.133334-17.066667 187.733333 119.466667 354.133333 307.2 371.2 89.6 8.533333 179.2-17.066667 247.466667-76.8 46.933333-38.4 81.066667-89.6 102.4-145.066667-106.666667 38.4-226.133333 21.333333-320-46.933333-119.466667-93.866667-166.4-251.733333-115.2-392.533334z"}))),o0=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 768c-141.376 0-256-114.624-256-256s114.624-256 256-256 256 114.624 256 256-114.624 256-256 256z m0-85.333333a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334zM469.333333 85.333333a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0V85.333333z m0 768a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0v-85.333334zM85.333333 554.666667a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334H85.333333z m768 0a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334h-85.333334zM161.834667 222.165333a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m576 576a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m-515.669334 64a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z m576-576a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z"}))),s0="base-theme-switch",l0=qd(s0),vl=e=>{if(!(typeof e>"u"))return e==="light"};function c0(e){return e===!0?"light":"dark"}const d0=e=>{const{className:t,style:n,onChange:r,theme:a,defaultTheme:i}=e;return l.createElement(Kd,{className:be([l0(),t]),style:n,checkedChildren:l.createElement(o0,{style:{height:"100%"}}),unCheckedChildren:l.createElement(i0,{style:{height:"100%"}}),checked:vl(i),defaultChecked:vl(a),onChange:o=>{const s=c0(o);r==null||r({theme:s})}})},ml=Ke.Option,u0="base-locale-selector",f0=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=T.useContext(ce),s=o(u0);return T.useMemo(()=>l.createElement(Ke,{style:n,className:be(s(),t),size:"small",defaultValue:r,value:a,onChange:i},l.createElement(ml,{value:"en-US"},"English"),l.createElement(ml,{value:"zh-CN"},"中文")),[t,n,r,a,i])};function ds(e){const{accept:t,success:n,error:r}=e;let a=document.createElement("input");a.type="file",t&&(a.accept=t),a.addEventListener("change",function(){var i;const o=(i=a.files)===null||i===void 0?void 0:i[0];n({file:o}),a=null}),a.addEventListener("error",function(i){typeof r=="function"&&r(i),a=null}),a.click()}function h0(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsDataURL(e)})}function p0(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsText(e)})}function g0(e){const t=new TextEncoder().encode(e),n=new Blob([t],{type:"text/plain;charset=utf-8"});return window.URL.createObjectURL(n)}function v0(e,t){const{fileName:n}=t,r=g0(e);let a=document.createElement("a");a.href=r,a.download=n,a.click(),a=null}function si(e){return typeof e=="string"&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)||/^[a-z]{1,}$/i.test(e))}function m0(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="linear-gradient"){const n=[];typeof e.angle=="number"?n.push(`${e.angle}deg`):n.push("180deg"),Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(${n.join(", ")})`}else if((e==null?void 0:e.type)==="radial-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`radial-gradient(circle, ${n.join(", ")})`}return t}function li(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="radial-gradient"||(e==null?void 0:e.type)==="linear-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.length>0&&(e.stops.forEach((r,a)=>{n.push(`${r.color} ${r.offset*100}%`),a===e.stops.length-1&&r.offset<1&&n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(90deg, ${n.join(", ")})`)}return t}function bl(e,t){if(t===1)return e;let n=1;const r=/^\#[0-9a-f]{6,6}$/i,a=/^\#[0-9a-f]{8,8}$/i;let i=e;if(r.test(e)?n=parseInt(e.substring(5,7).replace(/^\#/,"0x")):a.test(e)&&(n=parseInt(e.substring(7,9).replace(/^\#/,"0x")),i=e.substring(0,7)),n=n*t,r.test(i)&&n>0&&n<1){const o=Math.max(0,Math.min(255,Math.ceil(n*256)));i=`${i.toUpperCase()}${o.toString(16).toUpperCase()}`}return i}function ln(){function e(){return((1+Math.random())*65536|0).toString(16).substring(1)}return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function Ht(e){let t=0;for(let n=0;n=0)return n;if(r==="Array"){const a=[];return n.forEach(i=>{a.push(t(i))}),a}else if(r==="Object"){const a={};return Object.keys(n).forEach(s=>{a[s]=t(n[s])}),Object.getOwnPropertySymbols(n).forEach(s=>{a[s]=t(n[s])}),a}}return t(e)}function eo(e){const t=un(e),n=r=>{r.uuid=ln(),r.type==="group"&&r.detail.children&&r.detail.children.forEach(a=>{n(a)})};return n(t),t}function b0(e){return Object.prototype.toString.call(e).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}function y0(e,t){const n=e.assets||{},r=un(e),a=(t==null?void 0:t.loadItemMap)||{},i=o=>{o.forEach(s=>{var c,d,u;if(s.type==="image"&&s.detail.src){const f=s.detail.src;if(cn(f)&&!n[f]&&a[f]&&typeof((c=a[f])===null||c===void 0?void 0:c.source)=="string")n[f]={type:"image",value:a[f].source};else if(!n[f]){const h=hr(f);n[h]||(n[h]={type:"image",value:f}),s.detail.src=h}}else if(s.type==="svg"){const f=s.detail.svg;if(cn(f)&&!n[f]&&a[f]&&typeof((d=a[f])===null||d===void 0?void 0:d.source)=="string")n[f]={type:"svg",value:a[f].source};else if(!n[f]){const h=hr(f);n[h]||(n[h]={type:"svg",value:f}),s.detail.svg=h}}else if(s.type==="html"){const f=s.detail.html;if(cn(f)&&!n[f]&&a[f]&&typeof((u=a[f])===null||u===void 0?void 0:u.source)=="string")n[f]={type:"html",value:a[f].source};else if(!n[f]){const h=hr(f);n[h]||(n[h]={type:"html",value:f}),s.detail.html=h}}else if(s.type==="group"&&Array.isArray(s.detail.children)){const f=s.detail.assets||{};Object.keys(f).forEach(h=>{n[h]||(n[h]=f[h])}),delete s.detail.assets,i(s.detail.children)}})};return i(r.elements),r.assets=n,r}function dt(e){return(Object.prototype.toString.call(e)||"").replace(/(\[object|\])/gi,"").trim()}const jr={type(e,t){const n=dt(e);return t===!0?n.toLocaleLowerCase():n},array(e){return dt(e)==="Array"},json(e){return dt(e)==="Object"},function(e){return dt(e)==="Function"},asyncFunction(e){return dt(e)==="AsyncFunction"},boolean(e){return dt(e)==="Boolean"},string(e){return dt(e)==="String"},number(e){return dt(e)==="Number"},undefined(e){return dt(e)==="Undefined"},null(e){return dt(e)==="Null"},promise(e){return dt(e)==="Promise"}};function w0(e,t){const{width:n,height:r}=t;return new Promise((a,i)=>{const o=` + + +
+ ${e} +
+
+
+ `,s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),c=new FileReader;c.readAsDataURL(s),c.onload=function(d){var u;const f=(u=d==null?void 0:d.target)===null||u===void 0?void 0:u.result;a(f)},c.onerror=function(d){i(d)}})}function x0(e){return new Promise((t,n)=>{const r=e,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=new FileReader;i.readAsDataURL(a),i.onload=function(o){var s;const c=(s=o==null?void 0:o.target)===null||s===void 0?void 0:s.result;t(c)},i.onerror=function(o){n(o)}})}var tu=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{Image:S0}=window;function Oi(e){return new Promise((t,n)=>{const r=new S0;r.crossOrigin="anonymous",r.onload=function(){t(r)},r.onabort=n,r.onerror=n,r.src=e})}function E0(e){return tu(this,void 0,void 0,function*(){const t=yield x0(e);return yield Oi(t)})}function C0(e){return e.replace(/\&/gi,"&")}function M0(e,t){return tu(this,void 0,void 0,function*(){e=C0(e);const n=yield w0(e,t);return yield Oi(n)})}function vn(e){return typeof e=="number"&&(e>0||e<=0)}function A0(e){return vn(e)}function _0(e){return vn(e)}function nu(e){return typeof e=="number"&&e>=0}function T0(e){return typeof e=="number"&&e>=0}function O0(e){return typeof e=="number"&&e>=-360&&e<=360}function I0(e){return nu(e)}function $0(e){return vn(e)&&e>=0}function P0(e){return si(e)}function ru(e){return typeof e=="string"&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${e}`)}function au(e){return typeof e=="string"&&/^(data:image\/)/.test(`${e}`)}function R0(e){return au(e)||ru(e)}function z0(e){return typeof e=="string"&&/^()/i.test(`${e}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${e}`.trim())}function D0(e){let t=!1;if(typeof e=="string"){let n=document.createElement("div");n.innerHTML=e,n.children.length>0&&(t=!0),n=null}return t}function N0(e){return typeof e=="string"}function L0(e){return vn(e)&&e>0}function j0(e){return vn(e)&&e>0}function k0(e){return vn(e)&&e>0}function B0(e){return["center","left","right"].includes(e)}function F0(e){return typeof e=="string"&&e.length>0}function H0(e){return["bold"].includes(e)}function V0(e){return/^(-?\d+(?:\.\d+)?)$/.test(`${e}`)}const Fe={x:A0,y:_0,w:nu,h:T0,angle:O0,number:vn,numberStr:V0,borderWidth:I0,borderRadius:$0,color:P0,imageSrc:R0,imageURL:ru,imageBase64:au,svg:z0,html:D0,text:N0,fontSize:L0,lineHeight:j0,textAlign:B0,fontFamily:F0,fontWeight:H0,strokeWidth:k0};var ba=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Z=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Q,_t;const W0=12,G0="400",Y0="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";class iu{constructor(t,n){Q.set(this,void 0),_t.set(this,void 0),ba(this,Q,t,"f"),ba(this,_t,Object.assign({devicePixelRatio:1,offscreenCanvas:null},n),"f"),this.$resetFont()}$undoPixelRatio(t){return t/Z(this,_t,"f").devicePixelRatio}$doPixelRatio(t){return Z(this,_t,"f").devicePixelRatio*t}$getContext(){return Z(this,Q,"f")}$setContext(t){ba(this,Q,t,"f")}$setFont(t){const n=[];t.fontWeight&&n.push(`${t.fontWeight}`),n.push(`${this.$doPixelRatio(t.fontSize||12)}px`),n.push(`${t.fontFamily||"sans-serif"}`),Z(this,Q,"f").font=`${n.join(" ")}`}$resetFont(){this.$setFont({fontSize:W0,fontFamily:Y0,fontWeight:G0})}$getOffscreenCanvas(){return Z(this,_t,"f").offscreenCanvas}$resize(t){const{width:n,height:r,devicePixelRatio:a,resetStyle:i}=t,{canvas:o}=Z(this,Q,"f");o.width=n*a,o.height=r*a,ba(this,_t,Object.assign(Object.assign({},Z(this,_t,"f")),{devicePixelRatio:a}),"f"),i===!0&&(o.style.width=`${n}px`,o.style.height=`${r}px`)}$getSize(){const{devicePixelRatio:t}=Z(this,_t,"f"),{width:n,height:r}=Z(this,Q,"f").canvas;return{width:n/t,height:r/t,devicePixelRatio:t}}get canvas(){return Z(this,Q,"f").canvas}get fillStyle(){return Z(this,Q,"f").fillStyle}set fillStyle(t){Z(this,Q,"f").fillStyle=t}get strokeStyle(){return Z(this,Q,"f").strokeStyle}set strokeStyle(t){Z(this,Q,"f").strokeStyle=t}get lineWidth(){return this.$undoPixelRatio(Z(this,Q,"f").lineWidth)}set lineWidth(t){Z(this,Q,"f").lineWidth=this.$doPixelRatio(t)}get textAlign(){return Z(this,Q,"f").textAlign}set textAlign(t){Z(this,Q,"f").textAlign=t}get textBaseline(){return Z(this,Q,"f").textBaseline}set textBaseline(t){Z(this,Q,"f").textBaseline=t}get globalAlpha(){return Z(this,Q,"f").globalAlpha}set globalAlpha(t){Z(this,Q,"f").globalAlpha=t}get shadowColor(){return Z(this,Q,"f").shadowColor}set shadowColor(t){Z(this,Q,"f").shadowColor=t}get shadowOffsetX(){return this.$undoPixelRatio(Z(this,Q,"f").shadowOffsetX)}set shadowOffsetX(t){Z(this,Q,"f").shadowOffsetX=this.$doPixelRatio(t)}get shadowOffsetY(){return this.$undoPixelRatio(Z(this,Q,"f").shadowOffsetY)}set shadowOffsetY(t){Z(this,Q,"f").shadowOffsetY=this.$doPixelRatio(t)}get shadowBlur(){return this.$undoPixelRatio(Z(this,Q,"f").shadowBlur)}set shadowBlur(t){Z(this,Q,"f").shadowBlur=this.$doPixelRatio(t)}get lineCap(){return Z(this,Q,"f").lineCap}set lineCap(t){Z(this,Q,"f").lineCap=t}get globalCompositeOperation(){return Z(this,Q,"f").globalCompositeOperation}set globalCompositeOperation(t){Z(this,Q,"f").globalCompositeOperation=t}fill(...t){return Z(this,Q,"f").fill(...t)}arc(t,n,r,a,i,o){return Z(this,Q,"f").arc(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),a,i,o)}rect(t,n,r,a){return Z(this,Q,"f").rect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}fillRect(t,n,r,a){return Z(this,Q,"f").fillRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}clearRect(t,n,r,a){return Z(this,Q,"f").clearRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}beginPath(){return Z(this,Q,"f").beginPath()}closePath(){return Z(this,Q,"f").closePath()}lineTo(t,n){return Z(this,Q,"f").lineTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}moveTo(t,n){return Z(this,Q,"f").moveTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}arcTo(t,n,r,a,i){return Z(this,Q,"f").arcTo(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i))}getLineDash(){return Z(this,Q,"f").getLineDash()}setLineDash(t){const n=t.map(r=>this.$doPixelRatio(r));return Z(this,Q,"f").setLineDash(n)}stroke(t){return t?Z(this,Q,"f").stroke(t):Z(this,Q,"f").stroke()}translate(t,n){return Z(this,Q,"f").translate(this.$doPixelRatio(t),this.$doPixelRatio(n))}rotate(t){return Z(this,Q,"f").rotate(t)}drawImage(...t){const n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],s=t[t.length-4],c=t[t.length-3],d=t[t.length-2],u=t[t.length-1];return t.length===9?Z(this,Q,"f").drawImage(n,this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o),this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u)):Z(this,Q,"f").drawImage(n,this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u))}createPattern(t,n){return Z(this,Q,"f").createPattern(t,n)}measureText(t){return Z(this,Q,"f").measureText(t)}fillText(t,n,r,a){return a!==void 0?Z(this,Q,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,Q,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}strokeText(t,n,r,a){return a!==void 0?Z(this,Q,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,Q,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}save(){Z(this,Q,"f").save()}restore(){Z(this,Q,"f").restore()}scale(t,n){Z(this,Q,"f").scale(t,n)}circle(t,n,r,a,i,o,s,c){Z(this,Q,"f").ellipse(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),i,o,s,c)}isPointInPath(t,n){return Z(this,Q,"f").isPointInPath(this.$doPixelRatio(t),this.$doPixelRatio(n))}clip(...t){return Z(this,Q,"f").clip(...t)}setTransform(t,n,r,a,i,o){return Z(this,Q,"f").setTransform(t,n,r,a,i,o)}getTransform(){return Z(this,Q,"f").getTransform()}createLinearGradient(t,n,r,a){return Z(this,Q,"f").createLinearGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}createRadialGradient(t,n,r,a,i,o){return Z(this,Q,"f").createRadialGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o))}createConicGradient(t,n,r){return Z(this,Q,"f").createConicGradient(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}}Q=new WeakMap,_t=new WeakMap;function An(e){const{width:t,height:n,ctx:r,devicePixelRatio:a}=e;let i=r;if(!i){const s=document.createElement("canvas");s.width=t*a,s.height=n*a,i=s.getContext("2d")}return new iu(i,e)}function Da(e){const{width:t,height:n,devicePixelRatio:r}=e,a=new OffscreenCanvas(t*r,n*r),o=a.getContext("2d").canvas.getContext("2d");return new iu(o,{devicePixelRatio:r,offscreenCanvas:a})}function U0(e,t){const{width:n,height:r,devicePixelRatio:a,offscreen:i,createCustomContext2D:o}=t,s={width:n,height:r,devicePixelRatio:a},c=e.getContext("2d");if(o){const d=o(s),u=o(s),f=o(s),h=An(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}if(i===!0){const d=Da(s),u=Da(s),f=Da(s),h=An(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}else{const d=An(s),u=An(s),f=An(s),h=An(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{h.clearRect(0,0,n,r),h.drawImage(f.canvas,0,0,n,r),h.drawImage(d.canvas,0,0,n,r),h.drawImage(u.canvas,0,0,n,r),f.clearRect(0,0,n,r),d.clearRect(0,0,n,r),u.clearRect(0,0,n,r)}}}}var X0=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ut=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},We;class fn{constructor(){We.set(this,void 0),X0(this,We,new Map,"f")}on(t,n){if(ut(this,We,"f").has(t)){const r=ut(this,We,"f").get(t)||[];r==null||r.push(n),ut(this,We,"f").set(t,r)}else ut(this,We,"f").set(t,[n])}off(t,n){if(ut(this,We,"f").has(t)){const r=ut(this,We,"f").get(t);if(Array.isArray(r)){for(let a=0;a<(r==null?void 0:r.length);a++)if(r[a]===n){r.splice(a,1);break}}ut(this,We,"f").set(t,r||[])}}trigger(t,n){const r=ut(this,We,"f").get(t);return Array.isArray(r)?(r.forEach(a=>{a(n)}),!0):!1}has(t){if(ut(this,We,"f").has(t)){const n=ut(this,We,"f").get(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}destroy(){this.clear()}clear(){ut(this,We,"f").clear()}}We=new WeakMap;function Z0(e,t){const n=(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y);return n===0?n:Math.sqrt(n)}function qe(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var ya=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},en=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Na,Tt,ci,Ro;class hn{constructor(t){Na.add(this),Tt.set(this,void 0),ci.set(this,void 0),ya(this,ci,un(t.defaultStorage),"f"),ya(this,Tt,en(this,Na,"m",Ro).call(this),"f")}set(t,n){en(this,Tt,"f")[t]=n}get(t){return en(this,Tt,"f")[t]}getSnapshot(t){return(t==null?void 0:t.deepClone)===!0?un(en(this,Tt,"f")):Object.assign({},en(this,Tt,"f"))}clear(){ya(this,Tt,en(this,Na,"m",Ro).call(this),"f")}destroy(){ya(this,Tt,null,"f")}}Tt=new WeakMap,ci=new WeakMap,Na=new WeakSet,Ro=function(){return un(en(this,ci,"f"))};function Ii(e){const{activeStore:t}=e;return{scale:t==null?void 0:t.scale,offsetTop:t==null?void 0:t.offsetTop,offsetBottom:t==null?void 0:t.offsetBottom,offsetLeft:t==null?void 0:t.offsetLeft,offsetRight:t==null?void 0:t.offsetRight}}function $i(e){const{activeStore:t}=e;return{devicePixelRatio:t.devicePixelRatio,width:t==null?void 0:t.width,height:t==null?void 0:t.height,contextWidth:t==null?void 0:t.contextWidth,contextHeight:t==null?void 0:t.contextHeight}}function Q0(e){return e/Math.PI*180}function Dt(e){return e/180*Math.PI}function na(e,t,n,r){const a=Dt(t||0);n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(a),e.translate(-n.x,-n.y)),r(e),n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(-a),e.translate(-n.x,-n.y))}function Lt(e,t,n){const r=bt(t);na(e,t.angle||0,r,()=>{n(e)})}function bt(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function ou(e){const t=Math.min(e[0].x,e[1].x,e[2].x,e[3].x),n=Math.min(e[0].y,e[1].y,e[2].y,e[3].y),r=Math.max(e[0].x,e[1].x,e[2].x,e[3].x),a=Math.max(e[0].y,e[1].y,e[2].y,e[3].y),i={x:t,y:n,w:r-t,h:a-n};return bt(i)}function K0(e,t,n){const r=zo(e,t),a=zo(e,n);return a!==null&&r!==null?r>Math.PI*3/2&&aMath.PI*3/2&&r0)return Math.PI}else if(r===0){if(n<0)return Math.PI*3/2;if(n>0)return Math.PI/2}return n>0&&r<0?Math.atan(Math.abs(n)/Math.abs(r)):n>0&&r>0?Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r>0?Math.PI+Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r<0?2*Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):0}function _e(e,t,n){let i=zo(e,t)+n;i>Math.PI*2?i=i-Math.PI*2:i<0-Math.PI*2&&(i=i+Math.PI*2),i<0&&(i=i+Math.PI*2);const o=Z0(e,t);let s=0,c=0;return i===0?(s=0,c=0-o):i>0&&iMath.PI/2&&iMath.PI&&i<3/2*Math.PI?(s=0-Math.sin(i-Math.PI)*o,c=Math.cos(i-Math.PI)*o):i===3/2*Math.PI?(s=0-o,c=0):i>3/2*Math.PI&&i<2*Math.PI?(s=0-Math.sin(2*Math.PI-i)*o,c=0-Math.cos(2*Math.PI-i)*o):i===2*Math.PI&&(s=0,c=0-o),s+=e.x,c+=e.y,{x:s,y:c}}function di(e,t){if((t==null?void 0:t.length)>0){let n=e.x,r=e.y;return t.forEach(a=>{const{x:i,y:o,w:s,h:c,angle:d=0}=a,u=bt({x:i,y:o,w:s,h:c,angle:d}),f=_e(u,{x:n,y:r},Dt(d));n=f.x,r=f.y}),{x:n,y:r}}return e}function su(e,t,n){const{x:r,y:a,w:i,h:o}=e;let s={x:r,y:a},c={x:r+i,y:a},d={x:r+i,y:a+o},u={x:r,y:a+o};if(n&&(n>0||n<0)){const f=Dt(vt(n));s=_e(t,s,f),c=_e(t,c,f),d=_e(t,d,f),u=_e(t,u,f)}return[s,c,d,u]}function pr(e){const{angle:t=0}=e,n=bt(e);return su(e,n,t)}function yl(e,t,n){return[_e(e,{x:t[0].x,y:t[0].y},n),_e(e,{x:t[1].x,y:t[1].y},n),_e(e,{x:t[2].x,y:t[2].y},n),_e(e,{x:t[3].x,y:t[3].y},n)]}function vt(e){if(!(e>0||e<0)||e===0)return 0;let t=e%360;return t<0&&(t+=360),t}function lu(e){let t=!0;if(Array.isArray(e)){const n=[];e.forEach(r=>{var a;typeof r.uuid=="string"&&r.uuid?n.includes(r.uuid)?(t=!1,console.warn(`Duplicate uuids: ${r.uuid}`)):n.push(r.uuid):(t=!1,console.warn("Element missing uuid",r)),r.type==="group"&&(t=lu((a=r==null?void 0:r.detail)===null||a===void 0?void 0:a.children))})}return t}function J0(e){var t;const n={x:0,y:0,w:0,h:0};let r=null;for(let i=0;i0||s.angle<0)){const c=pr(s);if(c.length===4){const d=[c[0].x,c[1].x,c[2].x,c[3].x],u=[c[0].y,c[1].y,c[2].y,c[3].y];s.x=Math.min(...d),s.y=Math.min(...u),s.w=Math.abs(Math.max(...d)-Math.min(...d)),s.h=Math.abs(Math.max(...u)-Math.min(...u))}}if(r){const c=Math.min(s.x,n.x),d=Math.min(s.y,n.y),u=Math.max(s.x+s.w,n.x+n.w),f=Math.max(s.y+s.h,n.y+n.h);n.x=c,n.y=d,n.w=Math.abs(u-c),n.h=Math.abs(f-d)}else n.x=s.x,n.y=s.y,n.w=s.w,n.h=s.h;r=s}return{x:Math.floor(n.x),y:Math.floor(n.y),w:Math.ceil(n.w),h:Math.ceil(n.h)}}function cu(e,t){const n={x:0,y:0,w:0,h:0};e.forEach(a=>{const i={x:a.x,y:a.y,w:a.w,h:a.h,angle:a.angle};if(i.angle&&(i.angle>0||i.angle<0)){const u=pr(i);if(u.length===4){const f=[u[0].x,u[1].x,u[2].x,u[3].x],h=[u[0].y,u[1].y,u[2].y,u[3].y];i.x=Math.min(...f),i.y=Math.min(...h),i.w=Math.abs(Math.max(...f)-Math.min(...f)),i.h=Math.abs(Math.max(...h)-Math.min(...h))}}const o=Math.min(i.x,n.x),s=Math.min(i.y,n.y),c=Math.max(i.x+i.w,n.x+n.w),d=Math.max(i.y+i.h,n.y+n.h);n.x=o,n.y=s,n.w=Math.abs(c-o),n.h=Math.abs(d-s)}),t!=null&&t.extend&&(n.x=Math.min(n.x,0),n.y=Math.min(n.y,0));const r={contextWidth:n.w,contextHeight:n.h};return t!=null&&t.viewWidth&&(t!=null&&t.viewHeight)&&(t==null?void 0:t.viewWidth)>0&&(t==null?void 0:t.viewHeight)>0&&(t.viewWidth>n.x+n.w&&(r.contextWidth=t.viewWidth-n.x),t.viewHeight>n.y+n.h&&(r.contextHeight=t.viewHeight-n.y)),r}function q0(e,t,n){const r=cu(e,{viewWidth:t.width,viewHeight:t.height,extend:n==null?void 0:n.extend});return(n==null?void 0:n.extend)===!0&&(r.contextWidth=Math.max(r.contextWidth,t.contextWidth),r.contextHeight=Math.max(r.contextHeight,t.contextHeight)),{contextSize:r}}function du(e,t){var n;let r=null;for(let a=0;a1)for(let i=0;i{const a=mt(r,t);a&&n.push(a)}),n}function mt(e,t){let n=null,r=t;for(let a=0;a{var o;for(let s=0;s0||f<0){const g=Dt(f);h=yl(v,h,g)}a.push({center:v,angle:f,radian:Dt(f)})}t.push(h)}return t}function ep(e,t){const{groupQueue:n}=t;if(!(n.length>0))return[pt(e)];const r=[...n,e];return us(r)}function Jr(e,t){return ep(e,t).pop()||null}function tp(e,t){const{scale:n,offsetX:r,offsetY:a}=e,{viewSizeInfo:i}=t,{width:o,height:s,contextWidth:c,contextHeight:d}=i,u=c*n,f=d*n,h=0-r*n,p=0-a*n,v=o-(u+h/n),g=s-(f+p/n);return{scale:n,offsetLeft:h,offsetTop:p,offsetRight:v,offsetBottom:g}}function np(e){const{scale:t,point:n,viewScaleInfo:r}=e,{offsetLeft:a,offsetTop:i}=r,o=t/r.scale,s=n.x,c=n.y,d=s-s*o+(a*o-a),u=c-c*o+(i*o-i);return{moveX:d,moveY:u}}function rp(e){const{moveX:t=0,moveY:n=0,viewScaleInfo:r,viewSizeInfo:a}=e,{scale:i}=r,{width:o,height:s,contextWidth:c,contextHeight:d}=a;let u=r.offsetLeft,f=r.offsetRight,h=r.offsetTop,p=r.offsetBottom;u+=t,h+=n;const v=c*i,g=d*i;return f=o-(v+u),p=s-(g+h),{scale:i,offsetTop:h,offsetLeft:u,offsetRight:f,offsetBottom:p}}function et(e,t){const{viewScaleInfo:n}=t,{x:r,y:a,w:i,h:o,angle:s}=e,{scale:c,offsetTop:d,offsetLeft:u}=n;return{x:r*c+u,y:a*c+d,w:i*c,h:o*c,angle:s}}function fe(e,t){const{viewScaleInfo:n}=t,{x:r,y:a}=e,{scale:i,offsetTop:o,offsetLeft:s}=n;return{x:r*i+s,y:a*i+o}}function ke(e,t){return[fe(e[0],t),fe(e[1],t),fe(e[2],t),fe(e[3],t)]}function Do(e,t){const{context2d:n,element:r,viewScaleInfo:a,viewSizeInfo:i}=t,{angle:o=0}=r,{x:s,y:c,w:d,h:u}=et(r,{viewScaleInfo:a,viewSizeInfo:i}),f=pr({x:s,y:c,w:d,h:u,angle:o});if(f.length>=2){n.beginPath(),n.moveTo(f[0].x,f[0].y);for(let h=1;h0)for(let f=d.length-1;f>=0;f--){let h=0,p=0,v=0;for(let m=0;m<=f;m++)h+=d[m].x,p+=d[m].y,v+=d[m].angle||0;const g=d[f];if(g&&g.type==="group"&&Array.isArray((n=g.detail)===null||n===void 0?void 0:n.children))for(let m=0;m=0;f--){const h=o.elements[f];if(((a=h==null?void 0:h.operations)===null||a===void 0?void 0:a.invisible)!==!0&&Do(e,{context2d:i,element:h,viewScaleInfo:s,viewSizeInfo:c})){u.index=f,u.element=h;break}}return u}function gu(e,t){const{groupQueue:n}=t,r=Jr(e,{groupQueue:n}),a=qe(r[0],r[1]),i=qe(r[1],r[2]),o=qe(r[2],r[3]),s=qe(r[3],r[0]),c=r[0],d=r[1],u=r[2],f=r[3],h=Math.max(c.x,d.x,u.x,f.x),p=Math.max(c.y,d.y,u.y,f.y),v=Math.min(c.x,d.x,u.x,f.x),g=Math.min(c.y,d.y,u.y,f.y);return{center:{x:(h+v)/2,y:(p+g)/2},topLeft:c,topRight:d,bottomLeft:f,bottomRight:u,top:a,right:i,left:s,bottom:o}}function vu(e){const t=Math.max(e.topLeft.x,e.topRight.x,e.bottomRight.x,e.bottomLeft.x),n=Math.max(e.topLeft.y,e.topRight.y,e.bottomRight.y,e.bottomLeft.y),r=Math.min(e.topLeft.x,e.topRight.x,e.bottomRight.x,e.bottomLeft.x),a=Math.min(e.topLeft.y,e.topRight.y,e.bottomRight.y,e.bottomLeft.y),i={x:e.center.x,y:e.center.y},o={x:r,y:a},s={x:t,y:a},c={x:t,y:n},d={x:r,y:n},u=qe(o,s),f=qe(d,c),h=qe(o,d),p=qe(s,c);return{center:i,topLeft:o,topRight:s,bottomLeft:d,bottomRight:c,top:u,right:p,left:h,bottom:f}}function ip(e,t){const n={},r=[],a=i=>{const o={isVisibleInView:!0,isGroup:i.type==="group",position:[...r]};let s=null;const c=fu(e,r);s=gu(i,{groupQueue:c||[]}),n[i.uuid]=Object.assign(Object.assign({},o),{originRectInfo:s,rangeRectInfo:Fe.angle(i.angle)?vu(s):s}),i.type==="group"&&i.detail.children.forEach((d,u)=>{r.push(u),a(d),r.pop()})};return e.forEach((i,o)=>{r.push(o),a(i),r.pop()}),mu(n,t)}function op(e,t){const n=Math.min(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),r=Math.max(e.topLeft.x,e.topRight.x,e.bottomLeft.x,e.bottomRight.x),a=Math.min(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y),i=Math.max(e.topLeft.y,e.topRight.y,e.bottomLeft.y,e.bottomRight.y),o=Math.min(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),s=Math.max(t.topLeft.x,t.topRight.x,t.bottomLeft.x,t.bottomRight.x),c=Math.min(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y),d=Math.max(t.topLeft.y,t.topRight.y,t.bottomLeft.y,t.bottomRight.y);return n<=s&&r>=o&&a<=d&&i>=c||s<=i&&s>=i&&s<=i&&s>=i}function mu(e,t){const n=sp(t);let r=0,a=0;return Object.keys(e).forEach(i=>{const o=e[i];o.isVisibleInView=op(o.rangeRectInfo,n),o.isVisibleInView?r++:a++}),{viewVisibleInfoMap:e,visibleCount:r,invisibleCount:a}}function sp(e){const{viewScaleInfo:t,viewSizeInfo:n}=e,{scale:r,offsetTop:a,offsetLeft:i}=t,{width:o,height:s}=n,c=0-i/r,d=0-a/r,u=o/r,f=s/r,h=bt({x:c,y:d,w:u,h:f}),p={x:c,y:d},v={x:c+u,y:d},g={x:c,y:d+f},m={x:c+u,y:d+f},y={x:c,y:h.y},b={x:h.x,y:d},E={x:c+u,y:h.y},w={x:h.x,y:d+f};return{center:h,topLeft:p,topRight:v,bottomLeft:g,bottomRight:m,left:y,top:b,right:E,bottom:w}}function Mt(e,t){const{x:n,y:r}=e,{size:a,angle:i}=t;return{x:n-a/2,y:r-a/2,w:a,h:a,angle:i}}function wa(e,t){const{groupQueue:n,controllerSize:r,viewScaleInfo:a}=t,i=(r&&r>0?r:8)/a.scale,{x:o,y:s,w:c,h:d,angle:u=0}=e,f=[{uuid:ln(),x:o,y:s,w:c,h:d,angle:u,type:"group",detail:{children:[]}},...n];let h=0;f.forEach(({angle:nt=0})=>{h+=nt});const p=Jr(e,{groupQueue:n}),v=Jr({x:o-i*2,y:s-i*2,h:d+i*4,w:c+i*4,angle:u},{groupQueue:[...n]}),g=qe(p[0],p[1]),m=qe(p[1],p[2]),y=qe(p[2],p[3]),b=qe(p[3],p[0]),E=p[0],w=p[1],C=p[2],S=p[3],$=Mt(g,{size:i,angle:h}),D=Mt(m,{size:i,angle:h}),B=Mt(y,{size:i,angle:h}),H=Mt(b,{size:i,angle:h}),G=Mt(E,{size:i,angle:h}),j=Mt(w,{size:i,angle:h}),M=Mt(S,{size:i,angle:h}),I=Mt(C,{size:i,angle:h}),k=pt(G),z=pt(j),A=pt(M),N=pt(I),x=[k[1],z[0],z[3],k[2]],R=[z[3],z[2],N[1],N[0]],Y=[A[1],N[0],N[3],A[2]],_=[k[3],k[2],A[1],A[0]],U=pt($),V=pt(D),O=pt(B),P=pt(H),L=qe(v[0],v[1]),F=Mt(L,{size:i,angle:h}),te=pt(F);return{elementWrapper:p,left:{type:"left",vertexes:_,center:b},right:{type:"right",vertexes:R,center:m},top:{type:"top",vertexes:x,center:g},bottom:{type:"bottom",vertexes:Y,center:y},topLeft:{type:"top-left",vertexes:k,center:E},topRight:{type:"top-right",vertexes:z,center:w},bottomLeft:{type:"bottom-left",vertexes:A,center:S},bottomRight:{type:"bottom-right",vertexes:N,center:C},leftMiddle:{type:"left-middle",vertexes:P,center:b},rightMiddle:{type:"right-middle",vertexes:V,center:m},topMiddle:{type:"top-middle",vertexes:U,center:g},bottomMiddle:{type:"bottom-middle",vertexes:O,center:y},rotate:{type:"rotate",vertexes:te,center:L}}}function bu(e){let t="";return e.forEach(n=>{t+=n.type+n.params.join(" ")}),t}function ve(e,t){let n=2;return typeof(t==null?void 0:t.decimalPlaces)<"u"&&(t==null?void 0:t.decimalPlaces)>=0&&(n=t.decimalPlaces),parseFloat(e.toFixed(n))}const ja="Text Element";function mn(){return{boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,lineHeight:20,fontFamily:"sans-serif",fontWeight:400,overflow:"hidden"}}function lp(){return{background:"#D9D9D9"}}function cp(){return{background:"#D9D9D9",radius:0}}function dp(e){const t=mn();return{text:ja,color:t.color,fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:e.w/ja.length,fontSize:e.w/ja.length,textAlign:"center",verticalAlign:"middle"}}function up(){return{svg:''}}function fp(){return{src:"data:image/svg+xml;base64,PHN2ZyAgIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPjxwYXRoIGQ9Ik05MjggMTYwSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY2NDBjMCAxNy43IDE0LjMgMzIgMzIgMzJoODMyYzE3LjcgMCAzMi0xNC4zIDMyLTMyVjE5MmMwLTE3LjctMTQuMy0zMi0zMi0zMnogbS00MCA2MzJIMTM2di0zOS45bDEzOC41LTE2NC4zIDE1MC4xIDE3OEw2NTguMSA0ODkgODg4IDc2MS42Vjc5MnogbTAtMTI5LjhMNjY0LjIgMzk2LjhjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDQyNC42IDY2Ni40bC0xNDQtMTcwLjdjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDEzNiA2NTIuN1YyMzJoNzUydjQzMC4yeiIgIGZpbGw9IiM1MTUxNTEiPjwvcGF0aD48cGF0aCBkPSJNMzA0IDQ1NmM0OC42IDAgODgtMzkuNCA4OC04OHMtMzkuNC04OC04OC04OC04OCAzOS40LTg4IDg4IDM5LjQgODggODggODh6IG0wLTExNmMxNS41IDAgMjggMTIuNSAyOCAyOHMtMTIuNSAyOC0yOCAyOC0yOC0xMi41LTI4LTI4IDEyLjUtMjggMjgtMjh6IiAgZmlsbD0iIzUxNTE1MSI+PC9wYXRoPjwvc3ZnPg=="}}function hp(){return{children:[],background:"#D9D9D9",overflow:"hidden"}}const pp=mn();function Ri(e,t){const{viewScaleInfo:n}=t,{scale:r}=n;let{borderRadius:a}=e.detail;const{boxSizing:i=pp.boxSizing,borderWidth:o}=e.detail;Array.isArray(o)&&(a=0);let{x:s,y:c,w:d,h:u}=e,f=[0,0,0,0];if(typeof a=="number"){const p=a*r;f=[p,p,p,p]}else Array.isArray(a)&&(a==null?void 0:a.length)===4&&(f=[a[0]*r,a[1]*r,a[2]*r,a[3]*r]);let h=0;return typeof o=="number"&&(h=(o||0)*r),i==="border-box"?(s=e.x+h/2,c=e.y+h/2,d=e.w-h,u=e.h-h):i==="content-box"?(s=e.x-h/2,c=e.y-h/2,d=e.w+h,u=e.h+h):(s=e.x,c=e.y,d=e.w,u=e.h),d=Math.max(d,1),u=Math.max(u,1),f=f.map(p=>Math.min(p,d/2,u/2)),{x:s,y:c,w:d,h:u,radiusList:f}}const je=e=>ve(e,{decimalPlaces:4});function yu(e,t){const{detail:n}=e,{xRatio:r,yRatio:a,maxRatio:i}=t,o=(r+a)/2,{borderWidth:s,borderRadius:c,borderDash:d,shadowOffsetX:u,shadowOffsetY:f,shadowBlur:h}=n;if(typeof s=="number")n.borderWidth=je(s*o);else if(Array.isArray(n.borderWidth)){const p=s;n.borderWidth=[je(p[0]*a),je(p[1]*r),je(p[2]*a),je(p[3]*r)]}if(typeof c=="number")n.borderRadius=je(c*o);else if(Array.isArray(n.borderRadius)){const p=c;n.borderRadius=[p[0]*r,p[1]*r,p[2]*a,p[3]*a]}Array.isArray(d)&&d.forEach((p,v)=>{n.borderDash[v]=je(p*i)}),typeof u=="number"&&(n.shadowOffsetX=je(u*i)),typeof f=="number"&&(n.shadowOffsetX=je(f*i)),typeof h=="number"&&(n.shadowOffsetX=je(h*i))}function gp(e,t){const{xRatio:n,yRatio:r}=t,{x:a,y:i,w:o,h:s}=e;e.x=je(a*n),e.y=je(i*r),e.w=je(o*n),e.h=je(s*r),yu(e,t)}function vp(e,t){const{minRatio:n,maxRatio:r}=t,{fontSize:a,lineHeight:i}=e.detail,o=(n+r)/2;a&&a>0&&(e.detail.fontSize=je(a*o)),i&&i>0&&(e.detail.lineHeight=je(i*o))}function wu(e,t){const{type:n}=e;gp(e,t),n==="circle"||(n==="text"?vp(e,t):n==="image"||n==="svg"||n==="html"||n==="path"||n==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(r=>{wu(r,t)}))}function xu(e,t){const n=t.w&&t.w>0?t.w:e.w,r=t.h&&t.h>0?t.h:e.h,a=n/e.w,i=r/e.h;if(a===i&&a===1)return e;const o=Math.min(a,i),s=Math.max(a,i);e.w=n,e.h=r;const c={xRatio:a,yRatio:i,minRatio:o,maxRatio:s};return e.type==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(d=>{wu(d,c)}),yu(e,c),e}const to=200,no=200;function mp(e,t){let n=0,r=0,a=to,i=no;if(t){const{viewScaleInfo:s,viewSizeInfo:c}=t,{scale:d,offsetLeft:u,offsetTop:f}=s,{width:h,height:p}=c,v=h/4,g=p/4;to>=v?a=v/d:a=to/d,no>=g?i=g/d:i=no/d,["circle","svg","image"].includes(e)?a=i=Math.max(a,i):e==="text"&&(i=a/ja.length*2),n=(0-u+h/2-a*d/2)/d,r=(0-f+p/2-i*d/2)/d}return{x:n,y:r,w:a,h:i}}function bp(e,t,n){const r=mp(e,n);let a={};return e==="rect"?a=lp():e==="circle"?a=cp():e==="text"?a=dp(r):e==="svg"?a=up():e==="image"?a=fp():e==="group"&&(a=hp()),Object.assign(Object.assign(Object.assign({},r),t),{uuid:ln(),type:e,detail:Object.assign(Object.assign({},a),t.detail||{})})}function Su(e,t,n){let r=!1;if(t.length===1){const a=t[0];n.splice(a,0,e),r=!0}else if(t.length>1){let a=n;for(let i=0;i1){let r=t;for(let a=0;a=0;s++)r[s]!==n[s]&&r[s]=0&&(n[o]=n[o]+1),Eu(n,e)}return{elements:e,from:n,to:r}}function wp(e,t){var n;const r=Object.keys(t);for(let a=0;a{e[i][s]=o}),e[i]=[...e[i],...t[i]])))}return e}function qr(e,t,n){var r,a;let i=null;for(let o=0;o0||t.h&&t.h>0)&&xu(s,{w:t.w,h:t.h}),wp(s,t),i=s;break}else s.type==="group"&&(i=qr(e,t,((a=s==null?void 0:s.detail)===null||a===void 0?void 0:a.children)||[]))}return i}function xp(e,t){var n,r,a,i,o,s,c,d,u,f;let h=0,p=0,v=1,g=((r=(n=e==null?void 0:e.elements)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.x)||0,m=((i=(a=e==null?void 0:e.elements)===null||a===void 0?void 0:a[0])===null||i===void 0?void 0:i.y)||0,y=((s=(o=e==null?void 0:e.elements)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.w)||0,b=((d=(c=e==null?void 0:e.elements)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.h)||0;const{width:E,height:w}=t.viewSizeInfo;if(e.layout&&((f=(u=e.layout)===null||u===void 0?void 0:u.detail)===null||f===void 0?void 0:f.overflow)==="hidden"?(g=0,m=0,y=e.layout.w||0,b=e.layout.h||0):e.elements.forEach(S=>{const $={x:S.x,y:S.y,w:S.w,h:S.h,angle:S.angle};if($.angle&&($.angle>0||$.angle<0)){const j=pr($);if(j.length===4){const M=[j[0].x,j[1].x,j[2].x,j[3].x],I=[j[0].y,j[1].y,j[2].y,j[3].y];$.x=Math.min(...M),$.y=Math.min(...I),$.w=Math.abs(Math.max(...M)-Math.min(...M)),$.h=Math.abs(Math.max(...I)-Math.min(...I))}}const D=Math.min($.x,g),B=Math.min($.y,m),H=Math.max($.x+$.w,g+y),G=Math.max($.y+$.h,m+b);g=D,m=B,y=Math.abs(H-D),b=Math.abs(G-B)}),y>0&&b>0){const S=ve(E/y,{decimalPlaces:4}),$=ve(w/b,{decimalPlaces:4});v=Math.min(S,$,1),h=(y*v-E)/2/v+g,p=(b*v-w)/2/v+m}return{offsetX:ve(h,{decimalPlaces:0}),offsetY:ve(p,{decimalPlaces:0}),scale:v}}function Sp(e){let t=0,n=0;if(e){const{viewScaleInfo:a,viewSizeInfo:i}=e,{offsetLeft:o,offsetTop:s,scale:c}=a,{width:d,height:u}=i;t=0-o+d/c/2,n=0-s+u/c/2}return{x:t,y:n}}function No(e,t,n){if(typeof t=="string")return t;const{viewElementSize:r,viewScaleInfo:a,opacity:i=1}=n,{x:o,y:s}=r,{scale:c}=a;if((t==null?void 0:t.type)==="linear-gradient"){const{start:d,end:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c},p={x:o+u.x*c,y:s+u.y*c},v=e.createLinearGradient(h.x,h.y,p.x,p.y);return f.forEach(g=>{v.addColorStop(g.offset,bl(g.color,i))}),v}if((t==null?void 0:t.type)==="radial-gradient"){const{inner:d,outer:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c,radius:d.radius*c},p={x:o+u.x*c,y:s+u.y*c,radius:u.radius*c},v=e.createRadialGradient(h.x,h.y,h.radius,p.x,p.y,p.radius);return f.forEach(g=>{v.addColorStop(g.offset,bl(g.color,i))}),v}return"#000000"}const Lo=mn();function pn(e){var t,n,r,a;let i=1;return((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.opacity)!==void 0&&((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.opacity)>=0&&((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.opacity)<=1&&(i=(a=e==null?void 0:e.detail)===null||a===void 0?void 0:a.opacity),i}function ra(e,t,n){const{pattern:r,renderContent:a,originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c}=n||{},{parentOpacity:d}=n,u=pn(i)*d;Ep(e,t,{originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c,renderContent:()=>{e.globalAlpha=u,Mu(e,t,{pattern:r,viewScaleInfo:s,viewSizeInfo:c}),a==null||a(),Au(e,t,{viewScaleInfo:s,viewSizeInfo:c}),e.globalAlpha=d}})}function Ep(e,t,n){const{renderContent:r,originElem:a,calcElemSize:i,viewSizeInfo:o}=n,s=o.devicePixelRatio,{clipPath:c}=(a==null?void 0:a.detail)||{};if(c&&i&&c.commands){const{x:d,y:u,w:f,h}=i,{originW:p,originH:v,originX:g,originY:m}=c,y=f/p,b=h/v,E=g*y,w=m*b,C=d-E,S=u-w;e.save(),e.translate(C,S),e.scale(s*y,s*b);const $=bu(c.commands||[]),D=new Path2D($);e.clip(D),e.translate(0-C,0-S),e.setTransform(1,0,0,1,0,0),Lt(e,Object.assign({},t),()=>{r==null||r()}),e.restore()}else r==null||r()}function Mu(e,t,n){var r,a;const{pattern:i,viewScaleInfo:o,viewSizeInfo:s}=n,c=[];if(t.detail.background||i){const{x:d,y:u,w:f,h,radiusList:p}=Ri(t,{viewScaleInfo:o,viewSizeInfo:s});if(e.beginPath(),e.moveTo(d+p[0],u),e.arcTo(d+f,u,d+f,u+h,p[1]),e.arcTo(d+f,u+h,d,u+h,p[2]),e.arcTo(d,u+h,d,u,p[3]),e.arcTo(d,u,d+f,u,p[0]),e.closePath(),typeof i=="string")e.fillStyle=i;else if(["CanvasPattern"].includes(jr.type(i)))e.fillStyle=i;else if(typeof t.detail.background=="string")e.fillStyle=t.detail.background;else if(((r=t.detail.background)===null||r===void 0?void 0:r.type)==="linear-gradient"){const v=No(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=v}else if(((a=t.detail.background)===null||a===void 0?void 0:a.type)==="radial-gradient"){const v=No(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});if(e.fillStyle=v,c&&c.length>0)for(let g=0;g<(c==null?void 0:c.length);g++){const m=c[g];m.method==="translate"?e.translate(m.args[0]+d,m.args[1]+u):m.method==="rotate"?e.rotate(...m.args):m.method==="scale"&&e.scale(...m.args)}}e.fill(),c&&c.length>0&&e.setTransform(1,0,0,1,0,0)}}function Au(e,t,n){if(t.detail.borderWidth===0||!si(t.detail.borderColor))return;const{viewScaleInfo:r}=n,{scale:a}=r;let i=Lo.borderColor;si(t.detail.borderColor)===!0&&(i=t.detail.borderColor);const{borderWidth:o,borderRadius:s,borderDash:c,boxSizing:d=Lo.boxSizing}=t.detail;let u=0;typeof o=="number"&&(u=o||1),u=u*a;let f=[0,0,0,0];if(typeof s=="number"){const y=s*a;f=[y,y,y,y]}else Array.isArray(s)&&(s==null?void 0:s.length)===4&&(f=[s[0]*a,s[1]*a,s[2]*a,s[3]*a]);e.strokeStyle=i;let h=[];Array.isArray(c)&&c.length>0&&(h=c.map(y=>Math.ceil(y*a)));let p=0,v=0,g=0,m=0;if(Array.isArray(o)&&(p=(o[0]||0)*a,v=(o[1]||0)*a,g=(o[2]||0)*a,m=(o[3]||0)*a),m||v||p||g){e.lineCap="butt";let{x:y,y:b,w:E,h:w}=t;d==="border-box"?(y=y+m/2,b=b+p/2,E=E-m/2-v/2,w=w-p/2-g/2):d==="content-box"?(y=y-m/2,b=b-p/2,E=E+m/2+v/2,w=w+p/2+g/2):(y=t.x,b=t.y,E=t.w,w=t.h),p&&(e.beginPath(),e.lineWidth=p,e.moveTo(y-m/2,b),e.lineTo(y+E+v/2,b),e.closePath(),e.stroke()),v&&(e.beginPath(),e.lineWidth=v,e.moveTo(y+E,b-p/2),e.lineTo(y+E,b+w+g/2),e.closePath(),e.stroke()),g&&(e.beginPath(),e.lineWidth=g,e.moveTo(y-m/2,b+w),e.lineTo(y+E+v/2,b+w),e.closePath(),e.stroke()),m&&(e.beginPath(),e.lineWidth=m,e.moveTo(y,b-p/2),e.lineTo(y,b+w+g/2),e.closePath(),e.stroke())}else{let{x:y,y:b,w:E,h:w}=t;d==="border-box"?(y=t.x+u/2,b=t.y+u/2,E=t.w-u,w=t.h-u):d==="content-box"?(y=t.x-u/2,b=t.y-u/2,E=t.w+u,w=t.h+u):(y=t.x,b=t.y,E=t.w,w=t.h),h.length>0?e.lineCap="butt":e.lineCap="square",E=Math.max(E,1),w=Math.max(w,1),f=f.map(C=>Math.min(C,E/2,w/2)),e.setLineDash(h),e.lineWidth=u,e.beginPath(),e.moveTo(y+f[0],b),e.arcTo(y+E,b,y+E,b+w,f[1]),e.arcTo(y+E,b+w,y,b+w,f[2]),e.arcTo(y,b+w,y,b,f[3]),e.arcTo(y,b,y+E,b,f[0]),e.closePath(),e.stroke()}e.setLineDash([])}function gr(e,t,n){const{detail:r}=t,{viewScaleInfo:a,renderContent:i}=n,{shadowColor:o,shadowOffsetX:s,shadowOffsetY:c,shadowBlur:d}=r;Fe.number(d)?(e.save(),e.shadowColor=o||Lo.shadowColor,e.shadowOffsetX=(s||0)*a.scale,e.shadowOffsetY=(c||0)*a.scale,e.shadowBlur=(d||0)*a.scale,i(),e.restore()):(e.save(),e.shadowColor="transparent",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,i(),e.restore())}function Cp(e,t,n){const{detail:r,angle:a}=t,{viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{background:c="#000000",borderColor:d="#000000",boxSizing:u,borderWidth:f=0}=r;let h=0;typeof f=="number"&&f>0?h=f:Array.isArray(f)&&typeof f[0]=="number"&&f[0]>0&&(h=f[0]),h=h*i.scale;const{x:p,y:v,w:g,h:m}=et({x:t.x,y:t.y,w:t.w,h:t.h},{viewScaleInfo:i,viewSizeInfo:o})||t,y=Object.assign(Object.assign({},t),{x:p,y:v,w:g,h:m,angle:a});Lt(e,{x:p,y:v,w:g,h:m,angle:a},()=>{gr(e,y,{viewScaleInfo:i,viewSizeInfo:o,renderContent:()=>{let b=g/2,E=m/2;const w=p+b,C=v+E;if(h>0&&(u==="border-box"?(b=b-h,E=E-h):u==="center-line"?(b=b-h/2,E=E-h/2):(b=b-h,E=E-h)),b>=0&&E>=0){const S=pn(y)*s;if(e.globalAlpha=S,typeof h=="number"&&h>0){const D=h/2+b,B=h/2+E;e.beginPath(),e.strokeStyle=d,e.lineWidth=h,e.circle(w,C,D,B,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath();const $=No(e,c,{viewElementSize:{x:p,y:v,w:g,h:m},viewScaleInfo:i,opacity:e.globalAlpha});e.fillStyle=$,e.circle(w,C,b,E,0,0,2*Math.PI),e.closePath(),e.fill(),e.globalAlpha=s}}})})}function Mp(e,t,n){const{viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i}=n,{x:o,y:s,w:c,h:d,angle:u}=et(t,{viewScaleInfo:r,viewSizeInfo:a})||t,f=Object.assign(Object.assign({},t),{x:o,y:s,w:c,h:d,angle:u});Lt(e,{x:o,y:s,w:c,h:d,angle:u},()=>{gr(e,f,{viewScaleInfo:r,viewSizeInfo:a,renderContent:()=>{ra(e,f,{originElem:t,calcElemSize:{x:o,y:s,w:c,h:d,angle:u},viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i,renderContent:()=>{}})}})})}function Ap(e,t,n){const r=n.loader.getContent(t),{viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=et(t,{viewScaleInfo:a,viewSizeInfo:i})||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});Lt(e,{x:s,y:c,w:d,h:u,angle:f},()=>{gr(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{ra(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{if(!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="image"&&r){e.globalAlpha=pn(t)*o;const{x:p,y:v,w:g,h:m,radiusList:y}=Ri(h,{viewScaleInfo:a,viewSizeInfo:i});e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(p+y[0],v),e.arcTo(p+g,v,p+g,v+m,y[1]),e.arcTo(p+g,v+m,p,v+m,y[2]),e.arcTo(p,v+m,p,v,y[3]),e.arcTo(p,v,p+g,v,y[0]),e.closePath(),e.fill(),e.clip(),e.drawImage(r,p,v,g,m),e.globalAlpha=o,e.restore()}}})}})})}function _p(e,t,n){const r=n.loader.getContent(t),{viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=et(t,{viewScaleInfo:a,viewSizeInfo:i})||t;Lt(e,{x:s,y:c,w:d,h:u,angle:f},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="svg"&&r&&(e.globalAlpha=pn(t)*o,e.drawImage(r,s,c,d,u),e.globalAlpha=o)})}function Tp(e,t,n){const r=n.loader.getContent(t),{viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=et(t,{viewScaleInfo:a,viewSizeInfo:i})||t;Lt(e,{x:s,y:c,w:d,h:u,angle:f},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="html"&&r&&(e.globalAlpha=pn(t)*o,e.drawImage(r,s,c,d,u),e.globalAlpha=o)})}const ro=mn();function Op(e,t,n){const{viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i}=n,{x:o,y:s,w:c,h:d,angle:u}=et(t,{viewScaleInfo:r,viewSizeInfo:a})||t,f=Object.assign(Object.assign({},t),{x:o,y:s,w:c,h:d,angle:u});Lt(e,{x:o,y:s,w:c,h:d,angle:u},()=>{ra(e,f,{originElem:t,calcElemSize:{x:o,y:s,w:c,h:d,angle:u},viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i,renderContent:()=>{const h=Object.assign(Object.assign({},ro),t.detail),p=(h.fontSize||ro.fontSize)*r.scale,v=h.lineHeight?h.lineHeight*r.scale:p;e.fillStyle=t.detail.color||ro.color,e.textBaseline="top",e.$setFont({fontWeight:h.fontWeight,fontSize:p,fontFamily:h.fontFamily});const g=h.text.replace(/\r\n/gi,` +`),m=v,y=g.split(` +`),b=[];let E=0;y.forEach((C,S)=>{let $="";if(C.length>0){for(let D=0;Dd));D++)if(C.length-1===D&&(E+1)*m{let D=o;h.textAlign==="center"?D=o+(c-S.width)/2:h.textAlign==="right"&&(D=o+(c-S.width)),e.fillText(S.text,D,C+m*$)})}}})})}function Ip(e,t,n){const{detail:r}=t,{originX:a,originY:i,originW:o,originH:s}=r,{viewScaleInfo:c,viewSizeInfo:d,parentOpacity:u}=n,{x:f,y:h,w:p,h:v,angle:g}=et(t,{viewScaleInfo:c,viewSizeInfo:d})||t,m=p/o,y=v/s,b=a*m,E=i*y,w=f-b,C=h-E,S=c.scale*d.devicePixelRatio,$=Object.assign(Object.assign({},t),{x:f,y:h,w:p,h:v,angle:g});Lt(e,{x:f,y:h,w:p,h:v,angle:g},()=>{ra(e,$,{originElem:t,calcElemSize:{x:f,y:h,w:p,h:v,angle:g},viewScaleInfo:c,viewSizeInfo:d,parentOpacity:u,renderContent:()=>{gr(e,$,{viewScaleInfo:c,viewSizeInfo:d,renderContent:()=>{e.save(),e.translate(w,C),e.scale(S*m/c.scale,S*y/c.scale);const D=bu(r.commands||[]),B=new Path2D(D);r.fill&&(e.fillStyle=r.fill,e.fill(B)),r.stroke&&r.strokeWidth!==0&&(e.strokeStyle=r.stroke,e.lineWidth=(r.strokeWidth||1)/d.devicePixelRatio,e.lineCap=r.strokeLineCap||"square",e.stroke(B)),e.translate(-w,-C),e.restore()}})}})})}function _u(e,t,n){var r;if(((r=t==null?void 0:t.operations)===null||r===void 0?void 0:r.invisible)===!0)return;const{w:a,h:i}=t,{scale:o}=n.viewScaleInfo;if(!(o<1&&(a*o<1||i*o<1)||n.parentOpacity===0))try{switch(t.type){case"rect":{Mp(e,t,n);break}case"circle":{Cp(e,t,n);break}case"text":{Op(e,t,n);break}case"image":{Ap(e,t,n);break}case"svg":{_p(e,t,n);break}case"html":{Tp(e,t,n);break}case"path":{Ip(e,t,n);break}case"group":{const s=Object.assign(Object.assign({},n.elementAssets||{}),t.detail.assets||{});$p(e,t,Object.assign(Object.assign({},n),{elementAssets:s}));break}default:break}}catch(s){console.error(s)}}function $p(e,t,n){const{viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i}=n,{x:o,y:s,w:c,h:d,angle:u}=et({x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle},{viewScaleInfo:r,viewSizeInfo:a})||t,f=Object.assign(Object.assign({},t),{x:o,y:s,w:c,h:d,angle:u});Lt(e,{x:o,y:s,w:c,h:d,angle:u},()=>{e.globalAlpha=pn(t)*i,gr(e,f,{viewScaleInfo:r,viewSizeInfo:a,renderContent:()=>{ra(e,f,{originElem:t,calcElemSize:{x:o,y:s,w:c,h:d,angle:u},viewScaleInfo:r,viewSizeInfo:a,parentOpacity:i,renderContent:()=>{const{x:h,y:p,w:v,h:g,radiusList:m}=Ri(f,{viewScaleInfo:r,viewSizeInfo:a});if(t.detail.overflow==="hidden"&&(e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(h+m[0],p),e.arcTo(h+v,p,h+v,p+g,m[1]),e.arcTo(h+v,p+g,h,p+g,m[2]),e.arcTo(h,p+g,h,p,m[3]),e.arcTo(h,p,h+v,p,m[0]),e.closePath(),e.fill(),e.clip()),Array.isArray(t.detail.children)){const{parentElementSize:y}=n,b={x:y.x+t.x,y:y.y+t.y,w:t.w||y.w,h:t.h||y.h,angle:t.angle},{calculator:E}=n;for(let w=0;w{Mu(e,p,{viewScaleInfo:a,viewSizeInfo:i})}}),t.detail.overflow==="hidden"){const{viewScaleInfo:v,viewSizeInfo:g}=n,m=Object.assign({uuid:"layout",type:"group",x:0,y:0},t),y=et(m,{viewScaleInfo:v,viewSizeInfo:g})||m,b=Object.assign(Object.assign({},m),y),{x:E,y:w,w:C,h:S,radiusList:$}=Ri(b,{viewScaleInfo:v,viewSizeInfo:g});e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(E+$[0],w),e.arcTo(E+C,w,E+C,w+S,$[1]),e.arcTo(E+C,w+S,E,w+S,$[2]),e.arcTo(E,w+S,E,w,$[3]),e.arcTo(E,w,E+C,w,$[0]),e.closePath(),e.fill(),e.clip()}r(e),t.detail.overflow==="hidden"&&e.restore(),Au(e,p,{viewScaleInfo:a,viewSizeInfo:i}),e.globalAlpha=o}var ao=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},ge=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Tr=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},st,Xr,sr,ot,zt,ka,io,xl,Sl,El,Tu,Ou;const zp=["image","svg","html"],kr=e=>{var t,n,r;let a=null;return e.type==="image"?a=((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.src)||null:e.type==="svg"?a=((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.svg)||null:e.type==="html"&&(a=((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.html)||null),typeof a=="string"&&a?cn(a)?a:hr(a):hr(`${ln()}-${e.uuid}-${ln()}-${ln()}`)};class Dp extends fn{constructor(){super(),st.add(this),Xr.set(this,{}),sr.set(this,{}),ot.set(this,{}),zt.set(this,!1),ge(this,st,"m",ka).call(this,"image",(t,n)=>ao(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.src])===null||r===void 0?void 0:r.value)||t.detail.src,i=yield Oi(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}})),ge(this,st,"m",ka).call(this,"html",(t,n)=>ao(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.html])===null||r===void 0?void 0:r.value)||t.detail.html,i=yield M0(a,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:i}})),ge(this,st,"m",ka).call(this,"svg",(t,n)=>ao(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.svg])===null||r===void 0?void 0:r.value)||t.detail.svg,i=yield E0(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}}))}isDestroyed(){return ge(this,zt,"f")}destroy(){Tr(this,zt,!0,"f"),this.clear(),Tr(this,Xr,null,"f"),Tr(this,sr,null,"f"),Tr(this,ot,null,"f")}load(t,n){ge(this,zt,"f")!==!0&&(ge(this,st,"m",Ou).call(this,t)||zp.includes(t.type)&&ge(this,st,"m",Tu).call(this,t,n))}getContent(t){var n,r;const a=kr(t);return((r=(n=ge(this,ot,"f"))===null||n===void 0?void 0:n[a])===null||r===void 0?void 0:r.content)||null}getLoadItemMap(){return ge(this,ot,"f")}setLoadItemMap(t){Tr(this,ot,t,"f")}}Xr=new WeakMap,sr=new WeakMap,ot=new WeakMap,zt=new WeakMap,st=new WeakSet,ka=function(t,n){ge(this,Xr,"f")[t]=n},io=function(t){var n,r,a;let i=null;return t.type==="image"?i=((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.src)||null:t.type==="svg"?i=((r=t==null?void 0:t.detail)===null||r===void 0?void 0:r.svg)||null:t.type==="html"&&(i=((a=t==null?void 0:t.detail)===null||a===void 0?void 0:a.html)||null),i},xl=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:ge(this,st,"m",io).call(this,t)}},Sl=function(t){const n=kr(t.element),r=ge(this,ot,"f")[n];ge(this,zt,"f")||(r?r.startTime{ge(this,zt,"f")||(r.content=o.content,r.endTime=Date.now(),r.status="load",ge(this,st,"m",Sl).call(this,r))}).catch(o=>{console.warn(`Load element source "${r.source}" fail`,o,t),r.endTime=Date.now(),r.status="error",r.error=o,ge(this,st,"m",El).call(this,r)}))},Ou=function(t){var n;const r=kr(t),a=(n=ge(this,sr,"f"))===null||n===void 0?void 0:n[r];return!!(a&&a.status==="error"&&a.source&&a.source===ge(this,st,"m",io).call(this,t))};var Or=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ft=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},jo,Gt,Pt,Ba,Iu;class $u extends fn{constructor(t){super(),jo.add(this),Gt.set(this,void 0),Pt.set(this,new Dp),Ba.set(this,!1),Or(this,Gt,t,"f"),ft(this,jo,"m",Iu).call(this)}isDestroyed(){return ft(this,Ba,"f")}destroy(){this.clear(),Or(this,Gt,null,"f"),ft(this,Pt,"f").destroy(),Or(this,Pt,null,"f"),Or(this,Ba,!0,"f")}updateOptions(t){Or(this,Gt,t,"f")}drawData(t,n){const r=ft(this,Pt,"f"),{calculator:a}=ft(this,Gt,"f"),i=ft(this,Gt,"f").viewContext;i.clearRect(0,0,i.canvas.width,i.canvas.height);const o={x:0,y:0,w:n.viewSizeInfo.width,h:n.viewSizeInfo.height},s=Object.assign({loader:r,calculator:a,parentElementSize:o,elementAssets:t.assets,parentOpacity:1},n);t.layout?Rp(i,t.layout,s,()=>{wl(i,t,s)}):wl(i,t,s)}scale(t){const{sharer:n}=ft(this,Gt,"f");if(!n)return;const{data:r,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s,width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}=n.getActiveStoreSnapshot();r&&this.drawData(r,{viewScaleInfo:{scale:t,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s},viewSizeInfo:{width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}})}setLoadItemMap(t){ft(this,Pt,"f").setLoadItemMap(t)}getLoadItemMap(){return ft(this,Pt,"f").getLoadItemMap()}getLoader(){return ft(this,Pt,"f")}}Gt=new WeakMap,Pt=new WeakMap,Ba=new WeakMap,jo=new WeakSet,Iu=function(){const t=ft(this,Pt,"f");t.on("load",n=>{this.trigger("load",n)}),t.on("error",n=>{console.error(n)})};var oo=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ve=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Nn,Be;class Pu{constructor(t){Nn.set(this,void 0),Be.set(this,void 0),oo(this,Nn,t,"f"),oo(this,Be,new hn({defaultStorage:{viewVisibleInfoMap:{},visibleCount:0,invisibleCount:0}}),"f")}toGridNum(t,n){return(n==null?void 0:n.ignore)===!0?t:Math.round(t)}destroy(){oo(this,Nn,null,"f")}needRender(t){const r=Ve(this,Be,"f").get("viewVisibleInfoMap")[t.uuid];return r?r.isVisibleInView:!0}isPointInElement(t,n,r,a){const i=Ve(this,Nn,"f").viewContext;return Do(t,{context2d:i,element:n,viewScaleInfo:r,viewSizeInfo:a})}getPointElement(t,n){const r=Ve(this,Nn,"f").viewContext;return ap(t,Object.assign(Object.assign({},n),{context2d:r}))}resetViewVisibleInfoMap(t,n){if(t){const{viewVisibleInfoMap:r,invisibleCount:a,visibleCount:i}=ip(t.elements,n);Ve(this,Be,"f").set("viewVisibleInfoMap",r),Ve(this,Be,"f").set("invisibleCount",a),Ve(this,Be,"f").set("visibleCount",i)}}updateVisiableStatus(t){const{viewVisibleInfoMap:n,invisibleCount:r,visibleCount:a}=mu(Ve(this,Be,"f").get("viewVisibleInfoMap"),t);Ve(this,Be,"f").set("viewVisibleInfoMap",n),Ve(this,Be,"f").set("invisibleCount",r),Ve(this,Be,"f").set("visibleCount",a)}calcViewRectInfoFromOrigin(t,n){const r=Ve(this,Be,"f").get("viewVisibleInfoMap")[t];if(!(r!=null&&r.originRectInfo))return null;const{checkVisible:a,viewScaleInfo:i,viewSizeInfo:o}=n,{center:s,left:c,right:d,bottom:u,top:f,topLeft:h,topRight:p,bottomLeft:v,bottomRight:g}=r.originRectInfo;if(a===!0&&r.isVisibleInView===!1)return null;const m={viewScaleInfo:i,viewSizeInfo:o};return{center:fe(s,m),left:fe(c,m),right:fe(d,m),bottom:fe(u,m),top:fe(f,m),topLeft:fe(h,m),topRight:fe(p,m),bottomLeft:fe(v,m),bottomRight:fe(g,m)}}calcViewRectInfoFromRange(t,n){const r=Ve(this,Be,"f").get("viewVisibleInfoMap")[t];if(!(r!=null&&r.originRectInfo))return null;const{checkVisible:a,viewScaleInfo:i,viewSizeInfo:o}=n,{center:s,left:c,right:d,bottom:u,top:f,topLeft:h,topRight:p,bottomLeft:v,bottomRight:g}=r.rangeRectInfo;if(a===!0&&r.isVisibleInView===!1)return null;const m={viewScaleInfo:i,viewSizeInfo:o};return{center:fe(s,m),left:fe(c,m),right:fe(d,m),bottom:fe(u,m),top:fe(f,m),topLeft:fe(h,m),topRight:fe(p,m),bottomLeft:fe(v,m),bottomRight:fe(g,m)}}modifyViewVisibleInfoMap(t,n){const{modifyOptions:r,viewScaleInfo:a,viewSizeInfo:i}=n,{type:o,content:s}=r,c=t.elements,d=Ve(this,Be,"f").get("viewVisibleInfoMap");if(o==="deleteElement"){const{element:u}=s;delete d[u.uuid]}else if(o==="addElement"||o==="updateElement"){const{position:u}=s,f=mt(u,t.elements),h=fu(c,u);if(f){const p=gu(f,{groupQueue:h||[]}),v={originRectInfo:p,rangeRectInfo:Fe.angle(f.angle)?vu(p):p,isVisibleInView:!0,isGroup:(f==null?void 0:f.type)==="group",position:[...u]};d[f.uuid]=v,o==="updateElement"&&this.updateVisiableStatus({viewScaleInfo:a,viewSizeInfo:i})}}else o==="moveElement"&&this.resetViewVisibleInfoMap(t,{viewScaleInfo:a,viewSizeInfo:i});Ve(this,Be,"f").set("viewVisibleInfoMap",d)}}Nn=new WeakMap,Be=new WeakMap;var so=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ne=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Ee,lr,at,Fa,Ru,Ha,Va,Wa,Ga,Ya,Ua,Xa,Za,Ot,It,tn;function Cl(e){return e>0||e<0||e===0}class Np extends fn{constructor(t){super(),Ee.add(this),lr.set(this,void 0),at.set(this,void 0),Fa.set(this,!1),Ha.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;const a=ne(this,Ee,"m",It).call(this,r);if(!ne(this,Ee,"m",tn).call(this,a))return;r.preventDefault(),r.stopPropagation();const i=r.deltaX>0||r.deltaX<0?r.deltaX:0,o=r.deltaY>0||r.deltaY<0?r.deltaY:0;r.ctrlKey===!0&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:o,point:a}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:o,point:a})}),Va.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);ne(this,Ee,"m",tn).call(this,a)}),Wa.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);if(!ne(this,Ee,"m",tn).call(this,a))return;const i=500,o=Date.now(),s=ne(this,at,"f").get("prevClickPoint");s&&o-s.t<=i&&Math.abs(s.x-a.x)<=5&&Math.abs(s.y-a.y)<=5?this.trigger("doubleClick",{point:a}):ne(this,at,"f").set("prevClickPoint",a)}),Ga.set(this,r=>{if(ne(this,at,"f").set("hasPointDown",!1),!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);this.trigger("pointLeave",{point:a})}),Ya.set(this,r=>{if(ne(this,at,"f").set("hasPointDown",!1),!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);this.trigger("pointEnd",{point:a})}),Ua.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault(),r.stopPropagation();const a=ne(this,Ee,"m",It).call(this,r);if(!ne(this,Ee,"m",tn).call(this,a)){ne(this,at,"f").get("hasPointDown")&&(this.trigger("pointLeave",{point:a}),ne(this,at,"f").set("hasPointDown",!1));return}ne(this,at,"f").get("hasPointDown")===!0&&this.trigger("pointMove",{point:a})}),Xa.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);ne(this,Ee,"m",tn).call(this,a)&&(ne(this,at,"f").set("hasPointDown",!0),this.trigger("pointStart",{point:a}))}),Za.set(this,r=>{if(!ne(this,Ee,"m",Ot).call(this,r))return;r.preventDefault();const a=ne(this,Ee,"m",It).call(this,r);ne(this,Ee,"m",tn).call(this,a)&&this.trigger("hover",{point:a})});const n=new hn({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});so(this,at,n,"f"),so(this,lr,t,"f"),ne(this,Ee,"m",Ru).call(this)}onEvents(){if(ne(this,Fa,"f"))return;const t=window;t.addEventListener("mousemove",ne(this,Za,"f")),t.addEventListener("mousedown",ne(this,Xa,"f")),t.addEventListener("mousemove",ne(this,Ua,"f")),t.addEventListener("mouseup",ne(this,Ya,"f")),t.addEventListener("mouseleave",ne(this,Ga,"f")),t.addEventListener("wheel",ne(this,Ha,"f"),{passive:!1}),t.addEventListener("click",ne(this,Wa,"f")),t.addEventListener("contextmenu",ne(this,Va,"f"))}offEvents(){const t=window;t.removeEventListener("mousemove",ne(this,Za,"f")),t.removeEventListener("mousedown",ne(this,Xa,"f")),t.removeEventListener("mousemove",ne(this,Ua,"f")),t.removeEventListener("mouseup",ne(this,Ya,"f")),t.removeEventListener("mouseleave",ne(this,Ga,"f")),t.removeEventListener("wheel",ne(this,Ha,"f")),t.removeEventListener("click",ne(this,Wa,"f")),t.removeEventListener("contextmenu",ne(this,Va,"f"))}destroy(){this.offEvents(),ne(this,at,"f").destroy(),so(this,Fa,!0,"f")}}lr=new WeakMap,at=new WeakMap,Fa=new WeakMap,Ha=new WeakMap,Va=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Xa=new WeakMap,Za=new WeakMap,Ee=new WeakSet,Ru=function(){this.onEvents()},Ot=function(t){return t.target===ne(this,lr,"f").boardContent.boardContext.canvas},It=function(t){const r=ne(this,lr,"f").boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top,t:Date.now()}},tn=function(t){const n=ne(this,lr,"f").sharer.getActiveViewSizeInfo(),{width:r,height:a}=n;return!!(Cl(t.x)&&Cl(t.y)&&t.x<=r&&t.y<=a)};var Ml=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ye=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},we,Ln;const Lp={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0};class jp{constructor(){we.set(this,void 0),Ln.set(this,void 0);const t=new hn({defaultStorage:Lp}),n=new hn({defaultStorage:{}});Ml(this,we,t,"f"),Ml(this,Ln,n,"f")}getActiveStorage(t){return ye(this,we,"f").get(t)}setActiveStorage(t,n){return ye(this,we,"f").set(t,n)}getActiveStoreSnapshot(t){return ye(this,we,"f").getSnapshot(t)}getSharedStorage(t){return ye(this,Ln,"f").get(t)}setSharedStorage(t,n){return ye(this,Ln,"f").set(t,n)}getSharedStoreSnapshot(t){return ye(this,Ln,"f").getSnapshot(t)}getActiveViewScaleInfo(){return{scale:ye(this,we,"f").get("scale"),offsetTop:ye(this,we,"f").get("offsetTop"),offsetBottom:ye(this,we,"f").get("offsetBottom"),offsetLeft:ye(this,we,"f").get("offsetLeft"),offsetRight:ye(this,we,"f").get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:n,offsetTop:r,offsetBottom:a,offsetLeft:i,offsetRight:o}=t;ye(this,we,"f").set("scale",n),ye(this,we,"f").set("offsetTop",r),ye(this,we,"f").set("offsetBottom",a),ye(this,we,"f").set("offsetLeft",i),ye(this,we,"f").set("offsetRight",o)}setActiveViewSizeInfo(t){ye(this,we,"f").set("width",t.width),ye(this,we,"f").set("height",t.height),ye(this,we,"f").set("devicePixelRatio",t.devicePixelRatio),ye(this,we,"f").set("contextWidth",t.contextWidth),ye(this,we,"f").set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:ye(this,we,"f").get("width"),height:ye(this,we,"f").get("height"),devicePixelRatio:ye(this,we,"f").get("devicePixelRatio"),contextWidth:ye(this,we,"f").get("contextWidth"),contextHeight:ye(this,we,"f").get("contextHeight")}}}we=new WeakMap,Ln=new WeakMap;var Qa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Pe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Zr,Le,cr,jn,zu,Du;const{requestAnimationFrame:kp}=window;class Bp extends fn{constructor(t){super(),Zr.add(this),Le.set(this,void 0),cr.set(this,[]),jn.set(this,"FREE"),Qa(this,Le,t,"f"),Pe(this,Zr,"m",zu).call(this)}resetViewVisibleInfoMap(t,n){t&&Pe(this,Le,"f").calculator.resetViewVisibleInfoMap(t,n)}drawFrame(){const{sharer:t}=Pe(this,Le,"f"),n=t.getActiveStoreSnapshot(),r=t.getSharedStoreSnapshot();Pe(this,cr,"f").push({activeStore:n,sharedStore:r}),Pe(this,Zr,"m",Du).call(this)}scale(t){const{scale:n,point:r,ignoreUpdateVisibleStatus:a}=t,{sharer:i}=Pe(this,Le,"f"),{moveX:o,moveY:s}=np({scale:n,point:r,viewScaleInfo:i.getActiveViewScaleInfo(),viewSizeInfo:i.getActiveViewSizeInfo()});return i.setActiveStorage("scale",n),a||Pe(this,Le,"f").calculator.updateVisiableStatus({viewScaleInfo:i.getActiveViewScaleInfo(),viewSizeInfo:i.getActiveViewSizeInfo()}),{moveX:o,moveY:s}}scroll(t){const{sharer:n}=Pe(this,Le,"f"),r=n.getActiveViewScaleInfo(),{moveX:a,moveY:i,ignoreUpdateVisibleStatus:o}=t,s=n.getActiveViewSizeInfo(),c=rp({moveX:a,moveY:i,viewScaleInfo:r,viewSizeInfo:s});return n.setActiveViewScaleInfo(c),o||Pe(this,Le,"f").calculator.updateVisiableStatus({viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}),c}updateViewScaleInfo(t){const{sharer:n}=Pe(this,Le,"f"),r=tp(t,{viewSizeInfo:n.getActiveViewSizeInfo()});return n.setActiveViewScaleInfo(r),Pe(this,Le,"f").calculator.updateVisiableStatus({viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}),r}resize(t={},n){const{sharer:r}=Pe(this,Le,"f"),a=r.getActiveViewSizeInfo(),i=Object.assign(Object.assign({},a),t),{width:o,height:s,devicePixelRatio:c}=i,{underContext:d,boardContext:u,helperContext:f,viewContext:h}=Pe(this,Le,"f").boardContent;return u.canvas.width=o*c,u.canvas.height=s*c,u.canvas.style.width=`${o}px`,u.canvas.style.height=`${s}px`,d.canvas.width=o*c,d.canvas.height=s*c,f.canvas.width=o*c,f.canvas.height=s*c,h.canvas.width=o*c,h.canvas.height=s*c,r.setActiveViewSizeInfo(i),n!=null&&n.ignoreUpdateVisibleStatus||Pe(this,Le,"f").calculator.updateVisiableStatus({viewScaleInfo:r.getActiveViewScaleInfo(),viewSizeInfo:r.getActiveViewSizeInfo()}),i}}Le=new WeakMap,cr=new WeakMap,jn=new WeakMap,Zr=new WeakSet,zu=function(){const{renderer:t}=Pe(this,Le,"f");t.on("load",()=>{this.drawFrame()})},Du=function e(){if(Pe(this,jn,"f")==="DRAWING"||Pe(this,cr,"f").length===0)return;Qa(this,jn,"DRAWING","f");const t=Pe(this,cr,"f").shift(),{renderer:n,boardContent:r,beforeDrawFrame:a,afterDrawFrame:i}=Pe(this,Le,"f");if(t){const{scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u,width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g}=t.activeStore,m={scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u},y={width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g};t!=null&&t.activeStore.data&&n.drawData(t.activeStore.data,{viewScaleInfo:m,viewSizeInfo:y}),a({snapshot:t}),r.drawView(),i({snapshot:t})}if(Pe(this,cr,"f").length===0){Qa(this,jn,"COMPLETE","f");return}Qa(this,jn,"DRAWING","f")&&kp(()=>{Pe(this,Zr,"m",e).call(this)})};var Yt=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Re,kn,Rt,ui,ue,De,dr,St,Xe,Bn,ur,Ka,Nu,Al,_l,Tl,Ol,Il,$l,Pl,Rl,zl,Dl,Lu,ju,ku,Br;class Fp{constructor(t){Re.add(this),kn.set(this,void 0),Rt.set(this,new WeakMap),ui.set(this,[]),ue.set(this,[]),De.set(this,void 0),dr.set(this,void 0),St.set(this,void 0),Xe.set(this,void 0),Bn.set(this,void 0),ur.set(this,new fn),Ka.set(this,!1);const{boardContent:n}=t,r=new jp,a=new Pu({viewContext:n.viewContext}),i=new Np({boardContent:n,sharer:r}),o=new $u({viewContext:n.viewContext,sharer:r,calculator:a});Yt(this,kn,t,"f"),Yt(this,St,r,"f"),Yt(this,De,i,"f"),Yt(this,dr,o,"f"),Yt(this,Bn,a,"f"),Yt(this,Xe,new Bp({boardContent:t.boardContent,sharer:r,renderer:o,calculator:W(this,Bn,"f"),beforeDrawFrame:s=>{W(this,Re,"m",ju).call(this,s)},afterDrawFrame:s=>{W(this,Re,"m",ku).call(this,s)}}),"f"),W(this,Re,"m",Nu).call(this),W(this,Re,"m",Br).call(this)}isDestroyed(){return W(this,Ka,"f")}destroy(){W(this,De,"f").destroy(),W(this,dr,"f").destroy(),W(this,Bn,"f").destroy(),W(this,ur,"f").destroy(),Yt(this,Ka,!0,"f")}getSharer(){return W(this,St,"f")}getViewer(){return W(this,Xe,"f")}getRenderer(){return W(this,dr,"f")}setData(t,n){const{modifiedOptions:r}=n||{},a=W(this,St,"f");W(this,St,"f").setActiveStorage("data",t);const i=a.getActiveViewSizeInfo(),o=a.getActiveViewScaleInfo(),s=cu(t.elements,{viewWidth:i.width,viewHeight:i.height,extend:!0});r?W(this,Xe,"f").resetViewVisibleInfoMap(t,{viewSizeInfo:i,viewScaleInfo:o}):W(this,Xe,"f").resetViewVisibleInfoMap(t,{viewSizeInfo:i,viewScaleInfo:o}),W(this,Xe,"f").drawFrame();const c=Object.assign(Object.assign({},i),s);return W(this,St,"f").setActiveViewSizeInfo(c),{viewSizeInfo:c}}getData(){const{data:t}=W(this,St,"f").getActiveStoreSnapshot();return t}use(t){var n,r,a;if(W(this,Rt,"f").has(t)){const h=W(this,Rt,"f").get(t);if(h){(r=(n=h.middlewareObject).use)===null||r===void 0||r.call(n),h.status="enable",W(this,Rt,"f").set(t,h),W(this,Re,"m",Br).call(this);return}}const{boardContent:i,container:o}=W(this,kn,"f"),s=W(this,St,"f"),c=W(this,Xe,"f"),d=W(this,Bn,"f"),u=W(this,ur,"f"),f=t({boardContent:i,sharer:s,viewer:c,calculator:d,eventHub:u,container:o});(a=f.use)===null||a===void 0||a.call(f),W(this,ui,"f").push(t),W(this,ue,"f").push(f),W(this,Rt,"f").set(t,{status:"enable",middlewareObject:f}),W(this,Re,"m",Br).call(this)}disuse(t){var n,r;const a=W(this,Rt,"f").get(t);a&&((r=(n=a.middlewareObject).disuse)===null||r===void 0||r.call(n),a.status="disable",W(this,Rt,"f").set(t,a),W(this,Re,"m",Br).call(this))}scale(t){const n=W(this,Xe,"f"),{ignoreUpdateVisibleStatus:r}=t,{moveX:a,moveY:i}=n.scale(Object.assign(Object.assign({},t),{ignoreUpdateVisibleStatus:!0}));n.scroll({moveX:a,moveY:i,ignoreUpdateVisibleStatus:r})}scroll(t){return W(this,Xe,"f").scroll(t)}updateViewScaleInfo(t){return W(this,Xe,"f").updateViewScaleInfo(t)}resize(t,n){const r=W(this,Xe,"f").resize(t,n),{width:a,height:i,devicePixelRatio:o}=t,{boardContent:s}=W(this,kn,"f");s.viewContext.$resize({width:a,height:i,devicePixelRatio:o}),s.helperContext.$resize({width:a,height:i,devicePixelRatio:o}),s.boardContext.$resize({width:a,height:i,devicePixelRatio:o}),s.underContext.$resize({width:a,height:i,devicePixelRatio:o}),W(this,Xe,"f").drawFrame(),W(this,De,"f").trigger("resize",r),W(this,St,"f").setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=W(this,kn,"f"),{underContext:n,helperContext:r,viewContext:a,boardContext:i}=t;n.clearRect(0,0,n.canvas.width,n.canvas.height),r.clearRect(0,0,r.canvas.width,r.canvas.height),a.clearRect(0,0,a.canvas.width,a.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),W(this,Re,"m",Lu).call(this)}getEventHub(){return W(this,ur,"f")}onWatcherEvents(){W(this,De,"f").onEvents()}offWatcherEvents(){W(this,De,"f").offEvents()}}kn=new WeakMap,Rt=new WeakMap,ui=new WeakMap,ue=new WeakMap,De=new WeakMap,dr=new WeakMap,St=new WeakMap,Xe=new WeakMap,Bn=new WeakMap,ur=new WeakMap,Ka=new WeakMap,Re=new WeakSet,Nu=function(){W(this,De,"f").on("pointStart",W(this,Re,"m",Al).bind(this)),W(this,De,"f").on("pointEnd",W(this,Re,"m",_l).bind(this)),W(this,De,"f").on("pointMove",W(this,Re,"m",Tl).bind(this)),W(this,De,"f").on("hover",W(this,Re,"m",Ol).bind(this)),W(this,De,"f").on("wheel",W(this,Re,"m",$l).bind(this)),W(this,De,"f").on("wheelScale",W(this,Re,"m",Pl).bind(this)),W(this,De,"f").on("scrollX",W(this,Re,"m",Rl).bind(this)),W(this,De,"f").on("scrollY",W(this,Re,"m",zl).bind(this)),W(this,De,"f").on("resize",W(this,Re,"m",Dl).bind(this)),W(this,De,"f").on("doubleClick",W(this,Re,"m",Il).bind(this)),W(this,dr,"f").on("load",()=>{W(this,ur,"f").trigger("loadResource")})},Al=function(t){var n;for(let r=0;r{const a=n.get(r);(a==null?void 0:a.status)==="enable"&&(a!=null&&a.middlewareObject)&&t.push(a.middlewareObject)}),Yt(this,ue,t,"f")};const Hp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MDc6MjYrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjliMGM0MzI2LWU4ZTQtNDlkNy04MmUzLTgxODkwYTE2ZmU1YSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjMzOGFhZDBmLWZkZjMtODE0MS1iMTZmLWNiZWIzNTQyYTJhMCIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjUwODAxNzc1LWZlNGEtNDQyMy05NDQ3LThkYWRhNzZhYTllOSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NTA4MDE3NzUtZmU0YS00NDIzLTk0NDctOGRhZGE3NmFhOWU5IiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjA3OjI2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6OWIwYzQzMjYtZThlNC00OWQ3LTgyZTMtODE4OTBhMTZmZTVhIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7W6XrzAAAGLklEQVRYhb2Xf2iUdRzHX/txtfXLplZ6Wblm6fzRmG6r7Uou1AxKRjQKYUqgaLBACFogppcK1h8aLRkMSYaJIA5hYMomZpskEfPOufCaDpZ6t7rbre263U3vzn3643meu+eu3XNzvz7w4bbdc/e89nl/Pu/v50HUCAQCx1tbW0uAx4CHgSwggxkKERkziUQif2mQ0WjU53a7vwSeBB4BTEDmTICmBBwYGDivVlDjlFAo9KvT6dwIPAHkANkq6MwDXr169bCISENDg9TX14s+BgcHf2hubi5mBmRPCXj06NFPREQ6OjoEkPLycrl06VIMMhKJeFwu1xdMs+wpAYuLi9eIiIyOjkpeXp4AAsj27dvF7/fHQIPB4C9dXV0fME2ypwQEXvX7/bdFRNauXRsDBMRkMsnhw4cTZB8YGGhsamp6hSmW3Qhw1Y0bN86LiNTW1iYAallWViZtbW162ftcLtdO/i/7tAAWtba2ficicvLkyTEBtdy6dasMDg7GQIeHh9s7OzvfBx5nkrIbAS7du3fvxyIiPT09hoBa1tXVJcv+fWNj4zLgUeAhJiC7EeDLwOsiMioisnDhwnFBrlixQi5evKiX/c6tW7c+R5E9lweU3QjwReDV/v7+bhGRqqqqcQFquWnTJvH5fHrZLzocjkoSZU9bTSPA54GV165daxYROXDgwAMBannw4MFk2RsaGhqWME7ZjQDNwIrTp09/JSLS0tIyIUBACgoK5MKFCzHIcDj85+3btz8FZpFGdiPAZ4DCmpqaTSIiPp9vwoBaVlVVidfr1ct+/sqVK+9iILsR4FzgJcASDoeHRUSKioomDQnI/v37E2T3+Xz1hw4dWjSW7EaAeUA+UNbX12cXEdmyZcuUAAJiNpvlzJkzetl73G53rVrN2EmUCjATuA9EgYjL5eoGKCkpGatNHijmz5/Pxo0b2blzJ2azOfZ3k8lUYDabv45Go/Y7d+6sIY0VZQOjGqDT6bxeWlrKqlWrJgRlsVhYv349FRUVWCwWcnJyEt4PBoOuoaEhu9frvdzR0fHTtm3buolvRpLqe3OBp4EllZWV74mIRKNRyc3NTSvf7Nmzpbq6Wk6cOCFut1uSY2RkJOB0Ou3Nzc3Ha2trPwPWAGXAEuBZFFPPAbKMevBhYA6wCKgIBoP9IiKrV682hLPZbP8DEpH7vb29N1paWn602WwHFyxYsAX4EKgE3gIsQBFQgOIeT6j3z0wFqEkc60OPx9Odn58/t6SkhPb29jFLbrVa2bNnDwBer7fv5s2bPQ6Ho7upqcnZ1tbmASJq3gPC6utdYESXYfWeo6mkBaUHRQ/odrv/yM/Pt5SWlqb8kAbncDh+W7lyZYN683u6DOvAwipsOOnniA4wZf9lqhdoVYzY7fbrQMpBsdlsWK1WRkZGAtXV1d8D/wA+wKNLr5o+YEC9ZggIAEHiFbyfDhCUCcoFngIWFxYWrtMaat68eQl9V15eHmu2+vr6OuAd4A2gGFgMLERp/mdQ+noWyuadi9Jr2aQ4k42GBPXDs1Ga97WhoaFbIiIbNmxIANTWq87Ozp9VuApgGfACihPkoRjwI+p3mlSgtA9ZRkYNYwwKJBr2rl27sFqthEKhwZqamqOAX5f/AsPE5btLvM/GJWO6yFb/82eBonPnztWJiJw9e1YAWb58eUzaI0eOfAO8CbwCPIfiZZN+eEoncSaKLPOApbt3794uIuL1ehOktdvtF4C3gRKURXcOSn9lTRRsvIAZKI4+l/gjQFREZMeOHSIiEggE+tetW/cRitkuRhmERxnnxjxZQFDWnzzURwCv1+vUHxHHjh37lri0C1Am9KGpgDMC1G8SQnxxCHs8Hqf2RldX10+bN28+i+JjwyT62KSaP13oAfWTHO7t7f0dIBQK/b1v375GlEnVjPYuyoQaHlNTDahVMALca29vdwBcvnz5+KlTp26OATft1UuODBS7yEOxj0K/329HOSWWopjxlE1tchhtM7FriPfgXSDDbrfXo0gbJr4QzIi0WiRPYBbKZJrUV23b0dYn7XSYcsBkS9EiO/k6lApq1cwiPjzaAM1Y9cYC1G6uAWrPCtrvMwoHqU02Q5caIEzj1KaS+D+vIjxtLug31gAAAABJRU5ErkJggg==",Bu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MzE6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0MTBhYjUzLWM0ZjEtNDVhNS04MjhkLTIxOTczOWFjOTk3MSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjBkMDNmNjM5LTE5MzctY2Y0MC1hMTg0LTIyMjg0NzczNWNmYSIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjgyYjQwZGRmLWE0ZGEtNDY3MC1iYzc2LTBhYjY3ZmI5M2I0ZSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODJiNDBkZGYtYTRkYS00NjcwLWJjNzYtMGFiNjdmYjkzYjRlIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjMxOjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NjQxMGFiNTMtYzRmMS00NWE1LTgyOGQtMjE5NzM5YWM5OTcxIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz57vRudAAAEk0lEQVRYhe3ZW0jbVxzA8e8/MX+NYnG9uI4xE3bvoLt0FzradRfGBtsYo32YdAhb6WQyBqV7KOylpYjzZShDGfjmyxgbgjjwyRm16SYMhgiNKDhbL3VtNF4xJOnf3x7+59i/Wf4aTbInf3AwJMdzPjnnf/n9/jFEhGzDMIxMb3uAIsDs6ek5urS05Dtz5syE+uwekAQS6u89YD19gC0NIpJ1c8GZQHlXV9fJRCIxGo/HxxoaGj4CngWOAEGgEihXfT07MeQC3MB1dna+lkgkRkXF6urq3xcuXPgUOAE8DzwGPOiGLARwEy4ej4+JiITD4elr167NiIgsLi7eqq2trQPeBI4Bj7sh8w10xZmmeds0zdn+/v5/RERisdjUuXPnvgLeAl50Q+YTaAA+oKy7u/uE3laNAwSQ4uLiu6FQ6G4G5DG13YeAMjWWkU+gBygJhULHNe769etTTpwDGXUiz58//yXwujp5qoAHgBLAk0+gNxKJHEulUiMKN2ma5gwgPp/vjhOXjlxYWJisq6urBV5RW30IKAW8eQPGYrGjlmXdEBEZHBy8aZrmFCCmac729fVtAHt7e6MO5N2+vr47IiJLS0s3L126dBZ4Sh2LZUBRwVdwYGBgVuwOYh/zsoF0bnPBVzDTMRgOh6dFhROokSIi8/Pz0+pEeaPQx+DGWdzV1XVSX2LcgCIic3NzMzU1NV8D7wIvq9WrLNRZvOk62NHRccqJTAdGo9Hb1dXV3wAfYt9VjgAPFfI66EQWAxU9PT0fuwEvXrzYBJwF3gFeAAJAhfrfrO4k/7lxZxnr2JlJqry8POnWyePx6H4JR0vhktVkHGOXQI20SkpKLLcOhmGsA5YCaZiVLS5XoADi9XpdkznDMERhnE0fCgUHZhvOW+CO4/8A5hR7wFxjD5hr7AFzjZyBlmVlrOYdYaS1HUUuQA/gWV9fd51URDyqn1c1j6MVFGjoidfW1oq2ABrYj0V82OmVzwHNajVdB88C5wOKTdM87NaxsrKyQsFKHC2BnTDo+/TWt8Bd5INeVC44NDT0xXYZdXNz8w/AaeyS8yjwCPdzQu92ht2m/OUjIyOfS1pkAoqItLS0fA+8D7wKPA0cxs6qC1O4T0xMfKYnb21tnXEDNjc3z+nXbW1t3wFvYz9dCAL7KUThHovFPtGTNjU1jQFSX18/lg68cuXKLUAaGxs3vkB7e/u3wHHgCQpUdnpTqdQvesJgMDisUVevXh3Xry9fvnxTv66qqprQ/cfHx/vVNj/J/couv0DAv7q6+pMDeYPNSalkwkUikX7s4ukl4FHgAODPN1CXnPsWFxd/dCAjW+GGhoZCwAfYpeczwMPAPjVW3gv3IvXN98disZ8dyBGNCwQC4/r94eHhfuy6+JS6zATUCeJXY+W9cNfIUuDAwsLCr05kIBDYeBQ8Ojr6h8Lpx25BtbWlGpfv62BG5PLy8m+SFpOTk38C76mVe84NVyhgOvLgysrK7xoXjUb/Uqt2XG1rEDiYCbcd0MgwsWtk+J1EI03An0wmw5Zlefx+/2n1eRKIO5r+rWTTpFsZ/gWFrGMmeObuqwAAAABJRU5ErkJggg==",Vp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAEvUlEQVRYhc2Y20/cVRDHP8v+uKzAWkpDCtZq8BYhJkq8PBoJxgj7I2m0ryaSyFN9IT74pI8+8WJiggRj/APApFkSTGRJ+qKGUiyxbGPEWsUSuVhYC12Wy8+HmeMeYPe3d3WSye/k/M7le+bMzJkZ+J9ToEJreGVYN+vihcytstjQocUlAw0WCSoIVCv3Ae8CXwIt+u8XHVeOG8qLqgAHqAFCQCNwGugCthBJGd7S/tM6LqTzHI5KuqzgaoAHgEvAtwrkG2AG8FzXvep5nue67lX9N6P/PR1/SefXlBtkFXKNDUA/RyX1D9uUbYzOb9D1ygbSQU7eDMxhSSsSiVz3AxiJRK57nuf19/fPad8coqONFCBJPyUOIKc1OvcbgiY9ICDT8+0DHge2gR0gBeyTtviM5HeKAGlrrfMZVwhdAVaAr4F3KNF4gkA9cBbowOc68+3LwDn1Mhdy4/OcYk54nPr6+m54nofruvPa9SFQ6wfQTweNgTwInAGuQWk6mEUvHwb+Au4Dexx7ffK9+0q+CHWIBIOZ9skHYKWfK9tQ8gZoLDjIyWCg3ORY+2T8aYOyg4EaRIFrkCs4QU1NTSvabC20zyIDzuyfkYzEahHX8jHwE/LwXwHeJ4P7KIVIu5ouxFDC+HgLAy4MfEF2v1UpgOezATSiNVf6EvAWsD01NXVtdnb2bk9Pz81sp/q3KIi8t83Ae4DX0tJy0z7t8PDwD4FAYIX/WILVwKMAzc3Nu/agoaGhzmg0ugcsV0hIvlSNoH8IuIiebHJycrls4sotwaxGYvueAPAjEg3jum79yMjIr5WUjFLOxMpBIopWoBN4GfhOJ+4NDg4ulVt6i4uLm7r+BvAscA4fCXrAAfJQJ5Fg8gPgMuCMjo62d3V1LW1sbKRKlpXSxMTEmjZ/5qQrOwHwUAGmkIjiHhJdfKrM/Pz8Y+3t7RvT09Ob5QAYi8X2tbmke2cEZwAaCdoAt5QvIzEbiUSitbe3tyoej++UCnBhYSGkzdu6d1aQxkgOkfwgieQMCeCu8iwSnpNKpcIdHR3BZDJ5UCy4SCSyvL6+/giiSou67wE+eYmhAKKkIaAJUdynkdflNcQF3dFTpooxjmg0aozDAz4DXkB8bxPy1OYM7QzIOuAU0AY8pQu9CrwJ3AK8UCj0RyHgZmZmli1w3wOvAM/oHo1kiZiygbSDh7PAE8DzQA/wBqKnnuM4a2NjY7dygbtw4cICRy31deBFJA09o7eWsU7kJ1KTLJmyRyOSn5zS70fAkwBtbW2/DwwMHHR3d9d3dnY2rK6u7o2Pj2/GYrH9eDzurK2tndM1vwI+QXT7T2BTD5skQz6SCyAcLRoZkGEFGQbeRqpbubK+BPA5MI14h00L3I6Cy2h4+eQbJsKuRa6iQcGFFfB5oBt4DpFsI+Ky7iDBxW3gBhBH/GtC+R7i1lKk3UxRAG2QpvxWr0AbtB3SA5jkx36djH/dVlDbyibN3M8GDvJPyI2PSulixm/u6kZ1OQCaJ/S+tndJX6tvsFBIxcCUdA3vW5ubxMrObc0hDMhd/Rqp5QQHxeW8dubnHGM7tzVv/IECMlxQ/bpcRfRMqaNRheNcUGG9XFWDACfzWs/6Fl3t/xtO//8gpbCORQAAAABJRU5ErkJggg==",Wp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAER0lEQVRYhe2YT2hjRRjAf8lL22xsNsm6EWKrSKvuIkIh+O9QRFxEW18KUsoe7FHoRaWCN1FPetOrIHgVKS0q9P5OxaJbodkalgVrtVZjS7Ntd02z6abPw3yzmaT585q+elj2g2HmvZn35jffN/PNNwP35R6XgM/fuif4n+dO2klQvgsaZRc4NJJvoJbHdhrIAkJAN2ADHwFfAw9J3ZoB/b9I0AA6A0SBc0Aa2EVpSqddeZ+QdmfkO+u0gIPSQQR4HfhRQH4AHMDNZDJXXNd1M5nMFalzdB3wJTAOPAD0yEB9066G6wXepVZTd5MpTdporZ6jVqsatmMJoTR3HvgJQ1u2bS+3ArRte9l1XXdsbGyJo1pdBN6Wf3d3ChlAmSQO9LeC8fquQRpDWaerHWSjSr1iu4BkJyOsF9u2s67rkslkluTVxygltAVsJBZqdCngEj5osIlW+4EYytRNF04jeu3vulCT+7QkLH20dEOhumft97pQI4s3+iiRSPwtxVSbd39J8eEGvzFXc1NAs8KSFAZeBt4AHgNeBFDWObkEAne7HAK2gT2gCFQatdca1GbtBj4E3veFprVYVLXXcg4GqM6588BbAMlkcm1qamqzr6/v6ikBet5RgiizJoDPAXdgYGDZXHkzMzPrrk9CdRWngUeAsxxdCzVwpgZ/BigWiz1mo4mJif7jqMajeJrU5hywgGvAej6fvzA0NLThN1Eul9uT4g5VTbYFNKUIfAbsZ7PZvuHh4Wt+As7Ozu5IcY2j219TQB0NV4A7qODgO4CFhYWLg4ODOb8AHccpG4A68m6pRQ1YAQ6A28A+8BXwBcDq6upTqVTquh+AuVyuW4q/opRRaQdZD1gCbgE3ge+BT4HdfD7/ZDwe/z2bzRY6hRsfH1/e3Nx8FDX/sgbgoZfvg6jo4ixqW7oIPA+8CrwHrAJuJBLJd+JaHMf5k6qmPgGeQe1SCenXk0/U21xcIC8AzwGvAJPAEuAmEon1xcXFba9w8/Pz5oqdB14CnpY+oij35km0qwmjwqAU8ISM9hIwBeQA17KsG9PT07+1gxsZGdmgdqW+BjwLDAAPoo4ALU+W9arVwWoIpXp9kouKZpPAO8AwQCwW+2d0dLQ0OTkZSafT0UKhUJ6bm9t2HKeysrIS3tra0g7+KvABUJC0g5rrJdRcbLpImtleRzYashc1P2OSXwbebDVykX3gW+Ab1AHqhuQ3pe6AJlFMO0CoPROHDcio5I8DL1A9C8dQbmod+APYAK4DvwjQnsDdErgyVTfTEaCG1GFYGHXG7TVSo2OkdvhlAflXoHSuNdfStFqaRhEi2kfdprrj6M5LAt0I8EDaaMdflPal48CB95hMr3Bt8h4jD0kyL5E0pN6dysZzW7N2AqjbmhdIZjJvufTOpE19x3g+9s1XJ/ck5tVbfdhu+rxDfLiSO+lFToCjZwrXyH2/0Lwv95z8B1jAqXmDnj4YAAAAAElFTkSuQmCC",Gp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAIiklEQVRYhe2YW2yUxxmGn7W96zXGNnZsr2FJHQyYBHNIU1ttAqVUVjlJUAtxQyUXhKgQktUDdSUkuEDtBVJ9UQXRC0RJRblrq/SCIARpFImWQ8VBIZQinJpQYozNyWaxiw/rfXsx3+z+6xNOe9tPGv2nOTzzffPPvDMhSXwJC1nKAXIDV/9ellLAqF1T9o5A2Ry7J5A/Fbh3mUMh8qYJ5kHCQATID6QIkBcAHAVGgKFAStq33EB53/ao5Rm064i9g0CmqcDyrNICYCZQBJTYdaa9j1jelDUwCAwAz4F+ex61DhZauXzr1CDwDHhq1wFg2Do1KWAo0NsCAyoDKoGYXcuBWdZY1PKnzAsDQB/wBOg1yKTVN8vqmoHz6nOgC7gHdFrbCasrNRFgyMCj5qVXgDlANfAaMA/4ir2rMI+MtSHgEdAN9BjsiNVZYR0sNq8+AtqB69Z2MuDBcYA+pAXW0yoDWgTUWXrd8k1l+cBcSxjIIBlPB63G8uUB/8Z57znwAkgGAX1YC4BSK7QIWA7UWwoDJJNJzp49y4ULF2hvb6e7u5tEIkFhYSGVlZXMmzePhoYGNmzYQElJCVZv2tPt7e3s2bOHvr4+9u3bx/r16+PWjg/zQ9x4BEk+5UkqklQt6ZuSdkn6jaRbMhsYGFBbW5uWLVvmp5MpU3V1tVpbW9XV1aWgbdy4MZ2npqbGvx6W9DtJ35e0RFJREDBX0gxJcUnfkPQDScck3fGlz549q7q6ummBjU2xWEzvvfdeGvCtt95Kf6uoqAiyfyBpt6SvSZrlAUOSIpLKJS2X9D1Jv5Z025d69913FQqFJmy8rKxMS5YsUUNDg5YvX67Zs2dPCrpjxw6NjIxoxYoV6XdVVVVBwI8l/UTS1yWVesBcC+18SRsk/ULS33yJtra2CRtramrSiRMn1NXVpWQyKUlKpVJ6+vSpTp48qZ07dyo/P39cua1bt6q+vn4ywL9IapX0tqQyDxiRFDPq3ZL+JCklSadOnRrXwMKFC3X69GlNx65du6aVK1eOqyMYjTGAf50IsNC8t1FSm6TPJOn+/fuKxWJZFb/zzjvjBvx0bO/evQqHwxNG4mUe9MtYMZk5bwHA4cOH6enpSc9BixYt4uTJk5SVlflXfcBN4DFuapoHLPQfz58/z9WrVwmFQsTjceLxOHfv3uUlNlZcpFeMEtzsXg2QSCQ4duxYulQoFOLQoUNBuE7gvAE+x82b/VZHyblz52hsbCSZTL4MCGWrqUECq0gQsBi3ts4B+PDDD3n48GG61OrVq1mzZo1/fGZw54HbVmGV1bMAWPbRRx9NC24CwD7cajLiAXNwIS7ELW3lAGfOnMmqZPv27cHHvwM3gH8AnwH/wnn0C+AuwLZt25g/f/5L4cLhMNu2bfOPnbh1+xkZ9UMebvmKGmQEoLOzM11JQUEBK1eu9I/JAFAPTqnk4hTNY9xS1V5TU1N7+fJlOjo6SKXS+jPLJFFUVMTixYsxmJtW/inOi2nAXDI/C0BWeMvKyojFYv6xz1LCKhnCRSEBPMCFfBaQKi0tfb2+vn5qFzp7AnwCXAM+t45mAUJGfgMwOpoWtIRCWZ/89BB8TuJ+lG5cNEatkXYgjtN+BYG2ktaxBE4U3AP+iRsud3EeHCTwk6Ss0IhvtaKiIk3Q19dHb28vhYWF4H6mYtxwiBrQIE4aPTHgIVzoO3E/TzlOV4YD3/stj9eMPj2xzg4HAYMSPQnkxePxNGB/fz+XLl1iy5Yt4HTeq+aZTtyA9h18Yb33G6aRQBqyDiUNLihmH1q54LAZ9ZHKISPRn1loaGxsJGjHjx8PPi6xtAgnNufgVHcRmf1J2DpTiJsjvYout3c5gQ49Ns89s3fpOdB70I+Hx7iBXrV27VqKi4tJJBKAm3auXLmCDfpy4G3rZSHur/aSPg83BCpx24MFuNUlbnkHcGMubEDdxpG0lBn8AcBBsgfsVysqKti6dStHjhwBYGRkhJaWFs6dO0ckEgGYj9v0xIA71rkha7jUgBYCb5hHGRoaIj8/f4Z5s8jafUpmN/diLBwAkmZKWiipSdKvJN2VpI6ODhUVFWUt7Js2bdLAwMBYLdAt6VNJlyV9IumLsRkOHjyo2tparVixQrdvp2Xmn00YrJI0R05VBRV+GjAiqcoUxA8lnfI1HD16dJz6WLVqla5fvz4tFdPZ2anm5uas8s3Nzf7zp5J+LmmNpFcl5U8GmCupWFKtpO9K+qWkG76W3bt3j4OMRqNqaWnRhQsXNDQ0lAWVTCZ169YtHThwQFVVVePKtrS0+Kw3pgsYso+Vkuol7ZD0W0ldvsHW1tZJZXxtba0aGxvV1NSkdevWaenSpYpGoxPmXb9+vXp6ejzgx5J+ZiGeLSk8GaD34ky5Hd23JP1I0h8kPQmGu7y8/L/aNEUiEe3fv1/Dw8Pp6Es6KqlZ0puSXpHbVU4KiPVglqQFkr4j6aeSfi/pvq/13r172rVrlyorK6cFFo1GtXnzZl25ciU4Ch5J+qOkH0v6tqTXzDk5EwGGlNFjOWQOd8px4vUN4E3cpn2pz/jgwQPef/99Ll68yJ07d+jt7WVwcJBIJEJJSQlz586loaGBTZs2UVdXF5w0OoDLwFWcbPsct6r04+bRLHEYCoWyAD1kBDfHleHmsxrccccS3NFHNV/eenBy6iZwCycMOnHz5wBuDh2nyyY6H0zhFmoF7vtxk+l9q3ieQfrDo8msF7cy3cN56g7ZWnKcep7IxnrQmz+wHKu2K3EKJWbPpWSUTQ4ZtRJc23sC6ZGB9ZM52JwcboIQjzUvZvNxYfeHlyVkZFcBbux6wKA6ShjoM5yM8uH0Xpuy8ekAQuZc2W8P8nEei9p9mMmPgAfJHO0O27e0lHppw9MEDJo//A4eoE91iB48SJ80lFMB/t/+V/sPGZfTmtMFR4EAAAAASUVORK5CYII=";var fi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Oe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Qe,hi,Qr,Fn,Ja,nn,Fu,Hu,Vt,Nl,Ll;class Yp{constructor(t,n){Qe.add(this),hi.set(this,void 0),Qr.set(this,void 0),Fn.set(this,null),Ja.set(this,null),nn.set(this,{auto:Hp,"drag-default":Vp,"drag-active":Wp,"rotate-0":Bu,rotate:Gp}),fi(this,Qr,t,"f"),fi(this,hi,n.eventHub,"f"),Oe(this,Qe,"m",Fu).call(this),Oe(this,Qe,"m",Hu).call(this)}}hi=new WeakMap,Qr=new WeakMap,Fn=new WeakMap,Ja=new WeakMap,nn=new WeakMap,Qe=new WeakSet,Fu=function(){const t=Oe(this,hi,"f");Oe(this,Qe,"m",Vt).call(this,"default"),t.on("cursor",n=>{var r;n.type==="over-element"||!n.type?Oe(this,Qe,"m",Vt).call(this,"auto"):n.type==="resize-rotate"?Oe(this,Qe,"m",Vt).call(this,"rotate"):typeof n.type=="string"&&(!((r=n.type)===null||r===void 0)&&r.startsWith("resize-"))?Oe(this,Qe,"m",Nl).call(this,n):n.type==="drag-default"?Oe(this,Qe,"m",Vt).call(this,"drag-default"):n.type==="drag-active"?Oe(this,Qe,"m",Vt).call(this,"drag-active"):Oe(this,Qe,"m",Vt).call(this,"auto")})},Hu=function(){Oi(Bu).then(t=>{fi(this,Ja,t,"f")}).catch(t=>{console.error(t)})},Vt=function(t){if(Oe(this,Fn,"f")===t)return;fi(this,Fn,t,"f");const n=Oe(this,nn,"f")[Oe(this,Fn,"f")]||Oe(this,nn,"f").auto;let r=0,a=0;(t.startsWith("rotate-")&&Oe(this,nn,"f")[Oe(this,Fn,"f")]||t==="rotate")&&(r=10,a=10),t==="default"?Oe(this,Qr,"f").style.cursor="default":Oe(this,Qr,"f").style.cursor=`image-set(url(${n})2x) ${r} ${a}, auto`},Nl=function(t){var n;let r=0;t.type==="resize-top"?r+=0:t.type==="resize-top-right"?r+=45:t.type==="resize-right"?r+=90:t.type==="resize-bottom-right"?r+=135:t.type==="resize-bottom"?r+=180:t.type==="resize-bottom-left"?r+=225:t.type==="resize-left"?r+=270:t.type==="resize-top-left"&&(r+=315),r+=vt(((n=t==null?void 0:t.element)===null||n===void 0?void 0:n.angle)||0),Array.isArray(t.groupQueue)&&t.groupQueue.length>0&&t.groupQueue.forEach(i=>{r+=vt(i.angle||0)}),r=vt(r);const a=Oe(this,Qe,"m",Ll).call(this,r);Oe(this,Qe,"m",Vt).call(this,a)},Ll=function(t){const n=`rotate-${t}`;if(!Oe(this,nn,"f")[n]){const r=Oe(this,Ja,"f");if(r){const a=document.createElement("canvas"),i=r.width,o=r.height,s={x:i/2,y:o/2};a.width=i,a.height=o;const c=a.getContext("2d"),d=Dt(t);c.translate(s.x,s.y),c.rotate(d),c.translate(-s.x,-s.y),c.drawImage(r,0,0,i,o),c.translate(s.x,s.y),c.rotate(-d),c.translate(-s.x,-s.y);const u=a.toDataURL("image/png");Oe(this,nn,"f")[n]=u}}return n};const He="SELECT",xe=Symbol(`${He}_actionType`),Kt=Symbol(`${He}_resizeType`),xa=Symbol(`${He}_areaStart`),Sa=Symbol(`${He}_areaEnd`),Ir=Symbol(`${He}_hoverElement`),lo=Symbol(`${He}_hoverElementVertexes`),on=Symbol(`${He}_selectedElementList`),Up=Symbol(`${He}_selectedElementListVertexes`),_n=Symbol(`${He}_selectedElementController`),Tn=Symbol(`${He}_selectedElementPosition`),On=Symbol(`${He}_selectedReferenceXLines`),In=Symbol(`${He}_selectedReferenceYLines`),Ge=Symbol(`${He}_groupQueue`),co=Symbol(`${He}_groupQueueVertexesList`),Ea=Symbol(`${He}_isMoving`),Vu=2,Xp=4,Wu=1,aa="#1973ba",jl="#5b5959b5",Gu=10,Zp="#f7276e";function Ut(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[1].x,t[1].y),e.lineTo(t[2].x,t[2].y),e.lineTo(t[3].x,t[3].y),e.lineTo(t[0].x,t[0].y),e.closePath(),e.stroke(),e.fill()}function ko(e,t,n,r){const{borderColor:a,borderWidth:i,lineDash:o}=r;e.setLineDash([]),e.lineWidth=i,e.strokeStyle=a,e.setLineDash(o),e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.closePath(),e.stroke()}function Qp(e,t,n){const{size:r,borderColor:a,borderWidth:i,background:o}=n,s=t,c=r/2,d=c,u=c;if(d>=0&&u>=0){if(typeof i=="number"&&i>0){const f=i/2+d,h=i/2+u;e.beginPath(),e.strokeStyle=a,e.lineWidth=i,e.circle(s.x,s.y,f,h,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath(),e.fillStyle=o,e.circle(s.x,s.y,d,u,0,0,2*Math.PI),e.closePath(),e.fill()}}function $t(e,t,n){const{borderColor:r,borderWidth:a,lineDash:i}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.setLineDash(i),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[2].x,t[2].y),e.closePath(),e.stroke(),e.beginPath(),e.moveTo(t[1].x,t[1].y),e.lineTo(t[3].x,t[3].y),e.closePath(),e.stroke()}function kl(e,t,n){const{size:r,borderColor:a,borderWidth:i,lineDash:o}=n,s=t.x-r/2,c=t.x+r/2,d=t.y-r/2,u=t.y+r/2;$t(e,[{x:s,y:d},{x:c,y:d},{x:c,y:u},{x:s,y:u}],{borderColor:a,borderWidth:i,lineDash:o})}function Bl(e,t,n){if(!t)return;const r={borderColor:aa,borderWidth:1,background:"transparent",lineDash:[]};Ut(e,ke(t,n),r)}function Fl(e,t,n){if(!t)return;const r={borderColor:jl,borderWidth:1,background:"transparent",lineDash:[]};Ut(e,ke(t,n),r);const{controller:a}=n;if(a){const{topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,topMiddle:d,bottomMiddle:u,leftMiddle:f,rightMiddle:h}=a,p=Object.assign(Object.assign({},r),{borderWidth:1,background:jl});$t(e,ke(d.vertexes,n),p),$t(e,ke(u.vertexes,n),p),$t(e,ke(f.vertexes,n),p),$t(e,ke(h.vertexes,n),p),$t(e,ke(i.vertexes,n),p),$t(e,ke(o.vertexes,n),p),$t(e,ke(s.vertexes,n),p),$t(e,ke(c.vertexes,n),p)}}function Hl(e,t,n){if(!t)return;const{hideControllers:r}=n,{elementWrapper:a,topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,top:d,rotate:u}=t,f={borderColor:aa,borderWidth:Vu,background:"transparent",lineDash:[]},h=Object.assign(Object.assign({},f),{borderWidth:Xp,background:"#FFFFFF"});Ut(e,ke(a,n),f),r||(ko(e,fe(d.center,n),fe(u.center,n),Object.assign(Object.assign({},h),{borderWidth:2})),Ut(e,ke(i.vertexes,n),h),Ut(e,ke(o.vertexes,n),h),Ut(e,ke(s.vertexes,n),h),Ut(e,ke(c.vertexes,n),h),Qp(e,fe(u.center,n),Object.assign(Object.assign({},h),{size:Gu,borderWidth:2})))}function Kp(e,t){const{start:n,end:r}=t;e.setLineDash([]),e.lineWidth=Wu,e.strokeStyle=aa,e.fillStyle="#1976d24f",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,n.y),e.lineTo(r.x,r.y),e.lineTo(n.x,r.y),e.closePath(),e.stroke(),e.fill()}function Jp(e,t){const{areaSize:n}=t,{x:r,y:a,w:i,h:o}=n;e.setLineDash([]),e.lineWidth=Wu,e.strokeStyle=aa,e.fillStyle="#1976d21c",e.beginPath(),e.moveTo(r,a),e.lineTo(r+i,a),e.lineTo(r+i,a+o),e.lineTo(r,a+o),e.closePath(),e.stroke(),e.fill()}function qp(e,t,n){for(let r=0;r{o.forEach((s,c)=>{kl(e,s,i),o[c+1]&&ko(e,o[c],o[c+1],a)})}),r&&r.forEach(o=>{o.forEach((s,c)=>{kl(e,s,i),o[c+1]&&ko(e,o[c],o[c+1],a)})})}function de(e){return e*Math.PI/180}function Ca(e,t){return Math.sqrt(e*e+t*t)}function re(e,t){return t>0?Math.abs(e):0-Math.abs(e)}function Bo(e,t){const{ctx:n,viewScaleInfo:r,vertexes:a}=t,i=fe(a[0],{viewScaleInfo:r}),o=fe(a[1],{viewScaleInfo:r}),s=fe(a[2],{viewScaleInfo:r}),c=fe(a[3],{viewScaleInfo:r});return n.beginPath(),n.moveTo(i.x,i.y),n.lineTo(o.x,o.y),n.lineTo(s.x,s.y),n.lineTo(c.x,c.y),n.lineTo(i.x,i.y),n.closePath(),!!n.isPointInPath(e.x,e.y)}function Wl(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,groupQueue:i}=t;if(!i||!((i==null?void 0:i.length)>0))return!1;const o=us(i),s=o[o.length-1];return s?Bo(e,{ctx:n,vertexes:s,viewScaleInfo:r,viewSizeInfo:a}):!1}function $r(e,t){var n,r,a;const i={type:null,elements:[],elementVertexesList:[],groupQueue:[],groupQueueVertexesList:[]},{ctx:o,data:s,calculator:c,selectedElements:d,viewScaleInfo:u,viewSizeInfo:f,areaSize:h,groupQueue:p,selectedElementController:v}=t;if(v){const{left:g,right:m,top:y,bottom:b,topLeft:E,topRight:w,bottomLeft:C,bottomRight:S,rotate:$}=v,D=[g,m,y,b,E,w,C,S,$];for(let B=0;B0&&(i.groupQueue=p||[],i.elements=[d[0]]);break}}}if(p&&Array.isArray(p)&&p.length>0){const g=p[p.length-1];if(!((n=g==null?void 0:g.detail)===null||n===void 0)&&n.children&&Array.isArray((r=g==null?void 0:g.detail)===null||r===void 0?void 0:r.children))for(let m=g.detail.children.length-1;m>=0;m--){const y=g.detail.children[m],b=Jr(y,{groupQueue:p});if(b&&Bo(e,{ctx:o,vertexes:b,viewScaleInfo:u,viewSizeInfo:f}))return i.type||(i.type="over-element"),i.groupQueue=p,i.elements=[y],i}return i}if(i.type!==null)return i;if(h&&Array.isArray(d)&&(d==null?void 0:d.length)>1){const{x:g,y:m,w:y,h:b}=h;if(e.x>=g&&e.x<=g+y&&e.y>=m&&e.y<=m+b)return i.type="list-area",i.elements=d,i}if(s){const{index:g,element:m}=c.getPointElement(e,{data:s,viewScaleInfo:u,viewSizeInfo:f});if(g>=0&&m&&((a=m==null?void 0:m.operations)===null||a===void 0?void 0:a.invisible)!==!0)return i.elements=[m],i.type="over-element",i}return i}function eg(e,t){var n,r,a,i,o,s,c,d,u;let{x:f,y:h,w:p,h:v,angle:g=0}=e;const m=bt({x:f,y:h,w:p,h:v,angle:g});g=vt(g);const y=Dt(g),b=!!(!((n=e==null?void 0:e.operations)===null||n===void 0)&&n.limitRatio),{start:E,end:w,resizeType:C,scale:S}=t;let $=Object.assign({},E),D=Object.assign({},w),B={x:$.x,y:m.y},H={x:D.x,y:m.y},G=Object.assign({},B),j=Object.assign({},H),M={x:m.x,y:$.y},I={x:m.x,y:D.y},k=Object.assign({},M),z=Object.assign({},I),A=(j.x-G.x)/S,N=(j.y-G.y)/S,x=Ca(A,N),R=(z.x-k.x)/S,Y=(z.y-k.y)/S,_=Ca(R,Y);(g>0||g<0)&&($=_e(m,E,0-y),D=_e(m,w,0-y),B={x:$.x,y:m.y},H={x:D.x,y:m.y},G=_e(m,B,y),j=_e(m,H,y),M={x:m.x,y:$.y},I={x:m.x,y:D.y},k=_e(m,M,y),z=_e(m,I,y),A=(j.x-G.x)/S,N=(j.y-G.y)/S,x=Ca(A,N),x=re(x,N),R=(z.x-k.x)/S,Y=(z.y-k.y)/S,_=Ca(R,Y),_=re(_,Y));let U=(w.x-E.x)/S,V=(w.y-E.y)/S;if(b===!0){if(["resize-top","resize-bottom","resize-left","resize-right"].includes(C)){const O=Math.max(Math.abs(U),Math.abs(V));U=(U>=0?1:-1)*O,V=(V>=0?1:-1)*O/e.w*e.h;const P=Math.max(Math.abs(R),Math.abs(Y));R=(R>=0?1:-1)*P,Y=(Y>=0?1:-1)*P/e.w*e.h;const L=Math.max(Math.abs(A),Math.abs(N));A=(A>=0?1:-1)*L,N=(N>=0?1:-1)*L/e.w*e.h}else if(["resize-top-left","resize-top-right","resize-bottom-left","resize-bottom-right"].includes(C)){{const O=Math.abs(U);U=(U>=0?1:-1)*O;const P=O/e.w*e.h;C==="resize-top-left"||C==="resize-bottom-right"?V=U>0?P:-P:(C==="resize-top-right"||C==="resize-bottom-left")&&(V=U>0?-P:P)}x=Math.abs(x),_=x/e.w*e.h}}switch(C){case"resize-top":{if(g===0)v-V>0&&(h+=V,v-=V,((r=e.operations)===null||r===void 0?void 0:r.limitRatio)===!0&&(f+=V/e.h*e.w/2,p-=V/e.h*e.w));else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=0-re(_,Y);const L=de(g),F=_/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L)}else if(g<180){_=re(_,R);const L=de(g-90),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L)}else if(g<270){_=re(_,Y);const L=de(g-180),F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L)}else if(g<360){_=0-re(_,R);const L=de(g-270),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L)}v+_>0&&(((a=e.operations)===null||a===void 0?void 0:a.limitRatio)===!0&&(p=p+_/e.h*e.w),v=v+_,f=O-p/2,h=P-v/2)}break}case"resize-bottom":{if(g===0)e.h+V>0&&(v+=V,((i=e.operations)===null||i===void 0?void 0:i.limitRatio)===!0&&(f-=V/e.h*e.w/2,p+=V/e.h*e.w));else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=re(_,Y);const L=de(g),F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L)}else if(g<180){_=0-re(_,R);const L=de(g-90),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L)}else if(g<270){_=re(_,R);const L=de(g-180),F=_/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L)}else if(g<360){_=re(_,R);const L=de(g-270),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L)}v+_>0&&(((o=e.operations)===null||o===void 0?void 0:o.limitRatio)===!0&&(p=p+_/e.h*e.w),v=v+_,f=O-p/2,h=P-v/2)}break}case"resize-left":{if(g===0)e.w-U>0&&(f+=U,p-=U,((s=e.operations)===null||s===void 0?void 0:s.limitRatio)===!0&&(v-=U/e.w*e.h,h+=U/e.w*e.h/2));else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){x=0-re(x,A);const L=de(g),F=x/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L)}else if(g<180){x=re(x,A);const L=de(g-90),F=x/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L)}else if(g<270){x=re(x,N);const L=de(g-180),F=x/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L)}else if(g<360){x=re(x,N);const L=de(g-270),F=x/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L)}p+x>0&&(((c=e.operations)===null||c===void 0?void 0:c.limitRatio)===!0&&(v=v+x/e.w*e.h),p=p+x,f=O-p/2,h=P-v/2)}break}case"resize-right":{if(g===0)e.w+U>0&&(p+=U,((d=e.operations)===null||d===void 0?void 0:d.limitRatio)===!0&&(h-=U*e.h/e.w/2,v+=U*e.h/e.w));else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){x=re(x,N);const L=de(g),F=x/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L)}else if(g<180){x=re(x,V);const L=de(g-90),F=x/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L)}else if(g<270){x=re(x,V);const L=de(g-180),F=x/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L),x=0-x}else if(g<360){x=re(x,U);const L=de(g-270),F=x/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L)}p+x>0&&(((u=e.operations)===null||u===void 0?void 0:u.limitRatio)===!0&&(v=v+x/e.w*e.h),p=p+x,f=O-p/2,h=P-v/2)}break}case"resize-top-left":{if(g===0)p-U>0&&(f+=U,p-=U),v-V>0&&(h+=V,v-=V);else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=0-re(_,Y),x=0-re(x,b?0-_:A);const L=_/2;O=O+L*Math.sin(y),P=P-L*Math.cos(y);const F=x/2;O=O-F*Math.cos(y),P=P-F*Math.sin(y)}else if(g<180){_=re(_,R),x=re(x,b?_:A);const L=de(g-90),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L);const te=x/2;O=O+te*Math.sin(L),P=P-te*Math.cos(L)}else if(g<270){_=re(_,Y),x=re(x,b?_:N);const L=de(g-180),F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L);const te=x/2;O=O+te*Math.cos(L),P=P+te*Math.sin(L)}else if(g<360){_=0-re(_,R),x=re(x,b?_:N);const L=de(g-270),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L);const te=x/2;O=O-te*Math.sin(L),P=P+te*Math.cos(L)}v+_>0&&(v=v+_),p+x>0&&(p=p+x),f=O-p/2,h=P-v/2}break}case"resize-top-right":{if(g===0)p+U>0&&(p+=U),v-V>0&&(h+=V,v-=V);else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=0-re(_,Y),x=re(x,b?_:N);const L=de(g),F=_/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L);const te=x/2;O=O+te*Math.cos(L),P=P+te*Math.sin(L)}else if(g<180){_=re(_,R),x=re(x,b?_:N);const L=de(g-90),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L);const te=x/2;O=O-te*Math.sin(L),P=P+te*Math.cos(L)}else if(g<270){const L=de(g-180);_=re(_,Y),x=re(x,b?_:0-A);const F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L);const te=x/2;O=O-te*Math.cos(L),P=P-te*Math.sin(L)}else if(g<360){_=0-re(_,R),x=re(x,b?_:A);const L=de(g-270),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L);const te=x/2;O=O+te*Math.sin(L),P=P-te*Math.cos(L)}v+_>0&&(v=v+_),p+x>0&&(p=p+x),f=O-p/2,h=P-v/2}break}case"resize-bottom-left":{if(g===0)e.h+V>0&&(v+=V),e.w-U>0&&(f+=U,p-=U);else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=re(_,Y),x=0-re(x,b?0-_:A);const L=de(g),F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L);const te=x/2;O=O-te*Math.cos(L),P=P-te*Math.sin(L)}else if(g<180){_=0-re(_,R),x=re(x,b?_:A);const L=de(g-90),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L);const te=x/2;O=O+te*Math.sin(L),P=P-te*Math.cos(L)}else if(g<270){_=re(_,R),x=re(x,b?_:N);const L=de(g-180),F=_/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L);const te=x/2;O=O+te*Math.cos(L),P=P+te*Math.sin(L)}else if(g<360){_=re(_,R),x=re(x,b?_:N);const L=de(g-270),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L);const te=x/2;O=O-te*Math.sin(L),P=P+te*Math.cos(L)}v+_>0&&(v=v+_),p+x>0&&(p=p+x),f=O-p/2,h=P-v/2}break}case"resize-bottom-right":{if(g===0)e.h+V>0&&(v+=V),e.w+U>0&&(p+=U);else if(g>0||g<0){let O=m.x,P=m.y;if(g<90){_=re(_,Y),x=re(x,b?_:N);const L=de(g),F=_/2;O=O-F*Math.sin(L),P=P+F*Math.cos(L);const te=x/2;O=O+te*Math.cos(L),P=P+te*Math.sin(L)}else if(g<180){_=0-re(_,R),x=re(x,b?_:V);const L=de(g-90),F=_/2;O=O-F*Math.cos(L),P=P-F*Math.sin(L);const te=x/2;O=O-te*Math.sin(L),P=P+te*Math.cos(L)}else if(g<270){_=re(_,R),x=re(x,b?_:0-N);const L=de(g-180),F=_/2;O=O+F*Math.sin(L),P=P-F*Math.cos(L);const te=x/2;O=O-te*Math.cos(L),P=P-te*Math.sin(L)}else if(g<360){_=re(_,R),x=re(x,b?_:A);const L=de(g-270),F=_/2;O=O+F*Math.cos(L),P=P+F*Math.sin(L);const te=x/2;O=O+te*Math.sin(L),P=P-te*Math.cos(L)}v+_>0&&(v=v+_),p+x>0&&(p=p+x),f=O-p/2,h=P-v/2}break}}return{x:f,y:h,w:p,h:v,angle:e.angle}}function tg(e,t){const{x:n,y:r,w:a,h:i,angle:o=0}=e,{center:s,start:c,end:d,viewScaleInfo:u}=t,f=fe(s,{viewScaleInfo:u}),h=vt(o),p=K0(f,c,d),v=h+Q0(p);return{x:n,y:r,w:a,h:i,angle:v}}function ng(e,t){var n;const r=[],a=[],i=[],{viewScaleInfo:o,viewSizeInfo:s,start:c,end:d}=t;if(!(Array.isArray(e.elements)&&c&&d))return{indexes:r,uuids:a,elements:i};const u=Math.min(c.x,d.x),f=Math.max(c.x,d.x),h=Math.min(c.y,d.y),p=Math.max(c.y,d.y);for(let v=0;v=u&&y.x<=f&&y.y>=h&&y.y<=p&&(r.push(v),a.push(g.uuid),i.push(g),m.angle&&(m.angle>0||m.angle<0))){const b=pr(m);if(b.length===4){const E=[b[0].x,b[1].x,b[2].x,b[3].x],w=[b[0].y,b[1].y,b[2].y,b[3].y];m.x=Math.min(...E),m.y=Math.min(...w),m.w=Math.abs(Math.max(...E)-Math.min(...E)),m.h=Math.abs(Math.max(...w)-Math.min(...w))}}}return{indexes:r,uuids:a,elements:i}}function uo(e,t){var n;if(!Array.isArray(e))return null;const r={x:0,y:0,w:0,h:0},{viewScaleInfo:a,viewSizeInfo:i}=t;let o=null;for(let s=0;s0||d.angle<0)){const u=pr(d);if(u.length===4){const f=[u[0].x,u[1].x,u[2].x,u[3].x],h=[u[0].y,u[1].y,u[2].y,u[3].y];d.x=Math.min(...f),d.y=Math.min(...h),d.w=Math.abs(Math.max(...f)-Math.min(...f)),d.h=Math.abs(Math.max(...h)-Math.min(...h))}}if(o){const u=Math.min(d.x,r.x),f=Math.min(d.y,r.y),h=Math.max(d.x+d.w,r.x+r.w),p=Math.max(d.y+d.h,r.y+r.h);r.x=u,r.y=f,r.w=Math.abs(h-u),r.h=Math.abs(p-f)}else r.x=d.x,r.y=d.y,r.w=d.w,r.h=d.h;o=d}return r}function rg(e,t){var n;if((t==null?void 0:t.type)==="group"&&Array.isArray((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.children))for(let r=0;r{const{x:s,y:c,w:d,h:u,angle:f=0}=o;i.push({x:s,y:c,w:d,h:u,angle:0-f})}),(n==null?void 0:n.length)>0){const o=di(e,i),s=di(t,i);r=s.x-o.x,a=s.y-o.y}return{moveX:r,moveY:a}}const Gl=2;function Yl(e){return{minX:e.topLeft.x,minY:e.topLeft.y,maxX:e.bottomRight.x,maxY:e.bottomRight.y,midX:e.center.x,midY:e.center.y}}const $n=(e,t)=>{if(e.length===0)throw null;if(e.length===1)return e[0];let n=0,r=e.length-1;for(;n<=r;){const a=Math.floor((n+r)/2);if(e[a]===t)return e[a];e[a]=e.length?e[r]:r<0?e[n]:Math.abs(e[r]-t)<=Math.abs(e[n]-t)?e[r]:e[n]},rt=(e,t)=>Math.abs(e-t)<1e-5;function ig(e,t){var n,r;const{data:a,groupQueue:i,calculator:o,viewScaleInfo:s,viewSizeInfo:c}=t;let d=a.elements||[];(i==null?void 0:i.length)>0&&(d=((r=(n=i[i.length-1])===null||n===void 0?void 0:n.detail)===null||r===void 0?void 0:r.children)||[]);const u=[];d.forEach(z=>{if(z.uuid!==e){const A=o.calcViewRectInfoFromRange(z.uuid,{checkVisible:!0,viewScaleInfo:s,viewSizeInfo:c});A&&u.push(A)}});const f=o.calcViewRectInfoFromRange(e,{viewScaleInfo:s,viewSizeInfo:c});if(!f)return null;const h={},p={},v={},g={},m=[],y=[];let b=[],E=[];const w=Yl(f);h[w.minX]=[w.minY,w.midY,w.maxY],h[w.midX]=[w.minY,w.midY,w.maxY],h[w.maxX]=[w.minY,w.midY,w.maxY],p[w.minY]=[w.minX,w.midX,w.maxX],p[w.midY]=[w.minX,w.midX,w.maxX],p[w.maxY]=[w.minX,w.midX,w.maxX],u.forEach(z=>{const A=Yl(z);v[A.minX]||(v[A.minX]=[]),v[A.midX]||(v[A.midX]=[]),v[A.maxX]||(v[A.maxX]=[]),g[A.minY]||(g[A.minY]=[]),g[A.midY]||(g[A.midY]=[]),g[A.maxY]||(g[A.maxY]=[]),v[A.minX]=[A.minY,A.midY,A.maxY],v[A.midX]=[A.minY,A.midY,A.maxY],v[A.maxX]=[A.minY,A.midY,A.maxY],b.push(A.minX),b.push(A.midX),b.push(A.maxX),g[A.minY]=[A.minX,A.midX,A.maxX],g[A.midY]=[A.minX,A.midX,A.maxX],g[A.maxY]=[A.minX,A.midX,A.maxX],E.push(A.minY),E.push(A.midY),E.push(A.maxY)}),b=b.sort((z,A)=>z-A),E=E.sort((z,A)=>z-A);let C=null,S=null,$=null,D=null,B=null,H=null,G=null,j=null;if(b.length>0){$=$n(b,w.minX),D=$n(b,w.midX),B=$n(b,w.maxX);const z=Math.abs($-w.minX),A=Math.abs(D-w.midX),N=Math.abs(B-w.maxX),x=Math.min(z,A,N);x<=Gl/s.scale&&(rt(x,z)?C=$-w.minX:rt(x,A)?C=D-w.midX:rt(x,N)&&(C=B-w.maxX))}if(E.length>0){H=$n(E,w.minY),G=$n(E,w.midY),j=$n(E,w.maxY);const z=Math.abs(H-w.minY),A=Math.abs(G-w.midY),N=Math.abs(j-w.maxY),x=Math.min(z,A,N);x<=Gl/s.scale&&(rt(x,z)?S=H-w.minY:rt(x,A)?S=G-w.midY:rt(x,N)&&(S=j-w.maxY))}const M=Object.assign({},w);if(C!==null&&(M.minX+=C,M.midX+=C,M.maxX+=C),S!==null&&(M.minY+=S,M.midY+=S,M.maxY+=S),Fe.x(C)&&C!==null&&$!==null&&D!==null&&B!==null){if(rt(C,$-w.minX)){const z={x:$,yList:[]};z.yList.push(M.minY),z.yList.push(M.midY),z.yList.push(M.maxY),z.yList.push(...(g==null?void 0:g[$])||[]),m.push(z)}if(rt(C,D-w.minX)){const z={x:D,yList:[]};z.yList.push(M.minY),z.yList.push(M.midY),z.yList.push(M.maxY),z.yList.push(...(g==null?void 0:g[D])||[]),m.push(z)}if(rt(C,B-w.minX)){const z={x:B,yList:[]};z.yList.push(M.minY),z.yList.push(M.midY),z.yList.push(M.maxY),z.yList.push(...(g==null?void 0:g[B])||[]),m.push(z)}}if(Fe.y(S)&&S!==null&&H!==null&&G!==null&&j!==null){if(rt(S,H-w.minY)){const z={y:H,xList:[]};z.xList.push(M.minX),z.xList.push(M.midX),z.xList.push(M.maxX),z.xList.push(...(v==null?void 0:v[H])||[]),y.push(z)}if(rt(S,G-w.midY)){const z={y:G,xList:[]};z.xList.push(M.minX),z.xList.push(M.midX),z.xList.push(M.maxX),z.xList.push(...(v==null?void 0:v[H])||[]),y.push(z)}if(rt(S,j-w.maxY)){const z={y:j,xList:[]};z.xList.push(M.minX),z.xList.push(M.midX),z.xList.push(M.maxX),z.xList.push(...(v==null?void 0:v[j])||[]),y.push(z)}}const I=[];(m==null?void 0:m.length)>0&&m.forEach((z,A)=>{I.push([]),z.yList.forEach(N=>{I[A].push({x:z.x,y:N})})});const k=[];return(y==null?void 0:y.length)>0&&y.forEach((z,A)=>{k.push([]),z.xList.forEach(N=>{k[A].push({x:N,y:z.y})})}),{offsetX:C,offsetY:S,yLines:I,xLines:k}}const pi="@middleware/text-edit",Fo="@middleware/text-change",og=mn(),Ul=e=>{const{eventHub:t,boardContent:n,viewer:r}=e,a=n.boardContext.canvas,i=document.createElement("div");i.setAttribute("contenteditable","true");const o=document.createElement("div"),s=e.container||document.body,c=document.createElement("div");let d=null,u=[];o.appendChild(i),o.style.position="absolute",c.appendChild(o),c.style.position="fixed",c.style.top="0",c.style.bottom="0",c.style.left="0",c.style.right="0",c.style.display="none",s.appendChild(c);const f=b=>{m(),g(b),c.style.display="block"},h=()=>{c.style.display="none",d=null,u=[]},p=()=>{const b=a.getBoundingClientRect(),{left:E,top:w,width:C,height:S}=b;return{left:E,top:w,width:C,height:S}},v=b=>{const{size:E,parent:w}=b,C=document.createElement("div"),{x:S,y:$,w:D,h:B}=E,H=vt(E.angle||0);return C.style.position="absolute",C.style.left=`${S}px`,C.style.top=`${$}px`,C.style.width=`${D}px`,C.style.height=`${B}px`,C.style.transform=`rotate(${H}deg)`,w.appendChild(C),C},g=b=>{const{viewScaleInfo:E,element:w,groupQueue:C}=b,{scale:S,offsetTop:$,offsetLeft:D}=E;o.children&&Array.from(o.children).forEach(A=>{A.remove()});let B=o;for(let A=0;A0&&(G=w.x*S,j=w.y*S,M=w.w*S,I=w.h*S);let k="center",z="center";H.textAlign==="left"?k="start":H.textAlign==="right"&&(k="end"),H.verticalAlign==="top"?z="start":H.verticalAlign==="bottom"&&(z="end"),i.style.display="inline-flex",i.style.justifyContent=k,i.style.alignItems=z,i.style.position="absolute",i.style.left=`${G-1}px`,i.style.top=`${j-1}px`,i.style.width=`${M+2}px`,i.style.height=`${I+2}px`,i.style.transform=`rotate(${vt(w.angle||0)}deg)`,i.style.boxSizing="border-box",i.style.border="1px solid #1973ba",i.style.resize="none",i.style.overflow="hidden",i.style.wordBreak="break-all",i.style.background="#FFFFFF",i.style.color="#333333",i.style.fontSize=`${H.fontSize*S}px`,i.style.lineHeight=`${H.lineHeight*S}px`,i.style.fontFamily=H.fontFamily,i.style.fontWeight=`${H.fontWeight}`,i.style.padding="0",i.style.margin="0",i.style.outline="none",i.innerText=H.text||"",B.appendChild(i)},m=()=>{const{left:b,top:E,width:w,height:C}=p();o.style.position="absolute",o.style.overflow="hidden",o.style.top=`${E}px`,o.style.left=`${b}px`,o.style.width=`${w}px`,o.style.height=`${C}px`};c.addEventListener("click",()=>{h()}),i.addEventListener("click",b=>{b.stopPropagation()}),i.addEventListener("input",()=>{d&&u&&(d.detail.text=i.innerText||"",t.trigger(Fo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u||[]]}),r.drawFrame())}),i.addEventListener("blur",()=>{d&&u&&t.trigger(Fo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u]}),h()}),i.addEventListener("keydown",b=>{b.stopPropagation()}),i.addEventListener("keypress",b=>{b.stopPropagation()}),i.addEventListener("keyup",b=>{b.stopPropagation()}),i.addEventListener("wheel",b=>{b.stopPropagation(),b.preventDefault()});const y=b=>{var E;b!=null&&b.position&&(b!=null&&b.element)&&((E=b==null?void 0:b.element)===null||E===void 0?void 0:E.type)==="text"&&(d=b.element,u=b.position),f(b)};return{name:"@middleware/text-editor",use(){t.on(pi,y)},disuse(){t.off(pi,y)}}},qa="@middleware/select",Ho="@middleware/select-clear",Xl=e=>{const{viewer:t,sharer:n,boardContent:r,calculator:a,eventHub:i}=e,{helperContext:o}=r;let s=null,c=null;n.setSharedStorage(xe,null);const d=()=>n.getSharedStorage(on),u=y=>{let b=n.getSharedStorage(Ge);Array.isArray(b)||(b=[]),b.length>0?rg(y,b[b.length-1])?b.push(y):b=[]:b.length===0&&b.push(y);const E=us(b);return n.setSharedStorage(Ge,b),n.setSharedStorage(co,E),b.length>0},f=y=>{n.setSharedStorage(Ir,y);let b=null;y&&(b=Jr(y,{groupQueue:n.getSharedStorage(Ge)})),n.setSharedStorage(lo,b)},h=(y,b)=>{var E;if(n.setSharedStorage(on,y),y.length===1){const w=wa(y[0],{groupQueue:n.getSharedStorage(Ge),controllerSize:Gu,viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(_n,w),n.setSharedStorage(Tn,Nt(y[0].uuid,((E=n.getActiveStorage("data"))===null||E===void 0?void 0:E.elements)||[]))}else n.setSharedStorage(_n,null),n.setSharedStorage(Tn,[]);(b==null?void 0:b.triggerEvent)===!0&&i.trigger(qa,{uuids:y.map(w=>w.uuid)})},p=()=>({ctx:o,calculator:a,data:n.getActiveStorage("data"),selectedElements:d(),viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Ge),areaSize:null,selectedElementController:n.getSharedStorage(_n),selectedElementPosition:n.getSharedStorage(Tn)}),v=()=>{n.setSharedStorage(xe,null),n.setSharedStorage(Kt,null),n.setSharedStorage(xa,null),n.setSharedStorage(Sa,null),n.setSharedStorage(Ge,[]),n.setSharedStorage(co,[]),n.setSharedStorage(Ir,null),n.setSharedStorage(lo,null),n.setSharedStorage(on,[]),n.setSharedStorage(Up,null),n.setSharedStorage(_n,null),n.setSharedStorage(Tn,[]),n.setSharedStorage(On,[]),n.setSharedStorage(In,[]),n.setSharedStorage(Ea,null)};v();const g=({uuids:y,positions:b})=>{let E=[];const w=n.getSharedStorage(xe),C=n.getActiveStorage("data");b&&Array.isArray(b)?E=hu(b,(C==null?void 0:C.elements)||[]):E=La(y,(C==null?void 0:C.elements)||[]);let S=!1;if(!w&&E.length===1?(n.setSharedStorage(xe,"select"),S=!0):w==="select"&&E.length===1&&(S=!0),S){const $=E[0],D=uu($.uuid,(C==null?void 0:C.elements)||[]);n.setSharedStorage(Ge,D),h(E),t.drawFrame()}},m=()=>{v(),t.drawFrame()};return{name:"@middleware/selector",use(){i.on(qa,g),i.on(Ho,m)},disuse(){i.off(qa,g),i.off(Ho,m)},hover:y=>{var b,E,w,C,S;const $=n.getSharedStorage(Kt),D=n.getSharedStorage(xe),B=n.getSharedStorage(Ge),H=k=>{const z=k.type;c===null&&i.trigger("cursor",{type:z,groupQueue:k.groupQueue,element:k.elements[0]})};if((B==null?void 0:B.length)>0){if(!Wl(y.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Ge)})){f(null),t.drawFrame();return}const z=$r(y.point,p());if(H(z),$||["area","drag","drag-list"].includes(D)){f(null),t.drawFrame();return}if(((b=z==null?void 0:z.elements)===null||b===void 0?void 0:b.length)===1){f(z.elements[0]),t.drawFrame();return}f(null),t.drawFrame();return}if($||["area","drag","drag-list"].includes(D)){f(null);return}if(D==="drag"){f(null);return}const G=d(),j=n.getActiveViewScaleInfo(),M=n.getActiveViewSizeInfo(),I=$r(y.point,Object.assign(Object.assign({},p()),{areaSize:uo(G,{viewScaleInfo:j,viewSizeInfo:M,calculator:a})}));if(H(I),I.type!==null&&!(I.type==="over-element"&&n.getSharedStorage(xe)==="select"&&I.elements.length===1&&I.elements[0].uuid===((w=(E=d())===null||E===void 0?void 0:E[0])===null||w===void 0?void 0:w.uuid))&&!(I.type==="over-element"&&n.getSharedStorage(xe)===null&&I.elements.length===1&&I.elements[0].uuid===((C=n.getSharedStorage(Ir))===null||C===void 0?void 0:C.uuid))){if(I.type==="over-element"&&((S=I==null?void 0:I.elements)===null||S===void 0?void 0:S.length)===1){f(I.elements[0]),t.drawFrame();return}if(n.getSharedStorage(Ir)){f(null),t.drawFrame();return}}},pointStart:y=>{var b,E,w,C,S,$,D,B,H,G;s=y.point;const j=n.getSharedStorage(Ge);if((j==null?void 0:j.length)>0){if(Wl(y.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:j})){const k=$r(y.point,p());if(((b=k==null?void 0:k.elements)===null||b===void 0?void 0:b.length)===1&&((w=(E=k.elements[0])===null||E===void 0?void 0:E.operations)===null||w===void 0?void 0:w.lock)===!0)return;f(null),k.type==="over-element"&&((C=k==null?void 0:k.elements)===null||C===void 0?void 0:C.length)===1?(h([k.elements[0]],{triggerEvent:!0}),n.setSharedStorage(xe,"drag")):!((S=k.type)===null||S===void 0)&&S.startsWith("resize-")?(n.setSharedStorage(Kt,k.type),n.setSharedStorage(xe,"resize")):h([],{triggerEvent:!0})}else v();t.drawFrame();return}const M=uo(d(),{viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),calculator:a}),I=$r(y.point,Object.assign(Object.assign({},p()),{areaSize:M,groupQueue:[]}));(($=I==null?void 0:I.elements)===null||$===void 0?void 0:$.length)===1&&((B=(D=I.elements[0])===null||D===void 0?void 0:D.operations)===null||B===void 0?void 0:B.lock)===!0||(f(null),I.type==="list-area"?n.setSharedStorage(xe,"drag-list"):I.type==="over-element"&&((H=I==null?void 0:I.elements)===null||H===void 0?void 0:H.length)===1?(h([I.elements[0]],{triggerEvent:!0}),n.setSharedStorage(xe,"drag")):!((G=I.type)===null||G===void 0)&&G.startsWith("resize-")?(n.setSharedStorage(Kt,I.type),n.setSharedStorage(xe,"resize")):(v(),n.setSharedStorage(xe,"area"),n.setSharedStorage(xa,y.point),h([],{triggerEvent:!0})),t.drawFrame())},pointMove:y=>{var b,E,w;n.setSharedStorage(On,[]),n.setSharedStorage(In,[]),n.setSharedStorage(Ea,!0);const C=n.getActiveStorage("data"),S=d(),$=n.getActiveStorage("scale")||1,D=n.getActiveViewScaleInfo(),B=n.getActiveViewSizeInfo(),H=s,G=y.point,j=n.getSharedStorage(Kt),M=n.getSharedStorage(xe),I=n.getSharedStorage(Ge);if(M==="drag"){if(c="drag",C&&(S==null?void 0:S.length)===1&&H&&G&&((E=(b=S[0])===null||b===void 0?void 0:b.operations)===null||E===void 0?void 0:E.lock)!==!0){const{moveX:k,moveY:z}=ag(H,G,I);let A=a.toGridNum(k/$),N=a.toGridNum(z/$);const x=ig(S[0].uuid,{calculator:a,data:C,groupQueue:I,viewScaleInfo:D,viewSizeInfo:B});try{x&&(Fe.x(x.offsetX)&&x.offsetX!==null&&(A=a.toGridNum(A+x.offsetX)),Fe.y(x.offsetY)&&x.offsetY!==null&&(N=a.toGridNum(N+x.offsetY)),n.setSharedStorage(On,x.xLines),n.setSharedStorage(In,x.yLines))}catch(R){console.error(R)}S[0].x=a.toGridNum(S[0].x+A),S[0].y=a.toGridNum(S[0].y+N),h([S[0]]),a.modifyViewVisibleInfoMap(C,{modifyOptions:{type:"updateElement",content:{element:S[0],position:n.getSharedStorage(Tn)||[]}},viewSizeInfo:B,viewScaleInfo:D})}t.drawFrame()}else if(M==="drag-list"){if(c="drag-list",C&&H&&G&&(S==null?void 0:S.length)>1){const k=(G.x-H.x)/$,z=(G.y-H.y)/$;S.forEach(A=>{var N;A&&((N=A==null?void 0:A.operations)===null||N===void 0?void 0:N.lock)!==!0&&(A.x=a.toGridNum(A.x+k),A.y=a.toGridNum(A.y+z),a.modifyViewVisibleInfoMap(C,{modifyOptions:{type:"updateElement",content:{element:A,position:Nt(A.uuid,C.elements)||[]}},viewSizeInfo:B,viewScaleInfo:D}))}),n.setActiveStorage("data",C)}t.drawFrame()}else if(M==="resize"){if(C&&(S==null?void 0:S.length)===1&&H&&(j!=null&&j.startsWith("resize-"))){c="resize";const k=[];I.forEach(N=>{const{x,y:R,w:Y,h:_,angle:U=0}=N;k.push({x,y:R,w:Y,h:_,angle:0-U})});let z=H,A=G;if(I.length>0&&(z=di(H,k),A=di(G,k)),j==="resize-rotate"){const N=n.getSharedStorage(_n),x=[N.topLeft.center,N.topRight.center,N.bottomLeft.center,N.bottomRight.center],R=ou(x),Y=tg(S[0],{center:R,viewScaleInfo:D,viewSizeInfo:B,start:H,end:G,resizeType:j,sharer:n});S[0].angle=a.toGridNum(Y.angle||0)}else{const N=eg(S[0],{scale:$,start:z,end:A,resizeType:j,sharer:n}),x={ignore:!!S[0].angle};S[0].x=a.toGridNum(N.x,x),S[0].y=a.toGridNum(N.y,x),S[0].type==="group"&&((w=S[0].operations)===null||w===void 0?void 0:w.deepResize)===!0?xu(S[0],{w:a.toGridNum(N.w,x),h:a.toGridNum(N.h,x)}):(S[0].w=a.toGridNum(N.w,x),S[0].h=a.toGridNum(N.h,x))}h([S[0]]),a.modifyViewVisibleInfoMap(C,{modifyOptions:{type:"updateElement",content:{element:S[0],position:n.getSharedStorage(Tn)||[]}},viewSizeInfo:B,viewScaleInfo:D}),t.drawFrame()}}else M==="area"&&(c="area",n.setSharedStorage(Sa,y.point),t.drawFrame());s=y.point},pointEnd(y){c=null,n.setSharedStorage(On,[]),n.setSharedStorage(In,[]),n.setSharedStorage(Ea,!1);const b=n.getActiveStorage("data"),E=n.getSharedStorage(Kt),w=n.getSharedStorage(xe),C=n.getActiveViewSizeInfo();let S=!1;if(s=null,w==="resize"&&E)n.setSharedStorage(Kt,null),S=!0;else if(w==="area"){if(n.setSharedStorage(xe,null),b){const D=n.getSharedStorage(xa),B=n.getSharedStorage(Sa);if(D&&B){const{elements:H}=ng(b,{start:D,end:B,calculator:a,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()});H.length>0&&(n.setSharedStorage(xe,"drag-list"),h(H,{triggerEvent:!0}),S=!0)}}}else w==="drag-list"?(n.setSharedStorage(xe,"drag-list-end"),S=!0):b&&(a.getPointElement(y.point,{data:b,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}).element?(n.setSharedStorage(xe,"select"),S=!0):n.setSharedStorage(xe,null));n.getSharedStorage(xe)===null&&(v(),S=!0),(()=>{if(S){if(b&&Array.isArray(b==null?void 0:b.elements)&&["drag","drag-list"].includes(w)){const D=q0(b.elements,C,{extend:!0});n.setActiveStorage("contextHeight",D.contextSize.contextHeight),n.setActiveStorage("contextWidth",D.contextSize.contextWidth)}b&&["drag","drag-list","drag-list-end","resize"].includes(w)&&i.trigger("change",{data:b,type:"dragElement"}),t.drawFrame()}})()},pointLeave(){s=null,v(),t.drawFrame()},doubleClick(y){var b,E,w,C,S,$;const D=$r(y.point,p());if(n.setSharedStorage(_n,null),n.setSharedStorage(on,[]),!(D.elements.length===1&&((E=(b=D.elements[0])===null||b===void 0?void 0:b.operations)===null||E===void 0?void 0:E.lock)===!0)){if(D.elements.length===1&&((w=D.elements[0])===null||w===void 0?void 0:w.type)==="group"){if(u(D.elements[0])===!0){n.setSharedStorage(xe,null),t.drawFrame();return}}else D.elements.length===1&&((C=D.elements[0])===null||C===void 0?void 0:C.type)==="text"&&i.trigger(pi,{element:D.elements[0],groupQueue:n.getSharedStorage(Ge)||[],position:Nt((S=D.elements[0])===null||S===void 0?void 0:S.uuid,(($=n.getActiveStorage("data"))===null||$===void 0?void 0:$.elements)||[]),viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(xe,null)}},beforeDrawFrame({snapshot:y}){var b;const{activeStore:E,sharedStore:w}=y,{scale:C,offsetLeft:S,offsetTop:$,offsetRight:D,offsetBottom:B,width:H,height:G,contextHeight:j,contextWidth:M,devicePixelRatio:I}=E,k=e.sharer,z={scale:C,offsetLeft:S,offsetTop:$,offsetRight:D,offsetBottom:B},A={width:H,height:G,contextHeight:j,contextWidth:M,devicePixelRatio:I},x=w[on][0],R=w[Ir],Y=w[lo],_=w[xe],U=w[xa],V=w[Sa],O=w[Ge],P=w[co],L=w[Ea],F={calculator:a,viewScaleInfo:z,viewSizeInfo:A},te=x?wa(x,{groupQueue:O,controllerSize:10,viewScaleInfo:z}):null,xt=!!(!((b=R==null?void 0:R.operations)===null||b===void 0)&&b.lock);if((O==null?void 0:O.length)>0){if(qp(o,P,F),R&&_!=="drag"&&(xt?Fl(o,Y,Object.assign(Object.assign({},F),{controller:wa(R,{groupQueue:O,controllerSize:10,viewScaleInfo:z})})):Bl(o,Y,F)),!xt&&x&&["select","drag","resize"].includes(_)&&(Hl(o,te,Object.assign(Object.assign({},F),{element:x,calculator:a,hideControllers:!!L&&_==="drag"})),_==="drag")){const nt=k.getSharedStorage(On),ee=k.getSharedStorage(In);Vl(o,{xLines:nt,yLines:ee})}}else if(R&&_!=="drag"&&(xt?Fl(o,Y,Object.assign(Object.assign({},F),{controller:wa(R,{groupQueue:O,controllerSize:10,viewScaleInfo:z})})):Bl(o,Y,F)),!xt&&x&&["select","drag","resize"].includes(_)){if(Hl(o,te,Object.assign(Object.assign({},F),{element:x,calculator:a,hideControllers:!!L&&_==="drag"})),_==="drag"){const nt=k.getSharedStorage(On),ee=k.getSharedStorage(In);Vl(o,{xLines:nt,yLines:ee})}}else if(_==="area"&&U&&V)Kp(o,{start:U,end:V});else if(["drag-list","drag-list-end"].includes(_)){const nt=uo(d(),{viewScaleInfo:k.getActiveViewScaleInfo(),viewSizeInfo:k.getActiveViewSizeInfo(),calculator:a});nt&&Jp(o,{areaSize:nt})}}}},ia="SCROLL",ei=Symbol(`${ia}_xThumbRect`),ti=Symbol(`${ia}_yThumbRect`),Hn=Symbol(`${ia}_prevPoint`),Vo=Symbol(`${ia}_activePoint`),Fr=Symbol(`${ia}_activeThumbType`),sg=12,Zl=16,lg=.3,Ql={width:sg,thumbColor:"#000000AA",scrollBarColor:"#FFFFFF60",showScrollBar:!1};function Kl(e,t,n){const r=e,{x:a,y:i,w:o,h:s}=n;return r.beginPath(),r.rect(a,i,o,s),r.closePath(),!!r.isPointInPath(t.x,t.y)}function cg(e,t,n){let r=null;const{xThumbRect:a,yThumbRect:i}=n;return a&&Kl(e,t,a)?r="X":i&&Kl(e,t,i)&&(r="Y"),r}function dg(e){const{sharedStore:t}=e;return{activePoint:t[Vo]||null,prevPoint:t[Hn]||null,activeThumbType:t[Fr]||null,xThumbRect:t[ei]||null,yThumbRect:t[ti]||null}}function ug(e,t){const{width:n,height:r}=t,{offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s}=e,c=Zl*2.5,d=Zl;let u=0,f=0;u=Math.max(c,n-d*2-(Math.abs(o)+Math.abs(s))),u>=n&&(u=n),f=Math.max(c,r-d*2-(Math.abs(a)+Math.abs(i))),f>=r&&(f=r);const h=d,p=n-u-d;let v=h;o>0?v=h:s>0?v=p:o<=0&&u>0&&!(o===0&&s===0)&&(v=h+(n-u)*Math.abs(o)/(Math.abs(o)+Math.abs(s)),v=Math.min(Math.max(0,v-h),n-u));const g=d,m=r-f-d;let y=g;a>0?y=g:i>0?y=m:a<=0&&f>0&&!(a===0&&i===0)&&(y=g+(r-f)*Math.abs(a)/(Math.abs(a)+Math.abs(i)),y=Math.min(Math.max(0,y-g),r-f));const b={x:v,y:r-d,w:u,h:d},E={x:n-d,y,w:d,h:f};return{lineSize:d,xSize:u,ySize:f,translateY:y,translateX:v,thumbColor:Ql.thumbColor,scrollBarColor:Ql.scrollBarColor,xThumbRect:b,yThumbRect:E}}function Jl(e,t){let{x:n,y:r,h:a,w:i}=t;e.save(),e.shadowColor="#FFFFFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=1;{const{color:o,axis:s}=t;s==="X"?(r=r+a/4+0,a=a/2):s==="Y"&&(n=n+i/4+0,i=i/2);let c=t.r;c=Math.min(c,i/2,a/2),(i{const{viewer:t,boardContent:n,sharer:r}=e,{helperContext:a}=n;r.setSharedStorage(ei,null),r.setSharedStorage(ti,null);const i=()=>{r.setSharedStorage(Hn,null),r.setSharedStorage(Vo,null),r.setSharedStorage(Fr,null)};i();const o=d=>{const u=r.getSharedStorage(Hn);if(u){const{offsetLeft:f,offsetRight:h}=r.getActiveViewScaleInfo(),{width:p}=r.getActiveViewSizeInfo(),v=-(d.x-u.x),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveX:m}),t.drawFrame()}},s=d=>{const u=r.getSharedStorage(Hn);if(u){const{offsetTop:f,offsetBottom:h}=r.getActiveViewScaleInfo(),{height:p}=r.getActiveViewSizeInfo(),v=-(d.y-u.y),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveY:m}),t.drawFrame()}},c=d=>cg(a,d,{xThumbRect:r.getSharedStorage(ei),yThumbRect:r.getSharedStorage(ti)});return{name:"@middleware/scroller",wheel:d=>{t.scroll({moveX:0-d.deltaX,moveY:0-d.deltaY}),t.drawFrame()},pointStart:d=>{const{point:u}=d,f=c(u);if(f==="X"||f==="Y")return r.setSharedStorage(Fr,f),r.setSharedStorage(Hn,u),!1},pointMove:d=>{const{point:u}=d,f=r.getSharedStorage(Fr);if(f==="X"||f==="Y")return r.setSharedStorage(Vo,u),f==="X"?o(u):f==="Y"&&s(u),r.setSharedStorage(Hn,u),!1},pointEnd:()=>{const d=r.getSharedStorage(Fr);if(i(),d==="X"||d==="Y")return t.scroll({moveX:0,moveY:0}),t.drawFrame(),!1},beforeDrawFrame({snapshot:d}){const{xThumbRect:u,yThumbRect:f}=hg(a,{snapshot:d});r.setSharedStorage(ei,u),r.setSharedStorage(ti,f)}}},Yu="@middleware/scale",ec=e=>{const{viewer:t,sharer:n,eventHub:r}=e,a=50,i=.05;return{name:"@middleware/scaler",wheelScale(o){const{deltaY:s,point:c}=o,{scale:d}=n.getActiveViewScaleInfo();let u=d;if(s<0?u=d*1.1:s>0&&(u=d*.9),ua)return;const{moveX:f,moveY:h}=t.scale({scale:u,point:c});t.scroll({moveX:f,moveY:h}),t.drawFrame();const p=ve(d);r.trigger(Yu,{scale:p})}}},ze=16,pg="#FFFFFFA8",gg="#00000080",Uu="#000000",Xu="#00000080",Zu="monospace",Wo=10,Qu=100,tc="#AAAAAA20",nc="#AAAAAA40",zi=1,rc="#196097";function Ku(e){const{scale:t,viewLength:n,viewOffset:r}=e,a=[];let i=10;i=ve(i/t,{decimalPlaces:0}),i=Math.max(10,Math.min(i,1e3));const o=i*10,s=i*5;let c=0;const d=i*t,u=0-r,f=0,h=u%d,p=(u-h+d)/t,v=f+(d-h);for(;v+c*d{e.fillStyle=Xu,e.textBaseline="top",e.$setFont({fontWeight:Qu,fontSize:Wo,fontFamily:Zu}),e.fillText(h,s+Wo,d.position+s)})}}}function wg(e,t){const{viewSizeInfo:n}=t,{width:r,height:a}=n;e.beginPath(),e.moveTo(0,0),e.lineTo(r+1,0),e.lineTo(r+1,ze),e.lineTo(ze,ze),e.lineTo(ze,a+1),e.lineTo(0,a+1),e.lineTo(0,0),e.closePath(),e.fillStyle=pg,e.fill(),e.lineWidth=zi,e.setLineDash([]),e.strokeStyle=gg,e.stroke()}function xg(e,t){const{xList:n,yList:r,viewSizeInfo:a}=t,{width:i,height:o}=a;for(let s=0;s0){const s=Ii(n),c=$i(n),d=[],u=[],f=[],h=[],p=[];if(i.forEach(b=>{const E=r.calcViewRectInfoFromRange(b.uuid,{viewScaleInfo:s,viewSizeInfo:c});E&&(d.push(E),u.push(E.left.x),f.push(E.right.x),h.push(E.top.y),p.push(E.bottom.y))}),!(d.length>0))return;const v=Math.min(...u),g=Math.max(...f),m=Math.min(...h),y=Math.max(...p);e.globalAlpha=1,e.beginPath(),e.moveTo(v,0),e.lineTo(g,0),e.lineTo(g,ze),e.lineTo(v,ze),e.fillStyle=rc,e.closePath(),e.fill(),e.beginPath(),e.moveTo(0,m),e.lineTo(ze,m),e.lineTo(ze,y),e.lineTo(0,y),e.fillStyle=rc,e.closePath(),e.fill()}}const Go="@middleware/show-ruler",ac=e=>{const{boardContent:t,viewer:n,eventHub:r,calculator:a}=e,{helperContext:i,underContext:o}=t;let s=!0,c=!0;const d=u=>{typeof(u==null?void 0:u.show)=="boolean"&&(s=u.show),typeof(u==null?void 0:u.showGrid)=="boolean"&&(c=u.showGrid),(typeof(u==null?void 0:u.show)=="boolean"||typeof(u==null?void 0:u.showGrid)=="boolean")&&n.drawFrame()};return{name:"@middleware/ruler",use(){r.on(Go,d)},disuse(){r.off(Go,d)},beforeDrawFrame:({snapshot:u})=>{if(s===!0){const f=Ii(u),h=$i(u);Sg(i,{snapshot:u,calculator:a}),wg(i,{viewScaleInfo:f,viewSizeInfo:h});const p=vg({viewScaleInfo:f,viewSizeInfo:h});bg(i,{scaleList:p});const v=mg({viewScaleInfo:f,viewSizeInfo:h});yg(i,{scaleList:v}),c===!0&&xg(o,{xList:p,yList:v,viewScaleInfo:f,viewSizeInfo:h})}}}},Eg="DRAG",Ma=Symbol(`${Eg}_prevPoint`),ic=e=>{const{eventHub:t,sharer:n,viewer:r}=e;let a=!1;return{name:"@middleware/dragger",hover(){a!==!0&&t.trigger("cursor",{type:"drag-default"})},pointStart(i){const{point:o}=i;n.setSharedStorage(Ma,o),a=!0,t.trigger("cursor",{type:"drag-active"})},pointMove(i){const{point:o}=i,s=n.getSharedStorage(Ma);if(o&&s){const c=o.x-s.x,d=o.y-s.y;r.scroll({moveX:c,moveY:d}),r.drawFrame()}n.setSharedStorage(Ma,o)},pointEnd(){a=!1,n.setSharedStorage(Ma,null),t.trigger("cursor",{type:"drag-default"})}}},fs="monospace";function Cg(e,t){const{point:n,rotateCenter:r,angle:a,text:i,color:o,background:s,fontSize:c,lineHeight:d}=t;na(e,a,r,()=>{e.$setFont({fontWeight:"300",fontSize:c,fontFamily:fs});const u=(d-c)/2,f=e.$undoPixelRatio(e.measureText(i).width),h={x:n.x-f/2-u,y:n.y},p={x:h.x+f+u*2,y:h.y+c+u},v={x:n.x-f/2,y:n.y};e.setLineDash([]),e.fillStyle=s,e.beginPath(),e.moveTo(h.x,h.y),e.lineTo(p.x,h.y),e.lineTo(p.x,p.y),e.lineTo(h.x,p.y),e.closePath(),e.fill(),e.fillStyle=o,e.textBaseline="top",e.fillText(i,v.x,v.y+u)})}function Mg(e,t){const{point:n,rotateCenter:r,angle:a,text:i,color:o,background:s,fontSize:c,lineHeight:d}=t;na(e,a,r,()=>{e.$setFont({fontWeight:"300",fontSize:c,fontFamily:fs});const u=(d-c)/2,f=e.$undoPixelRatio(e.measureText(i).width),h={x:n.x,y:n.y},p={x:h.x+f+u*2,y:h.y+c+u},v={x:n.x+u,y:n.y};e.setLineDash([]),e.fillStyle=s,e.beginPath(),e.moveTo(h.x,h.y),e.lineTo(p.x,h.y),e.lineTo(p.x,p.y),e.lineTo(h.x,p.y),e.closePath(),e.fill(),e.fillStyle=o,e.textBaseline="top",e.fillText(i,v.x,v.y+u)})}function Ag(e,t){const{point:n,rotateCenter:r,angle:a,text:i,color:o,background:s,fontSize:c,lineHeight:d}=t;na(e,a,r,()=>{e.$setFont({fontWeight:"300",fontSize:c,fontFamily:fs});const u=(d-c)/2,f=e.$undoPixelRatio(e.measureText(i).width),h={x:n.x,y:n.y},p={x:h.x+f+u*2,y:h.y+c+u},v={x:n.x+u,y:n.y};e.setLineDash([]),e.fillStyle=s,e.beginPath(),e.moveTo(h.x,h.y),e.lineTo(p.x,h.y),e.lineTo(p.x,p.y),e.lineTo(h.x,p.y),e.closePath(),e.fill(),e.fillStyle=o,e.textBaseline="top",e.fillText(i,v.x,v.y+u)})}const fo="#1973bac6",ho="#ffffff",Jt=10,po=16,oc=e=>{const{boardContent:t,calculator:n}=e,{helperContext:r}=t;return{name:"@middleware/info",beforeDrawFrame({snapshot:a}){const{sharedStore:i}=a,o=i[on],s=i[xe],c=i[Ge]||[];if(o.length===1){const d=o[0];if(d&&["select","drag","resize"].includes(s)){const u=Ii(a),f=$i(a),{x:h,y:p,w:v,h:g,angle:m}=d,y=[...c,{uuid:ln(),x:h,y:p,w:v,h:g,angle:m,type:"group",detail:{children:[]}}],b={viewScaleInfo:u,viewSizeInfo:f},E=n.calcViewRectInfoFromOrigin(d.uuid,b);let w=0;y.forEach(S=>{w+=S.angle||0});const C=Dt(vt(0-w));if(E){const S=E==null?void 0:E.center,$={topLeft:_e(S,E.topLeft,C),topRight:_e(S,E.topRight,C),bottomRight:_e(S,E.bottomRight,C),bottomLeft:_e(S,E.bottomLeft,C),center:_e(S,E.center,C),top:_e(S,E.top,C),right:_e(S,E.right,C),bottom:_e(S,E.bottom,C),left:_e(S,E.left,C)},D=ve(d.x,{decimalPlaces:2}),B=ve(d.y,{decimalPlaces:2}),H=ve(d.w,{decimalPlaces:2}),G=ve(d.h,{decimalPlaces:2}),j=`${ve(D,{decimalPlaces:0})},${ve(B,{decimalPlaces:0})}`,M=`${ve(H,{decimalPlaces:0})}x${ve(G,{decimalPlaces:0})}`,I=`${ve(d.angle||0,{decimalPlaces:0})}°`;Cg(r,{point:{x:$.bottom.x,y:$.bottom.y+Jt},rotateCenter:$.center,angle:w,text:M,fontSize:Jt,lineHeight:po,color:ho,background:fo}),Mg(r,{point:{x:$.topLeft.x,y:$.topLeft.y-Jt*2},rotateCenter:$.center,angle:w,text:j,fontSize:Jt,lineHeight:po,color:ho,background:fo}),Ag(r,{point:{x:$.top.x+Jt,y:$.top.y-Jt*2},rotateCenter:$.center,angle:w,text:I,fontSize:Jt,lineHeight:po,color:ho,background:fo})}}}}}};var go=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ie=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Yo,$e,ni,gi,Ju;class _g{constructor(t,n){Yo.add(this),$e.set(this,void 0),ni.set(this,void 0),gi.set(this,void 0);const{devicePixelRatio:r=1,width:a,height:i,createCustomContext2D:o}=n;go(this,gi,t,"f");const s=document.createElement("canvas");go(this,ni,s,"f"),Ie(this,Yo,"m",Ju).call(this),t.appendChild(s);const c=U0(s,{width:a,height:i,devicePixelRatio:r,offscreen:!0,createCustomContext2D:o}),d=new Fp({boardContent:c,container:t}),u=d.getSharer();u.setActiveViewSizeInfo({width:a,height:i,devicePixelRatio:r,contextWidth:a,contextHeight:i}),go(this,$e,d,"f"),this.resize(u.getActiveViewSizeInfo());const f=d.getEventHub();new Yp(t,{eventHub:f})}isDestroyed(){return Ie(this,$e,"f").isDestroyed()}destroy(){Ie(this,$e,"f").destroy(),Ie(this,ni,"f").remove()}use(t){Ie(this,$e,"f").use(t)}disuse(t){Ie(this,$e,"f").disuse(t)}setData(t,n){lu((t==null?void 0:t.elements)||[]),Ie(this,$e,"f").setData(t,n)}getData(){return Ie(this,$e,"f").getData()}scale(t){Ie(this,$e,"f").scale(t),Ie(this,$e,"f").getViewer().drawFrame()}resize(t){const n=Ie(this,$e,"f"),a=n.getSharer().getActiveViewSizeInfo();n.resize(Object.assign(Object.assign({},a),t))}clear(){Ie(this,$e,"f").clear()}on(t,n){Ie(this,$e,"f").getEventHub().on(t,n)}off(t,n){Ie(this,$e,"f").getEventHub().off(t,n)}trigger(t,n){Ie(this,$e,"f").getEventHub().trigger(t,n)}getViewInfo(){const n=Ie(this,$e,"f").getSharer(),r=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo();return{viewSizeInfo:r,viewScaleInfo:a}}refresh(){Ie(this,$e,"f").getViewer().drawFrame()}setViewScale(t){Ie(this,$e,"f").updateViewScaleInfo(t)}getLoadItemMap(){return Ie(this,$e,"f").getRenderer().getLoadItemMap()}onBoardWatcherEvents(){Ie(this,$e,"f").onWatcherEvents()}offBoardWatcherEvents(){Ie(this,$e,"f").offWatcherEvents()}}$e=new WeakMap,ni=new WeakMap,gi=new WeakMap,Yo=new WeakSet,Ju=function(){const t=Ie(this,gi,"f");t.style.position="relative"};const vi="select",Tg={mode:vi};function Og(){return{mode:vi,enableRuler:!1,enableScale:!1,enableScroll:!1,enableSelect:!1,enableTextEdit:!1,enableDrag:!1,enableInfo:!1}}var Ig=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function $g(e){return Ig(this,void 0,void 0,function*(){const{data:t,width:n,height:r,devicePixelRatio:a,viewScaleInfo:i,viewSizeInfo:o,loadItemMap:s}=e;let c=Da({width:n,height:r,devicePixelRatio:a}),d=new Pu({viewContext:c}),u=new $u({viewContext:c,calculator:d});u.setLoadItemMap(s),u.drawData(t,{viewScaleInfo:i,viewSizeInfo:o,forceDrawAll:!0});let f=null,h=c.$getOffscreenCanvas();if(h){const p=yield h.convertToBlob();f=window.URL.createObjectURL(p)}return h=null,c=null,d=null,u=null,{blobURL:f,width:n,height:r,devicePixelRatio:a}})}const Pg="change",sc={change:Pg,ruler:Go,scale:Yu,select:qa,clearSelect:Ho,textEdit:pi,textChange:Fo},Ae={};Object.keys(sc).forEach(e=>{Object.defineProperty(Ae,e,{value:sc[e],writable:!1})});function Rg(e){return["select","drag","readOnly"].includes(e)}function qu(e,t){const{enableRuler:n,enableScale:r,enableScroll:a,enableSelect:i,enableTextEdit:o,enableDrag:s,enableInfo:c}=t.getSnapshot();a===!0?e.use(ql):a===!1&&e.disuse(ql),i===!0?e.use(Xl):i===!1&&e.disuse(Xl),r===!0?e.use(ec):r===!1&&e.disuse(ec),n===!0?e.use(ac):n===!1&&e.disuse(ac),o===!0?e.use(Ul):o===!1&&e.disuse(Ul),s===!0?e.use(ic):s===!1&&e.disuse(ic),c===!0?e.use(oc):c===!1&&e.disuse(oc)}function Uo(e,t,n){let r=!1,a=!1,i=!1,o=!1,s=!1,c=!1;const d=!0;let u="select";n.set("mode",u),Rg(e)?u=e:console.warn(`${e} is invalid mode of iDraw.js`),u==="select"?(r=!0,a=!0,i=!0,o=!0,s=!1,c=!0):u==="drag"?(r=!0,a=!0,i=!1,o=!1,s=!0,c=!0):u==="readOnly"&&(r=!1,a=!1,i=!1,o=!1,s=!1,c=!1),n.set("enableScale",r),n.set("enableScroll",a),n.set("enableSelect",i),n.set("enableTextEdit",o),n.set("enableDrag",s),n.set("enableRuler",c),n.set("enableInfo",d),qu(t,n)}var zg=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},vo=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},oe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Hr,pe,Vr,sn,ef,Xo;class Dg{constructor(t,n){Hr.add(this),pe.set(this,void 0),Vr.set(this,void 0),sn.set(this,new hn({defaultStorage:Og()}));const r=Object.assign(Object.assign({},Tg),n),{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s}=r,c=new _g(t,{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s});vo(this,pe,c,"f"),vo(this,Vr,r,"f"),oe(this,Hr,"m",ef).call(this)}reset(t){const n=oe(this,pe,"f"),r=oe(this,sn,"f");r.clear(),Uo(t.mode||vi,n,r),n.refresh(),vo(this,Vr,Object.assign(Object.assign({},oe(this,Vr,"f")),t),"f")}setMode(t){const n=oe(this,pe,"f"),r=oe(this,sn,"f");Uo(t||vi,n,r),n.refresh()}enable(t){oe(this,Hr,"m",Xo).call(this,t,!0)}disable(t){oe(this,Hr,"m",Xo).call(this,t,!1)}setData(t){const n=oe(this,pe,"f");n.setData(t),n.trigger(Ae.change,{data:t,type:"setData"})}getData(t){const n=oe(this,pe,"f").getData();return n&&(t==null?void 0:t.compact)===!0?y0(n,{loadItemMap:oe(this,pe,"f").getLoadItemMap()}):n}getViewInfo(){return oe(this,pe,"f").getViewInfo()}scale(t){oe(this,pe,"f").scale(t)}setViewScale(t){const n=oe(this,pe,"f");n.setViewScale(t),n.refresh()}centerContent(t){const n=(t==null?void 0:t.data)||oe(this,pe,"f").getData(),{viewSizeInfo:r}=this.getViewInfo();if(Array.isArray(n==null?void 0:n.elements)&&(n==null?void 0:n.elements.length)>0){const a=xp(n,{viewSizeInfo:r});this.setViewScale(a)}}resize(t){oe(this,pe,"f").resize(t)}on(t,n){oe(this,pe,"f").on(t,n)}off(t,n){oe(this,pe,"f").off(t,n)}trigger(t,n){oe(this,pe,"f").trigger(t,n)}selectElement(t){this.selectElements([t])}selectElements(t){this.trigger(Ae.select,{uuids:t})}selectElementByPosition(t){this.selectElementsByPositions([t])}selectElementsByPositions(t){this.trigger(Ae.select,{positions:t})}cancelElements(){this.trigger(Ae.select,{uuids:[]})}createElement(t,n){const{viewScaleInfo:r,viewSizeInfo:a}=oe(this,pe,"f").getViewInfo();return bp(t,(n==null?void 0:n.element)||{},(n==null?void 0:n.viewCenter)===!0?{viewScaleInfo:r,viewSizeInfo:a}:void 0)}updateElement(t){const n=oe(this,pe,"f"),r=n.getData()||{elements:[]};qr(t.uuid,t,r.elements),n.setData(r),n.refresh(),n.trigger(Ae.change,{data:r,type:"updateElement"})}addElement(t,n){var r;const a=oe(this,pe,"f"),i=a.getData()||{elements:[]};if(!n||!(!((r=n==null?void 0:n.position)===null||r===void 0)&&r.length))i.elements.push(t);else if(n!=null&&n.position){const o=[...n==null?void 0:n.position];Su(t,o,i.elements)}return a.setData(i),a.refresh(),a.trigger(Ae.change,{data:i,type:"addElement"}),i}deleteElement(t){const n=oe(this,pe,"f"),r=n.getData()||{elements:[]};yp(t,r.elements),n.setData(r),n.refresh(),n.trigger(Ae.change,{data:r,type:"deleteElement"})}moveElement(t,n){const r=oe(this,pe,"f"),a=r.getData()||{elements:[]},i=Nt(t,a.elements),{elements:o}=Cu(a.elements,{from:i,to:n});a.elements=o,r.setData(a),r.refresh(),r.trigger(Ae.change,{data:a,type:"moveElement"})}getImageBlobURL(t){return zg(this,void 0,void 0,function*(){const n=this.getData()||{elements:[]},{devicePixelRatio:r}=t,a=J0(n.elements),{viewSizeInfo:i}=this.getViewInfo();return yield $g({width:a.w,height:a.h,devicePixelRatio:r,data:n,viewScaleInfo:{scale:1,offsetLeft:-a.x,offsetTop:-a.y,offsetBottom:0,offsetRight:0},viewSizeInfo:Object.assign(Object.assign({},i),{devicePixelRatio:r}),loadItemMap:oe(this,pe,"f").getLoadItemMap()})})}isDestroyed(){return oe(this,pe,"f").isDestroyed()}destroy(){const t=oe(this,pe,"f"),n=oe(this,sn,"f");t.destroy(),n.destroy()}getViewCenter(){const{viewScaleInfo:t,viewSizeInfo:n}=this.getViewInfo();return Sp({viewScaleInfo:t,viewSizeInfo:n})}$onBoardWatcherEvents(){oe(this,pe,"f").onBoardWatcherEvents()}$offBoardWatcherEvents(){oe(this,pe,"f").offBoardWatcherEvents()}}pe=new WeakMap,Vr=new WeakMap,sn=new WeakMap,Hr=new WeakSet,ef=function(){const t=oe(this,pe,"f"),n=oe(this,sn,"f");Uo("select",t,n)},Xo=function(t,n){const r=oe(this,sn,"f");if(["ruler","scroll","scale","info"].includes(t)){const a={ruler:"enableRuler",scroll:"enableScroll",scale:"enableScale",info:"enableInfo"};r.set(a[t],!!n),qu(oe(this,pe,"f"),r),oe(this,pe,"f").refresh()}};const Ng=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}),l.createElement("path",{d:"M921 867L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}))),Lg="base-scale-selector",jg=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=T.useContext(ce),s=o(Lg),c=s("menu-item"),d=s("input"),[u,f]=T.useState(100);T.useEffect(()=>{const m=ve(parseFloat(a||"1")*100);f(m)},[a]);const h=m=>{const{key:y}=m;i==null||i(y)},p=m=>{m.stopPropagation()},g={items:[{label:l.createElement("span",{className:c},l.createElement(le,{className:d,size:"small",value:u,suffix:"%",onClick:p,step:1,min:10,max:1e4,controls:!1,onChange:m=>{if(m&&m>0){const y=ve(m/100);i==null||i(`${y}`)}}})),key:"custom"},...[.5,1,2,3].map(m=>({key:`${m}`,label:l.createElement("span",{className:c},`${ve(m*100)}%`)}))],onClick:h,selectedKeys:[`${a||r}`]};return T.useMemo(()=>l.createElement(_i,{className:be(s(),t),menu:g},l.createElement(Je,{icon:l.createElement(Ng,null),size:"small"},`${ve(parseFloat(a||"1")*100)}%`)),[t,n,r,a,i,u])},kg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M508 512m-112 0a112 112 0 1 0 224 0 112 112 0 1 0-224 0Z"}),l.createElement("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3-7.7 16.2-7.7 35.2 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}))),Bg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M942.3 486.4l-0.1-0.1-0.1-0.1c-36.4-76.7-80-138.7-130.7-186L760.7 351c43.7 40.2 81.5 93.7 114.1 160.9C791.5 684.2 673.4 766 512 766c-51.3 0-98.3-8.3-141.2-25.1l-54.7 54.7C374.6 823.8 439.8 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0.1-51.3zM878.3 154.2l-42.4-42.4c-3.1-3.1-8.2-3.1-11.3 0L707.8 228.5C649.4 200.2 584.2 186 512 186c-192.2 0-335.4 100.5-430.2 300.3v0.1c-7.7 16.2-7.7 35.2 0 51.5 36.4 76.7 80 138.7 130.7 186.1L111.8 824.5c-3.1 3.1-3.1 8.2 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0l712.8-712.8c3.1-3 3.1-8.1 0-11.2zM398.9 537.4c-1.9-8.2-2.9-16.7-2.9-25.4 0-61.9 50.1-112 112-112 8.7 0 17.3 1 25.4 2.9L398.9 537.4z m184.5-184.5C560.5 342.1 535 336 508 336c-97.2 0-176 78.8-176 176 0 27 6.1 52.5 16.9 75.4L263.3 673c-43.7-40.2-81.5-93.7-114.1-160.9C232.6 339.8 350.7 258 512 258c51.3 0 98.3 8.3 141.2 25.1l-69.8 69.8z"}),l.createElement("path",{d:"M508 624c-6.4 0-12.7-0.5-18.8-1.6l-51.1 51.1c21.4 9.3 45.1 14.4 69.9 14.4 97.2 0 176-78.8 176-176 0-24.8-5.1-48.5-14.4-69.9l-51.1 51.1c1 6.1 1.6 12.4 1.6 18.8C620 573.9 569.9 624 508 624z"}))),tf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"}))),nf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),rf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M853.333333 170.666667H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666666v128a42.666667 42.666667 0 0 0 85.333333 0V256h256v554.666667H384a42.666667 42.666667 0 0 0 0 85.333333h256a42.666667 42.666667 0 0 0 0-85.333333h-85.333333V256h256v85.333333a42.666667 42.666667 0 0 0 85.333333 0V213.333333a42.666667 42.666667 0 0 0-42.666667-42.666666z"}))),af=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M0.00592 521.157814v-103.646801l430.267025 235.101281c36.191582 13.567843 70.207188 15.615819 111.870706 0.191998l440.986902-258.365013v103.614802l-435.386966 258.877007c-42.175512 18.303788-91.326944 18.303788-126.398539 0L0.00592 521.157814z"}),l.createElement("path",{d:"M0.00592 743.651242v-104.798789l406.427301 221.43744c17.2798 9.439891 40.511532 17.599797 65.119247 20.383764h27.999676c32.511624-5.023942 47.103455-10.207882 67.615218-22.943735l415.931191-258.173014v98.974855l-430.875018 268.95689c-42.111513 17.439798-95.806892 18.079791-130.878487 0.575994L0.00592 743.619242zM20.069688 246.024995L399.073306 20.971598c41.279523-26.303696 90.430954-27.967677 133.342458-4.35195l421.083131 198.621703c35.743587 17.599797 37.18357 61.311291 2.655969 81.151062l-414.043212 226.205384a165.758083 165.758083 0 0 1-133.374458 4.415949L22.725657 327.208057C9.157814 318.664155 0.90191 303.56033 0.229917 285.000545c-0.607993-18.911781 10.719876-32.159628 19.807771-38.94355z"})," ")),of=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}))),sf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32z m-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792z m0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z"}),l.createElement("path",{d:"M304 456c48.6 0 88-39.4 88-88s-39.4-88-88-88-88 39.4-88 88 39.4 88 88 88z m0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}))),Fg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M256 682.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0zM768 170.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0z"}),l.createElement("path",{d:"M707.84 316.16a42.666667 42.666667 0 0 1 0 60.330667l-331.178667 331.178666a42.666667 42.666667 0 0 1-60.330666-60.330666l331.178666-331.178667a42.666667 42.666667 0 0 1 60.330667 0z"}))),lf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M145 96l66 746.6L511.8 928l299.6-85.4L878.7 96H145z m610.9 700.6l-244.1 69.6-245.2-69.6-56.7-641.2h603.8l-57.8 641.2z"}),l.createElement("path",{d:"M281 249l1.7 24.3 22.7 253.5h206.5v-0.1h112.9l-11.4 118.5L511 672.9v0.2h-0.8l-102.4-27.7-6.5-73.2h-91l11.3 144.7 188.6 52h1.7v-0.4l187.7-51.7 1.7-16.3 21.2-242.2 3.2-24.3H511v0.2H389.9l-8.2-94.2h352.1l1.7-19.5 4.8-47.2L742 249H511z"}))),Hg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-0.7 5.2-2L869 536.2c14.7-12.8 14.7-35.6 0-48.4z"}))),Vg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}),l.createElement("path",{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),qt="node",Wg=e=>{const{className:t,style:n,type:r,uuid:a,nodeKey:i,title:o,position:s,generateClassName:c,onTitleChange:d,onOperationToggle:u,onDelete:f,onSelect:h,onGoToGroup:p,operations:v,isSelected:g}=e,[m,y]=T.useState(!1),[b,E]=T.useState(!1),w=T.useRef(o),C=c(qt),S=c(qt,"icon"),$=c(qt,"title"),D=c(qt,"title","input"),B=c(qt,"title","icon"),H=c(qt,"action"),G=c(qt,"selected"),j=T.useRef(0),M=T.useRef(null);T.useEffect(()=>{var V;m===!0&&((V=M.current)===null||V===void 0||V.focus())},[m]);const I=V=>{y(!1),d==null||d({uuid:i,value:V.target.value||""})},k=V=>{w.current=V.target.value||""},z=V=>{var O;V.code==="Enter"&&(y(!1),d==null||d({uuid:i,value:((O=V==null?void 0:V.target)===null||O===void 0?void 0:O.value)||""}))},A=V=>{V.stopPropagation(),V.preventDefault()},N=V=>{V.stopPropagation(),E(!0)},x=V=>{V.stopPropagation(),E(!1)},R=V=>{const O=Date.now(),P=O-j.current;j.current=O,h==null||h({uuids:[a],positions:[s]}),P<=300&&P>0&&(V.stopPropagation(),V.preventDefault(),y(!0))},Y=V=>{V.stopPropagation(),V.preventDefault(),f==null||f({uuid:i})},_=V=>{V.stopPropagation(),V.preventDefault(),u==null||u({uuid:i,operations:{invisible:!v.invisible}})},U=V=>{V.stopPropagation(),V.preventDefault(),p==null||p({uuid:a,position:s})};return T.useMemo(()=>{w.current=o;function V(O){return O==="rect"?l.createElement(tf,{className:B}):O==="circle"?l.createElement(nf,{className:B}):O==="text"?l.createElement(rf,{className:B}):O==="path"?l.createElement(Fg,{className:B}):O==="image"?l.createElement(sf,{className:B}):O==="svg"?l.createElement(of,{className:B}):O==="group"?l.createElement(af,{className:B}):O==="html"?l.createElement(lf,{className:B}):l.createElement("span",{className:B})}return l.createElement("span",{key:i,style:n,className:be(C,t,g?G:null),onClick:R,onMouseOver:N,onMouseLeave:x},l.createElement("span",{className:$},V(r),l.createElement("span",null,o)),b&&l.createElement("span",{className:H},r==="group"&&l.createElement(Hg,{className:S,onClick:U}),v.invisible?l.createElement(Bg,{className:S,onClick:_}):l.createElement(kg,{className:S,onClick:_}),l.createElement(Vg,{className:S,onClick:Y})),m&&l.createElement("span",{className:D},l.createElement(dn,{ref:M,size:"small",defaultValue:o,onBlur:I,onClick:A,onKeyDown:z,onChange:k})))},[i,o,m,r,b,v,g])};function Gg(e,t){const n=[],{position:r}=t;if(Array.isArray(e)){const a=[...r];e.forEach((i,o)=>{a.push(o),n.push(cf(i,Object.assign(Object.assign({},t),{position:[...a]}))),a.pop()})}return n}const cf=(e,t)=>{const{onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,position:s,selectedKeys:c}=t,d={key:e.key,title:l.createElement(Wg,{uuid:e.key,title:e.title,position:s,operations:e.operations,nodeKey:e.key,type:e.type,generateClassName:t.generateClassName,onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,isSelected:c==null?void 0:c.includes(e.key)}),children:[]};if(Array.isArray(e.children)){const u=[...s];e.children.forEach((f,h)=>{u.push(h),d.children.push(cf(f,Object.assign(Object.assign({},t),{position:[...u]}))),u.pop()})}return d},Yg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}),l.createElement("path",{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8C574.1 404.4 544.1 392 512 392z"}))),Ug=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M264 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM760 654c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),Xg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M120 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM120 654h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),Zg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M904 158H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 582H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),Qg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}))),Kg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333zM128 469.333333v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM128 640v85.333333h85.333333v-85.333333z m0-341.333333v85.333333h85.333333v-85.333333z m341.333333 341.333333v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128zM128 810.666667v85.333333h768v-85.333333z"}))),Jg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M592 928H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96zM976 0H784a48 48 0 1 0 0 96h144v144.016a48 48 0 1 0 96 0V48a48 48 0 0 0-48-48zM240 928H96v-144a48 48 0 1 0-96 0v192a48 48 0 0 0 48 48h192a48 48 0 1 0 0-96zM48 640a48 48 0 0 0 48-48V432a48 48 0 1 0-96 0v160a48 48 0 0 0 48 48zM240 0H48a48 48 0 0 0-48 48v192a48 48 0 1 0 96 0V96h144a48 48 0 1 0 0-96z m784 592V432a48 48 0 1 0-96 0v160a48 48 0 1 0 96 0zM592 0H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96z m384 736a48 48 0 0 0-48 48v144h-144a48 48 0 1 0 0 96h192a48 48 0 0 0 48-48V784a48 48 0 0 0-48-48z"}))),qg=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333z m-512-170.666667v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM469.333333 640v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v768h85.333333V128z m170.666667 0v85.333333h85.333333V128z m170.666666 682.666667v85.333333h85.333334v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m-512 0v85.333333h85.333333v-85.333333z"}))),ev=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333zM128 213.333333h85.333333V128H128v85.333333z m170.666667 0h85.333333V128h-85.333333v85.333333z m0 341.333334h85.333333v-85.333334h-85.333333v85.333334zM128 896h85.333333v-85.333333H128v85.333333z m341.333333 0h85.333334v-85.333333h-85.333334v85.333333zM128 554.666667h85.333333v-85.333334H128v85.333334z m0 170.666666h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m170.666667-170.666666h85.333333v-85.333334h-85.333333v85.333334z m170.666667-426.666667v768h85.333333V128h-85.333333z m-170.666667 768h85.333333v-85.333333h-85.333333v85.333333z m0-682.666667h85.333333V128h-85.333333v85.333333z m-170.666667 341.333334h85.333334v-85.333334h-85.333334v85.333334z m0-341.333334h85.333334V128h-85.333334v85.333333z m0 170.666667h85.333334v-85.333333h-85.333334v85.333333z"}))),tv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333z m0-341.333333h85.333333v-85.333334h-85.333333v85.333334z m170.666666 0h85.333334v-85.333334h-85.333334v85.333334z m0 341.333333h85.333334v-85.333333h-85.333334v85.333333zM128 725.333333h85.333333v-85.333333H128v85.333333z m0 170.666667h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333334H128v85.333334z m0-170.666667h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m341.333334-341.333333h85.333333v-85.333333h-85.333333v85.333333z m0 170.666667h85.333333v-85.333334h-85.333333v85.333334zM128 128v85.333333h768V128H128z m682.666667 597.333333h85.333333v-85.333333h-85.333333v85.333333z m-170.666667 170.666667h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-512h85.333334v-85.333333h-85.333334v85.333333z m341.333334 512h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-341.333333h85.333333v-85.333334h-85.333333v85.333334z"}))),nv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M341.333333 512a42.666667 42.666667 0 0 0 42.666667 42.666667h256a42.666667 42.666667 0 0 0 0-85.333334H384a42.666667 42.666667 0 0 0-42.666667 42.666667z"}),l.createElement("path",{d:"M384 682.666667H307.626667A176.213333 176.213333 0 0 1 128 527.786667 170.666667 170.666667 0 0 1 298.666667 341.333333h85.333333a42.666667 42.666667 0 0 0 0-85.333333H307.626667a262.4 262.4 0 0 0-262.826667 222.293333A256 256 0 0 0 298.666667 768h85.333333a42.666667 42.666667 0 0 0 0-85.333333zM981.333333 479.573333A262.826667 262.826667 0 0 0 715.093333 256h-64.426666C616.106667 256 597.333333 275.2 597.333333 298.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h76.373333A176.213333 176.213333 0 0 1 896 496.213333 170.666667 170.666667 0 0 1 725.333333 682.666667h-85.333333a42.666667 42.666667 0 0 0 0 85.333333h85.333333a256 256 0 0 0 256-288.426667z"}))),rv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M712 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM136 374h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM136 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM540 824H358c-87.3 0-158-70.7-158-158V484c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v182c0 127 103 230 230 230h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),av=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM484 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM658 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 476h-56c-4.4 0-8 3.6-8 8v182c0 87.3-70.7 158-158 158H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c127 0 230-103 230-230V484c0-4.4-3.6-8-8-8z"}))),iv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M656 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128H358c-127 0-230 103-230 230v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-87.3 70.7-158 158-158h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),ov=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM666 128H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c87.3 0 158 70.7 158 158v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-127-103-230-230-230z"}))),lc=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M896 810.666667v85.333333h-85.333333v-85.333333h85.333333z m-170.666667 0v85.333333h-85.333333v-85.333333h85.333333z m-170.666666 0v85.333333h-85.333334v-85.333333h85.333334z m-170.666667 0v85.333333H298.666667v-85.333333h85.333333z m-170.666667 0v85.333333H128v-85.333333h85.333333z m682.666667-170.666667v85.333333h-85.333333v-85.333333h85.333333zM213.333333 640v85.333333H128v-85.333333h85.333333z m0-170.666667v85.333334H128v-85.333334h85.333333z m469.333334-341.333333a213.418667 213.418667 0 0 1 213.12 204.074667L896 341.333333v213.333334h-85.333333V341.333333a128.426667 128.426667 0 0 0-120.490667-127.786666L682.666667 213.333333h-213.333334V128h213.333334zM213.333333 298.666667v85.333333H128V298.666667h85.333333z m0-170.666667v85.333333H128V128h85.333333z m170.666667 0v85.333333H298.666667V128h85.333333z"}))),sv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z"}),l.createElement("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}))),lv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M510.762667 970.666667A458.666667 458.666667 0 1 1 969.429333 512a459.178667 459.178667 0 0 1-458.666666 458.666667z m0-853.333334a394.666667 394.666667 0 1 0 394.666666 394.666667 395.093333 395.093333 0 0 0-394.666666-394.666667z"}),l.createElement("path",{d:"M512 724.48A212.48 212.48 0 1 1 724.48 512 212.736 212.736 0 0 1 512 724.48z m0-360.96A148.48 148.48 0 1 0 660.48 512 148.608 148.608 0 0 0 512 363.52z"}))),cv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M272.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512z"}),l.createElement("path",{d:"M576.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}))),df=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z"}))),dv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M841.065412 337.317647v352.015059c0 46.802824-23.070118 74.752-39.936 95.111529-14.095059 17.106824-21.443765 26.684235-21.443765 41.803294V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-107.39953c0-37.526588 19.576471-61.199059 35.297882-80.173176 14.576941-17.648941 26.142118-31.563294 26.142118-56.681412V337.317647c0-18.793412-16.143059-36.502588-33.189647-36.502588-19.817412 0-24.033882 3.072-24.214588 3.19247-3.975529 5.360941-3.855059 34.273882-3.794824 57.584942 0.060235 11.384471 0.120471 24.094118-0.12047 38.068705-0.240941 16.504471-12.830118 28.792471-30.358589 29.696a30.117647 30.117647 0 0 1-29.876706-30.117647v-127.698823c0-18.492235-13.372235-32.406588-31.081411-32.406588-16.263529 0-28.190118 12.107294-29.635765 29.394823v120.651294a30.117647 30.117647 0 0 1-60.235294 0V268.047059l-0.120471-0.602353v-46.561882c0-3.975529-0.843294-38.671059-28.551529-38.671059-27.105882 0-31.201882 24.214588-31.201883 38.671059v42.345411c0 1.686588-0.662588 3.252706-0.963764 4.879059v156.250353a30.117647 30.117647 0 0 1-60.235294 0V262.686118c-2.891294-11.685647-11.324235-23.491765-28.069647-23.491765-17.227294 0-31.744 15.721412-31.744 34.334118v201.788235c0 0.421647-0.361412 0.783059-0.361412 1.204706v66.319059a30.117647 30.117647 0 0 1-60.235294 0v-50.236236c-10.601412-3.855059-25.961412-6.987294-34.755765-4.999529-7.107765 1.385412-14.275765 7.649882-18.733176 16.323765a43.309176 43.309176 0 0 0-0.542118 38.369882L345.148235 766.192941a31.563294 31.563294 0 0 1 2.108236 6.505412 32.888471 32.888471 0 0 0 35.418353 25.961412 30.238118 30.238118 0 0 1 33.310117 29.936941V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-77.462588a92.521412 92.521412 0 0 1-66.680471-67.764706L187.934118 567.055059a104.448 104.448 0 0 1 1.927529-90.774588c12.890353-24.877176 35.418353-42.706824 60.295529-47.766589 12.649412-2.590118 29.756235-1.867294 46.682353 1.566118v-43.369412c0-0.602353 0.301176-1.144471 0.361412-1.746823v-111.435294c0-52.163765 41.321412-94.569412 91.979294-94.569412 12.047059 0 23.612235 2.409412 34.093177 6.746353 11.986824-38.791529 44.152471-63.668706 86.317176-63.668706 40.237176 0 71.800471 25.419294 83.666824 63.909647 10.721882-4.517647 22.467765-6.987294 34.876235-6.987294 41.502118 0 75.776 26.744471 87.160471 64.572235 11.023059-2.409412 22.226824-2.951529 32.286117-2.951529 50.718118 0 93.485176 44.272941 93.485177 96.737882z"}))),uv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M170.666667 298.666667a42.666667 42.666667 0 1 1-85.333334 0V256a170.666667 170.666667 0 0 1 170.666667-170.666667h42.666667a42.666667 42.666667 0 1 1 0 85.333334H256a85.333333 85.333333 0 0 0-85.333333 85.333333v42.666667z m554.666666-128a42.666667 42.666667 0 0 1 0-85.333334h42.666667a170.666667 170.666667 0 0 1 170.666667 170.666667v42.666667a42.666667 42.666667 0 0 1-85.333334 0V256a85.333333 85.333333 0 0 0-85.333333-85.333333h-42.666667z m128 554.666666a42.666667 42.666667 0 0 1 85.333334 0v42.666667a170.666667 170.666667 0 0 1-170.666667 170.666667h-42.666667a42.666667 42.666667 0 0 1 0-85.333334h42.666667a85.333333 85.333333 0 0 0 85.333333-85.333333v-42.666667zM298.666667 853.333333a42.666667 42.666667 0 0 1 0 85.333334H256a170.666667 170.666667 0 0 1-170.666667-170.666667v-42.666667a42.666667 42.666667 0 0 1 85.333334 0v42.666667a85.333333 85.333333 0 0 0 85.333333 85.333333h42.666667z"}))),fv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M118.979048 637.074286l137.99619 66.243047 255.171048 123.587048 246.076952-119.222857 147.163429-70.485334a73.142857 73.142857 0 0 1-34.230857 97.109334l-327.119239 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 734.305524A73.142857 73.142857 0 0 1 118.979048 637.074286z m786.090666-153.063619a73.142857 73.142857 0 0 1-33.913904 97.767619L544.01219 740.205714a73.142857 73.142857 0 0 1-63.780571 0L153.136762 581.778286A73.142857 73.142857 0 0 1 117.51619 487.862857l362.300953 170.886095 32.329143 15.652572 327.119238-158.427429 65.80419-31.939047zM544.036571 139.190857l327.094858 158.403048a73.142857 73.142857 0 0 1 0 131.657143l-327.094858 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 429.251048a73.142857 73.142857 0 0 1 0-131.657143L480.256 139.215238a73.142857 73.142857 0 0 1 63.780571 0z m-31.890285 65.828572L185.027048 363.422476l327.119238 158.427429 327.119238-158.427429L512.146286 205.04381z"}))),hv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8c-16.4 12.8-16.4 37.5 0 50.3l450.8 352.1c5.3 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}))),pv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 42.666667a469.333333 469.333333 0 1 0 469.333333 469.333333A469.333333 469.333333 0 0 0 512 42.666667z m0 864a394.666667 394.666667 0 1 1 394.666667-394.666667 395.146667 395.146667 0 0 1-394.666667 394.666667z"}),l.createElement("path",{d:"M304.906667 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}),l.createElement("path",{d:"M512 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333334 0 66.666667 66.666667 0 1 0-133.333334 0Z"}),l.createElement("path",{d:"M719.093333 512m-66.666666 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}))),gv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M935.253333 111.786667a42.666667 42.666667 0 0 0-23.04-23.04A42.666667 42.666667 0 0 0 896 85.333333h-256a42.666667 42.666667 0 0 0 0 85.333334h153.173333L170.666667 793.173333V640a42.666667 42.666667 0 0 0-85.333334 0v256a42.666667 42.666667 0 0 0 3.413334 16.213333 42.666667 42.666667 0 0 0 23.04 23.04A42.666667 42.666667 0 0 0 128 938.666667h256a42.666667 42.666667 0 0 0 0-85.333334H230.826667L853.333333 230.826667V384a42.666667 42.666667 0 0 0 85.333334 0V128a42.666667 42.666667 0 0 0-3.413334-16.213333z"}))),vv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M128 128h64v389.312A384.32 384.32 0 0 1 506.688 832H896v64H192a64 64 0 0 1-64-64V128z m313.6 704A320.384 320.384 0 0 0 192 582.4V832h249.6z"}))),mv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M929.19 352.19c3.12 3.12 3.12 8.19 0 11.31L363.51 929.19c-3.12 3.12-8.19 3.12-11.31 0L94.81 671.81c-3.12-3.12-3.12-8.19 0-11.31L660.49 94.81c3.12-3.12 8.19-3.12 11.31 0l257.39 257.38z m-424.26 5.66l108.89 108.89c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0L456.85 405.93l-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-62.23 62.23 161.22 161.22 469.52-469.52-161.23-161.21-62.23 62.23 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91z"}))),bv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M725.333333 341.333333a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666666a42.666667 42.666667 0 1 0 42.666667 42.666666 42.666667 42.666667 0 0 0-42.666667-42.666666z"}),l.createElement("path",{d:"M640 256H85.333333a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM938.666667 256h-128a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333zM512 640a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666667 42.666667 42.666667 42.666667 0 0 0-42.666667-42.666667z"}),l.createElement("path",{d:"M426.666667 554.666667H85.333333a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM938.666667 554.666667h-341.333334a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM298.666667 938.666667a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666666 42.666667 42.666667 42.666667 0 0 0-42.666666-42.666667z"}),l.createElement("path",{d:"M938.666667 853.333333H384a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM213.333333 853.333333H85.333333a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333z"}))),yv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M802.742857 777.485714c49.942857 0 90.742857-41.371429 90.742857-92 0-61.142857-90.742857-160.914286-90.742857-160.914285S712 624.342857 712 685.485714c0 50.628571 40.8 92 90.742857 92z m-430.971428-50.4c8.114286 8.114286 21.257143 8.114286 29.257142 0l292.685715-292.571428c8.114286-8.114286 8.114286-21.257143 0-29.257143l-292.571429-292.571429c-0.685714-0.685714-1.485714-1.371429-2.285714-1.942857l-89.371429-89.371428a10.411429 10.411429 0 0 0-14.628571 0l-54.857143 54.857142a10.411429 10.411429 0 0 0 0 14.628572l76.8 76.8-237.485714 237.6c-8.114286 8.114286-8.114286 21.257143 0 29.257143l292.457143 292.571428z m14.742857-512.685714l204.457143 204.457143H182.171429l204.342857-204.457143zM960 859.428571H64c-5.028571 0-9.142857 4.114286-9.142857 9.142858v91.428571c0 5.028571 4.114286 9.142857 9.142857 9.142857h896c5.028571 0 9.142857-4.114286 9.142857-9.142857v-91.428571c0-5.028571-4.114286-9.142857-9.142857-9.142858z"}))),wv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}))),xv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 474H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM506.3 399.3c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7 0.4-11.7-5.7-11.7H550V104c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v156h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.6zM517.7 624.7c-2.9-3.7-8.5-3.7-11.3 0L405.6 752.3c-3.7 4.7-0.4 11.7 5.7 11.7H474v156c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V764h62.8c6 0 9.4-7 5.7-11.7L517.7 624.7z"}))),Sv=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355c-3.2-4.1-9.4-4.1-12.6 0l-112 141.7c-4.1 5.2-0.4 12.9 6.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"}))),{DirectoryTree:Ev}=Bh,Cv="base-element-tree",mo=e=>{const t=e.split("-").map(n=>parseInt(n));return t.shift(),t},Mv=l.forwardRef((e,t)=>{const{height:n,className:r,style:a,treeData:i,onTitleChange:o,onOperationToggle:s,onSelect:c,selectedKeys:d,onDrop:u,defaultExpandedKeys:f,expandedKeys:h,onDelete:p,onExpand:v,onGoToGroup:g}=e,{createPrefixName:m}=T.useContext(ce),y=m(Cv),b=(w,C)=>{const $=[mo(C.node.pos)],D=[w[0]];c==null||c({uuids:D,positions:$})},E=({uuid:w})=>{p==null||p({uuid:w})};return T.useMemo(()=>{const w=Gg(i||[],{generateClassName:y,onTitleChange:o,onOperationToggle:s,onDelete:E,onGoToGroup:g,position:[],selectedKeys:d||[]});return l.createElement(Ev,{ref:t,height:n,style:a,className:be(y(),r),showLine:!0,blockNode:!0,multiple:!0,selectedKeys:d,switcherIcon:l.createElement(df,null),icon:null,onSelect:b,treeData:w,defaultExpandedKeys:f,expandedKeys:h,onExpand:v,draggable:{icon:!1,nodeDraggable:()=>!0},onDrop:C=>{const{dragNode:S,node:$,dropToGap:D,dropPosition:B}=C,H=mo(S.pos),G=mo($.pos);D===!0&&B>=0?G[G.length-1]=B:$.dragOverGapBottom===!0?G[G.length-1]=G[G.length-1]+1:$.dragOverGapTop===!0?G[G.length-1]=Math.max(0,G[G.length-1]-1):$.dragOver===!0&&G.push(0),u==null||u({from:H,to:G})}})},[r,a,b,i,d])});var Av=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{value:t,onChange:n}=e,r=Av(e,["value","onChange"]),a=o=>{n==null||n(o)},i=()=>{a(!t)};return l.createElement(Je,Object.assign({},r,{type:t?"primary":"default",onClick:i}))},Tv="ElementDetail",bn=()=>{const[e]=Xh(Tv);return e},Ov="base-element-basic-attribute",Wt=e=>Fe.number(e*1)?ve(e*1):e,cc=e=>{if(Fe.number(e*1)){const t=ve(e*1);return vt(t)}return e},Iv=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,o=T.useRef(null),{createPrefixName:s}=T.useContext(ce),c=s(Ov),d=c(),u=c("row"),f=c("col"),h=c("input"),p=c("form-item"),v=bn(),g=m=>{var y;((y=r==null?void 0:r.operations)===null||y===void 0?void 0:y.limitRatio)===!0&&(m!=null&&m.hasOwnProperty("w")?m.h=ve(m.w/r.w*r.h):m!=null&&m.hasOwnProperty("h")&&(m.w=ve(m.h/r.h*r.w))),a==null||a(m)};return T.useEffect(()=>{var m;const{type:y,x:b,y:E,w,h:C,angle:S=0,operations:$={}}=r||{},D={x:b,y:E,w,h:C,angle:S,operations:{limitRatio:$.limitRatio}};y==="group"&&(D.operations.deepResize=$.deepResize),(m=o.current)===null||m===void 0||m.setFieldsValue(D)},[r]),T.useMemo(()=>l.createElement(J,{ref:o,style:n,className:be(d,t),onValuesChange:g},l.createElement(me,{className:u},l.createElement(K,{span:10,className:f},l.createElement(J.Item,{className:p,name:"x"},l.createElement(le,{className:h,size:"small",placeholder:"X",prefix:"X",disabled:i,formatter:Wt,parser:Wt}))),l.createElement(K,{span:10,className:f},l.createElement(J.Item,{className:p,name:"y"},l.createElement(le,{className:h,size:"small",placeholder:"Y",prefix:"Y",disabled:i,formatter:Wt,parser:Wt})))),l.createElement(me,{className:u},l.createElement(K,{span:10,className:f},l.createElement(J.Item,{className:p,name:"w"},l.createElement(le,{className:h,size:"small",placeholder:"Width",prefix:v.w,disabled:i,formatter:Wt,parser:Wt}))),l.createElement(K,{span:10,className:f},l.createElement(J.Item,{className:p,name:"h"},l.createElement(le,{className:h,size:"small",placeholder:"Height",prefix:v.h,disabled:i,formatter:Wt,parser:Wt}))),l.createElement(K,{span:4,className:f},l.createElement(J.Item,{className:p,name:["operations","limitRatio"]},l.createElement(_v,{icon:l.createElement(nv,null),size:"small",disabled:i})))),l.createElement(me,{className:u},l.createElement(K,{span:10,className:f},l.createElement(J.Item,{className:p,name:"angle"},l.createElement(le,{className:h,size:"small",placeholder:"Angle",prefix:l.createElement(vv,{style:{fontSize:14}}),disabled:i,formatter:cc,parser:cc,suffix:"°"})))),(r==null?void 0:r.type)==="group"&&l.createElement(me,{className:u},l.createElement(K,{span:18,className:f},v.deepResizeInGroup),l.createElement(K,{span:6,className:f},l.createElement(J.Item,{className:p,name:["operations","deepResize"]},l.createElement(Kd,{size:"small"}))))),[v,i,r])};var lt={},oa={},$v=typeof va=="object"&&va&&va.Object===Object&&va,uf=$v,Pv=uf,Rv=typeof self=="object"&&self&&self.Object===Object&&self,zv=Pv||Rv||Function("return this")(),Ct=zv,Dv=Ct,Nv=Dv.Symbol,sa=Nv,dc=sa,ff=Object.prototype,Lv=ff.hasOwnProperty,jv=ff.toString,Pr=dc?dc.toStringTag:void 0;function kv(e){var t=Lv.call(e,Pr),n=e[Pr];try{e[Pr]=void 0;var r=!0}catch{}var a=jv.call(e);return r&&(t?e[Pr]=n:delete e[Pr]),a}var Bv=kv,Fv=Object.prototype,Hv=Fv.toString;function Vv(e){return Hv.call(e)}var Wv=Vv,uc=sa,Gv=Bv,Yv=Wv,Uv="[object Null]",Xv="[object Undefined]",fc=uc?uc.toStringTag:void 0;function Zv(e){return e==null?e===void 0?Xv:Uv:fc&&fc in Object(e)?Gv(e):Yv(e)}var yn=Zv,Qv=Array.isArray,yt=Qv;function Kv(e){return e!=null&&typeof e=="object"}var jt=Kv,Jv=yn,qv=yt,e3=jt,t3="[object String]";function n3(e){return typeof e=="string"||!qv(e)&&e3(e)&&Jv(e)==t3}var r3=n3;function a3(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++a];if(n(i[c],c,i)===!1)break}return t}}var i3=a3,o3=i3,s3=o3(),l3=s3;function c3(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=M3}var ps=A3,_3=yn,T3=ps,O3=jt,I3="[object Arguments]",$3="[object Array]",P3="[object Boolean]",R3="[object Date]",z3="[object Error]",D3="[object Function]",N3="[object Map]",L3="[object Number]",j3="[object Object]",k3="[object RegExp]",B3="[object Set]",F3="[object String]",H3="[object WeakMap]",V3="[object ArrayBuffer]",W3="[object DataView]",G3="[object Float32Array]",Y3="[object Float64Array]",U3="[object Int8Array]",X3="[object Int16Array]",Z3="[object Int32Array]",Q3="[object Uint8Array]",K3="[object Uint8ClampedArray]",J3="[object Uint16Array]",q3="[object Uint32Array]",Ce={};Ce[G3]=Ce[Y3]=Ce[U3]=Ce[X3]=Ce[Z3]=Ce[Q3]=Ce[K3]=Ce[J3]=Ce[q3]=!0;Ce[I3]=Ce[$3]=Ce[V3]=Ce[P3]=Ce[W3]=Ce[R3]=Ce[z3]=Ce[D3]=Ce[N3]=Ce[L3]=Ce[j3]=Ce[k3]=Ce[B3]=Ce[F3]=Ce[H3]=!1;function em(e){return O3(e)&&T3(e.length)&&!!Ce[_3(e)]}var tm=em;function nm(e){return function(t){return e(t)}}var gs=nm,bi={exports:{}};bi.exports;(function(e,t){var n=uf,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,s=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(bi,bi.exports);var vs=bi.exports,rm=tm,am=gs,pc=vs,gc=pc&&pc.isTypedArray,im=gc?am(gc):rm,vf=im,om=d3,sm=pf,lm=yt,cm=hs,dm=gf,um=vf,fm=Object.prototype,hm=fm.hasOwnProperty;function pm(e,t){var n=lm(e),r=!n&&sm(e),a=!n&&!r&&cm(e),i=!n&&!r&&!a&&um(e),o=n||r||a||i,s=o?om(e.length,String):[],c=s.length;for(var d in e)(t||hm.call(e,d))&&!(o&&(d=="length"||a&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||dm(d,c)))&&s.push(d);return s}var mf=pm,gm=Object.prototype;function vm(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||gm;return e===n}var ms=vm;function mm(e,t){return function(n){return e(t(n))}}var bf=mm,bm=bf,ym=bm(Object.keys,Object),wm=ym,xm=ms,Sm=wm,Em=Object.prototype,Cm=Em.hasOwnProperty;function Mm(e){if(!xm(e))return Sm(e);var t=[];for(var n in Object(e))Cm.call(e,n)&&n!="constructor"&&t.push(n);return t}var Am=Mm;function _m(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var vr=_m,Tm=yn,Om=vr,Im="[object AsyncFunction]",$m="[object Function]",Pm="[object GeneratorFunction]",Rm="[object Proxy]";function zm(e){if(!Om(e))return!1;var t=Tm(e);return t==$m||t==Pm||t==Im||t==Rm}var yf=zm,Dm=yf,Nm=ps;function Lm(e){return e!=null&&Nm(e.length)&&!Dm(e)}var Di=Lm,jm=mf,km=Am,Bm=Di;function Fm(e){return Bm(e)?jm(e):km(e)}var la=Fm,Hm=l3,Vm=la;function Wm(e,t){return e&&Hm(e,t,Vm)}var wf=Wm;function Gm(e){return e}var xf=Gm,Ym=xf;function Um(e){return typeof e=="function"?e:Ym}var Xm=Um,Zm=wf,Qm=Xm;function Km(e,t){return e&&Zm(e,Qm(t))}var bs=Km,Jm=bf,qm=Jm(Object.getPrototypeOf,Object),ys=qm,e6=yn,t6=ys,n6=jt,r6="[object Object]",a6=Function.prototype,i6=Object.prototype,Sf=a6.toString,o6=i6.hasOwnProperty,s6=Sf.call(Object);function l6(e){if(!n6(e)||e6(e)!=r6)return!1;var t=t6(e);if(t===null)return!0;var n=o6.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Sf.call(n)==s6}var c6=l6;function d6(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n-1}var A6=M6,_6=Ni;function T6(e,t){var n=this.__data__,r=_6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var O6=T6,I6=f6,$6=w6,P6=E6,R6=A6,z6=O6;function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&Yb?new Hb:void 0;for(i.set(e,t),i.set(t,e);++f0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,N4.default)(t,function(r){Array.isArray(r)?e(r).map(function(a){return n.push(a)}):(0,z4.default)(r)?(0,P4.default)(r,function(a,i){a===!0&&n.push(i),n.push(i+"-"+a)}):(0,I4.default)(r)&&n.push(r)}),n};oa.default=L4;var ca={};function j4(e,t){for(var n=-1,r=e==null?0:e.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=t.default&&(0,aS.default)(t.default)||{};return n.map(function(a){var i=t[a];return i&&(0,nS.default)(i,function(o,s){r[s]||(r[s]={}),r[s]=iS({},r[s],i[s])}),a}),r};ca.default=oS;var da={};Object.defineProperty(da,"__esModule",{value:!0});da.autoprefix=void 0;var sS=bs,Zc=cS(sS),lS=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){vS(a,r);function a(){var i,o,s,c;gS(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){SS(a,r);function a(){var i,o,s,c;xS(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:!0;r[o]=s};return t===0&&a("first-child"),t===n-1&&a("last-child"),(t===0||t%2===0)&&a("even"),Math.abs(t%2)===1&&a("odd"),a("nth-child",t),r};Is.default=CS;Object.defineProperty(lt,"__esModule",{value:!0});lt.ReactCSS=lt.loop=lt.handleActive=$s=lt.handleHover=lt.hover=void 0;var MS=oa,AS=Sr(MS),_S=ca,TS=Sr(_S),OS=da,IS=Sr(OS),$S=ua,Uf=Sr($S),PS=fa,RS=Sr(PS),zS=Is,DS=Sr(zS);function Sr(e){return e&&e.__esModule?e:{default:e}}lt.hover=Uf.default;var $s=lt.handleHover=Uf.default;lt.handleActive=RS.default;lt.loop=DS.default;var NS=lt.ReactCSS=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;as?h=1:h=Math.round(f*100/s)/100,n.a!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>o?p=1:p=Math.round(u*100/o)/100,a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},Eo={},jS=function(t,n,r,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=t,o.fillRect(0,0,i.width,i.height),o.fillStyle=n,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},kS=function(t,n,r,a){var i=t+"-"+n+"-"+r+(a?"-server":"");if(Eo[i])return Eo[i];var o=jS(t,n,r,a);return Eo[i]=o,o},Jc=Object.assign||function(e){for(var t=1;t-1},qS=function(t){return Number(String(t).replace(/%/g,""))},eE=1,se=function(e){XS(t,e);function t(n){YS(this,t);var r=US(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(a){r.setUpdatedValue(a.target.value,a)},r.handleKeyDown=function(a){var i=qS(a.target.value);if(!isNaN(i)&&JS(a.keyCode)){var o=r.getArrowOffset(),s=a.keyCode===Xf?i+o:i-o;r.setUpdatedValue(s,a)}},r.handleDrag=function(a){if(r.props.dragLabel){var i=Math.round(r.props.value+a.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),a)}},r.handleMouseDown=function(a){r.props.dragLabel&&(a.preventDefault(),r.handleDrag(a),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+eE++,r}return WS(t,[{key:"componentDidUpdate",value:function(r,a){this.props.value!==this.state.value&&(r.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return GS({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||ZS}},{key:"setUpdatedValue",value:function(r,a){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,a),this.setState({value:r})}},{key:"render",value:function(){var r=this,a=ie({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return l.createElement("div",{style:a.wrap},l.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?l.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(T.PureComponent||T.Component),tE=function(t,n,r,a){var i=a.clientWidth,o=a.clientHeight,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(a.getBoundingClientRect().left+window.pageXOffset),u=c-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var f=void 0;if(u<0)f=359;else if(u>o)f=0;else{var h=-(u*100/o)+100;f=360*h/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var p=void 0;if(d<0)p=0;else if(d>i)p=359;else{var v=d*100/i;p=360*v/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},nE=function(){function e(t,n){for(var r=0;r1?Vn("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):Vn("Invalid argument supplied to oneOf, expected an array."),_a;function I(k,z,A,N,x){for(var R=k[z],Y=0;Y0?", expected one of type ["+_.join(", ")+"]":"";return new c("Invalid "+R+" `"+Y+"` supplied to "+("`"+x+"`"+P+"."))}return d(z)}function E(){function M(I,k,z,A,N){return $(I[k])?null:new c("Invalid "+A+" `"+N+"` supplied to "+("`"+z+"`, expected a ReactNode."))}return d(M)}function w(M,I,k,z,A){return new c((M||"React class")+": "+I+" type `"+k+"."+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+A+"`.")}function C(M){function I(k,z,A,N,x){var R=k[z],Y=B(R);if(Y!=="object")return new c("Invalid "+N+" `"+x+"` of type `"+Y+"` "+("supplied to `"+A+"`, expected `object`."));for(var _ in M){var U=M[_];if(typeof U!="function")return w(A,N,x,_,H(U));var V=U(R,_,A,N,x+"."+_,Pn);if(V)return V}return null}return d(I)}function S(M){function I(k,z,A,N,x){var R=k[z],Y=B(R);if(Y!=="object")return new c("Invalid "+N+" `"+x+"` of type `"+Y+"` "+("supplied to `"+A+"`, expected `object`."));var _=gE({},k[z],M);for(var U in _){var V=M[U];if(Co(M,U)&&typeof V!="function")return w(A,N,x,U,H(V));if(!V)return new c("Invalid "+N+" `"+x+"` key `"+U+"` supplied to `"+A+"`.\nBad object: "+JSON.stringify(k[z],null," ")+` +Valid keys: `+JSON.stringify(Object.keys(M),null," "));var O=V(R,U,A,N,x+"."+U,Pn);if(O)return O}return null}return d(I)}function $(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every($);if(M===null||e(M))return!0;var I=a(M);if(I){var k=I.call(M),z;if(I!==M.entries){for(;!(z=k.next()).done;)if(!$(z.value))return!1}else for(;!(z=k.next()).done;){var A=z.value;if(A&&!$(A[1]))return!1}}else return!1;return!0;default:return!1}}function D(M,I){return M==="symbol"?!0:I?I["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&I instanceof Symbol:!1}function B(M){var I=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":D(I,M)?"symbol":I}function H(M){if(typeof M>"u"||M===null)return""+M;var I=B(M);if(I==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return I}function G(M){var I=H(M);switch(I){case"array":case"object":return"an "+I;case"boolean":case"date":case"regexp":return"a "+I;default:return I}}function j(M){return!M.constructor||!M.constructor.name?i:M.constructor.name}return o.checkPropTypes=nd,o.resetWarningCache=nd.resetWarningCache,o.PropTypes=o,o};{var mE=Kf,bE=!0;Zf.exports=vE(mE.isElement,bE)}var yE=Zf.exports;const X=jh(yE);function wE(){this.__data__=[],this.size=0}function ha(e,t){return e===t||e!==e&&t!==t}function Wi(e,t){for(var n=e.length;n--;)if(ha(e[n][0],t))return n;return-1}var xE=Array.prototype,SE=xE.splice;function EE(e){var t=this.__data__,n=Wi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():SE.call(t,n,1),--this.size,!0}function CE(e){var t=this.__data__,n=Wi(t,e);return n<0?void 0:t[n][1]}function ME(e){return Wi(this.__data__,e)>-1}function AE(e,t){var n=this.__data__,r=Wi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function kt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=D7}function Mr(e){return e!=null&&Ns(e.length)&&!Rs(e)}function N7(e){return Zt(e)&&Mr(e)}function L7(){return!1}var lh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dd=lh&&typeof module=="object"&&module&&!module.nodeType&&module,j7=dd&&dd.exports===lh,ud=j7?wt.Buffer:void 0,k7=ud?ud.isBuffer:void 0,Ci=k7||L7,B7="[object Object]",F7=Function.prototype,H7=Object.prototype,ch=F7.toString,V7=H7.hasOwnProperty,W7=ch.call(Object);function G7(e){if(!Zt(e)||xn(e)!=B7)return!1;var t=oh(e);if(t===null)return!0;var n=V7.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ch.call(n)==W7}var Y7="[object Arguments]",U7="[object Array]",X7="[object Boolean]",Z7="[object Date]",Q7="[object Error]",K7="[object Function]",J7="[object Map]",q7="[object Number]",eC="[object Object]",tC="[object RegExp]",nC="[object Set]",rC="[object String]",aC="[object WeakMap]",iC="[object ArrayBuffer]",oC="[object DataView]",sC="[object Float32Array]",lC="[object Float64Array]",cC="[object Int8Array]",dC="[object Int16Array]",uC="[object Int32Array]",fC="[object Uint8Array]",hC="[object Uint8ClampedArray]",pC="[object Uint16Array]",gC="[object Uint32Array]",Me={};Me[sC]=Me[lC]=Me[cC]=Me[dC]=Me[uC]=Me[fC]=Me[hC]=Me[pC]=Me[gC]=!0;Me[Y7]=Me[U7]=Me[iC]=Me[X7]=Me[oC]=Me[Z7]=Me[Q7]=Me[K7]=Me[J7]=Me[q7]=Me[eC]=Me[tC]=Me[nC]=Me[rC]=Me[aC]=!1;function vC(e){return Zt(e)&&Ns(e.length)&&!!Me[xn(e)]}function mC(e){return function(t){return e(t)}}var dh=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kr=dh&&typeof module=="object"&&module&&!module.nodeType&&module,bC=Kr&&Kr.exports===dh,Ao=bC&&th.process,fd=function(){try{var e=Kr&&Kr.require&&Kr.require("util").types;return e||Ao&&Ao.binding&&Ao.binding("util")}catch{}}(),hd=fd&&fd.isTypedArray,Ls=hd?mC(hd):vC;function rs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var yC=Object.prototype,wC=yC.hasOwnProperty;function xC(e,t,n){var r=e[t];(!(wC.call(e,t)&&ha(r,n))||n===void 0&&!(t in e))&&zs(e,t,n)}function SC(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i-1&&e%1==0&&e0){if(++t>=kC)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var VC=HC(jC);function WC(e,t){return VC(DC(e,t,Yi),e+"")}function GC(e,t,n){if(!ct(n))return!1;var r=typeof t;return(r=="number"?Mr(n)&&js(t,n.length):r=="string"&&t in n)?ha(n[t],e):!1}function YC(e){return WC(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&GC(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r=t||$<0||f&&D>=i}function y(){var S=_o();if(m(S))return b(S);s=setTimeout(y,g(S))}function b(S){return s=void 0,h&&r?p(S):(r=a=void 0,o)}function E(){s!==void 0&&clearTimeout(s),d=0,r=c=a=s=void 0}function w(){return s===void 0?o:b(_o())}function C(){var S=_o(),$=m(S);if(r=arguments,a=this,c=S,$){if(s===void 0)return v(c);if(f)return clearTimeout(s),s=setTimeout(y,t),p(c)}return s===void 0&&(s=setTimeout(y,t)),o}return C.cancel=E,C.flush=w,C}var iM="Expected a function";function oM(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(iM);return ct(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),ph(e,t,{leading:r,maxWait:t,trailing:a})}var sM=function(t,n,r){var a=r.getBoundingClientRect(),i=a.width,o=a.height,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(r.getBoundingClientRect().left+window.pageXOffset),u=c-(r.getBoundingClientRect().top+window.pageYOffset);d<0?d=0:d>i&&(d=i),u<0?u=0:u>o&&(u=o);var f=d/i,h=1-u/o;return{h:n.h,s:f,v:h,a:n.a,source:"hsv"}},lM=function(){function e(t,n){for(var r=0;r=0,i=!n&&a&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(PM,arguments)},brighten:function(){return this._applyModification(RM,arguments)},darken:function(){return this._applyModification(zM,arguments)},desaturate:function(){return this._applyModification(OM,arguments)},saturate:function(){return this._applyModification(IM,arguments)},greyscale:function(){return this._applyModification($M,arguments)},spin:function(){return this._applyModification(DM,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(jM,arguments)},complement:function(){return this._applyCombination(NM,arguments)},monochromatic:function(){return this._applyCombination(kM,arguments)},splitcomplement:function(){return this._applyCombination(LM,arguments)},triad:function(){return this._applyCombination(xd,[3])},tetrad:function(){return this._applyCombination(xd,[4])}};q.fromRatio=function(e,t){if(Mi(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=Wr(e[r]));e=n}return q(e,t)};function CM(e){var t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=WM(e)),Mi(e)=="object"&&(At(e.r)&&At(e.g)&&At(e.b)?(t=MM(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):At(e.h)&&At(e.s)&&At(e.v)?(r=Wr(e.s),a=Wr(e.v),t=_M(e.h,r,a),o=!0,s="hsv"):At(e.h)&&At(e.s)&&At(e.l)&&(r=Wr(e.s),i=Wr(e.l),t=AM(e.h,r,i),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=vh(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function MM(e,t,n){return{r:Te(e,255)*255,g:Te(t,255)*255,b:Te(n,255)*255}}function md(e,t,n){e=Te(e,255),t=Te(t,255),n=Te(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=(r+a)/2;if(r==a)i=o=0;else{var c=r-a;switch(o=s>.5?c/(2-r-a):c/(r+a),r){case e:i=(t-n)/c+(t1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(t===0)r=a=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),a=o(c,s,e),i=o(c,s,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function bd(e,t,n){e=Te(e,255),t=Te(t,255),n=Te(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=r,c=r-a;if(o=r===0?0:c/r,r==a)i=0;else{switch(r){case e:i=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(q(r));return i}function kM(e,t){t=t||6;for(var n=q(e).toHsv(),r=n.h,a=n.s,i=n.v,o=[],s=1/t;t--;)o.push(q({h:r,s:a,v:i})),i=(i+s)%1;return o}q.mix=function(e,t,n){n=n===0?0:n||50;var r=q(e).toRgb(),a=q(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return q(o)};q.readability=function(e,t){var n=q(e),r=q(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};q.isReadable=function(e,t,n){var r=q.readability(e,t),a,i;switch(i=!1,a=GM(n),a.level+a.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};q.mostReadable=function(e,t,n){var r=null,a=0,i,o,s,c;n=n||{},o=n.includeFallbackColors,s=n.level,c=n.size;for(var d=0;da&&(a=i,r=q(t[d]));return q.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],n))};var as=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},BM=q.hexNames=FM(as);function FM(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function vh(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Te(e,t){HM(e)&&(e="100%");var n=VM(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Zi(e){return Math.min(1,Math.max(0,e))}function Ze(e){return parseInt(e,16)}function HM(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function VM(e){return typeof e=="string"&&e.indexOf("%")!=-1}function gt(e){return e.length==1?"0"+e:""+e}function Wr(e){return e<=1&&(e=e*100+"%"),e}function mh(e){return Math.round(parseFloat(e)*255).toString(16)}function Sd(e){return Ze(e)/255}var ht=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function At(e){return!!ht.CSS_UNIT.exec(e)}function WM(e){e=e.replace(SM,"").replace(EM,"").toLowerCase();var t=!1;if(as[e])e=as[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=ht.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=ht.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ht.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=ht.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ht.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=ht.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ht.hex8.exec(e))?{r:Ze(n[1]),g:Ze(n[2]),b:Ze(n[3]),a:Sd(n[4]),format:t?"name":"hex8"}:(n=ht.hex6.exec(e))?{r:Ze(n[1]),g:Ze(n[2]),b:Ze(n[3]),format:t?"name":"hex"}:(n=ht.hex4.exec(e))?{r:Ze(n[1]+""+n[1]),g:Ze(n[2]+""+n[2]),b:Ze(n[3]+""+n[3]),a:Sd(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=ht.hex3.exec(e))?{r:Ze(n[1]+""+n[1]),g:Ze(n[2]+""+n[2]),b:Ze(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function GM(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var Ed=function(t){var n=["r","g","b","a","h","s","l","v"],r=0,a=0;return xM(n,function(i){if(t[i]&&(r+=1,isNaN(t[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(t[i])&&(a+=1)}}),r===a?t:!1},Gr=function(t,n){var r=t.hex?q(t.hex):q(t),a=r.toHsl(),i=r.toHsv(),o=r.toRgb(),s=r.toHex();a.s===0&&(a.h=n||0,i.h=n||0);var c=s==="000000"&&o.a===0;return{hsl:a,hex:c?"transparent":"#"+s,rgb:o,hsv:i,oldHue:t.h||n||a.h,source:t.source}},Qt=function(t){if(t==="transparent")return!0;var n=String(t).charAt(0)==="#"?1:0;return t.length!==4+n&&t.length<7+n&&q(t).isValid()},Bs=function(t){if(!t)return"#fff";var n=Gr(t);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},To=function(t,n){var r=t.replace("°","");return q(n+" ("+r+")")._ok},zr=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){qM(a,r);function a(){var i,o,s,c;JM(this,a);for(var d=arguments.length,u=Array(d),f=0;fs))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&uA?new Ai:void 0;for(i.set(e,t),i.set(t,e);++f=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var Oa=24,T_=_h.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?Oa:r,i=e.height,o=i===void 0?Oa:i,s=e.style,c=s===void 0?{}:s,d=__(e,["fill","width","height","style"]);return Hd.default.createElement("svg",Fd({viewBox:"0 0 "+Oa+" "+Oa,style:Fd({fill:n,width:a,height:o},c)},d),Hd.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},O_=function(){function e(t,n){for(var r=0;r1&&(a.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),r.props.onChange({h:a.h||r.props.hsl.h,s:Number(Bd(a.s)?r.props.hsl.s:a.s),l:Number(Bd(a.l)?r.props.hsl.l:a.l),source:"hsl"},i))},r.showHighlight=function(a){a.currentTarget.style.background="#eee"},r.hideHighlight=function(a){a.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return O_(t,[{key:"render",value:function(){var r=this,a=ie({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(se,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(se,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(se,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),l.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,l.createElement("div",{style:a.toggle},l.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},l.createElement(T_,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),t}(l.Component);Th.defaultProps={view:"hex"};var Vd=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return l.createElement("div",{style:t.picker})},R_=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return l.createElement("div",{style:t.picker})},Ys=function(t){var n=t.width,r=t.onChange,a=t.disableAlpha,i=t.rgb,o=t.hsl,s=t.hsv,c=t.hex,d=t.renderers,u=t.styles,f=u===void 0?{}:u,h=t.className,p=h===void 0?"":h,v=t.defaultView,g=ie(Ye({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},f),{disableAlpha:a});return l.createElement("div",{style:g.picker,className:"chrome-picker "+p},l.createElement("div",{style:g.saturation},l.createElement(Xi,{style:g.Saturation,hsl:o,hsv:s,pointer:R_,onChange:r})),l.createElement("div",{style:g.body},l.createElement("div",{style:g.controls,className:"flexbox-fix"},l.createElement("div",{style:g.color},l.createElement("div",{style:g.swatch},l.createElement("div",{style:g.active}),l.createElement(Er,{renderers:d}))),l.createElement("div",{style:g.toggles},l.createElement("div",{style:g.hue},l.createElement(Cr,{style:g.Hue,hsl:o,pointer:Vd,onChange:r})),l.createElement("div",{style:g.alpha},l.createElement(Ps,{style:g.Alpha,rgb:i,hsl:o,pointer:Vd,renderers:d,onChange:r})))),l.createElement(Th,{rgb:i,hsl:o,hex:c,view:v,onChange:r,disableAlpha:a})))};Ys.propTypes={width:X.oneOfType([X.string,X.number]),disableAlpha:X.bool,styles:X.object,defaultView:X.oneOf(["hex","rgb","hsl"])};Ys.defaultProps={width:225,disableAlpha:!1,styles:{}};const z_=Ue(Ys);var D_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.active,s=ie({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Bs(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(Cn,{style:s.color,color:n,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:s.dot}))},N_=function(t){var n=t.hex,r=t.rgb,a=t.onChange,i=ie({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(c,d){c.r||c.g||c.b?a({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,source:"rgb"},d):a({hex:c.hex,source:"hex"},d)};return l.createElement("div",{style:i.fields,className:"flexbox-fix"},l.createElement("div",{style:i.active}),l.createElement(se,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:o}),l.createElement(se,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),l.createElement(se,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),l.createElement(se,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}))},Us=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.colors,i=t.hex,o=t.rgb,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(Ye({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),h=function(v,g){v.hex?Qt(v.hex)&&n({hex:v.hex,source:"hex"},g):n(v,g)};return l.createElement(pa,{style:f.Compact,styles:c},l.createElement("div",{style:f.compact,className:"compact-picker "+u},l.createElement("div",null,Mn(a,function(p){return l.createElement(D_,{key:p,color:p,active:p.toLowerCase()===i,onClick:h,onSwatchHover:r})}),l.createElement("div",{style:f.clear})),l.createElement(N_,{hex:i,rgb:o,onChange:h})))};Us.propTypes={colors:X.arrayOf(X.string),styles:X.object};Us.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Ue(Us);var L_=function(t){var n=t.hover,r=t.color,a=t.onClick,i=t.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ie({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:n});return l.createElement("div",{style:s.swatch},l.createElement(Cn,{color:r,onClick:a,onHover:i,focusStyle:o}))};const j_=$s(L_);var Xs=function(t){var n=t.width,r=t.colors,a=t.onChange,i=t.onSwatchHover,o=t.triangle,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(Ye({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),h=function(v,g){return a({hex:v,source:"hex"},g)};return l.createElement("div",{style:f.card,className:"github-picker "+u},l.createElement("div",{style:f.triangleShadow}),l.createElement("div",{style:f.triangle}),Mn(r,function(p){return l.createElement(j_,{color:p,key:p,onClick:h,onSwatchHover:i})}))};Xs.propTypes={width:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.string),triangle:X.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:X.object};Xs.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Ue(Xs);var k_=function(t){var n=t.direction,r=ie({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return l.createElement("div",{style:r.picker})},B_=Object.assign||function(e){for(var t=1;t.5});return l.createElement("div",{style:r.picker})},W_=function(){var t=ie({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return l.createElement("div",{style:t.pointer},l.createElement("div",{style:t.left},l.createElement("div",{style:t.leftInside})),l.createElement("div",{style:t.right},l.createElement("div",{style:t.rightInside})))},Wd=function(t){var n=t.onClick,r=t.label,a=t.children,i=t.active,o=ie({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return l.createElement("div",{style:o.button,onClick:n},r||a)},G_=function(t){var n=t.rgb,r=t.currentColor,a=ie({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return l.createElement("div",null,l.createElement("div",{style:a.label},"new"),l.createElement("div",{style:a.swatches},l.createElement("div",{style:a.new}),l.createElement("div",{style:a.current})),l.createElement("div",{style:a.label},"current"))},Y_=function(){function e(t,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:a.h,s:a.s,l:a.l,a:u.a,source:"rgb"},f))};return l.createElement("div",{style:s.fields,className:"flexbox-fix"},l.createElement("div",{style:s.double},l.createElement(se,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:c})),l.createElement("div",{style:s.single},l.createElement(se,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(se,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(se,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.alpha},l.createElement(se,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:c,dragLabel:"true",dragMax:"100"})))},K_=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var Ia=24,a9=Ih.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?Ia:r,i=e.height,o=i===void 0?Ia:i,s=e.style,c=s===void 0?{}:s,d=r9(e,["fill","width","height","style"]);return Yd.default.createElement("svg",Gd({viewBox:"0 0 "+Ia+" "+Ia,style:Gd({fill:n,width:a,height:o},c)},d),Yd.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},i9=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.first,s=t.last,c=t.active,d=ie({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:Bs(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:s,active:c,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(Cn,{color:n,style:d.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:d.check},l.createElement(a9,null)))},o9=function(t){var n=t.onClick,r=t.onSwatchHover,a=t.group,i=t.active,o=ie({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return l.createElement("div",{style:o.group},Mn(a,function(s,c){return l.createElement(i9,{key:s,color:s,active:s.toLowerCase()===i,first:c===0,last:c===a.length-1,onClick:n,onSwatchHover:r})}))},qs=function(t){var n=t.width,r=t.height,a=t.onChange,i=t.onSwatchHover,o=t.colors,s=t.hex,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(Ye({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},d)),p=function(g,m){return a({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.picker,className:"swatches-picker "+f},l.createElement(pa,null,l.createElement("div",{style:h.overflow},l.createElement("div",{style:h.body},Mn(o,function(v){return l.createElement(o9,{key:v.toString(),group:v,active:s,onClick:p,onSwatchHover:i})}),l.createElement("div",{style:h.clear})))))};qs.propTypes={width:X.oneOfType([X.string,X.number]),height:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.arrayOf(X.string)),styles:X.object};qs.defaultProps={width:320,height:240,colors:[[Wn[900],Wn[700],Wn[500],Wn[300],Wn[100]],[Gn[900],Gn[700],Gn[500],Gn[300],Gn[100]],[Yn[900],Yn[700],Yn[500],Yn[300],Yn[100]],[Un[900],Un[700],Un[500],Un[300],Un[100]],[Xn[900],Xn[700],Xn[500],Xn[300],Xn[100]],[Zn[900],Zn[700],Zn[500],Zn[300],Zn[100]],[Qn[900],Qn[700],Qn[500],Qn[300],Qn[100]],[Kn[900],Kn[700],Kn[500],Kn[300],Kn[100]],[Jn[900],Jn[700],Jn[500],Jn[300],Jn[100]],["#194D33",Yr[700],Yr[500],Yr[300],Yr[100]],[qn[900],qn[700],qn[500],qn[300],qn[100]],[er[900],er[700],er[500],er[300],er[100]],[tr[900],tr[700],tr[500],tr[300],tr[100]],[nr[900],nr[700],nr[500],nr[300],nr[100]],[rr[900],rr[700],rr[500],rr[300],rr[100]],[ar[900],ar[700],ar[500],ar[300],ar[100]],[ir[900],ir[700],ir[500],ir[300],ir[100]],[or[900],or[700],or[500],or[300],or[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Ue(qs);var el=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(Ye({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},d),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),p=function(g,m){Qt(g)&&n({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.card,className:"twitter-picker "+f},l.createElement("div",{style:h.triangleShadow}),l.createElement("div",{style:h.triangle}),l.createElement("div",{style:h.body},Mn(i,function(v,g){return l.createElement(Cn,{key:g,color:v,hex:v,style:h.swatch,onClick:p,onHover:r,focusStyle:{boxShadow:"0 0 4px "+v}})}),l.createElement("div",{style:h.hash},"#"),l.createElement(se,{label:null,style:{input:h.input},value:a.replace("#",""),onChange:p}),l.createElement("div",{style:h.clear})))};el.propTypes={width:X.oneOfType([X.string,X.number]),triangle:X.oneOf(["hide","top-left","top-right"]),colors:X.arrayOf(X.string),styles:X.object};el.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Ue(el);var tl=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return l.createElement("div",{style:n.picker})};tl.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};tl.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var nl=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return l.createElement("div",{style:n.picker})};nl.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};nl.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var s9=function(t){var n=t.onChange,r=t.rgb,a=t.hsl,i=t.hex,o=t.hsv,s=function(p,v){if(p.hex)Qt(p.hex)&&n({hex:p.hex,source:"hex"},v);else if(p.rgb){var g=p.rgb.split(",");To(p.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},v)}else if(p.hsv){var m=p.hsv.split(",");To(p.hsv,"hsv")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),m[1]==1?m[1]=.01:m[2]==1&&(m[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsv"},v))}else if(p.hsl){var y=p.hsl.split(",");To(p.hsl,"hsl")&&(y[2]=y[2].replace("%",""),y[1]=y[1].replace("%",""),y[0]=y[0].replace("°",""),f[1]==1?f[1]=.01:f[2]==1&&(f[2]=.01),n({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsl"},v))}},c=ie({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),d=r.r+", "+r.g+", "+r.b,u=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",f=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return l.createElement("div",{style:c.wrap,className:"flexbox-fix"},l.createElement("div",{style:c.fields},l.createElement("div",{style:c.double},l.createElement(se,{style:{input:c.input,label:c.label},label:"hex",value:i,onChange:s})),l.createElement("div",{style:c.column},l.createElement("div",{style:c.single},l.createElement(se,{style:{input:c.input2,label:c.label2},label:"rgb",value:d,onChange:s})),l.createElement("div",{style:c.single},l.createElement(se,{style:{input:c.input2,label:c.label2},label:"hsv",value:f,onChange:s})),l.createElement("div",{style:c.single},l.createElement(se,{style:{input:c.input2,label:c.label2},label:"hsl",value:u,onChange:s})))))},rl=function(t){var n=t.width,r=t.onChange,a=t.rgb,i=t.hsl,o=t.hsv,s=t.hex,c=t.header,d=t.styles,u=d===void 0?{}:d,f=t.className,h=f===void 0?"":f,p=ie(Ye({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return l.createElement("div",{style:p.picker,className:"google-picker "+h},l.createElement("div",{style:p.head},c),l.createElement("div",{style:p.swatch}),l.createElement("div",{style:p.saturation},l.createElement(Xi,{hsl:i,hsv:o,pointer:tl,onChange:r})),l.createElement("div",{style:p.body},l.createElement("div",{style:p.controls,className:"flexbox-fix"},l.createElement("div",{style:p.hue},l.createElement(Cr,{style:p.Hue,hsl:i,radius:"4px",pointer:nl,onChange:r}))),l.createElement(s9,{rgb:a,hsl:i,hex:s,hsv:o,onChange:r})))};rl.propTypes={width:X.oneOfType([X.string,X.number]),styles:X.object,header:X.string};rl.defaultProps={width:652,styles:{},header:"Color picker"};Ue(rl);function l9(e){let t=e.toLocaleUpperCase();const n={r:0,g:0,b:0,a:1};return/^\#[0-9a-f]{3,3}$/i.test(t)?t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}FF`:/^\#[0-9a-f]{6,6}$/i.test(t)&&(t=`${t}FF`),/^\#[0-9a-f]{8,8}$/i.test(t)&&(n.r=parseInt(`${t[1]}${t[2]}`,16),n.g=parseInt(`${t[3]}${t[4]}`,16),n.b=parseInt(`${t[5]}${t[6]}`,16),n.a=parseInt(`${t[7]}${t[8]}`,16)/255),n}function c9(e){const t=[];return t.push(e.r.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.g.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.b.toString(16).padStart(2,"0").toLocaleUpperCase()),e.a<1&&t.push(Math.floor(e.a*255).toString(16).padStart(2,"0").toLocaleUpperCase()),`#${t.join("")}`}const d9=({value:e="",onChange:t,className:n})=>l.createElement(z_,{className:n,color:l9(e),onChangeComplete:r=>{const a=c9(r==null?void 0:r.rgb);t==null||t(a)}}),$h="base-element-field-multiple-color-picker",Ph=16,Ud=e=>{var t,n;const r=(t=e.currentTarget.parentElement)===null||t===void 0?void 0:t.getBoundingClientRect(),a=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.x-Ph/2;let o=parseFloat((n=i/a.width)===null||n===void 0?void 0:n.toFixed(2));return o=Math.min(Math.max(o,0),1),o};function u9(e){const{mode:t,value:n,internalColor:r,internalLinearGradient:a,internalRadialGradient:i,currentPickedColor:o,onChange:s,onSelectStop:c}=e,[d,u]=T.useState(li(n)),[f,h]=T.useState(null),p=T.useRef(!1),{createPrefixName:v}=T.useContext(ce),g=v($h),m=g("gradient-root"),y=g("gradient-delete"),b=g("gradient"),E=g("gradient-bar"),w=g("gradient-point"),C=g("gradient-point-active");T.useEffect(()=>{var j;const M=li(n);u(M),["linear-gradient","radial-gradient"].includes(n==null?void 0:n.type)&&(f||h((j=n==null?void 0:n.stops)===null||j===void 0?void 0:j[0]))},[n]),T.useEffect(()=>{f?c==null||c(Object.assign({},f)):c==null||c(f)},[f]);const S=j=>{j.stopPropagation(),p.current=!0;const M=Ud(j);let I=null;if(t==="linear-gradient"?I=a:t==="radial-gradient"&&(I=i),I){const k=[...I.stops];for(let A=0;AN.offset&&!x){k.push(R),h(R);break}if(!x)break}const z=Object.assign(Object.assign({},I),{stops:k});s==null||s(z)}},$=j=>{if(p.current===!0&&f){const M=Ud(j);let I=null;if(t==="linear-gradient"?I=a:t==="radial-gradient"&&(I=i),I){const k=[...I.stops];for(let N=0;NN.offset-x.offset),A=Object.assign(Object.assign({},I),{stops:z});s==null||s(A)}}},D=j=>{j.stopPropagation(),p.current=!1},B=(j,M)=>{j.stopPropagation(),h(M),p.current=!0},H=()=>{let j=null;t==="linear-gradient"?j=a:t==="radial-gradient"&&(j=i);let M=-1;if(j&&f){const I=[...j.stops];for(let k=0;k=0){I.splice(M,1);const k=Object.assign(Object.assign({},j),{stops:I});s==null||s(k)}}},G=j=>{p.current=!1};return T.useMemo(()=>{var j,M,I;return l.createElement(l.Fragment,null,(t==="linear-gradient"||t==="radial-gradient")&&l.createElement("div",{className:m},l.createElement("div",{className:b,"data-css":d,style:{background:d}},l.createElement("div",{className:E,onMouseDown:S,onMouseUp:D,onMouseMove:$,onMouseLeave:D},(I=(M=(j=t==="linear-gradient"?a:i)===null||j===void 0?void 0:j.stops)===null||M===void 0?void 0:M.map)===null||I===void 0?void 0:I.call(M,(k,z)=>l.createElement("span",{key:z,className:be({[w]:!0,[C]:(f==null?void 0:f.offset)===k.offset}),style:{left:`calc(${k.offset*100}% - ${Ph/2}px)`,background:k.color},onMouseDown:A=>{B(A,k)},onMouseUp:G})))),l.createElement("div",{className:y,onClick:k=>{k.stopPropagation(),H()}},l.createElement(sv,null))))},[t,d,o,r,a,i,f])}function Xd(e){let t="solid";return e&&(e!=null&&e.type)&&(t=e.type),t}function f9(e){const{value:t,onChange:n,elementSize:r,disabledLinearGradient:a,disabledRadialGradient:i}=e,[o,s]=T.useState(li(t)),[c,d]=T.useState(Xd(t)),[u,f]=T.useState("#000000"),[h,p]=T.useState(null),[v,g]=T.useState(null),[m,y]=T.useState(null),b=T.useRef(null),E=T.useRef(null),w=T.useRef(null),{createPrefixName:C}=T.useContext(ce),S=C($h),$=S(),D=S("header"),B=S("internal-picker"),H=S("radio-group"),G=S("row"),j=S("col"),M=S("input"),I=S("form-item");T.useEffect(()=>{s(li(t)),d(Xd(t)),typeof t=="string"?(p(t),f(t)):(t==null?void 0:t.type)==="linear-gradient"?g(t):(t==null?void 0:t.type)==="radial-gradient"&&y(t)},[t]),T.useEffect(()=>{var x,R;c==="linear-gradient"&&(t==null?void 0:t.type)===c?(x=E.current)===null||x===void 0||x.setFieldsValue(t):c==="radial-gradient"&&(t==null?void 0:t.type)===c&&((R=w.current)===null||R===void 0||R.setFieldsValue(t))},[c,t]);const k=x=>{var R,Y,_,U,V,O;let P;x==="linear-gradient"?(P={type:"linear-gradient",start:{x:0,y:0},end:{x:0,y:(r==null?void 0:r.h)||0},stops:[]},typeof t=="string"?(P.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],g(P)):(t==null?void 0:t.type)==="radial-gradient"&&(P.stops=[...(t==null?void 0:t.stops)||[]],g(P)),(R=E.current)===null||R===void 0||R.setFieldsValue(P)):x==="radial-gradient"?(P={type:"radial-gradient",inner:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:0},outer:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:Math.min(((r==null?void 0:r.w)||0)/2,((r==null?void 0:r.h)||0)/2)},stops:[]},typeof t=="string"?(P.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],y(P)):(t==null?void 0:t.type)==="linear-gradient"&&(P.stops=[...(t==null?void 0:t.stops)||[]],y(P)),(Y=w.current)===null||Y===void 0||Y.setFieldsValue(P)):x==="solid"&&(P=t,(t==null?void 0:t.type)==="linear-gradient"?(P=((U=(_=t==null?void 0:t.stops)===null||_===void 0?void 0:_[0])===null||U===void 0?void 0:U.color)||"#000000",p(P)):(t==null?void 0:t.type)==="radial-gradient"&&(P=((O=(V=t==null?void 0:t.stops)===null||V===void 0?void 0:V[0])===null||O===void 0?void 0:O.color)||"#000000",p(P))),P&&(n==null||n(P))},z=x=>{if(c==="solid")n==null||n(x.color);else if(b.current){if(c==="linear-gradient"&&v&&Array.isArray(v==null?void 0:v.stops)){const R=[...v.stops];for(let _=0;_{const R=Object.assign({},v);x!=null&&x.start&&(R.start=Object.assign(Object.assign({},R.start),x.start)),x!=null&&x.end&&(R.end=Object.assign(Object.assign({},R.end),x.end)),n==null||n(R)},N=x=>{const R=Object.assign({},m);x!=null&&x.inner&&(R.inner=Object.assign(Object.assign({},R.inner),x.inner)),x!=null&&x.outer&&(R.outer=Object.assign(Object.assign({},R.outer),x.outer)),n==null||n(R)};return T.useMemo(()=>l.createElement("div",{className:$},!a&&!i&&l.createElement("div",{className:D},l.createElement(it.Group,{className:H,size:"small",buttonStyle:"solid",value:c,onChange:({target:{value:x}})=>{k(x)}},l.createElement(it.Button,{value:"solid"},l.createElement(yv,null)),!a&&l.createElement(it.Button,{value:"linear-gradient"},l.createElement(gv,null)),!i&&l.createElement(it.Button,{value:"radial-gradient"},l.createElement(lv,null)))),!a&&c==="linear-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:E,onValuesChange:A},l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"},"Start"),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["start","x"]},l.createElement(le,{className:M,size:"small",prefix:"X"}))),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["start","y"]},l.createElement(le,{className:M,size:"small",prefix:"Y"})))),l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"},"End"),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["end","x"]},l.createElement(le,{className:M,size:"small",prefix:"X"}))),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["end","y"]},l.createElement(le,{className:M,size:"small",prefix:"Y"})))))),!i&&c==="radial-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:w,onValuesChange:N},l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"},"Inner"),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["inner","x"]},l.createElement(le,{className:M,size:"small",prefix:"X"}))),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["inner","y"]},l.createElement(le,{className:M,size:"small",prefix:"Y"})))),l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"}),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["inner","radius"]},l.createElement(le,{className:M,size:"small",prefix:"R"})))),l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"},"Outer"),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["outer","x"]},l.createElement(le,{className:M,size:"small",prefix:"X"}))),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["outer","y"]},l.createElement(le,{className:M,size:"small",prefix:"Y"})))),l.createElement(me,{className:G},l.createElement(K,{className:j,span:"4"}),l.createElement(K,{className:j,span:"10"},l.createElement(J.Item,{className:I,name:["outer","radius"]},l.createElement(le,{className:M,size:"small",prefix:"R"})))))),(!a||!i)&&(c==="linear-gradient"||c==="radial-gradient")&&l.createElement(u9,{mode:c,value:t,currentPickedColor:u,internalColor:h,internalLinearGradient:v,internalRadialGradient:m,onChange:x=>{(x==null?void 0:x.type)==="linear-gradient"?(g(x),n==null||n(x)):(x==null?void 0:x.type)==="radial-gradient"&&(y(x),n==null||n(x))},onSelectStop:x=>{x!=null&&x.color&&f(x.color),b.current=x}}),l.createElement(d9,{value:u,className:B,onChange:x=>{f(x),z({color:x})}})),[c,o,h,v,m,u,a,i])}const h9="base-element-field-multiple-color";function Ki(e){const{value:t,onChange:n,disabled:r,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o}=e,s=bn(),d=(b=>{let E="";return typeof b=="string"?E=b:["linear-gradient","radial-gradient"].includes(b==null?void 0:b.type)&&(E=s.gradient),E})(t),u=typeof t=="string",f=T.useRef(null),{createPrefixName:h,container:p}=T.useContext(ce),v=h(h9),g=v(),m=v("preview"),y=()=>p||document.body;return T.useMemo(()=>{const b=m0(t||"transparent");return l.createElement(l.Fragment,null,l.createElement(dn,{className:g,size:"small",disabled:r,prefix:r?l.createElement("span",null):l.createElement(Jd,{placement:"left",content:l.createElement(f9,{value:t,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o,onChange:n}),trigger:"click",getPopupContainer:y,getTooltipContainer:y},l.createElement("span",{className:m,style:{background:b}})),readOnly:!u,value:d,onChange:E=>{n==null||n(E.target.value)}}),l.createElement("div",{ref:f}))},[t,n,r,a])}const Io=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 384a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m0 170.666667a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m170.666667 0a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m-170.666667 170.666666a42.666667 42.666667 0 1 0-42.666667-42.666666 42.666667 42.666667 0 0 0 42.666667 42.666666z m341.333333-597.333333H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v682.666666a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667V170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667z m-42.666666 682.666667H213.333333V213.333333h597.333334zM341.333333 554.666667a42.666667 42.666667 0 1 0-42.666666-42.666667 42.666667 42.666667 0 0 0 42.666666 42.666667z"}))),p9="base-element-border-attribute",cs=4;function Nr(e){const{borderRadius:t,borderWidth:n,borderColor:r,boxSizing:a,borderDash:i}=(e==null?void 0:e.detail)||{};let o="solid",s=cs;Array.isArray(i)&&(i==null?void 0:i.length)>0&&i[0]>=1&&typeof n=="number"&&(o="dash",s=Math.ceil(i[0]));const c={borderRadiusList:[0,0,0,0],borderWidthList:[0,0,0,0],borderColor:r,borderType:o,boxSizing:a,borderDashNum:s};return typeof t=="number"?(c.borderRadius=t,c.borderRadiusList=[t,t,t,t]):Array.isArray(t)?c.borderRadiusList=[t[0]||0,t[1]||0,t[2]||0,t[3]||0]:c.borderRadius=0,typeof n=="number"?(c.borderWidth=n,c.borderWidthList=[n,n,n,n]):Array.isArray(n)?c.borderWidthList=[n[0]||0,n[1]||0,n[2]||0,n[3]||0]:c.borderWidth=0,c}const g9=e=>{var t,n;const{className:r,style:a,element:i,disabled:o,onChange:s}=e,c=T.useRef(null),{createPrefixName:d}=T.useContext(ce),u=d(p9),f=u(),h=u("row"),p=u("col"),v=u("input"),g=u("form-item"),[m,y]=T.useState(Array.isArray((t=i==null?void 0:i.detail)===null||t===void 0?void 0:t.borderRadius)),[b,E]=T.useState(Array.isArray((n=i==null?void 0:i.detail)===null||n===void 0?void 0:n.borderWidth)),[w,C]=T.useState(b),S=bn(),$=D=>{var B,H;const G=Nr(i),{borderColor:j,boxSizing:M,borderType:I,borderDashNum:k}=D,z={};if(j&&(z.borderColor=j),M&&(z.boxSizing=M),b===!0&&D.borderWidthList){const A=[0,0,0,0],N=Array.from((D==null?void 0:D.borderWidthList)||[null,null,null,null]);for(let x=0;x<4;x++){const R=N[x];typeof R=="number"?A[x]=R:A[x]=((B=G==null?void 0:G.borderWidthList)===null||B===void 0?void 0:B[x])||0,z.borderWidth=A}}else typeof D.borderWidth=="number"&&(z.borderWidth=D.borderWidth);if(m===!0&&D.borderRadiusList){const A=[0,0,0,0],N=Array.from((D==null?void 0:D.borderRadiusList)||[null,null,null,null]);for(let x=0;x<4;x++){const R=N[x];typeof R=="number"?A[x]=R:A[x]=((H=G==null?void 0:G.borderRadiusList)===null||H===void 0?void 0:H[x])||0,z.borderRadius=A}}else typeof D.borderRadius=="number"&&(z.borderRadius=D.borderRadius);b===!0?z.borderDash=[]:I==="solid"?z.borderDash=[]:I==="dash"?z.borderDash=[cs,cs]:k&&k>0&&(z.borderDash=[k,k]),s==null||s({detail:z})};return T.useEffect(()=>{var D,B,H;const G=Array.isArray((D=i==null?void 0:i.detail)===null||D===void 0?void 0:D.borderWidth),j=Array.isArray((B=i==null?void 0:i.detail)===null||B===void 0?void 0:B.borderRadius);E(G),y(j),C(G);const M=Nr(i);(H=c.current)===null||H===void 0||H.setFieldsValue(M)},[i]),T.useMemo(()=>{const D=Nr(i);return l.createElement(J,{ref:c,style:a,className:be(f,r),onValuesChange:$},l.createElement(l.Fragment,null,l.createElement(me,{className:h},l.createElement(K,{span:16,className:p},b?l.createElement(dn,{className:v,size:"small",prefix:l.createElement(Io,{style:{fontSize:14}}),disabled:!0,value:S.mixedBorderWidth}):l.createElement(J.Item,{className:g,name:"borderWidth"},l.createElement(le,{className:v,size:"small",min:0,placeholder:"Border Width",prefix:l.createElement(Io,{style:{fontSize:14}}),disabled:o||b}))),l.createElement(K,{span:4,className:p},l.createElement(Je,{icon:l.createElement(Io,null),size:"small",disabled:o,type:b?"primary":"default",onClick:()=>{var B;const H=!b;if(E(H),C(H),!H){const G=Nr(i),j=G.borderWidth||((B=G.borderWidthList)===null||B===void 0?void 0:B[0])||0;$({borderWidth:j})}}}))),b&&l.createElement(l.Fragment,null,l.createElement(me,{className:h},l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",0]},l.createElement(le,{className:v,size:"small",prefix:l.createElement(tv,null),disabled:o||!b,min:0}))),l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",1]},l.createElement(le,{className:v,size:"small",prefix:l.createElement(ev,null),disabled:o||!b,min:0})))),l.createElement(me,{className:h},l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",2]},l.createElement(le,{className:v,size:"small",prefix:l.createElement(Kg,null),disabled:o||!b,min:0}))),l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",3]},l.createElement(le,{className:v,size:"small",prefix:l.createElement(qg,null),disabled:o||!b,min:0})))))),!["circle"].includes(i==null?void 0:i.type)&&l.createElement(l.Fragment,null,l.createElement(me,{className:h},l.createElement(K,{span:16,className:p},m?l.createElement(dn,{className:v,size:"small",prefix:l.createElement(lc,{style:{fontSize:14}}),disabled:!0,value:S.mixedBorderRadius}):l.createElement(J.Item,{className:g,name:"borderRadius"},l.createElement(le,{className:v,size:"small",placeholder:"Radius",prefix:l.createElement(lc,{style:{fontSize:14}}),disabled:o||m||w,min:0}))),l.createElement(K,{span:4,className:p},l.createElement(Je,{icon:l.createElement(uv,null),size:"small",disabled:o||w,type:m?"primary":"default",onClick:()=>{var B;const H=!m;if(y(H),!H){const G=Nr(i),j=G.borderRadius||((B=G.borderRadiusList)===null||B===void 0?void 0:B[0])||0;$({borderRadius:j})}}}))),m&&l.createElement(l.Fragment,null,l.createElement(me,{className:h},l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",0]},l.createElement(le,{className:v,size:"small",placeholder:"",prefix:l.createElement(iv,null),disabled:o||!m||w,min:0}))),l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",1]},l.createElement(le,{className:v,size:"small",placeholder:"",prefix:l.createElement(ov,null),disabled:o||!m||w,min:0})))),l.createElement(me,{className:h},l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",2]},l.createElement(le,{className:v,size:"small",placeholder:"",prefix:l.createElement(rv,null),disabled:o||!m||w,min:0}))),l.createElement(K,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",3]},l.createElement(le,{className:v,size:"small",placeholder:"",prefix:l.createElement(av,null),disabled:o||!m||w,min:0})))))),l.createElement(me,{className:h},l.createElement(K,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"boxSizing"},l.createElement(Ke,{size:"small",disabled:o},l.createElement(Ke.Option,{value:"border-box"},S.inside),l.createElement(Ke.Option,{value:"content-box"},S.outside),l.createElement(Ke.Option,{value:"center-line"},S.centerLine)))),l.createElement(K,{className:p,span:"13"},l.createElement(J.Item,{className:g,name:"borderColor"},l.createElement(Ki,{elementSize:i?Pi(i):void 0,disabled:o,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(me,{className:h},l.createElement(K,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"borderType"},l.createElement(Ke,{size:"small",disabled:o||b},l.createElement(Ke.Option,{value:"solid"},S.solid),l.createElement(Ke.Option,{value:"dash"},S.dash)))),l.createElement(K,{className:p,span:"13"},D.borderType==="dash"&&l.createElement(J.Item,{className:g,name:"borderDashNum"},l.createElement(le,{disabled:o||b,className:v,size:"small",style:{width:"100%"},prefix:l.createElement(Jg,{style:{fontSize:14}})})))))},[S,i,o,m,b,w])},v9="base-element-detail-circle",m9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=T.useContext(ce),i=r(v9)();return T.useMemo(()=>l.createElement("div",{style:n,className:be(i,t)}),[n,t])};var b9=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{TextArea:y9}=dn,w9="base-element-field-image-picker",{useCallback:Zd}=l,x9=["image/png","image/jpeg","image/jpg","image/png"],S9=({value:e="",onChange:t})=>{const[n,r]=T.useState(e),[a,i]=T.useState("free"),{createPrefixName:o}=T.useContext(ce),s=o(w9),c=s(),d=s("box"),u=s("entity"),f=s("action"),h=s("action-text"),p=s("action-upload"),v=Zd(b=>{const E=b||"";let w=3,C=300;return E.length>128&&(w=10),{rows:w,width:C}},[n]),g=b=>{t==null||t(b||e)},m=b=>{r(b),Fe.imageSrc(b)&&g(b)},y=Zd(()=>{a!=="picking"&&(ds({success:b=>b9(void 0,void 0,void 0,function*(){if(x9.includes(b.file.type)!==!0){ai.error(`File's type "${b.file.type}" is not supported!`);return}try{const E=yield h0(b.file);m(E.toString())}catch{ai.error(`Failed to parse file ${b.file.name}`)}i("free")}),error:b=>{console.log(b),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return T.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("img",{className:u,src:e||n}),l.createElement("div",{className:f},l.createElement("div",{className:h},l.createElement(Jd,{content:()=>l.createElement("div",null,l.createElement(y9,{value:e||n,style:{width:v(e||n).width},rows:v(e||n).rows,onChange:b=>{m(b.target.value||"")}})),trigger:"click"},l.createElement("span",{style:{display:"inline-block",width:"100%",height:"100%",lineHeight:"50px"}},"URL"))),l.createElement("div",{onClick:y,className:p},l.createElement("span",null,"Upload"))))),[e,n])},E9="base-element-detail-image",C9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=T.useContext(ce),u=c(E9)(),f=T.useRef(null),h=v=>{const{src:g=""}=(v==null?void 0:v.detail)||{};return{src:g,imageResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.imageResource){const{assetId:m}=o({type:"image",value:v.imageResource});m&&cn(m)&&(g.src=m)}a==null||a({detail:g})};return T.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),T.useMemo(()=>l.createElement("div",{style:n,className:be(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"imageResource"},l.createElement(S9,null)))),[r,s])},M9="base-element-detail-path",A9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=T.useContext(ce),i=r(M9)();return T.useMemo(()=>l.createElement("div",{style:n,className:be(i,t)}),[n,t])},_9="base-element-detail-rect",T9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=T.useContext(ce),i=r(_9)();return T.useMemo(()=>l.createElement("div",{style:n,className:be(i,t)}),[n,t])};var O9=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const I9="base-element-field-svg-picker",$9=["image/svg+xml"];function P9(e){const t=document.createElement("div");return t.innerHTML=e,document.querySelector("svg").setAttribute("_t",Date.now()+""),{__html:t.innerHTML}}const R9=({value:e="",onChange:t})=>{const[n,r]=T.useState(e),[a,i]=T.useState("free"),{createPrefixName:o}=T.useContext(ce),s=o(I9),c=s(),d=s("box"),u=s("entity"),f=s("action");s("action-text");const h=s("action-upload"),p=m=>{t==null||t(m||e)},v=m=>{r(m),Fe.svg(m)&&p(m)},g=T.useCallback(()=>{a!=="picking"&&(ds({success:m=>O9(void 0,void 0,void 0,function*(){if($9.includes(m.file.type)!==!0){ai.error(`File's type "${m.file.type}" is not supported!`);return}try{let y=(yield p0(m.file)).toString();y=y.substring(y.indexOf("{console.log(m),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return T.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("div",{className:u,dangerouslySetInnerHTML:P9(e||n)}),l.createElement("div",{className:f},l.createElement("div",{onClick:g,className:h},l.createElement("span",null,"Upload"))))),[e,n])},z9="base-element-detail-svg",D9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=T.useContext(ce),u=c(z9)(),f=T.useRef(null),h=v=>{const{svg:g=""}=(v==null?void 0:v.detail)||{};return{svg:g,svgResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.svgResource){const{assetId:m}=o({type:"svg",value:v.svgResource});m&&cn(m)&&(g.svg=m)}a==null||a({detail:g})};return T.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),T.useMemo(()=>l.createElement("div",{style:n,className:be(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"svgResource"},l.createElement(R9,null)))),[r,s])},N9="base-element-detail-text",Rn={fontSize:20},{TextArea:L9}=dn,zn=e=>Fe.number(e*1)?ve(e*1):e,j9=e=>{const{color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o,text:s=""}=(e==null?void 0:e.detail)||{};return{text:s,color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o}},k9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=T.useContext(ce),s=o(N9),c=s(),d=s("row"),u=s("col"),f=s("switch"),h=s("form-item"),p=T.useRef(null);T.useEffect(()=>{var g;const m=j9(r);(g=p.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return T.useMemo(()=>l.createElement("div",{style:n,className:be(c,t)},l.createElement(J,{ref:p,style:n,className:c,onValuesChange:v},l.createElement(me,{className:d},l.createElement(K,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"verticalAlign"},l.createElement(it.Group,{disabled:i,className:f,size:"small"},l.createElement(it.Button,{value:"top"},l.createElement(Sv,{style:Rn})),l.createElement(it.Button,{value:"middle"},l.createElement(xv,{style:Rn})),l.createElement(it.Button,{value:"bottom"},l.createElement(wv,{style:Rn}))))),l.createElement(K,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"textAlign"},l.createElement(it.Group,{disabled:i,className:f,size:"small"},l.createElement(it.Button,{value:"left"},l.createElement(Xg,{style:Rn})),l.createElement(it.Button,{value:"center"},l.createElement(Ug,{style:Rn})),l.createElement(it.Button,{value:"right"},l.createElement(Zg,{style:Rn})))))),l.createElement(me,{className:d},l.createElement(K,{span:"10",className:u},"Text Color"),l.createElement(K,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"color"},l.createElement(Ki,{elementSize:r?Pi(r):void 0,disabled:i,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(me,{className:d},l.createElement(K,{span:"10",className:u},"Font Size"),l.createElement(K,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontSize"},l.createElement(le,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:zn,parser:zn})))),l.createElement(me,{className:d},l.createElement(K,{span:"10",className:u},"Font Weight"),l.createElement(K,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontWeight"},l.createElement(le,{disabled:i,size:"small",style:{width:"100%"},step:100,max:1e3,min:100,formatter:zn,parser:zn})))),l.createElement(me,{className:d},l.createElement(K,{span:"10",className:u},"Line Height"),l.createElement(K,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"lineHeight"},l.createElement(le,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:zn,parser:zn})))),l.createElement(me,{className:d},l.createElement(K,{span:"24",className:u},l.createElement(J.Item,{className:h,name:"text",style:{width:"100%"}},l.createElement(L9,{disabled:i,style:{width:"100%"},rows:3})))))),[n,t])},B9="base-element-detail-group",F9=e=>{const{overflow:t}=(e==null?void 0:e.detail)||{};return{overflow:t}},H9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=T.useContext(ce),s=o(B9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=T.useRef(null),p=bn();T.useEffect(()=>{var g;const m=F9(r);(g=h.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return T.useMemo(()=>l.createElement("div",{style:n,className:be(c,t)},l.createElement(J,{ref:h,style:n,className:c,onValuesChange:v},l.createElement(me,{className:d},l.createElement(K,{className:u,span:"10"},p.overflow),l.createElement(K,{span:"12",className:u},l.createElement(J.Item,{className:f,name:"overflow"},l.createElement(Ke,{size:"small",disabled:i},l.createElement(Ke.Option,{value:"visible"},p.visible),l.createElement(Ke.Option,{value:"hidden"},p.hidden))))))),[n,t,p])},V9="base-element-detail-attribute",W9=e=>{const{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}=e,{createPrefixName:o}=T.useContext(ce),c=o(V9)();return T.useMemo(()=>l.createElement("div",{className:c},(t==null?void 0:t.type)==="circle"&&l.createElement(m9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="image"&&l.createElement(C9,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="svg"&&l.createElement(D9,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="group"&&l.createElement(H9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="path"&&l.createElement(A9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="rect"&&l.createElement(T9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="text"&&l.createElement(k9,{element:t,onChange:n})),[r,t])},G9="base-element-content-attribute",Y9=e=>{let{opacity:t}=(e==null?void 0:e.detail)||{};const{background:n}=(e==null?void 0:e.detail)||{};return typeof t=="number"&&t>=0&&t<=1||(t=1),{background:n,opacity:t}},U9=e=>{const{style:t,element:n,disabled:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,s=T.useRef(null),{createPrefixName:c}=T.useContext(ce),d=c(G9),u=d(),f=d("row"),h=d("col"),p=d("form-item"),v=y=>{const b=y;a==null||a({detail:b})},g=y=>{a==null||a(y)},m=bn();return T.useEffect(()=>{var y;const b=Y9(n);(y=s.current)===null||y===void 0||y.setFieldsValue(b)},[n]),T.useMemo(()=>l.createElement(l.Fragment,null,l.createElement(J,{ref:s,style:t,className:u,onValuesChange:v},["rect","circle","text","group","path"].includes(n==null?void 0:n.type)&&l.createElement(me,{className:f},l.createElement(K,{className:h,span:"10"},m.background),l.createElement(K,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"background"},l.createElement(Ki,{elementSize:n?Pi(n):void 0,disabled:r})))),l.createElement(me,{className:f},l.createElement(K,{className:h,span:"10"},m.opacity),l.createElement(K,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"opacity"},l.createElement(le,{disabled:r,size:"small",style:{width:"100%"},step:.1}))))),l.createElement(W9,{element:n,disabled:r,onChange:g,getElementAsset:i,createElementAsset:o})),[m,n,r,a])},X9="base-element-shadow-attribute",Z9=e=>{const{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}=(e==null?void 0:e.detail)||{};return{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}},Q9=e=>{const{style:t,element:n,disabled:r,onChange:a}=e,i=T.useRef(null),{createPrefixName:o}=T.useContext(ce),s=o(X9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=v=>{const g=v;a==null||a({detail:g})},p=bn();return T.useEffect(()=>{var v;const g=Z9(n);(v=i.current)===null||v===void 0||v.setFieldsValue(g)},[n]),T.useMemo(()=>l.createElement(J,{ref:i,style:t,className:c,onValuesChange:h},l.createElement(me,{className:d},l.createElement(K,{className:u,span:"14"},l.createElement(J.Item,{className:f,name:"shadowColor"},l.createElement(Ki,{elementSize:n?Pi(n):void 0,disabled:r,disabledLinearGradient:!0,disabledRadialGradient:!0}))),l.createElement(K,{className:u,span:"10"},l.createElement(J.Item,{className:f,name:"shadowBlur"},l.createElement(le,{disabled:r,size:"small",style:{width:"100%"}})))),l.createElement(me,null,l.createElement(K,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetX"},l.createElement(le,{disabled:r,size:"small",style:{width:"100%"},prefix:"X"}))),l.createElement(K,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetY"},l.createElement(le,{disabled:r,size:"small",style:{width:"100%"},prefix:"Y"}))))),[p,n,r])},K9="base-element-detail",J9=mn(),q9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,{createPrefixName:s}=T.useContext(ce),c=s(K9),d=bn();let u=r;r&&(u=Object.assign(Object.assign({},r||{}),{detail:Object.assign(Object.assign({},J9),r==null?void 0:r.detail)}));const f=[{key:"basic-attribute",label:d.basicAttributes,children:l.createElement(Iv,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}})},{key:"border-attribute",label:d.borderAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(g9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(ma,{image:ma.PRESENTED_IMAGE_SIMPLE,description:!1})},{key:"content-attribute",label:d.contentAttribute,children:l.createElement(U9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)},getElementAsset:i,createElementAsset:o})},{key:"shadow-attribute",label:d.shadowAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(Q9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(ma,{image:ma.PRESENTED_IMAGE_SIMPLE,description:!1})}];return T.useMemo(()=>l.createElement("div",{style:n,className:be(c(),t)},l.createElement(Fh,{ghost:!0,items:f,size:"small",defaultActiveKey:f.map(h=>h.key)})),[u,d])},Rh=e=>{var t;const n={uuid:e.uuid,key:e.uuid,title:e.name||e.detail.text||e.type||"unamed",type:e.type,children:[],operations:e.operations||{}};return e.type==="group"&&Array.isArray((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.children)&&e.detail.children.forEach(r=>{n.children.push(Rh(r))}),n};function Ne(e){const t=[];return e.elements.forEach(n=>{const r=Rh(n);t.push(r)}),t}var eT=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a0){const r=mt(e,n.elements);(r==null?void 0:r.type)==="group"&&(r.detail.children=t.elements)}}const nT="dark",rT="en-US";function aT(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});let n=[],r=t;e!=null&&e.defaultEditingGroupUUID&&(n=Nt(e.defaultEditingGroupUUID,t.elements)),r=fr(n,t);const a=Ne(r);return{localeCode:(e==null?void 0:e.defaultLocale)||rT,themeMode:(e==null?void 0:e.defaultThemeMode)||nT,data:t,editingData:r,editingDataPosition:n,treeData:a,selectedUUIDs:(e==null?void 0:e.defaultSelectedElementUUIDs)||[],scaleInfo:Object.assign({scale:1,from:"init"},(e==null?void 0:e.defaultScaleInfo)||{})}}function iT(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});return{localeCode:"en-US",themeMode:(e==null?void 0:e.themeMode)||"light",data:Object.assign({elements:[]},(e==null?void 0:e.data)||{}),editingData:fr([],t),editingDataPosition:[],treeData:[],selectedUUIDs:[],scaleInfo:Object.assign({scale:1,from:"control"},(e==null?void 0:e.scaleInfo)||{})}}function oT(e,t){var n,r;switch(t.type){case"update":return t!=null&&t.payload?Object.assign(Object.assign({},e),t==null?void 0:t.payload):e;case"updateThemeMode":return!((n=t==null?void 0:t.payload)===null||n===void 0)&&n.themeMode?Object.assign(Object.assign({},e),{themeMode:(r=t==null?void 0:t.payload)===null||r===void 0?void 0:r.themeMode}):e;default:return e}}const Ar=T.createContext({state:iT(),dispatch:()=>{}}),sT=Ar.Provider,lT={locale:"en-US",NavMenu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"},Toolbar:{layers:"Layers",ruler:"Ruler",attributes:"Attributes",hand:"Hand tool",centerContent:"Center content"},contextMenu:{copy:"Copy",paste:"Paste",cut:"Cut",delete:"Delete"}},cT={locale:"zh-CN",NavMenu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"},Toolbar:{layers:"图层",ruler:"标尺",attributes:"属性",hand:"拖拽工具",centerContent:"内容居中"},contextMenu:{copy:"复制",paste:"粘贴",cut:"剪切",delete:"删除"}},dT={"en-US":lT,"zh-CN":cT},al=e=>{const{state:t}=T.useContext(Ar),n=t.localeCode;return[T.useMemo(()=>{const i=dT[n][e];return Object.assign({},i)},[n,e])]},uT="mod-toolbar",fT=()=>{const[e]=al("Toolbar");return e},hT=e=>{const{className:t,style:n,openLeftSider:r,openRightSider:a,onClickToggleLayer:i,onClickToggleSetting:o,sharedStore:s}=e,c={fontSize:16},{createPrefixName:d}=T.useContext(ce),u=d(uT),f=u(),h=u("left"),p=u("right"),v=u("btn"),[g,m]=T.useState(!1),[y,b]=T.useState(!0),E=fT();T.useEffect(()=>{const C=s.get("idraw");y===!0?C==null||C.enable("ruler"):C==null||C.disable("ruler")},[y]),T.useEffect(()=>{const C=s.get("idraw");C==null||C.setMode(g?"drag":"select")},[g]);const w={size:"small",className:v,shape:"default"};return T.useMemo(()=>l.createElement("div",{style:n,className:be(f,t)},l.createElement("div",{className:h}),l.createElement("div",{className:p},l.createElement(_r,{title:E.layers},l.createElement(Je,Object.assign({},w,{type:r?"primary":"default",icon:l.createElement(fv,{style:c}),onClick:i}))),l.createElement(_r,{title:E.attributes},l.createElement(Je,Object.assign({},w,{type:a?"primary":"default",icon:l.createElement(bv,{style:c}),onClick:o}))),l.createElement(_r,{title:E.ruler},l.createElement(Je,Object.assign({},w,{type:y?"primary":"default",icon:l.createElement(mv,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{b(!y)}}))),l.createElement(_r,{title:E.hand},l.createElement(Je,Object.assign({},w,{type:g?"primary":"default",icon:l.createElement(dv,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{m(!g)}}))),l.createElement(_r,{title:E.centerContent},l.createElement(Je,Object.assign({},w,{type:"text",icon:l.createElement(Yg,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{const C=s.get("idraw");C==null||C.centerContent()}}))))),[r,a,i,o,g,y,E])},pT="mod-panel-layer",gT=e=>{const{className:t,style:n,height:r,defaultSelectedElementUUIDs:a=[],sharedStore:i,sharedEvent:o,useContextMenuOptions:s}=e,{state:c,dispatch:d}=T.useContext(Ar),{createPrefixName:u}=T.useContext(ce),f=u(pT),{treeData:h,selectedUUIDs:p,editingData:v}=c,g=T.useRef(null),[m,y]=T.useState(a),b=f(),E=f("content"),w=f("header"),C=f("header","title"),S=f("header","btn"),[$]=s({sharedEvent:o,sharedStore:i}),D=()=>{if(c.editingDataPosition.length===0)return"";const j=mt(c.editingDataPosition,c.data.elements);return(j==null?void 0:j.name)||(j==null?void 0:j.type)||""},B=j=>{const M=i.get("idraw");M==null||M.selectElementsByPositions(j)};T.useEffect(()=>{o.on("scrollToLayer",({uuid:j})=>{var M;j&&((M=g.current)===null||M===void 0||M.scrollTo({key:j,align:"top"}))})},[]),T.useEffect(()=>{if(p[0]&&p.length===1){const M=uu(p[0],v.elements).map(k=>k.uuid);p[0]&&M.push(p[0]);const I=[...m];M.forEach(k=>{I.includes(k)||I.push(k)}),y(I)}},[p,v]);const H=()=>{o.trigger("resetEditingView",{type:"back-root",position:null})},G=()=>{o.trigger("resetEditingView",{type:"back-one",position:null})};return T.useMemo(()=>Array.isArray(h)&&h.length>0?l.createElement("div",{style:n,className:be(b,t),onContextMenu:j=>{j.preventDefault()}},l.createElement("div",{className:w},l.createElement(Je,{className:S,size:"small",icon:l.createElement(cv,null),disabled:!(c.editingDataPosition.length>0),onClick:H}),l.createElement(Je,{className:S,size:"small",icon:l.createElement(hv,null),disabled:!(c.editingDataPosition.length>0),onClick:G}),l.createElement("span",{className:C},D())),l.createElement(_i,{menu:{items:$},trigger:["contextMenu"]},l.createElement("div",{className:E},l.createElement(Mv,{ref:g,height:r,treeData:h,selectedKeys:p,expandedKeys:m,onTitleChange:({uuid:j,value:M})=>{qr(j,{name:M},c.editingData.elements);const I=Ne(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:I}})},onOperationToggle:({uuid:j,operations:M})=>{qr(j,{operations:M},c.editingData.elements);const I=Ne(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:I}})},onSelect:j=>{p!=null&&p.includes(j.uuids[0])||B(j.positions)},onDrop:j=>{const{elements:M}=Cu(v.elements,{from:j.from,to:j.to}),I=mt(j.to,v.elements);I&&(I.x=0,I.y=0);const k=Ne(v);d({type:"update",payload:{editingData:Object.assign(Object.assign({},v),{elements:[...M]}),treeData:k}})},onDelete:({uuid:j})=>{o.trigger("deleteElement",{uuid:j})},onGoToGroup:j=>{o.trigger("resetEditingView",{type:"go-to-group",position:j.position})},onExpand:(j,{node:M})=>{const I=M.key;if(I){let k=[...m];m.includes(I)?k.splice(k.indexOf(I),1):k=[...k,I],y(k)}}})))):l.createElement("div",{style:n,className:be(b,t),onContextMenu:j=>{j.preventDefault()}},l.createElement("div",{className:w},"..."),l.createElement("div",{className:E},l.createElement("div",{style:{padding:"20px 0",textAlign:"center"}},"Empty"))),[h,p,m,v.elements,c.editingDataPosition,$])},vT="mod-panel-detail",mT=e=>{const{className:t,style:n}=e,{createPrefixName:r}=T.useContext(ce),{state:a,dispatch:i}=T.useContext(Ar),o=r(vT),{selectedUUIDs:s,editingData:c}=a,d=o(),u=T.useCallback(v=>{if((s==null?void 0:s.length)===1&&s[0]){const g=s[0];qr(g,v,c.elements),i({type:"update",payload:{editingData:Object.assign({},c)}})}},[c,s]),f=T.useCallback(v=>(s==null?void 0:s.length)>1?null:du(v,c.elements),[c,s[0]]),h=T.useCallback(v=>{var g,m;let y=null;return v&&cn(v)&&(y=((m=(g=c.assets)===null||g===void 0?void 0:g[v])===null||m===void 0?void 0:m.value)||null),y},[c,s[0]]),p=T.useCallback(v=>{const g=hr(v.value);return c.assets||(c.assets={}),c.assets[g]=v,{assetId:g,assetItem:v}},[c,s[0]]);return T.useMemo(()=>{const v=f(s[0]);return l.createElement("div",{style:n,className:be(d,t),onContextMenu:g=>{g.preventDefault()}},l.createElement(q9,{element:v,onChange:u,getElementAsset:h,createElementAsset:p}))},[s[0]])},bT="mod-export-image-file",il=700,yT=il+48,Ur=500,wT=il-Ur,$a={devicePixelRatio:1,fileName:"download.png"},xT=e=>{const{className:t,style:n,sharedStore:r}=e,{createPrefixName:a}=T.useContext(ce),i=a(bT),o=i(),s=i("preview"),c=i("options"),d=i("canvas"),[u,f]=T.useState(null),[h,p]=T.useState(!0),[v,g]=T.useState(null),[m]=J.useForm(),y=T.useCallback(E=>{const w=r.get("idraw");w&&(p(!0),w.getImageBlobURL({devicePixelRatio:E}).then(({blobURL:C,width:S,height:$,devicePixelRatio:D})=>{C&&(g(C),f({width:S,height:$,devicePixelRatio:D}))}).catch(C=>{console.log(C)}).finally(()=>{p(!1)}))},[]);T.useEffect(()=>{m.setFieldsValue({devicePixelRatio:$a.devicePixelRatio,fileName:$a.fileName}),setTimeout(()=>{y($a.devicePixelRatio)},10)},[]);const b=()=>{if(!v)return;const E=m.getFieldsValue(),w=document.createElement("a");w.href=v,w.download=E.fileName||$a.fileName,document.body.appendChild(w),w.click(),document.body.removeChild(w)};return T.useMemo(()=>l.createElement("div",{style:Object.assign(Object.assign({},n),{width:il}),className:be(o,t)},l.createElement(Hh,{tip:"Loading...",spinning:h},l.createElement("div",{className:s,style:{width:Ur,height:Ur*3/4}},v&&l.createElement("img",{className:d,style:{maxWidth:Ur,maxHeight:Ur*3/4},src:v}))),l.createElement("div",{className:c,style:{width:wT}},l.createElement("div",{style:{marginBottom:6}},"Width: ",u==null?void 0:u.width),l.createElement("div",null,"Height: ",u==null?void 0:u.height),l.createElement(Vh,null),l.createElement("div",null,l.createElement(J,{form:m,layout:"vertical",onValuesChange:E=>{E.devicePixelRatio>0&&setTimeout(()=>{y(E.devicePixelRatio)},10)},disabled:h},l.createElement(J.Item,{label:"Device pixel ratio",name:"devicePixelRatio"},l.createElement(Ke,{size:"small",options:[1,2,3,4].map(E=>({label:`x${E}`,value:E}))})),l.createElement(J.Item,{label:"File name",name:"fileName"},l.createElement(dn,{size:"small",placeholder:"File name"})),l.createElement(Je,{type:"primary",onClick:b,disabled:h||!v,loading:h},"Download"))))),[u,h,v,y])};var ST=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function ET(e){return new Promise(function(t,n){const r=new FileReader;r.onload=function(){t(r)},r.onerror=n,e.type==="application/json"?r.readAsText(e):r.readAsArrayBuffer(e)})}function CT(e){ds({accept:"application/json",success:t=>ST(this,void 0,void 0,function*(){var n,r,a;const o=(yield ET(t.file)).result;if(typeof o=="string")try{const s=JSON.parse(o);(n=e==null?void 0:e.success)===null||n===void 0||n.call(e,{json:s})}catch(s){(r=e==null?void 0:e.error)===null||r===void 0||r.call(e,s)}else(a=e==null?void 0:e.error)===null||a===void 0||a.call(e,Error("ERROR_PICK_FILE_FAIL"))}),error:e==null?void 0:e.error})}const MT=()=>{const[e]=al("NavMenu");return e},AT="mod-nav-menu",_T=e=>{const{className:t,style:n,sharedStore:r,sharedEvent:a}=e,[i,o]=Wh.useModal(),{createPrefixName:s}=T.useContext(ce),c=s(AT),d=c(),u=c("dropdown"),[f,h]=T.useState([]),p=MT(),v=({key:w,domEvent:C})=>{C.preventDefault(),a.trigger("createElement",{type:w,element:{name:w}})},g=w=>{const C=r.get("idraw");C==null||C.resize({devicePixelRatio:w})},m={more:[{key:"about-idraw-stuido",label:p.about,disabled:!0},{key:"line",type:"divider"},{key:"file",label:p.file,children:[{key:"import-json-file",label:p.importJSONFile,onClick:()=>{CT({success:({json:w})=>{a.trigger("resetData",{data:w})},error:()=>{}})}},{key:"export-image",label:p.exportImage,onClick:()=>{i.info({icon:null,title:"Whole image file",width:yT,content:l.createElement(xT,{sharedEvent:a,sharedStore:r}),footer:null,closable:!0})}},{key:"export-json-file",label:p.exportJSONFile,onClick:()=>{const w=r.get("idraw"),C=w==null?void 0:w.getData({compact:!0});if(C){const S=JSON.stringify(C);v0(S,{fileName:"downdown.json"})}}}]},{key:"preferences",label:p.preferences,children:[{key:"device-pixel-ratio",label:p.devicePixelRatio,type:"group",children:[{key:"device-pixel-ratio-x1",label:"x1",onClick:()=>{g(1)}},{key:"device-pixel-ratio-x2",label:"x2",onClick:()=>{g(2)}},{key:"device-pixel-ratio-x3",label:"x3",onClick:()=>{g(3)}}]}]}],element:[{key:"rect",label:p.rect,icon:l.createElement(tf,null),onClick:v},{key:"circle",label:p.circle,icon:l.createElement(nf,null),onClick:v},{key:"text",label:p.text,icon:l.createElement(rf,null),onClick:v},{key:"image",label:p.image,icon:l.createElement(sf,null),onClick:v},{key:"svg",label:p.svg,icon:l.createElement(of,null),onClick:v},{key:"html",label:p.html,disabled:!0,icon:l.createElement(lf,null),onClick:v},{key:"group",label:p.group,icon:l.createElement(af,null),onClick:v}]},y={size:"small",type:"text"},b=[{key:"more",button:l.createElement(pv,{style:{fontSize:20}})},{key:"element",button:l.createElement(Qg,{style:{fontSize:20}})}],E=()=>{const w=r.get("idraw"),C=[];if(w){const{viewSizeInfo:S}=w.getViewInfo(),{devicePixelRatio:$}=S;C.push(`device-pixel-ratio-x${$}`)}h(C)};return T.useMemo(()=>l.createElement("div",{style:n,className:be(d,t)},b.map((w,C)=>l.createElement(_i,{key:C,trigger:["click","click"],menu:{items:m[w.key]||[],selectedKeys:f},placement:"bottom",overlayClassName:u,onOpenChange:S=>{S===!0&&E()}},l.createElement(Je,Object.assign({},y,{onClick:S=>S.preventDefault()}),l.createElement(Gh.Compact,null,w.button,l.createElement(df,{style:{fontSize:10,marginLeft:4}}))))),o),[f,p])},TT="mod-header",OT=e=>{const{logo:t,navigationMenu:n,navigationCenter:r,className:a,style:i,openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f}=e,{state:h,dispatch:p}=T.useContext(Ar),{createPrefixName:v}=T.useContext(ce),g=v(TT),m=g(),y=g("left"),b=g("right"),E=g("center"),w=g("locale"),C=g("scale"),S=g("switch"),{localeCode:$,scaleInfo:D}=h;return T.useMemo(()=>l.createElement("div",{style:i,className:be(m,a)},l.createElement("div",{className:y},t,n||l.createElement(_T,{sharedStore:u,sharedEvent:f}),l.createElement(hT,{openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f})),r&&l.createElement("div",{className:E},r),l.createElement("div",{className:b},l.createElement(jg,{className:C,value:`${ve(D.scale)}`,onChange:B=>{const H=parseFloat(B);H>0&&(p==null||p({type:"update",payload:{scaleInfo:{scale:ve(H),from:"control"}}}))}}),l.createElement(f0,{className:w,value:$,onChange:B=>{p==null||p({type:"update",payload:{localeCode:B}})}}),l.createElement(d0,{className:S,theme:h==null?void 0:h.themeMode,onChange:({theme:B})=>{p==null||p({type:"updateThemeMode",payload:{themeMode:B}})}}))),[$,D,o,s,c,d])},IT="mod-sketch",$T=e=>{const t=T.useRef(null),n=T.useRef(null),r=T.useRef(!1),{className:a,style:i,width:o,height:s,sharedEvent:c,sharedStore:d,useContextMenuOptions:u}=e,{generateClassName:f}=T.useContext(ce),{state:h,dispatch:p}=T.useContext(Ar),{editingData:v}=h,g=f(IT),m=T.useRef([]),y=T.useRef(h.editingData),b=T.useRef(h.data),E=T.useRef([]),[w]=u({sharedEvent:c,sharedStore:d});return T.useEffect(()=>{m.current=[...h.editingDataPosition],b.current=h.data,y.current=h.editingData,E.current=[...h.selectedUUIDs]},[h.editingDataPosition,h.data,h.editingData,h.selectedUUIDs]),T.useEffect(()=>{if(!(t!=null&&t.current)||n!=null&&n.current)return;const C={width:o,height:s,devicePixelRatio:window.devicePixelRatio},S=new Dg(t.current,C);S.enable("ruler"),n.current=S;const $=A=>{const N=y.current;let{uuids:x}=A;const{positions:R}=A;R&&Array.isArray(R)&&(x=hu(R,N.elements).map(_=>_.uuid)),p({type:"update",payload:{selectedUUIDs:x}})},D=A=>{const{data:N,type:x}=A,R=y.current;if(["addElement","updateElement","deleteElement","moveElement","dragElement","resizeElement"].includes(x)){const Y={editingData:Object.assign({},N)};["addElement","deleteElement","moveElement"].includes(x)&&(Y.treeData=Ne(R)),p({type:"update",payload:Y})}},B=A=>{const{scale:N}=A;p({type:"update",payload:{scaleInfo:{scale:N,from:"event"}}})},H=A=>{const{element:N}=A;S.updateElement(N);const x=Object.assign({},S.getData()),R=Ne(x);p({type:"update",payload:{editingData:Object.assign({},x),treeData:R}})},G=A=>{const{type:N,element:x}=A,R=S.createElement(N,{element:x,viewCenter:!0});let Y=S.getViewCenter();const _=E.current;let U=[];const V=S.getData();if(Array.isArray(_)&&_.length===1){const L=_[0],F=Nt(L,V.elements);let te=mt(F,V.elements);if(F.length>1){U=[...F];let xt=U.pop();xt+=1;const nt=[...U];U.push(xt),te=mt(nt,V.elements),Y=bt(te),R.x=Y.x-R.w/2,R.y=Y.y-R.h/2}}const O=S.addElement(R,{position:U}),P=Ne(O);p({type:"update",payload:{editingData:Object.assign({},O),treeData:P}}),S.selectElements([R.uuid])},j=A=>{const{element:N,position:x=[]}=A;let R=S.getViewCenter();const Y=E.current;let _=x;const U=S.getData();if(Array.isArray(Y)&&Y.length===1){const P=Y[0],L=Nt(P,U.elements),F=mt(L,U.elements);L.length>0&&(F==null?void 0:F.type)==="group"&&Array.isArray(F.detail.children)&&(_=[...L],_.push(F.detail.children.length),R=bt(F))}const V=S.addElement(Object.assign(Object.assign({},N),{x:R.x-N.w/2,y:R.y-N.h/2}),{position:_}),O=Ne(V);p({type:"update",payload:{editingData:Object.assign({},V),treeData:O}}),S.selectElements([N.uuid])},M=A=>{const{uuid:N}=A;S==null||S.deleteElement(N);const x=S==null?void 0:S.getData();if(x){const R=Ne(x);p({type:"update",payload:{editingData:Object.assign({},x),treeData:R}}),S.trigger(Ae.clearSelect,{})}},I=A=>{const{type:N,position:x}=A,R=n==null?void 0:n.current;if(!R)return;const Y=m.current,_=b.current,U=y.current;if(Y.length>0&&tT(Y,U,_),N==="go-to-group"&&x){const V=[...Y,...x],O=fr(V,_),P=Ne(O);p({type:"update",payload:{data:Object.assign({},_),editingData:Object.assign({},O),editingDataPosition:V,treeData:P}}),R.centerContent({data:O}),R.trigger(Ae.clearSelect,{})}else if(N==="back-one"&&Y.length>0){const V=[...Y];V.pop();const O=fr(V,_),P=Ne(O);p({type:"update",payload:{data:Object.assign({},_),editingData:Object.assign({},O),editingDataPosition:[...V],treeData:P}}),R.centerContent({data:O}),R.trigger(Ae.clearSelect,{})}else if(N==="back-root"){const V=[],O=fr(V,_),P=Ne(O);p({type:"update",payload:{data:Object.assign({},_),editingData:O,editingDataPosition:V,treeData:P}}),R.centerContent({data:O}),R.trigger(Ae.clearSelect,{})}},k=A=>{const{data:N}=A,x=[],R=fr(x,N),Y=Ne(R);p({type:"update",payload:{data:Object.assign({},N),editingData:Object.assign({},R),editingDataPosition:x,treeData:Y}}),S.setViewScale({scale:1,offsetX:0,offsetY:0}),S.trigger(Ae.clearSelect,{})},z=A=>{const{editingData:N}=A,x=Ne(N);p({type:"update",payload:{editingData:Object.assign({},N),treeData:x}}),S.trigger(Ae.clearSelect,{})};if(S.on(Ae.select,$),S.on(Ae.change,D),S.on(Ae.scale,B),S.on(Ae.textChange,H),c.on("createElement",G),c.on("addElement",j),c.on("deleteElement",M),c.on("resetEditingView",I),c.on("resetData",k),c.on("resetEditingData",z),c.on("dispatch",p),!r.current){if(h.scaleInfo){const{scale:A,offsetX:N,offsetY:x}=h.scaleInfo;A&&N&&x&&S.setViewScale({scale:A,offsetX:N,offsetY:x})}r.current=!0}return d.set("idraw",S),()=>{r.current=!1,S.off(Ae.select,$),S.off(Ae.change,D),S.off(Ae.scale,B),S.off(Ae.textChange,H),d.set("idraw",null)}},[]),T.useEffect(()=>{n!=null&&n.current&&n.current.setData(v)},[v]),T.useEffect(()=>{if(n!=null&&n.current){const C=n.current;h.scaleInfo.from==="control"&&C.scale({scale:h.scaleInfo.scale,point:{x:o/2,y:s/2}})}},[h.scaleInfo]),T.useEffect(()=>{const C=n.current,S=t.current;C&&C.resize({width:o,height:s}),S&&(S.style.width=`${o}px`,S.style.height=`${s}px`)},[o,s]),T.useMemo(()=>l.createElement(_i,{menu:{items:w},trigger:["contextMenu"]},l.createElement("div",{ref:t,className:be(g,a),style:Object.assign(Object.assign({},i),{width:o,height:s,padding:0})})),[w])},PT="mod-dashboard",Pa=240,Ra=240,Lr=36,RT=T.forwardRef((e,t)=>{const{className:n,style:r,width:a,height:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,sharedStore:u,sharedEvent:f,useContextMenuOptions:h,handleKeyboard:p}=e,{createPrefixName:v}=T.useContext(ce),g=v(PT),[m,y]=T.useState(!0),[b,E]=T.useState(!0);T.useEffect(()=>{const S=$=>{["INPUT","TEXTAREA"].includes($.target.nodeName)||p($,{sharedEvent:f,sharedStore:u})};return window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}},[]);const[w,C]=T.useState({leftWidth:m?Pa:0,rightWidth:b?Ra:0,centerWidth:a-(m?Pa:0)-(b?Ra:0)});return T.useEffect(()=>{const S=m?Pa:0,$=b?Ra:0,D=a-S-$;C({leftWidth:S,rightWidth:$,centerWidth:D})},[i,a,m,b]),T.useMemo(()=>{const{leftWidth:S,rightWidth:$,centerWidth:D}=w;return l.createElement("div",{ref:t,className:be(g(),n),style:Object.assign(Object.assign({},r),{width:a,height:i,padding:0})},l.createElement("div",{className:g("header"),style:{height:Lr}},l.createElement(OT,{sharedEvent:f,sharedStore:u,logo:o,navigationMenu:s,navigationCenter:c,openLeftSider:m,openRightSider:b,onClickToggleLayer:()=>{const B=!m;let H=S;B?H=Pa:H=0,C({leftWidth:H,rightWidth:$,centerWidth:a-H-$}),y(B)},onClickToggleSetting:()=>{const B=!b;let H=$;B?H=Ra:H=0,C({leftWidth:S,rightWidth:H,centerWidth:a-S-H}),E(B)}})),l.createElement("div",{className:g("content"),style:{top:Lr}},l.createElement(oi,{split:"vertical",defaultSize:D+$,allowResize:!0,onChange:B=>{const H=a-B,G=B-$;G<100||C({leftWidth:H,rightWidth:$,centerWidth:G})},pane1Style:{width:S},pane2Style:{width:D+$}},l.createElement("div",null,m&&l.createElement(gT,{height:i-Lr,className:g("left"),defaultSelectedElementUUIDs:d,sharedEvent:f,sharedStore:u,useContextMenuOptions:h})),l.createElement("div",{style:{width:w.centerWidth+w.rightWidth,display:"flex",flexDirection:"row"}},l.createElement($T,{className:g("center"),width:D,height:i-Lr,sharedStore:u,sharedEvent:f,useContextMenuOptions:h}),l.createElement("div",{className:g("right"),style:{width:$,height:i-Lr}},l.createElement(mT,null))))))},[n,m,b,w,i])});function Qd(){return{idraw:null,clipboard:{type:"default",data:null},selectedUUIDs:[]}}function zT(e){const{sharedEvent:t,sharedStore:n}=e;t.on("copy",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=La(a,i.elements);o.length>0&&n.set("clipboard",{type:"copy-elements",data:o})}}),t.on("paste",()=>{const r=n.get("idraw"),a=n.get("clipboard"),i=n.get("selectedUUIDs");if(r&&["copy-elements","cut-elements"].includes(a==null?void 0:a.type)&&Array.isArray(a.data)){const o=a.data,s=[];if(a.type==="copy-elements"){for(let h=0;h0&&d[d.length-1]++,s.forEach(h=>{r.addElement(h,{position:d})});const u=r==null?void 0:r.getData(),f=Ne(u);t.trigger("dispatch",{type:"update",payload:{editingData:u,treeData:f}}),r.selectElement(s[0].uuid),setTimeout(()=>{t.trigger("scrollToLayer",{uuid:s[0].uuid})},100)}}),t.on("cut",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const c=La(a,i.elements);c.length>0&&n.set("clipboard",{type:"cut-elements",data:c.map(d=>eo(d))}),c.forEach(d=>{r==null||r.deleteElement(d.uuid)})}const o=r==null?void 0:r.getData(),s=Ne(o);t.trigger("dispatch",{type:"update",payload:{editingData:o,treeData:s}}),r==null||r.trigger(Ae.clearSelect)}),t.on("delete",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=La(a,i.elements);if(o.length>0){for(let d=0;d{const[t]=al("contextMenu"),{sharedEvent:n}=e;return[[{label:t.copy,key:"copy",onClick:()=>{n.trigger("copy")}},{label:t.paste,key:"paste-here",onClick:()=>{n.trigger("paste")}},{label:t.cut,key:"cut",onClick:()=>{n.trigger("cut")}},{label:t.delete,key:"delete",onClick:()=>{n.trigger("delete")}}]]};var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});var NT=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),$o={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},zh={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:NT?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},ol={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var za=1;za<20;za++)ol["f"+za]=111+za;function Ji(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(o){return Dh(o,t)}),a=function(s){return r.some(function(c){return Nh(c,s)})},i=n==null?a:a(n);return i}function LT(e,t){return Ji(e,t)}function jT(e,t){return Ji(e,{byKey:!0},t)}function Dh(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var o in $o)r[$o[o]]=!1;var s=!0,c=!1,d=void 0;try{for(var u=a[Symbol.iterator](),f;!(s=(f=u.next()).done);s=!0){var h=f.value,p=h.endsWith("?")&&h.length>1;p&&(h=h.slice(0,-1));var v=sl(h),g=$o[v];if(h.length>1&&!g&&!zh[h]&&!ol[v])throw new TypeError('Unknown modifier: "'+h+'"');(i===1||!g)&&(n?r.key=v:r.which=Lh(h)),g&&(r[g]=p?null:!0)}}catch(m){c=!0,d=m}finally{try{!s&&u.return&&u.return()}finally{if(c)throw d}}return r}function Nh(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function Lh(e){e=sl(e);var t=ol[e]||e.toUpperCase().charCodeAt(0);return t}function sl(e){return e=e.toLowerCase(),e=zh[e]||e,e}var Dn=Ft.default=Ji;Ft.isHotkey=Ji;Ft.isCodeHotkey=LT;Ft.isKeyHotkey=jT;Ft.parseHotkey=Dh;Ft.compareHotkey=Nh;Ft.toKeyCode=Lh;Ft.toKeyName=sl;const kT=(e,t)=>{const{sharedEvent:n}=t;Dn("mod+c",e)?n.trigger("copy",void 0):Dn("mod+v",e)?n.trigger("paste",void 0):Dn("mod+x",e)?n.trigger("cut",void 0):Dn("del",e)||Dn("backspace",e)?n.trigger("delete",void 0):Dn("mod+s",e)&&console.log("Save ... ")},HT=l.forwardRef((e,t)=>{const{width:n=1e3,height:r=600,style:a,className:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,prefiexName:u,onEditGroupElement:f,useContextMenuOptions:h=DT,handleKeyboard:p=kT}=e,[v,g]=T.useReducer(oT,aT(e)),m=T.useRef(null),y=T.useRef(new fn),b=T.useRef(new hn({defaultStorage:Qd()}));return T.useEffect(()=>{const E=mt(v.editingDataPosition,v.data.elements);f==null||f({uuid:E==null?void 0:E.uuid,position:[...v.editingDataPosition]})},[v.editingDataPosition]),T.useImperativeHandle(t,()=>({getSharedEvent(){return y.current},getSharedStore(){return b.current},dispatch(w){const{type:C,payload:S}=w;g({type:C,payload:S})}}),[]),T.useEffect(()=>(y.current||(y.current=new fn),b.current||(b.current=new hn({defaultStorage:Qd()})),zT({sharedEvent:y.current,sharedStore:b.current}),()=>{var E,w;(E=b.current)===null||E===void 0||E.clear(),(w=y.current)===null||w===void 0||w.destroy(),y.current=null,b.current=null}),[]),T.useEffect(()=>{const E=b.current;E&&E.set("selectedUUIDs",[...v.selectedUUIDs])},[v.selectedUUIDs]),T.useEffect(()=>{const E=y.current;E==null||E.trigger("switchTheme",{theme:v.themeMode})},[v.themeMode]),T.useEffect(()=>{const E=y.current;E==null||E.trigger("changeLocale",{locale:v.localeCode})},[v.localeCode]),T.useEffect(()=>{const E=y.current;E==null||E.trigger("trackDataChange",{data:v.data})},[v.data]),T.useEffect(()=>{const E=y.current;E==null||E.trigger("trackEditingDataChange",{editingData:v.editingData,editingDataPosition:v.editingDataPosition})},[v.editingData,v.editingDataPosition]),T.useMemo(()=>l.createElement(Qh,{localeCode:v.localeCode,container:m.current,topPrefix:u,themeMode:v.themeMode},l.createElement(sT,{value:{state:v,dispatch:g}},l.createElement(RT,{logo:o,navigationMenu:s,navigationCenter:c,ref:m,width:n,height:r,style:a,className:i,defaultSelectedElementUUIDs:d,sharedEvent:y.current,sharedStore:b.current,useContextMenuOptions:h,handleKeyboard:p}))),[u,n,r,v,g,m])});export{HT as S}; diff --git a/docs/js/lib/draw.Q3HpuYqJ.js b/docs/js/lib/draw.Q3HpuYqJ.js deleted file mode 100644 index 25812ef..0000000 --- a/docs/js/lib/draw.Q3HpuYqJ.js +++ /dev/null @@ -1,52 +0,0 @@ -import{r as A,R as l,e as ra,g as df}from"./react.dwzOUFZb.js";import{c as pe,A as uf,t as Ks,S as _d,a as Ge,I as se,D as vi,B as Ve,b as Jt,T as ff,F as J,R as he,C as Q,d as Xe,P as Od,m as Ya,E as aa,e as hf,f as vr,g as pf,h as gf,M as vf,i as mf}from"./antd.mAE7kg8m.js";let mi="idraw-studio";function Qs(e){mi=e}function Js(){return mi}function Td(e){return(...t)=>[mi,e,...t].join("-")}function Xa(...e){return[mi,...e].join("-")}const bf={locale:"en-US",Header:{},ElementDetail:{basicAttributes:"Basic",borderAttribute:"Border",contentAttribute:"Content",shadowAttribute:"Shadow",x:"X",y:"Y",w:"W",h:"H",background:"Background",solid:"Solid",dash:"Dash",inside:"Inside",outside:"Outside",centerLine:"Center",gradient:"Gradient",opacity:"Opacity",mixedBorderWidth:"Mixed",mixedBorderRadius:"Mixed",overflow:"Overflow",hidden:"Hidden",visible:"Visible",deepResizeInGroup:"Deep resize in group"},Menu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"}},yf={locale:"zh-CN",Header:{},ElementDetail:{basicAttributes:"基础",borderAttribute:"边框",contentAttribute:"内容",shadowAttribute:"阴影",x:"X",y:"Y",w:"宽",h:"高",background:"背景色",solid:"实线",dash:"虚线",inside:"内线",outside:"外线",centerLine:"中线",gradient:"渐变",opacity:"透明度",mixedBorderWidth:"混合边框",mixedBorderRadius:"混合圆角",overflow:"溢出",hidden:"隐藏",visible:"可视",deepResizeInGroup:"组内尺寸关联调整"},Menu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"}},qs={"en-US":bf,"zh-CN":yf},po="en-US",wf=e=>{const{localeCode:t}=A.useContext(le);return[A.useMemo(()=>{const a=(qs[t||po]||qs[po])[e];return Object.assign({},a)},[t,e])]},xf=e=>{const{themeMode:t}=e,n="theme",r=Xa(n),a=Xa(n,"dark"),i=pe({[r]:!0,[a]:t==="dark"});return{themeMode:t,className:i}},$d=e=>(e!=null&&e.topPrefix&&typeof(e==null?void 0:e.topPrefix)=="string"&&Qs(e.topPrefix),Object.assign({topPrefix:Js(),createPrefixName:Td,generateClassName:Xa,getClassNameTopPrefix:Js,setClassNameTopPrefix:Qs,localeCode:po},e||{})),le=A.createContext($d()),Ef=e=>{const{children:t,topPrefix:n,localeCode:r,container:a,themeMode:i}=e,o=$d({topPrefix:n,localeCode:r}),[s,c]=A.useState(o),{className:d}=xf({themeMode:i});return A.useEffect(()=>{c(Object.assign(Object.assign({},s),{localeCode:r,container:a}))},[r,a]),l.createElement(le.Provider,{value:Object.assign({},s)},l.createElement(uf,{theme:{algorithm:i==="dark"?Ks.darkAlgorithm:Ks.defaultAlgorithm}},l.createElement("div",{className:d},t)))};class el extends l.PureComponent{render(){const{children:t,className:n,split:r,style:a,size:i,eleRef:o}=this.props,s=["Pane",r,n];let c={flex:1,position:"relative",outline:"none"};return i!==void 0&&(r==="vertical"?c.width=i:(c.height=i,c.display="flex"),c.flex="none"),c=Object.assign({},c,a||{}),l.createElement("div",{ref:o,className:s.join(" "),style:c},t)}}const Sf="base-split-pane",Cf=()=>{const{generateClassName:e}=A.useContext(le);return{modClassName:e(Sf)}};function Mf(e){const{modClassName:t}=Cf(),{className:n,onClick:r,onDoubleClick:a,onMouseDown:i,onTouchEnd:o,onTouchStart:s,resizerClassName:c=t,split:d,style:u}=e,f=[c,d,n];return A.useMemo(()=>l.createElement("span",{role:"presentation",className:f.join(" "),style:u,onMouseDown:h=>i(h),onTouchStart:h=>{h.preventDefault(),s(h)},onTouchEnd:h=>{h.preventDefault(),o(h)},onClick:h=>{r&&(h.preventDefault(),r(h))},onDoubleClick:h=>{a&&(h.preventDefault(),a(h))}}),[])}const Af="xxxxx";function tl(e,t){if(e.selection)e.selection.empty();else try{t.getSelection().removeAllRanges()}catch{}}function nl(e,t,n,r){if(typeof r=="number"){const a=typeof t=="number"?t:0,i=typeof n=="number"&&n>=0?n:1/0;return Math.max(a,Math.min(i,r))}return e!==void 0?e:t}function _f(e){return l.Children.toArray(e).filter(t=>t)}class Za extends l.Component{constructor(t){super(t),this.onMouseDown=this.onMouseDown.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this);const{size:n,defaultSize:r,minSize:a,maxSize:i,primary:o}=t,s=n!==void 0?n:nl(r,a,i,null);this.state={active:!1,resized:!1,pane1Size:o==="first"?s:void 0,pane2Size:o==="second"?s:void 0,instanceProps:{size:n}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(Za.getSizeUpdate(this.props,this.state))}static getDerivedStateFromProps(t,n){return Za.getSizeUpdate(t,n)}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}onMouseDown(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchStart(n)}onTouchStart(t){const{allowResize:n,onDragStarted:r,split:a}=this.props;if(n){tl(document,window);const i=a==="vertical"?t.touches[0].clientX:t.touches[0].clientY;typeof r=="function"&&r(),this.setState({active:!0,position:i})}}onMouseMove(t){const n=Object.assign({},t,{touches:[{clientX:t.clientX,clientY:t.clientY}]});this.onTouchMove(n)}onTouchMove(t){const{allowResize:n,maxSize:r,minSize:a,onChange:i,split:o,step:s}=this.props,{active:c,position:d}=this.state;if(n&&c){tl(document,window);const u=this.props.primary==="first",f=u?this.pane1:this.pane2,h=u?this.pane2:this.pane1;if(f){const p=f,v=h;if(p.getBoundingClientRect){const g=p.getBoundingClientRect().width,m=p.getBoundingClientRect().height,b=o==="vertical"?t.touches[0].clientX:t.touches[0].clientY,y=o==="vertical"?g:m;let S=d-b;if(s){if(Math.abs(S)E&&(x=-x);let j=r;if(r!==void 0&&r<=0){const F=this.splitPane;o==="vertical"?j=F.getBoundingClientRect().width+r:j=F.getBoundingClientRect().height+r}let z=y-x;const k=d-S;zj?z=j:this.setState({position:k,resized:!0}),i&&i(z),this.setState({draggedSize:z,[u?"pane1Size":"pane2Size"]:z})}}}}onMouseUp(){const{allowResize:t,onDragFinished:n}=this.props,{active:r,draggedSize:a}=this.state;t&&r&&(typeof n=="function"&&n(a),this.setState({active:!1}))}static getSizeUpdate(t,n){const r={},{instanceProps:a}=n;if(a.size===t.size&&t.size!==void 0)return{};const i=t.size!==void 0?t.size:nl(t.defaultSize,t.minSize,t.maxSize,n.draggedSize);t.size!==void 0&&(r.draggedSize=i);const o=t.primary==="first";return r[o?"pane1Size":"pane2Size"]=i,r[o?"pane2Size":"pane1Size"]=void 0,r.instanceProps={size:t.size},r}render(){const{allowResize:t,children:n,className:r,onResizerClick:a,onResizerDoubleClick:i,paneClassName:o,pane1ClassName:s,pane2ClassName:c,paneStyle:d,pane1Style:u,pane2Style:f,resizerClassName:h,resizerStyle:p,split:v,style:g}=this.props,{pane1Size:m,pane2Size:b}=this.state,y=t?"":"disabled",S=h&&`${h} ${Af}`,x=_f(n),C=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);v==="vertical"?Object.assign(C,{flexDirection:"row",left:0,right:0}):Object.assign(C,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const E=["SplitPane",r,v,y],j=Object.assign(Object.assign({},d),u),z=Object.assign(Object.assign({},d),f),k=["Pane1",o,s].join(" "),F=["Pane2",o,c].join(" ");return l.createElement("div",{className:E.join(" "),ref:U=>{this.splitPane=U},style:C},l.createElement(el,{className:k,key:"pane1",eleRef:U=>{this.pane1=U},size:m,split:v,style:j},x[0]),l.createElement(Mf,{className:y,onClick:a,onDoubleClick:i,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:S,split:v,style:p||{}}),l.createElement(el,{className:F,key:"pane2",eleRef:U=>{this.pane2=U},size:b,split:v,style:z},x[1]))}}var Of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a({iconClassName:Xa(Tf)}),ae=e=>{const{className:t,style:n,children:r}=e,a=Of(e,["className","style","children"]),{iconClassName:i}=$f();return A.useMemo(()=>l.createElement("span",Object.assign({className:pe([i,t]),style:n},a),r),[i,n,t])},Pf=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M516.266667 938.666667h-38.4c-234.666667-21.333333-405.333333-230.4-384-465.066667 17.066667-204.8 179.2-366.933333 384-384 17.066667 0 34.133333 8.533333 42.666666 21.333333 8.533333 12.8 8.533333 34.133333-4.266666 46.933334-85.333333 115.2-59.733333 273.066667 55.466666 358.4 89.6 68.266667 213.333333 68.266667 302.933334 0 12.8-8.533333 29.866667-12.8 46.933333-4.266667 12.8 8.533333 21.333333 25.6 21.333333 42.666667-8.533333 115.2-64 217.6-153.6 290.133333-81.066667 59.733333-174.933333 93.866667-273.066666 93.866667zM396.8 187.733333c-123.733333 42.666667-213.333333 153.6-221.866667 290.133334-17.066667 187.733333 119.466667 354.133333 307.2 371.2 89.6 8.533333 179.2-17.066667 247.466667-76.8 46.933333-38.4 81.066667-89.6 102.4-145.066667-106.666667 38.4-226.133333 21.333333-320-46.933333-119.466667-93.866667-166.4-251.733333-115.2-392.533334z"}))),If=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 768c-141.376 0-256-114.624-256-256s114.624-256 256-256 256 114.624 256 256-114.624 256-256 256z m0-85.333333a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334zM469.333333 85.333333a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0V85.333333z m0 768a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0v-85.333334zM85.333333 554.666667a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334H85.333333z m768 0a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334h-85.333334zM161.834667 222.165333a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m576 576a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m-515.669334 64a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z m576-576a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z"}))),zf="base-theme-switch",Rf=Td(zf),rl=e=>{if(!(typeof e>"u"))return e==="light"};function Df(e){return e===!0?"light":"dark"}const Nf=e=>{const{className:t,style:n,onChange:r,theme:a,defaultTheme:i}=e;return l.createElement(_d,{className:pe([Rf(),t]),style:n,checkedChildren:l.createElement(If,{style:{height:"100%"}}),unCheckedChildren:l.createElement(Pf,{style:{height:"100%"}}),checked:rl(i),defaultChecked:rl(a),onChange:o=>{const s=Df(o);r==null||r({theme:s})}})},al=Ge.Option,jf="base-locale-selector",Lf=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=A.useContext(le),s=o(jf);return A.useMemo(()=>l.createElement(Ge,{style:n,className:pe(s(),t),size:"small",defaultValue:r,value:a,onChange:i},l.createElement(al,{value:"en-US"},"English"),l.createElement(al,{value:"zh-CN"},"中文")),[t,n,r,a,i])};function ia(e,t){let n=-1;return function(...r){n>=0||(n=setTimeout(()=>{e(...r),n=-1},t))}}function Ko(e){const{accept:t,success:n,error:r}=e;let a=document.createElement("input");a.type="file",t&&(a.accept=t),a.addEventListener("change",function(){var i;const o=(i=a.files)===null||i===void 0?void 0:i[0];n({file:o}),a=null}),a.addEventListener("error",function(i){typeof r=="function"&&r(i),a=null}),a.click()}function kf(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsDataURL(e)})}function Bf(e){return new Promise(function(t,n){let r=new FileReader;r.addEventListener("load",function(){t(r.result),r=null}),r.addEventListener("error",function(a){n(a),r=null}),r.addEventListener("abort",function(){n(new Error("abort")),r=null}),r.readAsText(e)})}function Ff(e){const t=new TextEncoder().encode(e),n=new Blob([t],{type:"text/plain;charset=utf-8"});return window.URL.createObjectURL(n)}function Hf(e,t){const{fileName:n}=t,r=Ff(e);let a=document.createElement("a");a.href=r,a.download=n,a.click(),a=null}function Ka(e){return typeof e=="string"&&(/^\#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)||/^[a-z]{1,}$/i.test(e))}function Wf(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="linear-gradient"){const n=[];typeof e.angle=="number"?n.push(`${e.angle}deg`):n.push("180deg"),Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(${n.join(", ")})`}else if((e==null?void 0:e.type)==="radial-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.forEach(r=>{n.push(`${r.color} ${r.offset*100}%`)}),t=`radial-gradient(circle, ${n.join(", ")})`}return t}function Qa(e){let t="transparent";if(typeof e=="string")t=e;else if((e==null?void 0:e.type)==="radial-gradient"||(e==null?void 0:e.type)==="linear-gradient"){const n=[];Array.isArray(e.stops)&&e.stops.length>0&&(e.stops.forEach((r,a)=>{n.push(`${r.color} ${r.offset*100}%`),a===e.stops.length-1&&r.offset<1&&n.push(`${r.color} ${r.offset*100}%`)}),t=`linear-gradient(90deg, ${n.join(", ")})`)}return t}function il(e,t){if(t===1)return e;let n=1;const r=/^\#[0-9a-f]{6,6}$/i,a=/^\#[0-9a-f]{8,8}$/i;let i=e;if(r.test(e)?n=parseInt(e.substring(5,7).replace(/^\#/,"0x")):a.test(e)&&(n=parseInt(e.substring(7,9).replace(/^\#/,"0x")),i=e.substring(0,7)),n=n*t,r.test(i)&&n>0&&n<1){const o=Math.max(0,Math.min(255,Math.ceil(n*256)));i=`${i.toUpperCase()}${o.toString(16).toUpperCase()}`}return i}function tr(){function e(){return((1+Math.random())*65536|0).toString(16).substring(1)}return`${e()}${e()}-${e()}-${e()}-${e()}-${e()}${e()}${e()}`}function zt(e){let t=0;for(let n=0;n=0)return n;if(r==="Array"){const a=[];return n.forEach(i=>{a.push(t(i))}),a}else if(r==="Object"){const a={};return Object.keys(n).forEach(s=>{a[s]=t(n[s])}),Object.getOwnPropertySymbols(n).forEach(s=>{a[s]=t(n[s])}),a}}return t(e)}function Bi(e){const t=qt(e),n=r=>{r.uuid=tr(),r.type==="group"&&r.detail.children&&r.detail.children.forEach(a=>{n(a)})};return n(t),t}function Gf(e){return Object.prototype.toString.call(e).replace(/[\]|\[]{1,1}/gi,"").split(" ")[1]}function Vf(e,t){const n=e.assets||{},r=qt(e),a=(t==null?void 0:t.loadItemMap)||{},i=o=>{o.forEach(s=>{var c,d,u;if(s.type==="image"&&s.detail.src){const f=s.detail.src;if(Qt(f)&&!n[f]&&a[f]&&typeof((c=a[f])===null||c===void 0?void 0:c.source)=="string")n[f]={type:"image",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"image",value:f}),s.detail.src=h}}else if(s.type==="svg"){const f=s.detail.svg;if(Qt(f)&&!n[f]&&a[f]&&typeof((d=a[f])===null||d===void 0?void 0:d.source)=="string")n[f]={type:"svg",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"svg",value:f}),s.detail.svg=h}}else if(s.type==="html"){const f=s.detail.html;if(Qt(f)&&!n[f]&&a[f]&&typeof((u=a[f])===null||u===void 0?void 0:u.source)=="string")n[f]={type:"html",value:a[f].source};else if(!n[f]){const h=nr(f);n[h]||(n[h]={type:"html",value:f}),s.detail.html=h}}else if(s.type==="group"&&Array.isArray(s.detail.children)){const f=s.detail.assets||{};Object.keys(f).forEach(h=>{n[h]||(n[h]=f[h])}),delete s.detail.assets,i(s.detail.children)}})};return i(r.elements),r.assets=n,r}function tt(e){return(Object.prototype.toString.call(e)||"").replace(/(\[object|\])/gi,"").trim()}const Tr={type(e,t){const n=tt(e);return t===!0?n.toLocaleLowerCase():n},array(e){return tt(e)==="Array"},json(e){return tt(e)==="Object"},function(e){return tt(e)==="Function"},asyncFunction(e){return tt(e)==="AsyncFunction"},boolean(e){return tt(e)==="Boolean"},string(e){return tt(e)==="String"},number(e){return tt(e)==="Number"},undefined(e){return tt(e)==="Undefined"},null(e){return tt(e)==="Null"},promise(e){return tt(e)==="Promise"}};function Uf(e,t){const{width:n,height:r}=t;return new Promise((a,i)=>{const o=` - - -
- ${e} -
-
-
- `,s=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),c=new FileReader;c.readAsDataURL(s),c.onload=function(d){var u;const f=(u=d==null?void 0:d.target)===null||u===void 0?void 0:u.result;a(f)},c.onerror=function(d){i(d)}})}function Yf(e){return new Promise((t,n)=>{const r=e,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=new FileReader;i.readAsDataURL(a),i.onload=function(o){var s;const c=(s=o==null?void 0:o.target)===null||s===void 0?void 0:s.result;t(c)},i.onerror=function(o){n(o)}})}var Pd=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{Image:Xf}=window;function bi(e){return new Promise((t,n)=>{const r=new Xf;r.crossOrigin="anonymous",r.onload=function(){t(r)},r.onabort=n,r.onerror=n,r.src=e})}function Zf(e){return Pd(this,void 0,void 0,function*(){const t=yield Yf(e);return yield bi(t)})}function Kf(e){return e.replace(/\&/gi,"&")}function Qf(e,t){return Pd(this,void 0,void 0,function*(){e=Kf(e);const n=yield Uf(e,t);return yield bi(n)})}function an(e){return typeof e=="number"&&(e>0||e<=0)}function Jf(e){return an(e)}function qf(e){return an(e)}function Id(e){return typeof e=="number"&&e>=0}function eh(e){return typeof e=="number"&&e>=0}function th(e){return typeof e=="number"&&e>=-360&&e<=360}function nh(e){return Id(e)}function rh(e){return an(e)&&e>=0}function ah(e){return Ka(e)}function zd(e){return typeof e=="string"&&/^(http:\/\/|https:\/\/|\.\/|\/)/.test(`${e}`)}function Rd(e){return typeof e=="string"&&/^(data:image\/)/.test(`${e}`)}function ih(e){return Rd(e)||zd(e)}function oh(e){return typeof e=="string"&&/^()/i.test(`${e}`.trim())&&/<\/[\s]{0,}svg>$/i.test(`${e}`.trim())}function sh(e){let t=!1;if(typeof e=="string"){let n=document.createElement("div");n.innerHTML=e,n.children.length>0&&(t=!0),n=null}return t}function lh(e){return typeof e=="string"}function ch(e){return an(e)&&e>0}function dh(e){return an(e)&&e>0}function uh(e){return an(e)&&e>0}function fh(e){return["center","left","right"].includes(e)}function hh(e){return typeof e=="string"&&e.length>0}function ph(e){return["bold"].includes(e)}function gh(e){return/^(-?\d+(?:\.\d+)?)$/.test(`${e}`)}const At={x:Jf,y:qf,w:Id,h:eh,angle:th,number:an,numberStr:gh,borderWidth:nh,borderRadius:rh,color:ah,imageSrc:ih,imageURL:zd,imageBase64:Rd,svg:oh,html:sh,text:lh,fontSize:ch,lineHeight:dh,textAlign:fh,fontFamily:hh,fontWeight:ph,strokeWidth:uh};var oa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Z=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},K,wt;const vh=12,mh="400",bh="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";class Dd{constructor(t,n){K.set(this,void 0),wt.set(this,void 0),oa(this,K,t,"f"),oa(this,wt,Object.assign({devicePixelRatio:1,offscreenCanvas:null},n),"f"),this.$resetFont()}$undoPixelRatio(t){return t/Z(this,wt,"f").devicePixelRatio}$doPixelRatio(t){return Z(this,wt,"f").devicePixelRatio*t}$getContext(){return Z(this,K,"f")}$setContext(t){oa(this,K,t,"f")}$setFont(t){const n=[];t.fontWeight&&n.push(`${t.fontWeight}`),n.push(`${this.$doPixelRatio(t.fontSize||12)}px`),n.push(`${t.fontFamily||"sans-serif"}`),Z(this,K,"f").font=`${n.join(" ")}`}$resetFont(){this.$setFont({fontSize:vh,fontFamily:bh,fontWeight:mh})}$getOffscreenCanvas(){return Z(this,wt,"f").offscreenCanvas}$resize(t){const{width:n,height:r,devicePixelRatio:a,resetStyle:i}=t,{canvas:o}=Z(this,K,"f");o.width=n*a,o.height=r*a,oa(this,wt,Object.assign(Object.assign({},Z(this,wt,"f")),{devicePixelRatio:a}),"f"),i===!0&&(o.style.width=`${n}px`,o.style.height=`${r}px`)}$getSize(){const{devicePixelRatio:t}=Z(this,wt,"f"),{width:n,height:r}=Z(this,K,"f").canvas;return{width:n/t,height:r/t,devicePixelRatio:t}}get canvas(){return Z(this,K,"f").canvas}get fillStyle(){return Z(this,K,"f").fillStyle}set fillStyle(t){Z(this,K,"f").fillStyle=t}get strokeStyle(){return Z(this,K,"f").strokeStyle}set strokeStyle(t){Z(this,K,"f").strokeStyle=t}get lineWidth(){return this.$undoPixelRatio(Z(this,K,"f").lineWidth)}set lineWidth(t){Z(this,K,"f").lineWidth=this.$doPixelRatio(t)}get textAlign(){return Z(this,K,"f").textAlign}set textAlign(t){Z(this,K,"f").textAlign=t}get textBaseline(){return Z(this,K,"f").textBaseline}set textBaseline(t){Z(this,K,"f").textBaseline=t}get globalAlpha(){return Z(this,K,"f").globalAlpha}set globalAlpha(t){Z(this,K,"f").globalAlpha=t}get shadowColor(){return Z(this,K,"f").shadowColor}set shadowColor(t){Z(this,K,"f").shadowColor=t}get shadowOffsetX(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetX)}set shadowOffsetX(t){Z(this,K,"f").shadowOffsetX=this.$doPixelRatio(t)}get shadowOffsetY(){return this.$undoPixelRatio(Z(this,K,"f").shadowOffsetY)}set shadowOffsetY(t){Z(this,K,"f").shadowOffsetY=this.$doPixelRatio(t)}get shadowBlur(){return this.$undoPixelRatio(Z(this,K,"f").shadowBlur)}set shadowBlur(t){Z(this,K,"f").shadowBlur=this.$doPixelRatio(t)}get lineCap(){return Z(this,K,"f").lineCap}set lineCap(t){Z(this,K,"f").lineCap=t}get globalCompositeOperation(){return Z(this,K,"f").globalCompositeOperation}set globalCompositeOperation(t){Z(this,K,"f").globalCompositeOperation=t}fill(...t){return Z(this,K,"f").fill(...t)}arc(t,n,r,a,i,o){return Z(this,K,"f").arc(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),a,i,o)}rect(t,n,r,a){return Z(this,K,"f").rect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}fillRect(t,n,r,a){return Z(this,K,"f").fillRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}clearRect(t,n,r,a){return Z(this,K,"f").clearRect(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}beginPath(){return Z(this,K,"f").beginPath()}closePath(){return Z(this,K,"f").closePath()}lineTo(t,n){return Z(this,K,"f").lineTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}moveTo(t,n){return Z(this,K,"f").moveTo(this.$doPixelRatio(t),this.$doPixelRatio(n))}arcTo(t,n,r,a,i){return Z(this,K,"f").arcTo(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i))}getLineDash(){return Z(this,K,"f").getLineDash()}setLineDash(t){const n=t.map(r=>this.$doPixelRatio(r));return Z(this,K,"f").setLineDash(n)}stroke(t){return t?Z(this,K,"f").stroke(t):Z(this,K,"f").stroke()}translate(t,n){return Z(this,K,"f").translate(this.$doPixelRatio(t),this.$doPixelRatio(n))}rotate(t){return Z(this,K,"f").rotate(t)}drawImage(...t){const n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],s=t[t.length-4],c=t[t.length-3],d=t[t.length-2],u=t[t.length-1];return t.length===9?Z(this,K,"f").drawImage(n,this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o),this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u)):Z(this,K,"f").drawImage(n,this.$doPixelRatio(s),this.$doPixelRatio(c),this.$doPixelRatio(d),this.$doPixelRatio(u))}createPattern(t,n){return Z(this,K,"f").createPattern(t,n)}measureText(t){return Z(this,K,"f").measureText(t)}fillText(t,n,r,a){return a!==void 0?Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").fillText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}strokeText(t,n,r,a){return a!==void 0?Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a)):Z(this,K,"f").strokeText(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}save(){Z(this,K,"f").save()}restore(){Z(this,K,"f").restore()}scale(t,n){Z(this,K,"f").scale(t,n)}circle(t,n,r,a,i,o,s,c){Z(this,K,"f").ellipse(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),i,o,s,c)}isPointInPath(t,n){return Z(this,K,"f").isPointInPath(this.$doPixelRatio(t),this.$doPixelRatio(n))}clip(...t){return Z(this,K,"f").clip(...t)}setTransform(t,n,r,a,i,o){return Z(this,K,"f").setTransform(t,n,r,a,i,o)}getTransform(){return Z(this,K,"f").getTransform()}createLinearGradient(t,n,r,a){return Z(this,K,"f").createLinearGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a))}createRadialGradient(t,n,r,a,i,o){return Z(this,K,"f").createRadialGradient(this.$doPixelRatio(t),this.$doPixelRatio(n),this.$doPixelRatio(r),this.$doPixelRatio(a),this.$doPixelRatio(i),this.$doPixelRatio(o))}createConicGradient(t,n,r){return Z(this,K,"f").createConicGradient(t,this.$doPixelRatio(n),this.$doPixelRatio(r))}}K=new WeakMap,wt=new WeakMap;function vn(e){const{width:t,height:n,ctx:r,devicePixelRatio:a}=e;let i=r;if(!i){const s=document.createElement("canvas");s.width=t*a,s.height=n*a,i=s.getContext("2d")}return new Dd(i,e)}function Ca(e){const{width:t,height:n,devicePixelRatio:r}=e,a=new OffscreenCanvas(t*r,n*r),o=a.getContext("2d").canvas.getContext("2d");return new Dd(o,{devicePixelRatio:r,offscreenCanvas:a})}function yh(e,t){const{width:n,height:r,devicePixelRatio:a,offscreen:i,createCustomContext2D:o}=t,s={width:n,height:r,devicePixelRatio:a},c=e.getContext("2d");if(o){const d=o(s),u=o(s),f=o(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}if(i===!0){const d=Ca(s),u=Ca(s),f=Ca(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{const{width:g,height:m}=d.$getSize();h.clearRect(0,0,g,m),h.drawImage(f.canvas,0,0,g,m),h.drawImage(d.canvas,0,0,g,m),h.drawImage(u.canvas,0,0,g,m),f.clearRect(0,0,g,m),d.clearRect(0,0,g,m),u.clearRect(0,0,g,m)}}}else{const d=vn(s),u=vn(s),f=vn(s),h=vn(Object.assign({ctx:c},s));return{underContext:f,viewContext:d,helperContext:u,boardContext:h,drawView:()=>{h.clearRect(0,0,n,r),h.drawImage(f.canvas,0,0,n,r),h.drawImage(d.canvas,0,0,n,r),h.drawImage(u.canvas,0,0,n,r),f.clearRect(0,0,n,r),d.clearRect(0,0,n,r),u.clearRect(0,0,n,r)}}}}var wh=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},nt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Le;class en{constructor(){Le.set(this,void 0),wh(this,Le,new Map,"f")}on(t,n){if(nt(this,Le,"f").has(t)){const r=nt(this,Le,"f").get(t)||[];r==null||r.push(n),nt(this,Le,"f").set(t,r)}else nt(this,Le,"f").set(t,[n])}off(t,n){if(nt(this,Le,"f").has(t)){const r=nt(this,Le,"f").get(t);if(Array.isArray(r)){for(let a=0;a<(r==null?void 0:r.length);a++)if(r[a]===n){r.splice(a,1);break}}nt(this,Le,"f").set(t,r||[])}}trigger(t,n){const r=nt(this,Le,"f").get(t);return Array.isArray(r)?(r.forEach(a=>{a(n)}),!0):!1}has(t){if(nt(this,Le,"f").has(t)){const n=nt(this,Le,"f").get(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}destroy(){this.clear()}clear(){nt(this,Le,"f").clear()}}Le=new WeakMap;function xh(e,t){const n=(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y);return n===0?n:Math.sqrt(n)}function mr(e,t){return{x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}}var sa=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},En=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Ma,jt,Ja,go;class Fr{constructor(t){Ma.add(this),jt.set(this,void 0),Ja.set(this,void 0),sa(this,Ja,qt(t.defaultStorage),"f"),sa(this,jt,En(this,Ma,"m",go).call(this),"f")}set(t,n){En(this,jt,"f")[t]=n}get(t){return En(this,jt,"f")[t]}getSnapshot(){return qt(En(this,jt,"f"))}clear(){sa(this,jt,En(this,Ma,"m",go).call(this),"f")}destroy(){sa(this,jt,null,"f")}}jt=new WeakMap,Ja=new WeakMap,Ma=new WeakSet,go=function(){return qt(En(this,Ja,"f"))};function Nd(e){const{activeStore:t}=e;return{scale:t==null?void 0:t.scale,offsetTop:t==null?void 0:t.offsetTop,offsetBottom:t==null?void 0:t.offsetBottom,offsetLeft:t==null?void 0:t.offsetLeft,offsetRight:t==null?void 0:t.offsetRight}}function jd(e){const{activeStore:t}=e;return{devicePixelRatio:t.devicePixelRatio,width:t==null?void 0:t.width,height:t==null?void 0:t.height,contextWidth:t==null?void 0:t.contextWidth,contextHeight:t==null?void 0:t.contextHeight}}function Eh(e){return e/Math.PI*180}function Ft(e){return e/180*Math.PI}function Ld(e,t,n,r){const a=Ft(t||0);n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(a),e.translate(-n.x,-n.y)),r(e),n&&(a>0||a<0)&&(e.translate(n.x,n.y),e.rotate(-a),e.translate(-n.x,-n.y))}function _t(e,t,n){const r=vt(t);Ld(e,t.angle||0,r,()=>{n(e)})}function vt(e){return{x:e.x+e.w/2,y:e.y+e.h/2}}function kd(e){const t=Math.min(e[0].x,e[1].x,e[2].x,e[3].x),n=Math.min(e[0].y,e[1].y,e[2].y,e[3].y),r=Math.max(e[0].x,e[1].x,e[2].x,e[3].x),a=Math.max(e[0].y,e[1].y,e[2].y,e[3].y),i={x:t,y:n,w:r-t,h:a-n};return vt(i)}function Sh(e,t,n){const r=vo(e,t),a=vo(e,n);return a!==null&&r!==null?r>Math.PI*3/2&&aMath.PI*3/2&&r0)return Math.PI}else if(r===0){if(n<0)return Math.PI*3/2;if(n>0)return Math.PI/2}return n>0&&r<0?Math.atan(Math.abs(n)/Math.abs(r)):n>0&&r>0?Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r>0?Math.PI+Math.atan(Math.abs(n)/Math.abs(r)):n<0&&r<0?2*Math.PI-Math.atan(Math.abs(n)/Math.abs(r)):0}function je(e,t,n){let i=vo(e,t)+n;i>Math.PI*2?i=i-Math.PI*2:i<0-Math.PI*2&&(i=i+Math.PI*2),i<0&&(i=i+Math.PI*2);const o=xh(e,t);let s=0,c=0;return i===0?(s=0,c=0-o):i>0&&iMath.PI/2&&iMath.PI&&i<3/2*Math.PI?(s=0-Math.sin(i-Math.PI)*o,c=Math.cos(i-Math.PI)*o):i===3/2*Math.PI?(s=0-o,c=0):i>3/2*Math.PI&&i<2*Math.PI?(s=0-Math.sin(2*Math.PI-i)*o,c=0-Math.cos(2*Math.PI-i)*o):i===2*Math.PI&&(s=0,c=0-o),s+=e.x,c+=e.y,{x:s,y:c}}function qa(e,t){if((t==null?void 0:t.length)>0){let n=e.x,r=e.y;return t.forEach(a=>{const{x:i,y:o,w:s,h:c,angle:d=0}=a,u=vt({x:i,y:o,w:s,h:c,angle:d}),f=je(u,{x:n,y:r},Ft(d));n=f.x,r=f.y}),{x:n,y:r}}return e}function Bd(e,t,n){const{x:r,y:a,w:i,h:o}=e;let s={x:r,y:a},c={x:r+i,y:a},d={x:r+i,y:a+o},u={x:r,y:a+o};if(n&&(n>0||n<0)){const f=Ft(ht(n));s=je(t,s,f),c=je(t,c,f),d=je(t,d,f),u=je(t,u,f)}return[s,c,d,u]}function on(e){const{angle:t=0}=e,n=vt(e);return Bd(e,n,t)}function ol(e,t,n){return[je(e,{x:t[0].x,y:t[0].y},n),je(e,{x:t[1].x,y:t[1].y},n),je(e,{x:t[2].x,y:t[2].y},n),je(e,{x:t[3].x,y:t[3].y},n)]}function ht(e){if(!(e>0||e<0)||e===0)return 0;let t=e%360;return t<0&&(t+=360),t}function Fd(e){let t=!0;if(Array.isArray(e)){const n=[];e.forEach(r=>{var a;typeof r.uuid=="string"&&r.uuid?n.includes(r.uuid)?(t=!1,console.warn(`Duplicate uuids: ${r.uuid}`)):n.push(r.uuid):(t=!1,console.warn("Element missing uuid",r)),r.type==="group"&&(t=Fd((a=r==null?void 0:r.detail)===null||a===void 0?void 0:a.children))})}return t}function Ch(e){var t;const n={x:0,y:0,w:0,h:0};let r=null;for(let i=0;i0||s.angle<0)){const c=on(s);if(c.length===4){const d=[c[0].x,c[1].x,c[2].x,c[3].x],u=[c[0].y,c[1].y,c[2].y,c[3].y];s.x=Math.min(...d),s.y=Math.min(...u),s.w=Math.abs(Math.max(...d)-Math.min(...d)),s.h=Math.abs(Math.max(...u)-Math.min(...u))}}if(r){const c=Math.min(s.x,n.x),d=Math.min(s.y,n.y),u=Math.max(s.x+s.w,n.x+n.w),f=Math.max(s.y+s.h,n.y+n.h);n.x=c,n.y=d,n.w=Math.abs(u-c),n.h=Math.abs(f-d)}else n.x=s.x,n.y=s.y,n.w=s.w,n.h=s.h;r=s}return{x:Math.floor(n.x),y:Math.floor(n.y),w:Math.ceil(n.w),h:Math.ceil(n.h)}}function Hd(e,t){const n={x:0,y:0,w:0,h:0};e.forEach(a=>{const i={x:a.x,y:a.y,w:a.w,h:a.h,angle:a.angle};if(i.angle&&(i.angle>0||i.angle<0)){const u=on(i);if(u.length===4){const f=[u[0].x,u[1].x,u[2].x,u[3].x],h=[u[0].y,u[1].y,u[2].y,u[3].y];i.x=Math.min(...f),i.y=Math.min(...h),i.w=Math.abs(Math.max(...f)-Math.min(...f)),i.h=Math.abs(Math.max(...h)-Math.min(...h))}}const o=Math.min(i.x,n.x),s=Math.min(i.y,n.y),c=Math.max(i.x+i.w,n.x+n.w),d=Math.max(i.y+i.h,n.y+n.h);n.x=o,n.y=s,n.w=Math.abs(c-o),n.h=Math.abs(d-s)}),t!=null&&t.extend&&(n.x=Math.min(n.x,0),n.y=Math.min(n.y,0));const r={contextWidth:n.w,contextHeight:n.h};return t!=null&&t.viewWidth&&(t!=null&&t.viewHeight)&&(t==null?void 0:t.viewWidth)>0&&(t==null?void 0:t.viewHeight)>0&&(t.viewWidth>n.x+n.w&&(r.contextWidth=t.viewWidth-n.x),t.viewHeight>n.y+n.h&&(r.contextHeight=t.viewHeight-n.y)),r}function Mh(e,t,n){const r=Hd(e,{viewWidth:t.width,viewHeight:t.height,extend:n==null?void 0:n.extend});return(n==null?void 0:n.extend)===!0&&(r.contextWidth=Math.max(r.contextWidth,t.contextWidth),r.contextHeight=Math.max(r.contextHeight,t.contextHeight)),{contextSize:r}}function Wd(e,t){var n;let r=null;for(let a=0;a{const a=pt(r,t);a&&n.push(a)}),n}function pt(e,t){let n=null,r=t;for(let a=0;a{var o;for(let s=0;s=o&&r<=d&&i>=s}function _h(e,t){const{scale:n,offsetX:r,offsetY:a}=e,{viewSizeInfo:i}=t,{width:o,height:s,contextWidth:c,contextHeight:d}=i,u=c*n,f=d*n,h=0-r*n,p=0-a*n,v=o-(u+h/n),g=s-(f+p/n);return{scale:n,offsetLeft:h,offsetTop:p,offsetRight:v,offsetBottom:g}}function Oh(e){const{scale:t,point:n,viewScaleInfo:r}=e,{offsetLeft:a,offsetTop:i}=r,o=t/r.scale,s=n.x,c=n.y,d=s-s*o+(a*o-a),u=c-c*o+(i*o-i);return{moveX:d,moveY:u}}function Th(e){const{moveX:t=0,moveY:n=0,viewScaleInfo:r,viewSizeInfo:a}=e,{scale:i}=r,{width:o,height:s,contextWidth:c,contextHeight:d}=a;let u=r.offsetLeft,f=r.offsetRight,h=r.offsetTop,p=r.offsetBottom;u+=t,h+=n;const v=c*i,g=d*i;return f=o-(v+u),p=s-(g+h),{scale:i,offsetTop:h,offsetLeft:u,offsetRight:f,offsetBottom:p}}function Qo(e,t){const{viewScaleInfo:n}=t,{x:r,y:a,w:i,h:o,angle:s}=e,{scale:c,offsetTop:d,offsetLeft:u}=n;return{x:r*c+u,y:a*c+d,w:i*c,h:o*c,angle:s}}function Je(e,t){const{viewScaleInfo:n}=t,{x:r,y:a}=e,{scale:i,offsetTop:o,offsetLeft:s}=n;return{x:r*i+s,y:a*i+o}}function Re(e,t){return[Je(e[0],t),Je(e[1],t),Je(e[2],t),Je(e[3],t)]}function mo(e,t){const{context2d:n,element:r,viewScaleInfo:a,viewSizeInfo:i}=t,{angle:o=0}=r,{x:s,y:c,w:d,h:u}=Qo(r,{viewScaleInfo:a,viewSizeInfo:i}),f=on({x:s,y:c,w:d,h:u,angle:o});if(f.length>=2){n.beginPath(),n.moveTo(f[0].x,f[0].y);for(let h=1;h0)for(let f=d.length-1;f>=0;f--){let h=0,p=0,v=0;for(let m=0;m<=f;m++)h+=d[m].x,p+=d[m].y,v+=d[m].angle||0;const g=d[f];if(g&&g.type==="group"&&Array.isArray((n=g.detail)===null||n===void 0?void 0:n.children))for(let m=0;m=0;f--){const h=o.elements[f];if(((a=h==null?void 0:h.operations)===null||a===void 0?void 0:a.invisible)!==!0&&mo(e,{context2d:i,element:h,viewScaleInfo:s,viewSizeInfo:c})){u.index=f,u.element=h;break}}return u}function Ph(e,t){const{viewSizeInfo:n,viewScaleInfo:r}=t,{width:a,height:i}=n,{angle:o}=e,{x:s,y:c,w:d,h:u}=Qo(e,{viewScaleInfo:r,viewSizeInfo:n}),f=on({x:s,y:c,w:d,h:u,angle:o}),h={x:0,y:0,w:a,h:i},p=Math.min(f[0].x,f[1].x,f[2].x,f[3].x),v=Math.min(f[0].y,f[1].y,f[2].y,f[3].y),g=Math.max(f[0].x,f[1].x,f[2].x,f[3].x),m=Math.max(f[0].y,f[1].y,f[2].y,f[3].y),b={x:p,y:v,w:g-p,h:m-v};return Ah(h,b)}function Ud(e){const{x:t,y:n,h:r,w:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t+a,y:n+r},{x:t,y:n+r}]}function ot(e){const{x:t,y:n,w:r,h:a,angle:i=0}=e;return i===0?Ud(e):Bd(e,vt({x:t,y:n,w:r,h:a,angle:i}),i)}function Jo(e){const t=[];let n=0,r=0;const a=[],i=[...e];for(let o=0;o0||f<0){const g=Ft(f);h=ol(v,h,g)}a.push({center:v,angle:f,radian:Ft(f)})}t.push(h)}return t}function Ih(e,t){const{groupQueue:n}=t;if(!(n.length>0))return[ot(e)];const r=[...n,e];return Jo(r)}function ei(e,t){return Ih(e,t).pop()||null}function bt(e,t){const{x:n,y:r}=e,{size:a,angle:i}=t;return{x:n-a/2,y:r-a/2,w:a,h:a,angle:i}}function la(e,t){const{groupQueue:n,controllerSize:r,viewScaleInfo:a}=t,i=(r&&r>0?r:8)/a.scale,{x:o,y:s,w:c,h:d,angle:u=0}=e,f=[{uuid:tr(),x:o,y:s,w:c,h:d,angle:u,type:"group",detail:{children:[]}},...n];let h=0;f.forEach(({angle:It=0})=>{h+=It});const p=ei(e,{groupQueue:n}),v=ei({x:o-i*2,y:s-i*2,h:d+i*4,w:c+i*4,angle:u},{groupQueue:[...n]}),g=mr(p[0],p[1]),m=mr(p[1],p[2]),b=mr(p[2],p[3]),y=mr(p[3],p[0]),S=p[0],x=p[1],C=p[2],E=p[3],j=bt(g,{size:i,angle:h}),z=bt(m,{size:i,angle:h}),k=bt(b,{size:i,angle:h}),F=bt(y,{size:i,angle:h}),U=bt(S,{size:i,angle:h}),L=bt(x,{size:i,angle:h}),O=bt(E,{size:i,angle:h}),$=bt(C,{size:i,angle:h}),R=ot(U),G=ot(L),N=ot(O),D=ot($),w=[R[1],G[0],G[3],R[2]],P=[G[3],G[2],D[1],D[0]],V=[N[1],D[0],D[3],N[2]],M=[R[3],R[2],N[1],N[0]],Y=ot(j),H=ot(z),_=ot(k),T=ot(F),I=mr(v[0],v[1]),B=bt(I,{size:i,angle:h}),ee=ot(B);return{elementWrapper:p,left:{type:"left",vertexes:M,center:y},right:{type:"right",vertexes:P,center:m},top:{type:"top",vertexes:w,center:g},bottom:{type:"bottom",vertexes:V,center:b},topLeft:{type:"top-left",vertexes:R,center:S},topRight:{type:"top-right",vertexes:G,center:x},bottomLeft:{type:"bottom-left",vertexes:N,center:E},bottomRight:{type:"bottom-right",vertexes:D,center:C},leftMiddle:{type:"left-middle",vertexes:T,center:y},rightMiddle:{type:"right-middle",vertexes:H,center:m},topMiddle:{type:"top-middle",vertexes:Y,center:g},bottomMiddle:{type:"bottom-middle",vertexes:_,center:b},rotate:{type:"rotate",vertexes:ee,center:I}}}function Yd(e){let t="";return e.forEach(n=>{t+=n.type+n.params.join(" ")}),t}function $e(e,t){let n=2;return typeof(t==null?void 0:t.decimalPlaces)<"u"&&(t==null?void 0:t.decimalPlaces)>=0&&(n=t.decimalPlaces),parseFloat(e.toFixed(n))}const _a="Text Element";function sn(){return{boxSizing:"border-box",borderWidth:0,borderColor:"#000000",shadowColor:"#000000",borderRadius:0,borderDash:[],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,opacity:1,color:"#000000",textAlign:"left",verticalAlign:"top",fontSize:16,lineHeight:20,fontFamily:"sans-serif",fontWeight:400,overflow:"hidden"}}function zh(){return{background:"#D9D9D9"}}function Rh(){return{background:"#D9D9D9",radius:0}}function Dh(e){const t=sn();return{text:_a,color:t.color,fontFamily:t.fontFamily,fontWeight:t.fontWeight,lineHeight:e.w/_a.length,fontSize:e.w/_a.length,textAlign:"center",verticalAlign:"middle"}}function Nh(){return{svg:''}}function jh(){return{src:"data:image/svg+xml;base64,PHN2ZyAgIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiPjxwYXRoIGQ9Ik05MjggMTYwSDk2Yy0xNy43IDAtMzIgMTQuMy0zMiAzMnY2NDBjMCAxNy43IDE0LjMgMzIgMzIgMzJoODMyYzE3LjcgMCAzMi0xNC4zIDMyLTMyVjE5MmMwLTE3LjctMTQuMy0zMi0zMi0zMnogbS00MCA2MzJIMTM2di0zOS45bDEzOC41LTE2NC4zIDE1MC4xIDE3OEw2NTguMSA0ODkgODg4IDc2MS42Vjc5MnogbTAtMTI5LjhMNjY0LjIgMzk2LjhjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDQyNC42IDY2Ni40bC0xNDQtMTcwLjdjLTMuMi0zLjgtOS0zLjgtMTIuMiAwTDEzNiA2NTIuN1YyMzJoNzUydjQzMC4yeiIgIGZpbGw9IiM1MTUxNTEiPjwvcGF0aD48cGF0aCBkPSJNMzA0IDQ1NmM0OC42IDAgODgtMzkuNCA4OC04OHMtMzkuNC04OC04OC04OC04OCAzOS40LTg4IDg4IDM5LjQgODggODggODh6IG0wLTExNmMxNS41IDAgMjggMTIuNSAyOCAyOHMtMTIuNSAyOC0yOCAyOC0yOC0xMi41LTI4LTI4IDEyLjUtMjggMjgtMjh6IiAgZmlsbD0iIzUxNTE1MSI+PC9wYXRoPjwvc3ZnPg=="}}function Lh(){return{children:[],background:"#D9D9D9",overflow:"hidden"}}const kh=sn();function qo(e,t){const{viewScaleInfo:n}=t,{scale:r}=n;let{borderRadius:a}=e.detail;const{boxSizing:i=kh.boxSizing,borderWidth:o}=e.detail;Array.isArray(o)&&(a=0);let{x:s,y:c,w:d,h:u}=e,f=[0,0,0,0];if(typeof a=="number"){const p=a*r;f=[p,p,p,p]}else Array.isArray(a)&&(a==null?void 0:a.length)===4&&(f=[a[0]*r,a[1]*r,a[2]*r,a[3]*r]);let h=0;return typeof o=="number"&&(h=(o||0)*r),i==="border-box"?(s=e.x+h/2,c=e.y+h/2,d=e.w-h,u=e.h-h):i==="content-box"?(s=e.x-h/2,c=e.y-h/2,d=e.w+h,u=e.h+h):(s=e.x,c=e.y,d=e.w,u=e.h),d=Math.max(d,1),u=Math.max(u,1),f=f.map(p=>Math.min(p,d/2,u/2)),{x:s,y:c,w:d,h:u,radiusList:f}}const ze=e=>$e(e,{decimalPlaces:4});function Xd(e,t){const{detail:n}=e,{xRatio:r,yRatio:a,maxRatio:i}=t,o=(r+a)/2,{borderWidth:s,borderRadius:c,borderDash:d,shadowOffsetX:u,shadowOffsetY:f,shadowBlur:h}=n;if(typeof s=="number")n.borderWidth=ze(s*o);else if(Array.isArray(n.borderWidth)){const p=s;n.borderWidth=[ze(p[0]*a),ze(p[1]*r),ze(p[2]*a),ze(p[3]*r)]}if(typeof c=="number")n.borderRadius=ze(c*o);else if(Array.isArray(n.borderRadius)){const p=c;n.borderRadius=[p[0]*r,p[1]*r,p[2]*a,p[3]*a]}Array.isArray(d)&&d.forEach((p,v)=>{n.borderDash[v]=ze(p*i)}),typeof u=="number"&&(n.shadowOffsetX=ze(u*i)),typeof f=="number"&&(n.shadowOffsetX=ze(f*i)),typeof h=="number"&&(n.shadowOffsetX=ze(h*i))}function Bh(e,t){const{xRatio:n,yRatio:r}=t,{x:a,y:i,w:o,h:s}=e;e.x=ze(a*n),e.y=ze(i*r),e.w=ze(o*n),e.h=ze(s*r),Xd(e,t)}function Fh(e,t){const{minRatio:n,maxRatio:r}=t,{fontSize:a,lineHeight:i}=e.detail,o=(n+r)/2;a&&a>0&&(e.detail.fontSize=ze(a*o)),i&&i>0&&(e.detail.lineHeight=ze(i*o))}function Zd(e,t){const{type:n}=e;Bh(e,t),n==="circle"||(n==="text"?Fh(e,t):n==="image"||n==="svg"||n==="html"||n==="path"||n==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(r=>{Zd(r,t)}))}function Kd(e,t){const n=t.w&&t.w>0?t.w:e.w,r=t.h&&t.h>0?t.h:e.h,a=n/e.w,i=r/e.h;if(a===i&&a===1)return e;const o=Math.min(a,i),s=Math.max(a,i);e.w=n,e.h=r;const c={xRatio:a,yRatio:i,minRatio:o,maxRatio:s};return e.type==="group"&&Array.isArray(e.detail.children)&&e.detail.children.forEach(d=>{Zd(d,c)}),Xd(e,c),e}const Fi=200,Hi=200;function Hh(e,t){let n=0,r=0,a=Fi,i=Hi;if(t){const{viewScaleInfo:s,viewSizeInfo:c}=t,{scale:d,offsetLeft:u,offsetTop:f}=s,{width:h,height:p}=c,v=h/4,g=p/4;Fi>=v?a=v/d:a=Fi/d,Hi>=g?i=g/d:i=Hi/d,["circle","svg","image"].includes(e)?a=i=Math.max(a,i):e==="text"&&(i=a/_a.length*2),n=(0-u+h/2-a*d/2)/d,r=(0-f+p/2-i*d/2)/d}return{x:n,y:r,w:a,h:i}}function Wh(e,t,n){const r=Hh(e,n);let a={};return e==="rect"?a=zh():e==="circle"?a=Rh():e==="text"?a=Dh(r):e==="svg"?a=Nh():e==="image"?a=jh():e==="group"&&(a=Lh()),Object.assign(Object.assign(Object.assign({},r),t),{uuid:tr(),type:e,detail:Object.assign(Object.assign({},a),t.detail||{})})}function Qd(e,t,n){let r=!1;if(t.length===1){const a=t[0];n.splice(a,0,e),r=!0}else if(t.length>1){let a=n;for(let i=0;i1){let r=t;for(let a=0;a=0;s++)r[s]!==n[s]&&r[s]=0&&(n[o]=n[o]+1),Jd(n,e)}return{elements:e,from:n,to:r}}function Vh(e,t){var n;const r=Object.keys(t);for(let a=0;a{e[i][s]=o}),e[i]=[...e[i],...t[i]])))}return e}function Hr(e,t,n){var r,a;let i=null;for(let o=0;o0||t.h&&t.h>0)&&Kd(s,{w:t.w,h:t.h}),Vh(s,t),i=s;break}else s.type==="group"&&(i=Hr(e,t,((a=s==null?void 0:s.detail)===null||a===void 0?void 0:a.children)||[]))}return i}function Uh(e,t){var n,r,a,i,o,s,c,d;let u=0,f=0,h=1,p=((r=(n=e==null?void 0:e.elements)===null||n===void 0?void 0:n[0])===null||r===void 0?void 0:r.x)||0,v=((i=(a=e==null?void 0:e.elements)===null||a===void 0?void 0:a[0])===null||i===void 0?void 0:i.y)||0,g=((s=(o=e==null?void 0:e.elements)===null||o===void 0?void 0:o[0])===null||s===void 0?void 0:s.w)||0,m=((d=(c=e==null?void 0:e.elements)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.h)||0;const{width:b,height:y}=t.viewSizeInfo;if(e.elements.forEach(x=>{const C={x:x.x,y:x.y,w:x.w,h:x.h,angle:x.angle};if(C.angle&&(C.angle>0||C.angle<0)){const F=on(C);if(F.length===4){const U=[F[0].x,F[1].x,F[2].x,F[3].x],L=[F[0].y,F[1].y,F[2].y,F[3].y];C.x=Math.min(...U),C.y=Math.min(...L),C.w=Math.abs(Math.max(...U)-Math.min(...U)),C.h=Math.abs(Math.max(...L)-Math.min(...L))}}const E=Math.min(C.x,p),j=Math.min(C.y,v),z=Math.max(C.x+C.w,p+g),k=Math.max(C.y+C.h,v+m);p=E,v=j,g=Math.abs(z-E),m=Math.abs(k-j)}),g>0&&m>0){const x=$e(b/g,{decimalPlaces:4}),C=$e(y/m,{decimalPlaces:4});h=Math.min(x,C,1),u=(g*h-b)/2/h+p,f=(m*h-y)/2/h+v}return{offsetX:$e(u,{decimalPlaces:0}),offsetY:$e(f,{decimalPlaces:0}),scale:h}}function Yh(e){let t=0,n=0;if(e){const{viewScaleInfo:a,viewSizeInfo:i}=e,{offsetLeft:o,offsetTop:s,scale:c}=a,{width:d,height:u}=i;t=0-o+d/c/2,n=0-s+u/c/2}return{x:t,y:n}}function bo(e,t,n){if(typeof t=="string")return t;const{viewElementSize:r,viewScaleInfo:a,opacity:i=1}=n,{x:o,y:s}=r,{scale:c}=a;if((t==null?void 0:t.type)==="linear-gradient"){const{start:d,end:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c},p={x:o+u.x*c,y:s+u.y*c},v=e.createLinearGradient(h.x,h.y,p.x,p.y);return f.forEach(g=>{v.addColorStop(g.offset,il(g.color,i))}),v}if((t==null?void 0:t.type)==="radial-gradient"){const{inner:d,outer:u,stops:f}=t,h={x:o+d.x*c,y:s+d.y*c,radius:d.radius*c},p={x:o+u.x*c,y:s+u.y*c,radius:u.radius*c},v=e.createRadialGradient(h.x,h.y,h.radius,p.x,p.y,p.radius);return f.forEach(g=>{v.addColorStop(g.offset,il(g.color,i))}),v}return"#000000"}const yo=sn();function nn(e){var t,n,r,a;let i=1;return((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.opacity)!==void 0&&((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.opacity)>=0&&((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.opacity)<=1&&(i=(a=e==null?void 0:e.detail)===null||a===void 0?void 0:a.opacity),i}function rr(e,t,n){const{pattern:r,renderContent:a,originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c}=n||{},{parentOpacity:d}=n,u=nn(i)*d;Xh(e,t,{originElem:i,calcElemSize:o,viewScaleInfo:s,viewSizeInfo:c,renderContent:()=>{e.globalAlpha=u,Zh(e,t,{pattern:r,viewScaleInfo:s,viewSizeInfo:c}),a==null||a(),Kh(e,t,{viewScaleInfo:s,viewSizeInfo:c}),e.globalAlpha=d}})}function Xh(e,t,n){const{renderContent:r,originElem:a,calcElemSize:i,viewSizeInfo:o}=n,s=o.devicePixelRatio,{clipPath:c}=(a==null?void 0:a.detail)||{};if(c&&i&&c.commands){const{x:d,y:u,w:f,h}=i,{originW:p,originH:v,originX:g,originY:m}=c,b=f/p,y=h/v,S=g*b,x=m*y,C=d-S,E=u-x;e.save(),e.translate(C,E),e.scale(s*b,s*y);const j=Yd(c.commands||[]),z=new Path2D(j);e.clip(z),e.translate(0-C,0-E),e.setTransform(1,0,0,1,0,0),_t(e,Object.assign({},t),()=>{r==null||r()}),e.restore()}else r==null||r()}function Zh(e,t,n){var r,a;const{pattern:i,viewScaleInfo:o,viewSizeInfo:s}=n,c=[];if(t.detail.background||i){const{x:d,y:u,w:f,h,radiusList:p}=qo(t,{viewScaleInfo:o,viewSizeInfo:s});if(e.beginPath(),e.moveTo(d+p[0],u),e.arcTo(d+f,u,d+f,u+h,p[1]),e.arcTo(d+f,u+h,d,u+h,p[2]),e.arcTo(d,u+h,d,u,p[3]),e.arcTo(d,u,d+f,u,p[0]),e.closePath(),typeof i=="string")e.fillStyle=i;else if(["CanvasPattern"].includes(Tr.type(i)))e.fillStyle=i;else if(typeof t.detail.background=="string")e.fillStyle=t.detail.background;else if(((r=t.detail.background)===null||r===void 0?void 0:r.type)==="linear-gradient"){const v=bo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=v}else if(((a=t.detail.background)===null||a===void 0?void 0:a.type)==="radial-gradient"){const v=bo(e,t.detail.background,{viewElementSize:{x:d,y:u,w:f,h},viewScaleInfo:o,opacity:e.globalAlpha});if(e.fillStyle=v,c&&c.length>0)for(let g=0;g<(c==null?void 0:c.length);g++){const m=c[g];m.method==="translate"?e.translate(m.args[0]+d,m.args[1]+u):m.method==="rotate"?e.rotate(...m.args):m.method==="scale"&&e.scale(...m.args)}}e.fill(),c&&c.length>0&&e.setTransform(1,0,0,1,0,0)}}function Kh(e,t,n){if(t.detail.borderWidth===0||!Ka(t.detail.borderColor))return;const{viewScaleInfo:r}=n,{scale:a}=r;let i=yo.borderColor;Ka(t.detail.borderColor)===!0&&(i=t.detail.borderColor);const{borderWidth:o,borderRadius:s,borderDash:c,boxSizing:d=yo.boxSizing}=t.detail;let u=0;typeof o=="number"&&(u=o||1),u=u*a;let f=[0,0,0,0];if(typeof s=="number"){const b=s*a;f=[b,b,b,b]}else Array.isArray(s)&&(s==null?void 0:s.length)===4&&(f=[s[0]*a,s[1]*a,s[2]*a,s[3]*a]);e.strokeStyle=i;let h=[];Array.isArray(c)&&c.length>0&&(h=c.map(b=>Math.ceil(b*a)));let p=0,v=0,g=0,m=0;if(Array.isArray(o)&&(p=(o[0]||0)*a,v=(o[1]||0)*a,g=(o[2]||0)*a,m=(o[3]||0)*a),m||v||p||g){e.lineCap="butt";let{x:b,y,w:S,h:x}=t;d==="border-box"?(b=b+m/2,y=y+p/2,S=S-m/2-v/2,x=x-p/2-g/2):d==="content-box"?(b=b-m/2,y=y-p/2,S=S+m/2+v/2,x=x+p/2+g/2):(b=t.x,y=t.y,S=t.w,x=t.h),p&&(e.beginPath(),e.lineWidth=p,e.moveTo(b-m/2,y),e.lineTo(b+S+v/2,y),e.closePath(),e.stroke()),v&&(e.beginPath(),e.lineWidth=v,e.moveTo(b+S,y-p/2),e.lineTo(b+S,y+x+g/2),e.closePath(),e.stroke()),g&&(e.beginPath(),e.lineWidth=g,e.moveTo(b-m/2,y+x),e.lineTo(b+S+v/2,y+x),e.closePath(),e.stroke()),m&&(e.beginPath(),e.lineWidth=m,e.moveTo(b,y-p/2),e.lineTo(b,y+x+g/2),e.closePath(),e.stroke())}else{let{x:b,y,w:S,h:x}=t;d==="border-box"?(b=t.x+u/2,y=t.y+u/2,S=t.w-u,x=t.h-u):d==="content-box"?(b=t.x-u/2,y=t.y-u/2,S=t.w+u,x=t.h+u):(b=t.x,y=t.y,S=t.w,x=t.h),h.length>0?e.lineCap="butt":e.lineCap="square",S=Math.max(S,1),x=Math.max(x,1),f=f.map(C=>Math.min(C,S/2,x/2)),e.setLineDash(h),e.lineWidth=u,e.beginPath(),e.moveTo(b+f[0],y),e.arcTo(b+S,y,b+S,y+x,f[1]),e.arcTo(b+S,y+x,b,y+x,f[2]),e.arcTo(b,y+x,b,y,f[3]),e.arcTo(b,y,b+S,y,f[0]),e.closePath(),e.stroke()}e.setLineDash([])}function ar(e,t,n){const{detail:r}=t,{viewScaleInfo:a,renderContent:i}=n,{shadowColor:o,shadowOffsetX:s,shadowOffsetY:c,shadowBlur:d}=r;At.number(d)?(e.save(),e.shadowColor=o||yo.shadowColor,e.shadowOffsetX=(s||0)*a.scale,e.shadowOffsetY=(c||0)*a.scale,e.shadowBlur=(d||0)*a.scale,i(),e.restore()):(e.save(),e.shadowColor="transparent",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,i(),e.restore())}function Qh(e,t,n){const{detail:r,angle:a}=t,{calculator:i,viewScaleInfo:o,viewSizeInfo:s,parentOpacity:c}=n,{background:d="#000000",borderColor:u="#000000",boxSizing:f,borderWidth:h=0}=r;let p=0;typeof h=="number"&&h>0?p=h:Array.isArray(h)&&typeof h[0]=="number"&&h[0]>0&&(p=h[0]),p=p*o.scale;const{x:v,y:g,w:m,h:b}=(i==null?void 0:i.elementSize({x:t.x,y:t.y,w:t.w,h:t.h},o,s))||t,y=Object.assign(Object.assign({},t),{x:v,y:g,w:m,h:b,angle:a});_t(e,{x:v,y:g,w:m,h:b,angle:a},()=>{ar(e,y,{viewScaleInfo:o,viewSizeInfo:s,renderContent:()=>{let S=m/2,x=b/2;const C=v+S,E=g+x;if(p>0&&(f==="border-box"?(S=S-p,x=x-p):f==="center-line"?(S=S-p/2,x=x-p/2):(S=S-p,x=x-p)),S>=0&&x>=0){const j=nn(y)*c;if(e.globalAlpha=j,typeof p=="number"&&p>0){const k=p/2+S,F=p/2+x;e.beginPath(),e.strokeStyle=u,e.lineWidth=p,e.circle(C,E,k,F,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath();const z=bo(e,d,{viewElementSize:{x:v,y:g,w:m,h:b},viewScaleInfo:o,opacity:e.globalAlpha});e.fillStyle=z,e.circle(C,E,S,x,0,0,2*Math.PI),e.closePath(),e.fill(),e.globalAlpha=c}}})})}function Jh(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{ar(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})})}function qh(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t,p=Object.assign(Object.assign({},t),{x:c,y:d,w:u,h:f,angle:h});_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{ar(e,p,{viewScaleInfo:i,viewSizeInfo:o,renderContent:()=>{rr(e,p,{originElem:t,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s,renderContent:()=>{if(!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="image"&&r){e.globalAlpha=nn(t)*s;const{x:v,y:g,w:m,h:b,radiusList:y}=qo(p,{viewScaleInfo:i,viewSizeInfo:o});e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(v+y[0],g),e.arcTo(v+m,g,v+m,g+b,y[1]),e.arcTo(v+m,g+b,v,g+b,y[2]),e.arcTo(v,g+b,v,g,y[3]),e.arcTo(v,g,v+m,g,y[0]),e.closePath(),e.fill(),e.clip(),e.drawImage(r,v,g,m,b),e.globalAlpha=s,e.restore()}}})}})})}function ep(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="svg"&&r&&(e.globalAlpha=nn(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}function tp(e,t,n){const r=n.loader.getContent(t),{calculator:a,viewScaleInfo:i,viewSizeInfo:o,parentOpacity:s}=n,{x:c,y:d,w:u,h:f,angle:h}=(a==null?void 0:a.elementSize(t,i,o))||t;_t(e,{x:c,y:d,w:u,h:f,angle:h},()=>{!r&&!n.loader.isDestroyed()&&n.loader.load(t,n.elementAssets||{}),t.type==="html"&&r&&(e.globalAlpha=nn(t)*s,e.drawImage(r,c,d,u,f),e.globalAlpha=s)})}const Wi=sn();function np(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize(t,a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const p=Object.assign(Object.assign({},Wi),t.detail),v=(p.fontSize||Wi.fontSize)*a.scale,g=p.lineHeight?p.lineHeight*a.scale:v;e.fillStyle=t.detail.color||Wi.color,e.textBaseline="top",e.$setFont({fontWeight:p.fontWeight,fontSize:v,fontFamily:p.fontFamily});const m=p.text.replace(/\r\n/gi,` -`),b=g,y=m.split(` -`),S=[];let x=0;y.forEach((E,j)=>{let z="";if(E.length>0){for(let k=0;ku));k++)if(E.length-1===k&&(x+1)*b{let k=s;p.textAlign==="center"?k=s+(d-j.width)/2:p.textAlign==="right"&&(k=s+(d-j.width)),e.fillText(j.text,k,E+b*z)})}}})})}function rp(e,t,n){const{detail:r}=t,{originX:a,originY:i,originW:o,originH:s}=r,{calculator:c,viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f}=n,{x:h,y:p,w:v,h:g,angle:m}=(c==null?void 0:c.elementSize(t,d,u))||t,b=v/o,y=g/s,S=a*b,x=i*y,C=h-S,E=p-x,j=d.scale*u.devicePixelRatio,z=Object.assign(Object.assign({},t),{x:h,y:p,w:v,h:g,angle:m});_t(e,{x:h,y:p,w:v,h:g,angle:m},()=>{rr(e,z,{originElem:t,calcElemSize:{x:h,y:p,w:v,h:g,angle:m},viewScaleInfo:d,viewSizeInfo:u,parentOpacity:f,renderContent:()=>{ar(e,z,{viewScaleInfo:d,viewSizeInfo:u,renderContent:()=>{e.save(),e.translate(C,E),e.scale(j*b/d.scale,j*y/d.scale);const k=Yd(r.commands||[]),F=new Path2D(k);r.fill&&(e.fillStyle=r.fill,e.fill(F)),r.stroke&&r.strokeWidth!==0&&(e.strokeStyle=r.stroke,e.lineWidth=(r.strokeWidth||1)/u.devicePixelRatio,e.lineCap=r.strokeLineCap||"square",e.stroke(F)),e.translate(-C,-E),e.restore()}})}})})}function eu(e,t,n){var r;if(((r=t==null?void 0:t.operations)===null||r===void 0?void 0:r.invisible)===!0)return;const{w:a,h:i}=t,{scale:o}=n.viewScaleInfo;if(!(o<1&&(a*o<1||i*o<1)||n.parentOpacity===0))try{switch(t.type){case"rect":{Jh(e,t,n);break}case"circle":{Qh(e,t,n);break}case"text":{np(e,t,n);break}case"image":{qh(e,t,n);break}case"svg":{ep(e,t,n);break}case"html":{tp(e,t,n);break}case"path":{rp(e,t,n);break}case"group":{const s=Object.assign(Object.assign({},n.elementAssets||{}),t.detail.assets||{});ap(e,t,Object.assign(Object.assign({},n),{elementAssets:s}));break}default:break}}catch(s){console.error(s)}}function ap(e,t,n){const{calculator:r,viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o}=n,{x:s,y:c,w:d,h:u,angle:f}=(r==null?void 0:r.elementSize({x:t.x,y:t.y,w:t.w,h:t.h,angle:t.angle},a,i))||t,h=Object.assign(Object.assign({},t),{x:s,y:c,w:d,h:u,angle:f});_t(e,{x:s,y:c,w:d,h:u,angle:f},()=>{e.globalAlpha=nn(t)*o,ar(e,h,{viewScaleInfo:a,viewSizeInfo:i,renderContent:()=>{rr(e,h,{originElem:t,calcElemSize:{x:s,y:c,w:d,h:u,angle:f},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{const{x:p,y:v,w:g,h:m,radiusList:b}=qo(h,{viewScaleInfo:a,viewSizeInfo:i});if(t.detail.overflow==="hidden"&&(e.save(),e.fillStyle="transparent",e.beginPath(),e.moveTo(p+b[0],v),e.arcTo(p+g,v,p+g,v+m,b[1]),e.arcTo(p+g,v+m,p,v+m,b[2]),e.arcTo(p,v+m,p,v,b[3]),e.arcTo(p,v,p+g,v,b[0]),e.closePath(),e.fill(),e.clip()),Array.isArray(t.detail.children)){const{parentElementSize:y}=n,S={x:y.x+t.x,y:y.y+t.y,w:t.w||y.w,h:t.h||y.h,angle:t.angle},{calculator:x}=n;for(let C=0;C{rr(e,p,{originElem:s,calcElemSize:{x:c,y:d,w:u,h:f,angle:h},viewScaleInfo:a,viewSizeInfo:i,parentOpacity:o,renderContent:()=>{}})}})}var Gi=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},fe=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},br=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ke,jr,Xn,Ze,Mt,Oa,Vi,sl,ll,cl,tu,nu;const lp=["image","svg","html"],$r=e=>{var t,n,r;let a=null;return e.type==="image"?a=((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.src)||null:e.type==="svg"?a=((n=e==null?void 0:e.detail)===null||n===void 0?void 0:n.svg)||null:e.type==="html"&&(a=((r=e==null?void 0:e.detail)===null||r===void 0?void 0:r.html)||null),typeof a=="string"&&a?Qt(a)?a:nr(a):nr(`${tr()}-${e.uuid}-${tr()}-${tr()}`)};class cp extends en{constructor(){super(),Ke.add(this),jr.set(this,{}),Xn.set(this,{}),Ze.set(this,{}),Mt.set(this,!1),fe(this,Ke,"m",Oa).call(this,"image",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.src])===null||r===void 0?void 0:r.value)||t.detail.src,i=yield bi(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ke,"m",Oa).call(this,"html",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.html])===null||r===void 0?void 0:r.value)||t.detail.html,i=yield Qf(a,{width:t.detail.originW||t.w,height:t.detail.originH||t.h});return{uuid:t.uuid,lastModified:Date.now(),content:i}})),fe(this,Ke,"m",Oa).call(this,"svg",(t,n)=>Gi(this,void 0,void 0,function*(){var r;const a=((r=n[t.detail.svg])===null||r===void 0?void 0:r.value)||t.detail.svg,i=yield Zf(a);return{uuid:t.uuid,lastModified:Date.now(),content:i}}))}isDestroyed(){return fe(this,Mt,"f")}destroy(){br(this,Mt,!0,"f"),this.clear(),br(this,jr,null,"f"),br(this,Xn,null,"f"),br(this,Ze,null,"f")}load(t,n){fe(this,Mt,"f")!==!0&&(fe(this,Ke,"m",nu).call(this,t)||lp.includes(t.type)&&fe(this,Ke,"m",tu).call(this,t,n))}getContent(t){var n,r;const a=$r(t);return((r=(n=fe(this,Ze,"f"))===null||n===void 0?void 0:n[a])===null||r===void 0?void 0:r.content)||null}getLoadItemMap(){return fe(this,Ze,"f")}setLoadItemMap(t){br(this,Ze,t,"f")}}jr=new WeakMap,Xn=new WeakMap,Ze=new WeakMap,Mt=new WeakMap,Ke=new WeakSet,Oa=function(t,n){fe(this,jr,"f")[t]=n},Vi=function(t){var n,r,a;let i=null;return t.type==="image"?i=((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.src)||null:t.type==="svg"?i=((r=t==null?void 0:t.detail)===null||r===void 0?void 0:r.svg)||null:t.type==="html"&&(i=((a=t==null?void 0:t.detail)===null||a===void 0?void 0:a.html)||null),i},sl=function(t){return{element:t,status:"null",content:null,error:null,startTime:-1,endTime:-1,source:fe(this,Ke,"m",Vi).call(this,t)}},ll=function(t){const n=$r(t.element),r=fe(this,Ze,"f")[n];fe(this,Mt,"f")||(r?r.startTime{fe(this,Mt,"f")||(r.content=o.content,r.endTime=Date.now(),r.status="load",fe(this,Ke,"m",ll).call(this,r))}).catch(o=>{console.warn(`Load element source "${r.source}" fail`,o,t),r.endTime=Date.now(),r.status="error",r.error=o,fe(this,Ke,"m",cl).call(this,r)}))},nu=function(t){var n;const r=$r(t),a=(n=fe(this,Xn,"f"))===null||n===void 0?void 0:n[r];return!!(a&&a.status==="error"&&a.source&&a.source===fe(this,Ke,"m",Vi).call(this,t))};var yr=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},rt=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},wo,Lt,St,Ta,ru;class au extends en{constructor(t){super(),wo.add(this),Lt.set(this,void 0),St.set(this,new cp),Ta.set(this,!1),yr(this,Lt,t,"f"),rt(this,wo,"m",ru).call(this)}isDestroyed(){return rt(this,Ta,"f")}destroy(){this.clear(),yr(this,Lt,null,"f"),rt(this,St,"f").destroy(),yr(this,St,null,"f"),yr(this,Ta,!0,"f")}updateOptions(t){yr(this,Lt,t,"f")}drawData(t,n){const r=rt(this,St,"f"),{calculator:a}=rt(this,Lt,"f"),i=rt(this,Lt,"f").viewContext;i.clearRect(0,0,i.canvas.width,i.canvas.height);const o={x:0,y:0,w:n.viewSizeInfo.width,h:n.viewSizeInfo.height};t.underlay&&sp(i,t.underlay,Object.assign({loader:r,calculator:a,parentElementSize:o,parentOpacity:1},n)),op(i,t,Object.assign({loader:r,calculator:a,parentElementSize:o,elementAssets:t.assets,parentOpacity:1},n))}scale(t){const{sharer:n}=rt(this,Lt,"f");if(!n)return;const{data:r,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s,width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}=n.getActiveStoreSnapshot();r&&this.drawData(r,{viewScaleInfo:{scale:t,offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s},viewSizeInfo:{width:c,height:d,contextHeight:u,contextWidth:f,devicePixelRatio:h}})}setLoadItemMap(t){rt(this,St,"f").setLoadItemMap(t)}getLoadItemMap(){return rt(this,St,"f").getLoadItemMap()}getLoader(){return rt(this,St,"f")}}Lt=new WeakMap,St=new WeakMap,Ta=new WeakMap,wo=new WeakSet,ru=function(){const t=rt(this,St,"f");t.on("load",n=>{this.trigger("load",n)}),t.on("error",n=>{console.error(n)})};var dl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ul=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Sn;class iu{constructor(t){Sn.set(this,void 0),dl(this,Sn,t,"f")}destroy(){dl(this,Sn,null,"f")}elementSize(t,n,r){return Qo(t,{viewScaleInfo:n,viewSizeInfo:r})}isElementInView(t,n,r){return Ph(t,{viewScaleInfo:n,viewSizeInfo:r})}isPointInElement(t,n,r,a){const i=ul(this,Sn,"f").viewContext;return mo(t,{context2d:i,element:n,viewScaleInfo:r,viewSizeInfo:a})}getPointElement(t,n){const r=ul(this,Sn,"f").viewContext;return $h(t,Object.assign(Object.assign({},n),{context2d:r}))}}Sn=new WeakMap;var Ui=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ne=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},we,Zn,Ye,$a,ou,Pa,Ia,za,Ra,Da,Na,ja,La,xt,Et,Yt;function fl(e){return e>0||e<0||e===0}class dp extends en{constructor(t){super(),we.add(this),Zn.set(this,void 0),Ye.set(this,void 0),$a.set(this,!1),Pa.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a))return;r.preventDefault(),r.stopPropagation();const i=r.deltaX>0||r.deltaX<0?r.deltaX:0,o=r.deltaY>0||r.deltaY<0?r.deltaY:0;r.ctrlKey===!0&&this.has("wheelScale")?this.trigger("wheelScale",{deltaX:i,deltaY:o,point:a}):this.has("wheel")&&this.trigger("wheel",{deltaX:i,deltaY:o,point:a})}),Ia.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)}),za.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a))return;const i=500,o=Date.now(),s=ne(this,Ye,"f").get("prevClickPoint");s&&o-s.t<=i&&Math.abs(s.x-a.x)<=5&&Math.abs(s.y-a.y)<=5?this.trigger("doubleClick",{point:a}):ne(this,Ye,"f").set("prevClickPoint",a)}),Ra.set(this,r=>{if(ne(this,Ye,"f").set("hasPointDown",!1),!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);this.trigger("pointLeave",{point:a})}),Da.set(this,r=>{if(ne(this,Ye,"f").set("hasPointDown",!1),!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);this.trigger("pointEnd",{point:a})}),Na.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault(),r.stopPropagation();const a=ne(this,we,"m",Et).call(this,r);if(!ne(this,we,"m",Yt).call(this,a)){ne(this,Ye,"f").get("hasPointDown")&&(this.trigger("pointLeave",{point:a}),ne(this,Ye,"f").set("hasPointDown",!1));return}ne(this,Ye,"f").get("hasPointDown")===!0&&this.trigger("pointMove",{point:a})}),ja.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)&&(ne(this,Ye,"f").set("hasPointDown",!0),this.trigger("pointStart",{point:a}))}),La.set(this,r=>{if(!ne(this,we,"m",xt).call(this,r))return;r.preventDefault();const a=ne(this,we,"m",Et).call(this,r);ne(this,we,"m",Yt).call(this,a)&&this.trigger("hover",{point:a})});const n=new Fr({defaultStorage:{hasPointDown:!1,prevClickPoint:null}});Ui(this,Ye,n,"f"),Ui(this,Zn,t,"f"),ne(this,we,"m",ou).call(this)}onEvents(){if(ne(this,$a,"f"))return;const t=window;t.addEventListener("mousemove",ne(this,La,"f")),t.addEventListener("mousedown",ne(this,ja,"f")),t.addEventListener("mousemove",ne(this,Na,"f")),t.addEventListener("mouseup",ne(this,Da,"f")),t.addEventListener("mouseleave",ne(this,Ra,"f")),t.addEventListener("wheel",ne(this,Pa,"f"),{passive:!1}),t.addEventListener("click",ne(this,za,"f")),t.addEventListener("contextmenu",ne(this,Ia,"f"))}offEvents(){const t=window;t.removeEventListener("mousemove",ne(this,La,"f")),t.removeEventListener("mousedown",ne(this,ja,"f")),t.removeEventListener("mousemove",ne(this,Na,"f")),t.removeEventListener("mouseup",ne(this,Da,"f")),t.removeEventListener("mouseleave",ne(this,Ra,"f")),t.removeEventListener("wheel",ne(this,Pa,"f")),t.removeEventListener("click",ne(this,za,"f")),t.removeEventListener("contextmenu",ne(this,Ia,"f"))}destroy(){this.offEvents(),ne(this,Ye,"f").destroy(),Ui(this,$a,!0,"f")}}Zn=new WeakMap,Ye=new WeakMap,$a=new WeakMap,Pa=new WeakMap,Ia=new WeakMap,za=new WeakMap,Ra=new WeakMap,Da=new WeakMap,Na=new WeakMap,ja=new WeakMap,La=new WeakMap,we=new WeakSet,ou=function(){this.onEvents()},xt=function(t){return t.target===ne(this,Zn,"f").boardContent.boardContext.canvas},Et=function(t){const r=ne(this,Zn,"f").boardContent.boardContext.canvas.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top,t:Date.now()}},Yt=function(t){const n=ne(this,Zn,"f").sharer.getActiveViewSizeInfo(),{width:r,height:a}=n;return!!(fl(t.x)&&fl(t.y)&&t.x<=r&&t.y<=a)};var hl=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},ge=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ve,Cn;const up={width:0,height:0,devicePixelRatio:1,contextWidth:0,contextHeight:0,data:null,scale:1,offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0};class fp{constructor(){ve.set(this,void 0),Cn.set(this,void 0);const t=new Fr({defaultStorage:up}),n=new Fr({defaultStorage:{}});hl(this,ve,t,"f"),hl(this,Cn,n,"f")}getActiveStorage(t){return ge(this,ve,"f").get(t)}setActiveStorage(t,n){return ge(this,ve,"f").set(t,n)}getActiveStoreSnapshot(){return ge(this,ve,"f").getSnapshot()}getSharedStorage(t){return ge(this,Cn,"f").get(t)}setSharedStorage(t,n){return ge(this,Cn,"f").set(t,n)}getSharedStoreSnapshot(){return ge(this,Cn,"f").getSnapshot()}getActiveViewScaleInfo(){return{scale:ge(this,ve,"f").get("scale"),offsetTop:ge(this,ve,"f").get("offsetTop"),offsetBottom:ge(this,ve,"f").get("offsetBottom"),offsetLeft:ge(this,ve,"f").get("offsetLeft"),offsetRight:ge(this,ve,"f").get("offsetRight")}}setActiveViewScaleInfo(t){const{scale:n,offsetTop:r,offsetBottom:a,offsetLeft:i,offsetRight:o}=t;ge(this,ve,"f").set("scale",n),ge(this,ve,"f").set("offsetTop",r),ge(this,ve,"f").set("offsetBottom",a),ge(this,ve,"f").set("offsetLeft",i),ge(this,ve,"f").set("offsetRight",o)}setActiveViewSizeInfo(t){ge(this,ve,"f").set("width",t.width),ge(this,ve,"f").set("height",t.height),ge(this,ve,"f").set("devicePixelRatio",t.devicePixelRatio),ge(this,ve,"f").set("contextWidth",t.contextWidth),ge(this,ve,"f").set("contextHeight",t.contextHeight)}getActiveViewSizeInfo(){return{width:ge(this,ve,"f").get("width"),height:ge(this,ve,"f").get("height"),devicePixelRatio:ge(this,ve,"f").get("devicePixelRatio"),contextWidth:ge(this,ve,"f").get("contextWidth"),contextHeight:ge(this,ve,"f").get("contextHeight")}}}ve=new WeakMap,Cn=new WeakMap;var ka=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},De=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Lr,st,Kn,Mn,su,lu;const{requestAnimationFrame:hp}=window;class pp extends en{constructor(t){super(),Lr.add(this),st.set(this,void 0),Kn.set(this,[]),Mn.set(this,"FREE"),ka(this,st,t,"f"),De(this,Lr,"m",su).call(this)}drawFrame(){const{sharer:t}=De(this,st,"f"),n=t.getActiveStoreSnapshot(),r=t.getSharedStoreSnapshot();De(this,Kn,"f").push({activeStore:n,sharedStore:r}),De(this,Lr,"m",lu).call(this)}scale(t){const{scale:n,point:r}=t,{sharer:a}=De(this,st,"f"),{moveX:i,moveY:o}=Oh({scale:n,point:r,viewScaleInfo:a.getActiveViewScaleInfo(),viewSizeInfo:a.getActiveViewSizeInfo()});return a.setActiveStorage("scale",n),{moveX:i,moveY:o}}scroll(t){const{sharer:n}=De(this,st,"f"),r=n.getActiveViewScaleInfo(),{moveX:a,moveY:i}=t,o=n.getActiveViewSizeInfo(),s=Th({moveX:a,moveY:i,viewScaleInfo:r,viewSizeInfo:o});return n.setActiveViewScaleInfo(s),s}updateViewScaleInfo(t){const{sharer:n}=De(this,st,"f"),r=_h(t,{viewSizeInfo:n.getActiveViewSizeInfo()});return n.setActiveViewScaleInfo(r),r}resize(t={}){const{sharer:n}=De(this,st,"f"),r=n.getActiveViewSizeInfo(),a=Object.assign(Object.assign({},r),t),{width:i,height:o,devicePixelRatio:s}=a,{underContext:c,boardContext:d,helperContext:u,viewContext:f}=De(this,st,"f").boardContent;return d.canvas.width=i*s,d.canvas.height=o*s,d.canvas.style.width=`${i}px`,d.canvas.style.height=`${o}px`,c.canvas.width=i*s,c.canvas.height=o*s,u.canvas.width=i*s,u.canvas.height=o*s,f.canvas.width=i*s,f.canvas.height=o*s,n.setActiveViewSizeInfo(a),a}}st=new WeakMap,Kn=new WeakMap,Mn=new WeakMap,Lr=new WeakSet,su=function(){const{renderer:t}=De(this,st,"f");t.on("load",()=>{this.drawFrame()})},lu=function e(){if(De(this,Mn,"f")==="DRAWING"||De(this,Kn,"f").length===0)return;ka(this,Mn,"DRAWING","f");const t=De(this,Kn,"f").shift(),{renderer:n,boardContent:r,beforeDrawFrame:a,afterDrawFrame:i}=De(this,st,"f");if(t){const{scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u,width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g}=t.activeStore,m={scale:o,offsetTop:s,offsetBottom:c,offsetLeft:d,offsetRight:u},b={width:f,height:h,contextHeight:p,contextWidth:v,devicePixelRatio:g};t!=null&&t.activeStore.data&&n.drawData(t.activeStore.data,{viewScaleInfo:m,viewSizeInfo:b}),a({snapshot:t}),r.drawView(),i({snapshot:t})}if(De(this,Kn,"f").length===0){ka(this,Mn,"COMPLETE","f");return}ka(this,Mn,"DRAWING","f")&&hp(()=>{De(this,Lr,"m",e).call(this)})};var kt=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Te,An,Ct,ti,de,Pe,Qn,ft,at,_n,Jn,Ba,cu,pl,gl,vl,ml,bl,yl,wl,xl,El,Sl,du,uu,fu,Pr;const ca=10;class gp{constructor(t){Te.add(this),An.set(this,void 0),Ct.set(this,new WeakMap),ti.set(this,[]),de.set(this,[]),Pe.set(this,void 0),Qn.set(this,void 0),ft.set(this,void 0),at.set(this,void 0),_n.set(this,void 0),Jn.set(this,new en),Ba.set(this,!1);const{boardContent:n}=t,r=new fp,a=new iu({viewContext:n.viewContext}),i=new dp({boardContent:n,sharer:r}),o=new au({viewContext:n.viewContext,sharer:r,calculator:a});kt(this,An,t,"f"),kt(this,ft,r,"f"),kt(this,Pe,i,"f"),kt(this,Qn,o,"f"),kt(this,_n,a,"f"),kt(this,at,new pp({boardContent:t.boardContent,sharer:r,renderer:o,calculator:W(this,_n,"f"),beforeDrawFrame:s=>{W(this,Te,"m",uu).call(this,s)},afterDrawFrame:s=>{W(this,Te,"m",fu).call(this,s)}}),"f"),W(this,Te,"m",cu).call(this),W(this,Te,"m",Pr).call(this)}isDestroyed(){return W(this,Ba,"f")}destroy(){W(this,Pe,"f").destroy(),W(this,Qn,"f").destroy(),W(this,_n,"f").destroy(),W(this,Jn,"f").destroy(),kt(this,Ba,!0,"f")}getSharer(){return W(this,ft,"f")}getViewer(){return W(this,at,"f")}getRenderer(){return W(this,Qn,"f")}setData(t){const n=W(this,ft,"f");W(this,ft,"f").setActiveStorage("data",t);const r=n.getActiveViewSizeInfo(),a=Hd(t.elements,{viewWidth:r.width,viewHeight:r.height,extend:!0});W(this,at,"f").drawFrame();const i=Object.assign(Object.assign({},r),a);return W(this,ft,"f").setActiveViewSizeInfo(i),{viewSizeInfo:i}}getData(){const{data:t}=W(this,ft,"f").getActiveStoreSnapshot();return t}use(t){var n,r,a;if(W(this,Ct,"f").has(t)){const h=W(this,Ct,"f").get(t);if(h){(r=(n=h.middlewareObject).use)===null||r===void 0||r.call(n),h.status="enable",W(this,Ct,"f").set(t,h),W(this,Te,"m",Pr).call(this);return}}const{boardContent:i,container:o}=W(this,An,"f"),s=W(this,ft,"f"),c=W(this,at,"f"),d=W(this,_n,"f"),u=W(this,Jn,"f"),f=t({boardContent:i,sharer:s,viewer:c,calculator:d,eventHub:u,container:o});(a=f.use)===null||a===void 0||a.call(f),W(this,ti,"f").push(t),W(this,de,"f").push(f),W(this,Ct,"f").set(t,{status:"enable",middlewareObject:f}),W(this,Te,"m",Pr).call(this)}disuse(t){var n,r;const a=W(this,Ct,"f").get(t);a&&((r=(n=a.middlewareObject).disuse)===null||r===void 0||r.call(n),a.status="disable",W(this,Ct,"f").set(t,a),W(this,Te,"m",Pr).call(this))}scale(t){const n=W(this,at,"f"),{moveX:r,moveY:a}=n.scale(t);n.scroll({moveX:r,moveY:a})}scroll(t){return W(this,at,"f").scroll(t)}updateViewScaleInfo(t){return W(this,at,"f").updateViewScaleInfo(t)}resize(t){const n=W(this,at,"f").resize(t),{width:r,height:a,devicePixelRatio:i}=t,{boardContent:o}=W(this,An,"f");o.viewContext.$resize({width:r,height:a,devicePixelRatio:i}),o.helperContext.$resize({width:r,height:a,devicePixelRatio:i}),o.boardContext.$resize({width:r,height:a,devicePixelRatio:i}),o.underContext.$resize({width:r,height:a,devicePixelRatio:i}),W(this,at,"f").drawFrame(),W(this,Pe,"f").trigger("resize",n),W(this,ft,"f").setActiveViewSizeInfo(t)}clear(){const{boardContent:t}=W(this,An,"f"),{underContext:n,helperContext:r,viewContext:a,boardContext:i}=t;n.clearRect(0,0,n.canvas.width,n.canvas.height),r.clearRect(0,0,r.canvas.width,r.canvas.height),a.clearRect(0,0,a.canvas.width,a.canvas.height),i.clearRect(0,0,i.canvas.width,i.canvas.height),W(this,Te,"m",du).call(this)}getEventHub(){return W(this,Jn,"f")}onWatcherEvents(){W(this,Pe,"f").onEvents()}offWatcherEvents(){W(this,Pe,"f").offEvents()}}An=new WeakMap,Ct=new WeakMap,ti=new WeakMap,de=new WeakMap,Pe=new WeakMap,Qn=new WeakMap,ft=new WeakMap,at=new WeakMap,_n=new WeakMap,Jn=new WeakMap,Ba=new WeakMap,Te=new WeakSet,cu=function(){W(this,Pe,"f").on("pointStart",W(this,Te,"m",pl).bind(this)),W(this,Pe,"f").on("pointEnd",W(this,Te,"m",gl).bind(this)),W(this,Pe,"f").on("pointMove",ia(t=>{W(this,Te,"m",vl).call(this,t)},ca)),W(this,Pe,"f").on("hover",ia(t=>{W(this,Te,"m",ml).call(this,t)},ca)),W(this,Pe,"f").on("wheel",ia(t=>{W(this,Te,"m",yl).call(this,t)},ca)),W(this,Pe,"f").on("wheelScale",ia(t=>{W(this,Te,"m",wl).call(this,t)},ca)),W(this,Pe,"f").on("scrollX",W(this,Te,"m",xl).bind(this)),W(this,Pe,"f").on("scrollY",W(this,Te,"m",El).bind(this)),W(this,Pe,"f").on("resize",W(this,Te,"m",Sl).bind(this)),W(this,Pe,"f").on("doubleClick",W(this,Te,"m",bl).bind(this)),W(this,Qn,"f").on("load",()=>{W(this,Jn,"f").trigger("loadResource")})},pl=function(t){var n;for(let r=0;r{const a=n.get(r);(a==null?void 0:a.status)==="enable"&&(a!=null&&a.middlewareObject)&&t.push(a.middlewareObject)}),kt(this,de,t,"f")};const vp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MDc6MjYrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjliMGM0MzI2LWU4ZTQtNDlkNy04MmUzLTgxODkwYTE2ZmU1YSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjMzOGFhZDBmLWZkZjMtODE0MS1iMTZmLWNiZWIzNTQyYTJhMCIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjUwODAxNzc1LWZlNGEtNDQyMy05NDQ3LThkYWRhNzZhYTllOSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NTA4MDE3NzUtZmU0YS00NDIzLTk0NDctOGRhZGE3NmFhOWU5IiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjA3OjI2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6OWIwYzQzMjYtZThlNC00OWQ3LTgyZTMtODE4OTBhMTZmZTVhIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjEyOjUwKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7W6XrzAAAGLklEQVRYhb2Xf2iUdRzHX/txtfXLplZ6Wblm6fzRmG6r7Uou1AxKRjQKYUqgaLBACFogppcK1h8aLRkMSYaJIA5hYMomZpskEfPOufCaDpZ6t7rbre263U3vzn3643meu+eu3XNzvz7w4bbdc/e89nl/Pu/v50HUCAQCx1tbW0uAx4CHgSwggxkKERkziUQif2mQ0WjU53a7vwSeBB4BTEDmTICmBBwYGDivVlDjlFAo9KvT6dwIPAHkANkq6MwDXr169bCISENDg9TX14s+BgcHf2hubi5mBmRPCXj06NFPREQ6OjoEkPLycrl06VIMMhKJeFwu1xdMs+wpAYuLi9eIiIyOjkpeXp4AAsj27dvF7/fHQIPB4C9dXV0fME2ypwQEXvX7/bdFRNauXRsDBMRkMsnhw4cTZB8YGGhsamp6hSmW3Qhw1Y0bN86LiNTW1iYAallWViZtbW162ftcLtdO/i/7tAAWtba2ficicvLkyTEBtdy6dasMDg7GQIeHh9s7OzvfBx5nkrIbAS7du3fvxyIiPT09hoBa1tXVJcv+fWNj4zLgUeAhJiC7EeDLwOsiMioisnDhwnFBrlixQi5evKiX/c6tW7c+R5E9lweU3QjwReDV/v7+bhGRqqqqcQFquWnTJvH5fHrZLzocjkoSZU9bTSPA54GV165daxYROXDgwAMBannw4MFk2RsaGhqWME7ZjQDNwIrTp09/JSLS0tIyIUBACgoK5MKFCzHIcDj85+3btz8FZpFGdiPAZ4DCmpqaTSIiPp9vwoBaVlVVidfr1ct+/sqVK+9iILsR4FzgJcASDoeHRUSKioomDQnI/v37E2T3+Xz1hw4dWjSW7EaAeUA+UNbX12cXEdmyZcuUAAJiNpvlzJkzetl73G53rVrN2EmUCjATuA9EgYjL5eoGKCkpGatNHijmz5/Pxo0b2blzJ2azOfZ3k8lUYDabv45Go/Y7d+6sIY0VZQOjGqDT6bxeWlrKqlWrJgRlsVhYv349FRUVWCwWcnJyEt4PBoOuoaEhu9frvdzR0fHTtm3buolvRpLqe3OBp4EllZWV74mIRKNRyc3NTSvf7Nmzpbq6Wk6cOCFut1uSY2RkJOB0Ou3Nzc3Ha2trPwPWAGXAEuBZFFPPAbKMevBhYA6wCKgIBoP9IiKrV682hLPZbP8DEpH7vb29N1paWn602WwHFyxYsAX4EKgE3gIsQBFQgOIeT6j3z0wFqEkc60OPx9Odn58/t6SkhPb29jFLbrVa2bNnDwBer7fv5s2bPQ6Ho7upqcnZ1tbmASJq3gPC6utdYESXYfWeo6mkBaUHRQ/odrv/yM/Pt5SWlqb8kAbncDh+W7lyZYN683u6DOvAwipsOOnniA4wZf9lqhdoVYzY7fbrQMpBsdlsWK1WRkZGAtXV1d8D/wA+wKNLr5o+YEC9ZggIAEHiFbyfDhCUCcoFngIWFxYWrtMaat68eQl9V15eHmu2+vr6OuAd4A2gGFgMLERp/mdQ+noWyuadi9Jr2aQ4k42GBPXDs1Ga97WhoaFbIiIbNmxIANTWq87Ozp9VuApgGfACihPkoRjwI+p3mlSgtA9ZRkYNYwwKJBr2rl27sFqthEKhwZqamqOAX5f/AsPE5btLvM/GJWO6yFb/82eBonPnztWJiJw9e1YAWb58eUzaI0eOfAO8CbwCPIfiZZN+eEoncSaKLPOApbt3794uIuL1ehOktdvtF4C3gRKURXcOSn9lTRRsvIAZKI4+l/gjQFREZMeOHSIiEggE+tetW/cRitkuRhmERxnnxjxZQFDWnzzURwCv1+vUHxHHjh37lri0C1Am9KGpgDMC1G8SQnxxCHs8Hqf2RldX10+bN28+i+JjwyT62KSaP13oAfWTHO7t7f0dIBQK/b1v375GlEnVjPYuyoQaHlNTDahVMALca29vdwBcvnz5+KlTp26OATft1UuODBS7yEOxj0K/329HOSWWopjxlE1tchhtM7FriPfgXSDDbrfXo0gbJr4QzIi0WiRPYBbKZJrUV23b0dYn7XSYcsBkS9EiO/k6lApq1cwiPjzaAM1Y9cYC1G6uAWrPCtrvMwoHqU02Q5caIEzj1KaS+D+vIjxtLug31gAAAABJRU5ErkJggg==",hu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDYgNzkuMTY0NzUzLCAyMDIxLzAyLzE1LTExOjUyOjEzICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjMtMDktMTdUMTY6MzE6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0MTBhYjUzLWM0ZjEtNDVhNS04MjhkLTIxOTczOWFjOTk3MSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjBkMDNmNjM5LTE5MzctY2Y0MC1hMTg0LTIyMjg0NzczNWNmYSIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjgyYjQwZGRmLWE0ZGEtNDY3MC1iYzc2LTBhYjY3ZmI5M2I0ZSI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ODJiNDBkZGYtYTRkYS00NjcwLWJjNzYtMGFiNjdmYjkzYjRlIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjMxOjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6NjQxMGFiNTMtYzRmMS00NWE1LTgyOGQtMjE5NzM5YWM5OTcxIiBzdEV2dDp3aGVuPSIyMDIzLTA5LTE3VDE2OjQ0OjIyKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMyAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz57vRudAAAEk0lEQVRYhe3ZW0jbVxzA8e8/MX+NYnG9uI4xE3bvoLt0FzradRfGBtsYo32YdAhb6WQyBqV7KOylpYjzZShDGfjmyxgbgjjwyRm16SYMhgiNKDhbL3VtNF4xJOnf3x7+59i/Wf4aTbInf3AwJMdzPjnnf/n9/jFEhGzDMIxMb3uAIsDs6ek5urS05Dtz5syE+uwekAQS6u89YD19gC0NIpJ1c8GZQHlXV9fJRCIxGo/HxxoaGj4CngWOAEGgEihXfT07MeQC3MB1dna+lkgkRkXF6urq3xcuXPgUOAE8DzwGPOiGLARwEy4ej4+JiITD4elr167NiIgsLi7eqq2trQPeBI4Bj7sh8w10xZmmeds0zdn+/v5/RERisdjUuXPnvgLeAl50Q+YTaAA+oKy7u/uE3laNAwSQ4uLiu6FQ6G4G5DG13YeAMjWWkU+gBygJhULHNe769etTTpwDGXUiz58//yXwujp5qoAHgBLAk0+gNxKJHEulUiMKN2ma5gwgPp/vjhOXjlxYWJisq6urBV5RW30IKAW8eQPGYrGjlmXdEBEZHBy8aZrmFCCmac729fVtAHt7e6MO5N2+vr47IiJLS0s3L126dBZ4Sh2LZUBRwVdwYGBgVuwOYh/zsoF0bnPBVzDTMRgOh6dFhROokSIi8/Pz0+pEeaPQx+DGWdzV1XVSX2LcgCIic3NzMzU1NV8D7wIvq9WrLNRZvOk62NHRccqJTAdGo9Hb1dXV3wAfYt9VjgAPFfI66EQWAxU9PT0fuwEvXrzYBJwF3gFeAAJAhfrfrO4k/7lxZxnr2JlJqry8POnWyePx6H4JR0vhktVkHGOXQI20SkpKLLcOhmGsA5YCaZiVLS5XoADi9XpdkznDMERhnE0fCgUHZhvOW+CO4/8A5hR7wFxjD5hr7AFzjZyBlmVlrOYdYaS1HUUuQA/gWV9fd51URDyqn1c1j6MVFGjoidfW1oq2ABrYj0V82OmVzwHNajVdB88C5wOKTdM87NaxsrKyQsFKHC2BnTDo+/TWt8Bd5INeVC44NDT0xXYZdXNz8w/AaeyS8yjwCPdzQu92ht2m/OUjIyOfS1pkAoqItLS0fA+8D7wKPA0cxs6qC1O4T0xMfKYnb21tnXEDNjc3z+nXbW1t3wFvYz9dCAL7KUThHovFPtGTNjU1jQFSX18/lg68cuXKLUAaGxs3vkB7e/u3wHHgCQpUdnpTqdQvesJgMDisUVevXh3Xry9fvnxTv66qqprQ/cfHx/vVNj/J/couv0DAv7q6+pMDeYPNSalkwkUikX7s4ukl4FHgAODPN1CXnPsWFxd/dCAjW+GGhoZCwAfYpeczwMPAPjVW3gv3IvXN98disZ8dyBGNCwQC4/r94eHhfuy6+JS6zATUCeJXY+W9cNfIUuDAwsLCr05kIBDYeBQ8Ojr6h8Lpx25BtbWlGpfv62BG5PLy8m+SFpOTk38C76mVe84NVyhgOvLgysrK7xoXjUb/Uqt2XG1rEDiYCbcd0MgwsWtk+J1EI03An0wmw5Zlefx+/2n1eRKIO5r+rWTTpFsZ/gWFrGMmeObuqwAAAABJRU5ErkJggg==",mp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAEvUlEQVRYhc2Y20/cVRDHP8v+uKzAWkpDCtZq8BYhJkq8PBoJxgj7I2m0ryaSyFN9IT74pI8+8WJiggRj/APApFkSTGRJ+qKGUiyxbGPEWsUSuVhYC12Wy8+HmeMeYPe3d3WSye/k/M7le+bMzJkZ+J9ToEJreGVYN+vihcytstjQocUlAw0WCSoIVCv3Ae8CXwIt+u8XHVeOG8qLqgAHqAFCQCNwGugCthBJGd7S/tM6LqTzHI5KuqzgaoAHgEvAtwrkG2AG8FzXvep5nue67lX9N6P/PR1/SefXlBtkFXKNDUA/RyX1D9uUbYzOb9D1ygbSQU7eDMxhSSsSiVz3AxiJRK57nuf19/fPad8coqONFCBJPyUOIKc1OvcbgiY9ICDT8+0DHge2gR0gBeyTtviM5HeKAGlrrfMZVwhdAVaAr4F3KNF4gkA9cBbowOc68+3LwDn1Mhdy4/OcYk54nPr6+m54nofruvPa9SFQ6wfQTweNgTwInAGuQWk6mEUvHwb+Au4Dexx7ffK9+0q+CHWIBIOZ9skHYKWfK9tQ8gZoLDjIyWCg3ORY+2T8aYOyg4EaRIFrkCs4QU1NTSvabC20zyIDzuyfkYzEahHX8jHwE/LwXwHeJ4P7KIVIu5ouxFDC+HgLAy4MfEF2v1UpgOezATSiNVf6EvAWsD01NXVtdnb2bk9Pz81sp/q3KIi8t83Ae4DX0tJy0z7t8PDwD4FAYIX/WILVwKMAzc3Nu/agoaGhzmg0ugcsV0hIvlSNoH8IuIiebHJycrls4sotwaxGYvueAPAjEg3jum79yMjIr5WUjFLOxMpBIopWoBN4GfhOJ+4NDg4ulVt6i4uLm7r+BvAscA4fCXrAAfJQJ5Fg8gPgMuCMjo62d3V1LW1sbKRKlpXSxMTEmjZ/5qQrOwHwUAGmkIjiHhJdfKrM/Pz8Y+3t7RvT09Ob5QAYi8X2tbmke2cEZwAaCdoAt5QvIzEbiUSitbe3tyoej++UCnBhYSGkzdu6d1aQxkgOkfwgieQMCeCu8iwSnpNKpcIdHR3BZDJ5UCy4SCSyvL6+/giiSou67wE+eYmhAKKkIaAJUdynkdflNcQF3dFTpooxjmg0aozDAz4DXkB8bxPy1OYM7QzIOuAU0AY8pQu9CrwJ3AK8UCj0RyHgZmZmli1w3wOvAM/oHo1kiZiygbSDh7PAE8DzQA/wBqKnnuM4a2NjY7dygbtw4cICRy31deBFJA09o7eWsU7kJ1KTLJmyRyOSn5zS70fAkwBtbW2/DwwMHHR3d9d3dnY2rK6u7o2Pj2/GYrH9eDzurK2tndM1vwI+QXT7T2BTD5skQz6SCyAcLRoZkGEFGQbeRqpbubK+BPA5MI14h00L3I6Cy2h4+eQbJsKuRa6iQcGFFfB5oBt4DpFsI+Ky7iDBxW3gBhBH/GtC+R7i1lKk3UxRAG2QpvxWr0AbtB3SA5jkx36djH/dVlDbyibN3M8GDvJPyI2PSulixm/u6kZ1OQCaJ/S+tndJX6tvsFBIxcCUdA3vW5ubxMrObc0hDMhd/Rqp5QQHxeW8dubnHGM7tzVv/IECMlxQ/bpcRfRMqaNRheNcUGG9XFWDACfzWs/6Fl3t/xtO//8gpbCORQAAAABJRU5ErkJggg==",bp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAER0lEQVRYhe2YT2hjRRjAf8lL22xsNsm6EWKrSKvuIkIh+O9QRFxEW18KUsoe7FHoRaWCN1FPetOrIHgVKS0q9P5OxaJbodkalgVrtVZjS7Ntd02z6abPw3yzmaT585q+elj2g2HmvZn35jffN/PNNwP35R6XgM/fuif4n+dO2klQvgsaZRc4NJJvoJbHdhrIAkJAN2ADHwFfAw9J3ZoB/b9I0AA6A0SBc0Aa2EVpSqddeZ+QdmfkO+u0gIPSQQR4HfhRQH4AHMDNZDJXXNd1M5nMFalzdB3wJTAOPAD0yEB9066G6wXepVZTd5MpTdporZ6jVqsatmMJoTR3HvgJQ1u2bS+3ArRte9l1XXdsbGyJo1pdBN6Wf3d3ChlAmSQO9LeC8fquQRpDWaerHWSjSr1iu4BkJyOsF9u2s67rkslkluTVxygltAVsJBZqdCngEj5osIlW+4EYytRNF04jeu3vulCT+7QkLH20dEOhumft97pQI4s3+iiRSPwtxVSbd39J8eEGvzFXc1NAs8KSFAZeBt4AHgNeBFDWObkEAne7HAK2gT2gCFQatdca1GbtBj4E3veFprVYVLXXcg4GqM6588BbAMlkcm1qamqzr6/v6ikBet5RgiizJoDPAXdgYGDZXHkzMzPrrk9CdRWngUeAsxxdCzVwpgZ/BigWiz1mo4mJif7jqMajeJrU5hywgGvAej6fvzA0NLThN1Eul9uT4g5VTbYFNKUIfAbsZ7PZvuHh4Wt+As7Ozu5IcY2j219TQB0NV4A7qODgO4CFhYWLg4ODOb8AHccpG4A68m6pRQ1YAQ6A28A+8BXwBcDq6upTqVTquh+AuVyuW4q/opRRaQdZD1gCbgE3ge+BT4HdfD7/ZDwe/z2bzRY6hRsfH1/e3Nx8FDX/sgbgoZfvg6jo4ixqW7oIPA+8CrwHrAJuJBLJd+JaHMf5k6qmPgGeQe1SCenXk0/U21xcIC8AzwGvAJPAEuAmEon1xcXFba9w8/Pz5oqdB14CnpY+oij35km0qwmjwqAU8ISM9hIwBeQA17KsG9PT07+1gxsZGdmgdqW+BjwLDAAPoo4ALU+W9arVwWoIpXp9kouKZpPAO8AwQCwW+2d0dLQ0OTkZSafT0UKhUJ6bm9t2HKeysrIS3tra0g7+KvABUJC0g5rrJdRcbLpImtleRzYashc1P2OSXwbebDVykX3gW+Ab1AHqhuQ3pe6AJlFMO0CoPROHDcio5I8DL1A9C8dQbmod+APYAK4DvwjQnsDdErgyVTfTEaCG1GFYGHXG7TVSo2OkdvhlAflXoHSuNdfStFqaRhEi2kfdprrj6M5LAt0I8EDaaMdflPal48CB95hMr3Bt8h4jD0kyL5E0pN6dysZzW7N2AqjbmhdIZjJvufTOpE19x3g+9s1XJ/ck5tVbfdhu+rxDfLiSO+lFToCjZwrXyH2/0Lwv95z8B1jAqXmDnj4YAAAAAElFTkSuQmCC",yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAIiklEQVRYhe2YW2yUxxmGn7W96zXGNnZsr2FJHQyYBHNIU1ttAqVUVjlJUAtxQyUXhKgQktUDdSUkuEDtBVJ9UQXRC0RJRblrq/SCIARpFImWQ8VBIZQinJpQYozNyWaxiw/rfXsx3+z+6xNOe9tPGv2nOTzzffPPvDMhSXwJC1nKAXIDV/9ellLAqF1T9o5A2Ry7J5A/Fbh3mUMh8qYJ5kHCQATID6QIkBcAHAVGgKFAStq33EB53/ao5Rm064i9g0CmqcDyrNICYCZQBJTYdaa9j1jelDUwCAwAz4F+ex61DhZauXzr1CDwDHhq1wFg2Do1KWAo0NsCAyoDKoGYXcuBWdZY1PKnzAsDQB/wBOg1yKTVN8vqmoHz6nOgC7gHdFrbCasrNRFgyMCj5qVXgDlANfAaMA/4ir2rMI+MtSHgEdAN9BjsiNVZYR0sNq8+AtqB69Z2MuDBcYA+pAXW0yoDWgTUWXrd8k1l+cBcSxjIIBlPB63G8uUB/8Z57znwAkgGAX1YC4BSK7QIWA7UWwoDJJNJzp49y4ULF2hvb6e7u5tEIkFhYSGVlZXMmzePhoYGNmzYQElJCVZv2tPt7e3s2bOHvr4+9u3bx/r16+PWjg/zQ9x4BEk+5UkqklQt6ZuSdkn6jaRbMhsYGFBbW5uWLVvmp5MpU3V1tVpbW9XV1aWgbdy4MZ2npqbGvx6W9DtJ35e0RFJREDBX0gxJcUnfkPQDScck3fGlz549q7q6ummBjU2xWEzvvfdeGvCtt95Kf6uoqAiyfyBpt6SvSZrlAUOSIpLKJS2X9D1Jv5Z025d69913FQqFJmy8rKxMS5YsUUNDg5YvX67Zs2dPCrpjxw6NjIxoxYoV6XdVVVVBwI8l/UTS1yWVesBcC+18SRsk/ULS33yJtra2CRtramrSiRMn1NXVpWQyKUlKpVJ6+vSpTp48qZ07dyo/P39cua1bt6q+vn4ywL9IapX0tqQyDxiRFDPq3ZL+JCklSadOnRrXwMKFC3X69GlNx65du6aVK1eOqyMYjTGAf50IsNC8t1FSm6TPJOn+/fuKxWJZFb/zzjvjBvx0bO/evQqHwxNG4mUe9MtYMZk5bwHA4cOH6enpSc9BixYt4uTJk5SVlflXfcBN4DFuapoHLPQfz58/z9WrVwmFQsTjceLxOHfv3uUlNlZcpFeMEtzsXg2QSCQ4duxYulQoFOLQoUNBuE7gvAE+x82b/VZHyblz52hsbCSZTL4MCGWrqUECq0gQsBi3ts4B+PDDD3n48GG61OrVq1mzZo1/fGZw54HbVmGV1bMAWPbRRx9NC24CwD7cajLiAXNwIS7ELW3lAGfOnMmqZPv27cHHvwM3gH8AnwH/wnn0C+AuwLZt25g/f/5L4cLhMNu2bfOPnbh1+xkZ9UMebvmKGmQEoLOzM11JQUEBK1eu9I/JAFAPTqnk4hTNY9xS1V5TU1N7+fJlOjo6SKXS+jPLJFFUVMTixYsxmJtW/inOi2nAXDI/C0BWeMvKyojFYv6xz1LCKhnCRSEBPMCFfBaQKi0tfb2+vn5qFzp7AnwCXAM+t45mAUJGfgMwOpoWtIRCWZ/89BB8TuJ+lG5cNEatkXYgjtN+BYG2ktaxBE4U3AP+iRsud3EeHCTwk6Ss0IhvtaKiIk3Q19dHb28vhYWF4H6mYtxwiBrQIE4aPTHgIVzoO3E/TzlOV4YD3/stj9eMPj2xzg4HAYMSPQnkxePxNGB/fz+XLl1iy5Yt4HTeq+aZTtyA9h18Yb33G6aRQBqyDiUNLihmH1q54LAZ9ZHKISPRn1loaGxsJGjHjx8PPi6xtAgnNufgVHcRmf1J2DpTiJsjvYout3c5gQ49Ns89s3fpOdB70I+Hx7iBXrV27VqKi4tJJBKAm3auXLmCDfpy4G3rZSHur/aSPg83BCpx24MFuNUlbnkHcGMubEDdxpG0lBn8AcBBsgfsVysqKti6dStHjhwBYGRkhJaWFs6dO0ckEgGYj9v0xIA71rkha7jUgBYCb5hHGRoaIj8/f4Z5s8jafUpmN/diLBwAkmZKWiipSdKvJN2VpI6ODhUVFWUt7Js2bdLAwMBYLdAt6VNJlyV9IumLsRkOHjyo2tparVixQrdvp2Xmn00YrJI0R05VBRV+GjAiqcoUxA8lnfI1HD16dJz6WLVqla5fvz4tFdPZ2anm5uas8s3Nzf7zp5J+LmmNpFcl5U8GmCupWFKtpO9K+qWkG76W3bt3j4OMRqNqaWnRhQsXNDQ0lAWVTCZ169YtHThwQFVVVePKtrS0+Kw3pgsYso+Vkuol7ZD0W0ldvsHW1tZJZXxtba0aGxvV1NSkdevWaenSpYpGoxPmXb9+vXp6ejzgx5J+ZiGeLSk8GaD34ky5Hd23JP1I0h8kPQmGu7y8/L/aNEUiEe3fv1/Dw8Pp6Es6KqlZ0puSXpHbVU4KiPVglqQFkr4j6aeSfi/pvq/13r172rVrlyorK6cFFo1GtXnzZl25ciU4Ch5J+qOkH0v6tqTXzDk5EwGGlNFjOWQOd8px4vUN4E3cpn2pz/jgwQPef/99Ll68yJ07d+jt7WVwcJBIJEJJSQlz586loaGBTZs2UVdXF5w0OoDLwFWcbPsct6r04+bRLHEYCoWyAD1kBDfHleHmsxrccccS3NFHNV/eenBy6iZwCycMOnHz5wBuDh2nyyY6H0zhFmoF7vtxk+l9q3ieQfrDo8msF7cy3cN56g7ZWnKcep7IxnrQmz+wHKu2K3EKJWbPpWSUTQ4ZtRJc23sC6ZGB9ZM52JwcboIQjzUvZvNxYfeHlyVkZFcBbux6wKA6ShjoM5yM8uH0Xpuy8ekAQuZc2W8P8nEei9p9mMmPgAfJHO0O27e0lHppw9MEDJo//A4eoE91iB48SJ80lFMB/t/+V/sPGZfTmtMFR4EAAAAASUVORK5CYII=";var ni=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},Ae=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},We,ri,kr,On,Fa,Xt,pu,gu,Rt,Cl,Ml;class wp{constructor(t,n){We.add(this),ri.set(this,void 0),kr.set(this,void 0),On.set(this,null),Fa.set(this,null),Xt.set(this,{auto:vp,"drag-default":mp,"drag-active":bp,"rotate-0":hu,rotate:yp}),ni(this,kr,t,"f"),ni(this,ri,n.eventHub,"f"),Ae(this,We,"m",pu).call(this),Ae(this,We,"m",gu).call(this)}}ri=new WeakMap,kr=new WeakMap,On=new WeakMap,Fa=new WeakMap,Xt=new WeakMap,We=new WeakSet,pu=function(){const t=Ae(this,ri,"f");Ae(this,We,"m",Rt).call(this,"default"),t.on("cursor",n=>{var r;n.type==="over-element"||!n.type?Ae(this,We,"m",Rt).call(this,"auto"):n.type==="resize-rotate"?Ae(this,We,"m",Rt).call(this,"rotate"):typeof n.type=="string"&&(!((r=n.type)===null||r===void 0)&&r.startsWith("resize-"))?Ae(this,We,"m",Cl).call(this,n):n.type==="drag-default"?Ae(this,We,"m",Rt).call(this,"drag-default"):n.type==="drag-active"?Ae(this,We,"m",Rt).call(this,"drag-active"):Ae(this,We,"m",Rt).call(this,"auto")})},gu=function(){bi(hu).then(t=>{ni(this,Fa,t,"f")}).catch(t=>{console.error(t)})},Rt=function(t){if(Ae(this,On,"f")===t)return;ni(this,On,t,"f");const n=Ae(this,Xt,"f")[Ae(this,On,"f")]||Ae(this,Xt,"f").auto;let r=0,a=0;(t.startsWith("rotate-")&&Ae(this,Xt,"f")[Ae(this,On,"f")]||t==="rotate")&&(r=10,a=10),t==="default"?Ae(this,kr,"f").style.cursor="default":Ae(this,kr,"f").style.cursor=`image-set(url(${n})2x) ${r} ${a}, auto`},Cl=function(t){var n;let r=0;t.type==="resize-top"?r+=0:t.type==="resize-top-right"?r+=45:t.type==="resize-right"?r+=90:t.type==="resize-bottom-right"?r+=135:t.type==="resize-bottom"?r+=180:t.type==="resize-bottom-left"?r+=225:t.type==="resize-left"?r+=270:t.type==="resize-top-left"&&(r+=315),r+=ht(((n=t==null?void 0:t.element)===null||n===void 0?void 0:n.angle)||0),Array.isArray(t.groupQueue)&&t.groupQueue.length>0&&t.groupQueue.forEach(i=>{r+=ht(i.angle||0)}),r=ht(r);const a=Ae(this,We,"m",Ml).call(this,r);Ae(this,We,"m",Rt).call(this,a)},Ml=function(t){const n=`rotate-${t}`;if(!Ae(this,Xt,"f")[n]){const r=Ae(this,Fa,"f");if(r){const a=document.createElement("canvas"),i=r.width,o=r.height,s={x:i/2,y:o/2};a.width=i,a.height=o;const c=a.getContext("2d"),d=Ft(t);c.translate(s.x,s.y),c.rotate(d),c.translate(-s.x,-s.y),c.drawImage(r,0,0,i,o),c.translate(s.x,s.y),c.rotate(-d),c.translate(-s.x,-s.y);const u=a.toDataURL("image/png");Ae(this,Xt,"f")[n]=u}}return n};const et="SELECT",Ce=Symbol(`${et}_actionType`),Vt=Symbol(`${et}_resizeType`),da=Symbol(`${et}_areaStart`),ua=Symbol(`${et}_areaEnd`),wr=Symbol(`${et}_hoverElement`),Yi=Symbol(`${et}_hoverElementVertexes`),xr=Symbol(`${et}_selectedElementList`),xp=Symbol(`${et}_selectedElementListVertexes`),mn=Symbol(`${et}_selectedElementController`),Fe=Symbol(`${et}_groupQueue`),Xi=Symbol(`${et}_groupQueueVertexesList`),fa=Symbol(`${et}_isMoving`),vu=2,Ep=4,mu=1,Vr="#1973ba",Al="#5b5959b5",bu=10;function Bt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[1].x,t[1].y),e.lineTo(t[2].x,t[2].y),e.lineTo(t[3].x,t[3].y),e.lineTo(t[0].x,t[0].y),e.closePath(),e.stroke(),e.fill()}function Sp(e,t,n,r){const{borderColor:a,borderWidth:i,lineDash:o}=r;e.setLineDash([]),e.lineWidth=i,e.strokeStyle=a,e.setLineDash(o),e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.closePath(),e.stroke()}function Cp(e,t,n){const{size:r,borderColor:a,borderWidth:i,background:o}=n,s=t,c=r/2,d=c,u=c;if(d>=0&&u>=0){if(typeof i=="number"&&i>0){const f=i/2+d,h=i/2+u;e.beginPath(),e.strokeStyle=a,e.lineWidth=i,e.circle(s.x,s.y,f,h,0,0,2*Math.PI),e.closePath(),e.stroke()}e.beginPath(),e.fillStyle=o,e.circle(s.x,s.y,d,u,0,0,2*Math.PI),e.closePath(),e.fill()}}function Dt(e,t,n){const{borderColor:r,borderWidth:a,background:i,lineDash:o}=n;e.setLineDash([]),e.lineWidth=a,e.strokeStyle=r,e.fillStyle=i,e.setLineDash(o),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[2].x,t[2].y),e.closePath(),e.stroke(),e.beginPath(),e.moveTo(t[1].x,t[1].y),e.lineTo(t[3].x,t[3].y),e.closePath(),e.stroke()}function _l(e,t,n){if(!t)return;const r={borderColor:Vr,borderWidth:1,background:"transparent",lineDash:[]};Bt(e,Re(t,n),r)}function Ol(e,t,n){if(!t)return;const r={borderColor:Al,borderWidth:1,background:"transparent",lineDash:[]};Bt(e,Re(t,n),r);const{controller:a}=n;if(a){const{topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,topMiddle:d,bottomMiddle:u,leftMiddle:f,rightMiddle:h}=a,p=Object.assign(Object.assign({},r),{borderWidth:1,background:Al});Dt(e,Re(d.vertexes,n),p),Dt(e,Re(u.vertexes,n),p),Dt(e,Re(f.vertexes,n),p),Dt(e,Re(h.vertexes,n),p),Dt(e,Re(i.vertexes,n),p),Dt(e,Re(o.vertexes,n),p),Dt(e,Re(s.vertexes,n),p),Dt(e,Re(c.vertexes,n),p)}}function Tl(e,t,n){if(!t)return;const{hideControllers:r}=n,{elementWrapper:a,topLeft:i,topRight:o,bottomLeft:s,bottomRight:c,top:d,rotate:u}=t,f={borderColor:Vr,borderWidth:vu,background:"transparent",lineDash:[]},h=Object.assign(Object.assign({},f),{borderWidth:Ep,background:"#FFFFFF"});Bt(e,Re(a,n),f),r||(Sp(e,Je(d.center,n),Je(u.center,n),Object.assign(Object.assign({},h),{borderWidth:2})),Bt(e,Re(i.vertexes,n),h),Bt(e,Re(o.vertexes,n),h),Bt(e,Re(s.vertexes,n),h),Bt(e,Re(c.vertexes,n),h),Cp(e,Je(u.center,n),Object.assign(Object.assign({},h),{size:bu,borderWidth:2})))}function Mp(e,t){const{start:n,end:r}=t;e.setLineDash([]),e.lineWidth=mu,e.strokeStyle=Vr,e.fillStyle="#1976d24f",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,n.y),e.lineTo(r.x,r.y),e.lineTo(n.x,r.y),e.closePath(),e.stroke(),e.fill()}function Ap(e,t){const{areaSize:n}=t,{x:r,y:a,w:i,h:o}=n;e.setLineDash([]),e.lineWidth=mu,e.strokeStyle=Vr,e.fillStyle="#1976d21c",e.beginPath(),e.moveTo(r,a),e.lineTo(r+i,a),e.lineTo(r+i,a+o),e.lineTo(r,a+o),e.closePath(),e.stroke(),e.fill()}function _p(e,t,n){for(let r=0;r0?Math.abs(e):0-Math.abs(e)}function xo(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,vertexes:i}=t,o=Je(i[0],{viewScaleInfo:r,viewSizeInfo:a}),s=Je(i[1],{viewScaleInfo:r,viewSizeInfo:a}),c=Je(i[2],{viewScaleInfo:r,viewSizeInfo:a}),d=Je(i[3],{viewScaleInfo:r,viewSizeInfo:a});return n.beginPath(),n.moveTo(o.x,o.y),n.lineTo(s.x,s.y),n.lineTo(c.x,c.y),n.lineTo(d.x,d.y),n.lineTo(o.x,o.y),n.closePath(),!!n.isPointInPath(e.x,e.y)}function $l(e,t){const{ctx:n,viewScaleInfo:r,viewSizeInfo:a,groupQueue:i}=t;if(!i||!((i==null?void 0:i.length)>0))return!1;const o=Jo(i),s=o[o.length-1];return s?xo(e,{ctx:n,vertexes:s,viewScaleInfo:r,viewSizeInfo:a}):!1}function Er(e,t){var n,r,a;const i={type:null,elements:[],elementVertexesList:[],groupQueue:[],groupQueueVertexesList:[]},{ctx:o,data:s,calculator:c,selectedElements:d,viewScaleInfo:u,viewSizeInfo:f,areaSize:h,groupQueue:p,selectedElementController:v}=t;if(v){const{left:g,right:m,top:b,bottom:y,topLeft:S,topRight:x,bottomLeft:C,bottomRight:E,rotate:j}=v,z=[g,m,b,y,S,x,C,E,j];for(let k=0;k0&&(i.groupQueue=p||[],i.elements=[d[0]]);break}}}if(p&&Array.isArray(p)&&p.length>0){const g=p[p.length-1];if(!((n=g==null?void 0:g.detail)===null||n===void 0)&&n.children&&Array.isArray((r=g==null?void 0:g.detail)===null||r===void 0?void 0:r.children))for(let m=g.detail.children.length-1;m>=0;m--){const b=g.detail.children[m],y=ei(b,{groupQueue:p});if(y&&xo(e,{ctx:o,vertexes:y,viewScaleInfo:u,viewSizeInfo:f}))return i.type||(i.type="over-element"),i.groupQueue=p,i.elements=[b],i}return i}if(i.type!==null)return i;if(h&&Array.isArray(d)&&(d==null?void 0:d.length)>1){const{x:g,y:m,w:b,h:y}=h;if(e.x>=g&&e.x<=g+b&&e.y>=m&&e.y<=m+y)return i.type="list-area",i.elements=d,i}if(s){const{index:g,element:m}=c.getPointElement(e,{data:s,viewScaleInfo:u,viewSizeInfo:f});if(g>=0&&m&&((a=m==null?void 0:m.operations)===null||a===void 0?void 0:a.invisible)!==!0)return i.elements=[m],i.type="over-element",i}return i}function Op(e,t){var n,r,a,i,o,s,c,d,u;let{x:f,y:h,w:p,h:v,angle:g=0}=e;const m=vt({x:f,y:h,w:p,h:v,angle:g});g=ht(g);const b=Ft(g),y=!!(!((n=e==null?void 0:e.operations)===null||n===void 0)&&n.limitRatio),{start:S,end:x,resizeType:C,scale:E}=t;let j=Object.assign({},S),z=Object.assign({},x),k={x:j.x,y:m.y},F={x:z.x,y:m.y},U=Object.assign({},k),L=Object.assign({},F),O={x:m.x,y:j.y},$={x:m.x,y:z.y},R=Object.assign({},O),G=Object.assign({},$),N=(L.x-U.x)/E,D=(L.y-U.y)/E,w=ha(N,D),P=(G.x-R.x)/E,V=(G.y-R.y)/E,M=ha(P,V);(g>0||g<0)&&(j=je(m,S,0-b),z=je(m,x,0-b),k={x:j.x,y:m.y},F={x:z.x,y:m.y},U=je(m,k,b),L=je(m,F,b),O={x:m.x,y:j.y},$={x:m.x,y:z.y},R=je(m,O,b),G=je(m,$,b),N=(L.x-U.x)/E,D=(L.y-U.y)/E,w=ha(N,D),w=re(w,D),P=(G.x-R.x)/E,V=(G.y-R.y)/E,M=ha(P,V),M=re(M,V));let Y=(x.x-S.x)/E,H=(x.y-S.y)/E;if(y===!0){if(["resize-top","resize-bottom","resize-left","resize-right"].includes(C)){const _=Math.max(Math.abs(Y),Math.abs(H));Y=(Y>=0?1:-1)*_,H=(H>=0?1:-1)*_/e.w*e.h;const T=Math.max(Math.abs(P),Math.abs(V));P=(P>=0?1:-1)*T,V=(V>=0?1:-1)*T/e.w*e.h;const I=Math.max(Math.abs(N),Math.abs(D));N=(N>=0?1:-1)*I,D=(D>=0?1:-1)*I/e.w*e.h}else if(["resize-top-left","resize-top-right","resize-bottom-left","resize-bottom-right"].includes(C)){{const _=Math.abs(Y);Y=(Y>=0?1:-1)*_;const T=_/e.w*e.h;C==="resize-top-left"||C==="resize-bottom-right"?H=Y>0?T:-T:(C==="resize-top-right"||C==="resize-bottom-left")&&(H=Y>0?-T:T)}w=Math.abs(w),M=w/e.w*e.h}}switch(C){case"resize-top":{if(g===0)v-H>0&&(h+=H,v-=H,((r=e.operations)===null||r===void 0?void 0:r.limitRatio)===!0&&(f+=H/e.h*e.w/2,p-=H/e.h*e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V);const I=ce(g),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<180){M=re(M,P);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<270){M=re(M,V);const I=ce(g-180),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<360){M=0-re(M,P);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}v+M>0&&(((a=e.operations)===null||a===void 0?void 0:a.limitRatio)===!0&&(p=p+M/e.h*e.w),v=v+M,f=_-p/2,h=T-v/2)}break}case"resize-bottom":{if(g===0)e.h+H>0&&(v+=H,((i=e.operations)===null||i===void 0?void 0:i.limitRatio)===!0&&(f-=H/e.h*e.w/2,p+=H/e.h*e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<180){M=0-re(M,P);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}else if(g<270){M=re(M,P);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<360){M=re(M,P);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}v+M>0&&(((o=e.operations)===null||o===void 0?void 0:o.limitRatio)===!0&&(p=p+M/e.h*e.w),v=v+M,f=_-p/2,h=T-v/2)}break}case"resize-left":{if(g===0)e.w-Y>0&&(f+=Y,p-=Y,((s=e.operations)===null||s===void 0?void 0:s.limitRatio)===!0&&(v-=Y/e.w*e.h,h+=Y/e.w*e.h/2));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){w=0-re(w,N);const I=ce(g),B=w/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I)}else if(g<180){w=re(w,N);const I=ce(g-90),B=w/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}else if(g<270){w=re(w,D);const I=ce(g-180),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<360){w=re(w,D);const I=ce(g-270),B=w/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}p+w>0&&(((c=e.operations)===null||c===void 0?void 0:c.limitRatio)===!0&&(v=v+w/e.w*e.h),p=p+w,f=_-p/2,h=T-v/2)}break}case"resize-right":{if(g===0)e.w+Y>0&&(p+=Y,((d=e.operations)===null||d===void 0?void 0:d.limitRatio)===!0&&(h-=Y*e.h/e.w/2,v+=Y*e.h/e.w));else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){w=re(w,D);const I=ce(g),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I)}else if(g<180){w=re(w,H);const I=ce(g-90),B=w/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I)}else if(g<270){w=re(w,H);const I=ce(g-180),B=w/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I),w=0-w}else if(g<360){w=re(w,Y);const I=ce(g-270),B=w/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I)}p+w>0&&(((u=e.operations)===null||u===void 0?void 0:u.limitRatio)===!0&&(v=v+w/e.w*e.h),p=p+w,f=_-p/2,h=T-v/2)}break}case"resize-top-left":{if(g===0)p-Y>0&&(f+=Y,p-=Y),v-H>0&&(h+=H,v-=H);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V),w=0-re(w,y?0-M:N);const I=M/2;_=_+I*Math.sin(b),T=T-I*Math.cos(b);const B=w/2;_=_-B*Math.cos(b),T=T-B*Math.sin(b)}else if(g<180){M=re(M,P),w=re(w,y?M:N);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}else if(g<270){M=re(M,V),w=re(w,y?M:D);const I=ce(g-180),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<360){M=0-re(M,P),w=re(w,y?M:D);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-top-right":{if(g===0)p+Y>0&&(p+=Y),v-H>0&&(h+=H,v-=H);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=0-re(M,V),w=re(w,y?M:D);const I=ce(g),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<180){M=re(M,P),w=re(w,y?M:D);const I=ce(g-90),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}else if(g<270){const I=ce(g-180);M=re(M,V),w=re(w,y?M:0-N);const B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<360){M=0-re(M,P),w=re(w,y?M:N);const I=ce(g-270),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-bottom-left":{if(g===0)e.h+H>0&&(v+=H),e.w-Y>0&&(f+=Y,p-=Y);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V),w=0-re(w,y?0-M:N);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<180){M=0-re(M,P),w=re(w,y?M:N);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}else if(g<270){M=re(M,P),w=re(w,y?M:D);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<360){M=re(M,P),w=re(w,y?M:D);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}case"resize-bottom-right":{if(g===0)e.h+H>0&&(v+=H),e.w+Y>0&&(p+=Y);else if(g>0||g<0){let _=m.x,T=m.y;if(g<90){M=re(M,V),w=re(w,y?M:D);const I=ce(g),B=M/2;_=_-B*Math.sin(I),T=T+B*Math.cos(I);const ee=w/2;_=_+ee*Math.cos(I),T=T+ee*Math.sin(I)}else if(g<180){M=0-re(M,P),w=re(w,y?M:H);const I=ce(g-90),B=M/2;_=_-B*Math.cos(I),T=T-B*Math.sin(I);const ee=w/2;_=_-ee*Math.sin(I),T=T+ee*Math.cos(I)}else if(g<270){M=re(M,P),w=re(w,y?M:0-D);const I=ce(g-180),B=M/2;_=_+B*Math.sin(I),T=T-B*Math.cos(I);const ee=w/2;_=_-ee*Math.cos(I),T=T-ee*Math.sin(I)}else if(g<360){M=re(M,P),w=re(w,y?M:N);const I=ce(g-270),B=M/2;_=_+B*Math.cos(I),T=T+B*Math.sin(I);const ee=w/2;_=_+ee*Math.sin(I),T=T-ee*Math.cos(I)}v+M>0&&(v=v+M),p+w>0&&(p=p+w),f=_-p/2,h=T-v/2}break}}return{x:f,y:h,w:p,h:v,angle:e.angle}}function Tp(e,t){const{x:n,y:r,w:a,h:i,angle:o=0}=e,{center:s,start:c,end:d,viewScaleInfo:u,viewSizeInfo:f}=t,h=Je(s,{viewScaleInfo:u,viewSizeInfo:f}),p=ht(o),v=Sh(h,c,d),g=p+Eh(v);return{x:n,y:r,w:a,h:i,angle:g}}function $p(e,t){var n;const r=[],a=[],i=[],{calculator:o,viewScaleInfo:s,viewSizeInfo:c,start:d,end:u}=t;if(!(Array.isArray(e.elements)&&d&&u))return{indexes:r,uuids:a,elements:i};const f=Math.min(d.x,u.x),h=Math.max(d.x,u.x),p=Math.min(d.y,u.y),v=Math.max(d.y,u.y);for(let g=0;g=f&&y.x<=h&&y.y>=p&&y.y<=v&&(r.push(g),a.push(m.uuid),i.push(m),b.angle&&(b.angle>0||b.angle<0))){const S=on(b);if(S.length===4){const x=[S[0].x,S[1].x,S[2].x,S[3].x],C=[S[0].y,S[1].y,S[2].y,S[3].y];b.x=Math.min(...x),b.y=Math.min(...C),b.w=Math.abs(Math.max(...x)-Math.min(...x)),b.h=Math.abs(Math.max(...C)-Math.min(...C))}}}return{indexes:r,uuids:a,elements:i}}function Zi(e,t){var n;if(!Array.isArray(e))return null;const r={x:0,y:0,w:0,h:0},{calculator:a,viewScaleInfo:i,viewSizeInfo:o}=t;let s=null;for(let c=0;c0||u.angle<0)){const f=on(u);if(f.length===4){const h=[f[0].x,f[1].x,f[2].x,f[3].x],p=[f[0].y,f[1].y,f[2].y,f[3].y];u.x=Math.min(...h),u.y=Math.min(...p),u.w=Math.abs(Math.max(...h)-Math.min(...h)),u.h=Math.abs(Math.max(...p)-Math.min(...p))}}if(s){const f=Math.min(u.x,r.x),h=Math.min(u.y,r.y),p=Math.max(u.x+u.w,r.x+r.w),v=Math.max(u.y+u.h,r.y+r.h);r.x=f,r.y=h,r.w=Math.abs(p-f),r.h=Math.abs(v-h)}else r.x=u.x,r.y=u.y,r.w=u.w,r.h=u.h;s=u}return r}function Pp(e,t){var n;if((t==null?void 0:t.type)==="group"&&Array.isArray((n=t==null?void 0:t.detail)===null||n===void 0?void 0:n.children))for(let r=0;r{const{x:s,y:c,w:d,h:u,angle:f=0}=o;i.push({x:s,y:c,w:d,h:u,angle:0-f})}),(n==null?void 0:n.length)>0){const o=qa(e,i),s=qa(t,i);r=s.x-o.x,a=s.y-o.y}return{moveX:r,moveY:a}}const ai="@middleware/text-edit",Eo="@middleware/text-change",zp=sn(),So=e=>{const{eventHub:t,boardContent:n,viewer:r}=e,a=n.boardContext.canvas,i=document.createElement("div");i.setAttribute("contenteditable","true");const o=document.createElement("div"),s=e.container||document.body,c=document.createElement("div");let d=null,u=[];o.appendChild(i),o.style.position="absolute",c.appendChild(o),c.style.position="fixed",c.style.top="0",c.style.bottom="0",c.style.left="0",c.style.right="0",c.style.display="none",s.appendChild(c);const f=y=>{m(),g(y),c.style.display="block"},h=()=>{c.style.display="none",d=null,u=[]},p=()=>{const y=a.getBoundingClientRect(),{left:S,top:x,width:C,height:E}=y;return{left:S,top:x,width:C,height:E}},v=y=>{const{size:S,parent:x}=y,C=document.createElement("div"),{x:E,y:j,w:z,h:k}=S,F=ht(S.angle||0);return C.style.position="absolute",C.style.left=`${E}px`,C.style.top=`${j}px`,C.style.width=`${z}px`,C.style.height=`${k}px`,C.style.transform=`rotate(${F}deg)`,x.appendChild(C),C},g=y=>{const{viewScaleInfo:S,element:x,groupQueue:C}=y,{scale:E,offsetTop:j,offsetLeft:z}=S;o.children&&Array.from(o.children).forEach(N=>{N.remove()});let k=o;for(let N=0;N0&&(U=x.x*E,L=x.y*E,O=x.w*E,$=x.h*E);let R="center",G="center";F.textAlign==="left"?R="start":F.textAlign==="right"&&(R="end"),F.verticalAlign==="top"?G="start":F.verticalAlign==="bottom"&&(G="end"),i.style.display="inline-flex",i.style.justifyContent=R,i.style.alignItems=G,i.style.position="absolute",i.style.left=`${U-1}px`,i.style.top=`${L-1}px`,i.style.width=`${O+2}px`,i.style.height=`${$+2}px`,i.style.transform=`rotate(${ht(x.angle||0)}deg)`,i.style.boxSizing="border-box",i.style.border="1px solid #1973ba",i.style.resize="none",i.style.overflow="hidden",i.style.wordBreak="break-all",i.style.background="#FFFFFF",i.style.color="#333333",i.style.fontSize=`${F.fontSize*E}px`,i.style.lineHeight=`${F.lineHeight*E}px`,i.style.fontFamily=F.fontFamily,i.style.fontWeight=`${F.fontWeight}`,i.style.padding="0",i.style.margin="0",i.style.outline="none",i.innerText=F.text||"",k.appendChild(i)},m=()=>{const{left:y,top:S,width:x,height:C}=p();o.style.position="absolute",o.style.overflow="hidden",o.style.top=`${S}px`,o.style.left=`${y}px`,o.style.width=`${x}px`,o.style.height=`${C}px`};c.addEventListener("click",()=>{h()}),i.addEventListener("click",y=>{y.stopPropagation()}),i.addEventListener("input",()=>{d&&u&&(d.detail.text=i.innerText||"",t.trigger(Eo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u||[]]}),r.drawFrame())}),i.addEventListener("blur",()=>{d&&u&&t.trigger(Eo,{element:{uuid:d.uuid,detail:{text:d.detail.text}},position:[...u]}),h()});const b=y=>{var S;y!=null&&y.position&&(y!=null&&y.element)&&((S=y==null?void 0:y.element)===null||S===void 0?void 0:S.type)==="text"&&(d=y.element,u=y.position),f(y)};return{name:"@middleware/text-editor",use(){t.on(ai,b)},disuse(){t.off(ai,b)}}},Ha="@middleware/select",Co="@middleware/select-clear",Mo=e=>{const{viewer:t,sharer:n,boardContent:r,calculator:a,eventHub:i}=e,{helperContext:o}=r;let s=null,c=null;n.setSharedStorage(Ce,null);const d=()=>n.getSharedStorage(xr),u=b=>{let y=n.getSharedStorage(Fe);Array.isArray(y)||(y=[]),y.length>0?Pp(b,y[y.length-1])?y.push(b):y=[]:y.length===0&&y.push(b);const S=Jo(y);return n.setSharedStorage(Fe,y),n.setSharedStorage(Xi,S),y.length>0},f=b=>{n.setSharedStorage(wr,b);let y=null;b&&(y=ei(b,{groupQueue:n.getSharedStorage(Fe)})),n.setSharedStorage(Yi,y)},h=(b,y)=>{if(n.setSharedStorage(xr,b),b.length===1){const S=la(b[0],{groupQueue:n.getSharedStorage(Fe),controllerSize:bu,viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(mn,S)}else n.setSharedStorage(mn,null);(y==null?void 0:y.triggerEvent)===!0&&i.trigger(Ha,{uuids:b.map(S=>S.uuid)})},p=()=>({ctx:o,calculator:a,data:n.getActiveStorage("data"),selectedElements:d(),viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Fe),areaSize:null,selectedElementController:n.getSharedStorage(mn)}),v=()=>{n.setSharedStorage(Ce,null),n.setSharedStorage(Vt,null),n.setSharedStorage(da,null),n.setSharedStorage(ua,null),n.setSharedStorage(Fe,[]),n.setSharedStorage(Xi,[]),n.setSharedStorage(wr,null),n.setSharedStorage(Yi,null),n.setSharedStorage(xr,[]),n.setSharedStorage(xp,null),n.setSharedStorage(mn,null),n.setSharedStorage(fa,null)};v();const g=({uuids:b,positions:y})=>{let S=[];const x=n.getSharedStorage(Ce),C=n.getActiveStorage("data");y&&Array.isArray(y)?S=Vd(y,(C==null?void 0:C.elements)||[]):S=Aa(b,(C==null?void 0:C.elements)||[]);let E=!1;if(!x&&S.length===1?(n.setSharedStorage(Ce,"select"),E=!0):x==="select"&&S.length===1&&(E=!0),E){const j=S[0],z=Gd(j.uuid,(C==null?void 0:C.elements)||[]);n.setSharedStorage(Fe,z),h(S),t.drawFrame()}},m=()=>{v(),t.drawFrame()};return{name:"@middleware/selector",use(){i.on(Ha,g),i.on(Co,m)},disuse(){i.off(Ha,g),i.off(Co,m)},hover:b=>{var y,S,x,C,E;const j=n.getSharedStorage(Vt),z=n.getSharedStorage(Ce),k=n.getSharedStorage(Fe),F=R=>{const G=R.type;c===null&&i.trigger("cursor",{type:G,groupQueue:R.groupQueue,element:R.elements[0]})};if((k==null?void 0:k.length)>0){if(!$l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:n.getSharedStorage(Fe)})){f(null),t.drawFrame();return}const G=Er(b.point,p());if(F(G),j||["area","drag","drag-list"].includes(z)){f(null),t.drawFrame();return}if(((y=G==null?void 0:G.elements)===null||y===void 0?void 0:y.length)===1){f(G.elements[0]),t.drawFrame();return}f(null),t.drawFrame();return}if(j||["area","drag","drag-list"].includes(z)){f(null);return}if(z==="drag"){f(null);return}const U=d(),L=n.getActiveViewScaleInfo(),O=n.getActiveViewSizeInfo(),$=Er(b.point,Object.assign(Object.assign({},p()),{areaSize:Zi(U,{viewScaleInfo:L,viewSizeInfo:O,calculator:a})}));if(F($),$.type!==null&&!($.type==="over-element"&&n.getSharedStorage(Ce)==="select"&&$.elements.length===1&&$.elements[0].uuid===((x=(S=d())===null||S===void 0?void 0:S[0])===null||x===void 0?void 0:x.uuid))&&!($.type==="over-element"&&n.getSharedStorage(Ce)===null&&$.elements.length===1&&$.elements[0].uuid===((C=n.getSharedStorage(wr))===null||C===void 0?void 0:C.uuid))){if($.type==="over-element"&&((E=$==null?void 0:$.elements)===null||E===void 0?void 0:E.length)===1){f($.elements[0]),t.drawFrame();return}if(n.getSharedStorage(wr)){f(null),t.drawFrame();return}}},pointStart:b=>{var y,S,x,C,E,j,z,k,F,U;s=b.point;const L=n.getSharedStorage(Fe);if((L==null?void 0:L.length)>0){if($l(b.point,{ctx:o,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),groupQueue:L})){const R=Er(b.point,p());if(((y=R==null?void 0:R.elements)===null||y===void 0?void 0:y.length)===1&&((x=(S=R.elements[0])===null||S===void 0?void 0:S.operations)===null||x===void 0?void 0:x.lock)===!0)return;f(null),R.type==="over-element"&&((C=R==null?void 0:R.elements)===null||C===void 0?void 0:C.length)===1?(h([R.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Ce,"drag")):!((E=R.type)===null||E===void 0)&&E.startsWith("resize-")?(n.setSharedStorage(Vt,R.type),n.setSharedStorage(Ce,"resize")):h([],{triggerEvent:!0})}else v();t.drawFrame();return}const O=Zi(d(),{viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo(),calculator:a}),$=Er(b.point,Object.assign(Object.assign({},p()),{areaSize:O,groupQueue:[]}));((j=$==null?void 0:$.elements)===null||j===void 0?void 0:j.length)===1&&((k=(z=$.elements[0])===null||z===void 0?void 0:z.operations)===null||k===void 0?void 0:k.lock)===!0||(f(null),$.type==="list-area"?n.setSharedStorage(Ce,"drag-list"):$.type==="over-element"&&((F=$==null?void 0:$.elements)===null||F===void 0?void 0:F.length)===1?(h([$.elements[0]],{triggerEvent:!0}),n.setSharedStorage(Ce,"drag")):!((U=$.type)===null||U===void 0)&&U.startsWith("resize-")?(n.setSharedStorage(Vt,$.type),n.setSharedStorage(Ce,"resize")):(v(),n.setSharedStorage(Ce,"area"),n.setSharedStorage(da,b.point),h([],{triggerEvent:!0})),t.drawFrame())},pointMove:b=>{var y,S,x;n.setSharedStorage(fa,!0);const C=n.getActiveStorage("data"),E=d(),j=n.getActiveStorage("scale")||1,z=n.getActiveViewScaleInfo(),k=n.getActiveViewSizeInfo(),F=s,U=b.point,L=n.getSharedStorage(Vt),O=n.getSharedStorage(Ce),$=n.getSharedStorage(Fe);if(O==="drag"){if(c="drag",C&&(E==null?void 0:E.length)===1&&F&&U&&((S=(y=E[0])===null||y===void 0?void 0:y.operations)===null||S===void 0?void 0:S.lock)!==!0){const{moveX:R,moveY:G}=Ip(F,U,$);E[0].x+=R/j,E[0].y+=G/j,h([E[0]])}t.drawFrame()}else if(O==="drag-list"){if(c="drag-list",C&&F&&U&&(E==null?void 0:E.length)>1){const R=(U.x-F.x)/j,G=(U.y-F.y)/j;E.forEach(N=>{var D;N&&((D=N==null?void 0:N.operations)===null||D===void 0?void 0:D.lock)!==!0&&(N.x+=R,N.y+=G)}),n.setActiveStorage("data",C)}t.drawFrame()}else if(O==="resize"){if(C&&(E==null?void 0:E.length)===1&&F&&(L!=null&&L.startsWith("resize-"))){c="resize";const R=[];$.forEach(D=>{const{x:w,y:P,w:V,h:M,angle:Y=0}=D;R.push({x:w,y:P,w:V,h:M,angle:0-Y})});let G=F,N=U;if($.length>0&&(G=qa(F,R),N=qa(U,R)),L==="resize-rotate"){const D=n.getSharedStorage(mn),w=[D.topLeft.center,D.topRight.center,D.bottomLeft.center,D.bottomRight.center],P=kd(w),V=Tp(E[0],{center:P,viewScaleInfo:z,viewSizeInfo:k,start:F,end:U,resizeType:L,sharer:n});E[0].angle=V.angle}else{const D=Op(E[0],{scale:j,start:G,end:N,resizeType:L,sharer:n});E[0].x=D.x,E[0].y=D.y,E[0].type==="group"&&((x=E[0].operations)===null||x===void 0?void 0:x.deepResize)===!0?Kd(E[0],{w:D.w,h:D.h}):(E[0].w=D.w,E[0].h=D.h)}h([E[0]]),t.drawFrame()}}else O==="area"&&(c="area",n.setSharedStorage(ua,b.point),t.drawFrame());s=b.point},pointEnd(b){c=null,n.setSharedStorage(fa,!1);const y=n.getActiveStorage("data"),S=n.getSharedStorage(Vt),x=n.getSharedStorage(Ce),C=n.getActiveViewSizeInfo();let E=!1;if(s=null,x==="resize"&&S)n.setSharedStorage(Vt,null),E=!0;else if(x==="area"){if(n.setSharedStorage(Ce,null),y){const z=n.getSharedStorage(da),k=n.getSharedStorage(ua);if(z&&k){const{elements:F}=$p(y,{start:z,end:k,calculator:a,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()});F.length>0&&(n.setSharedStorage(Ce,"drag-list"),h(F,{triggerEvent:!0}),E=!0)}}}else x==="drag-list"?(n.setSharedStorage(Ce,"drag-list-end"),E=!0):y&&(a.getPointElement(b.point,{data:y,viewScaleInfo:n.getActiveViewScaleInfo(),viewSizeInfo:n.getActiveViewSizeInfo()}).element?(n.setSharedStorage(Ce,"select"),E=!0):n.setSharedStorage(Ce,null));n.getSharedStorage(Ce)===null&&(v(),E=!0),(()=>{if(E){if(y&&Array.isArray(y==null?void 0:y.elements)&&["drag","drag-list"].includes(x)){const z=Mh(y.elements,C,{extend:!0});n.setActiveStorage("contextHeight",z.contextSize.contextHeight),n.setActiveStorage("contextWidth",z.contextSize.contextWidth)}y&&["drag","drag-list","drag-list-end","resize"].includes(x)&&i.trigger("change",{data:y,type:"dragElement"}),t.drawFrame()}})()},pointLeave(){s=null,v(),t.drawFrame()},doubleClick(b){var y,S,x,C,E,j;const z=Er(b.point,p());if(n.setSharedStorage(mn,null),n.setSharedStorage(xr,[]),!(z.elements.length===1&&((S=(y=z.elements[0])===null||y===void 0?void 0:y.operations)===null||S===void 0?void 0:S.lock)===!0)){if(z.elements.length===1&&((x=z.elements[0])===null||x===void 0?void 0:x.type)==="group"){if(u(z.elements[0])===!0){n.setSharedStorage(Ce,null),t.drawFrame();return}}else z.elements.length===1&&((C=z.elements[0])===null||C===void 0?void 0:C.type)==="text"&&i.trigger(ai,{element:z.elements[0],groupQueue:n.getSharedStorage(Fe)||[],position:tn((E=z.elements[0])===null||E===void 0?void 0:E.uuid,((j=n.getActiveStorage("data"))===null||j===void 0?void 0:j.elements)||[]),viewScaleInfo:n.getActiveViewScaleInfo()});n.setSharedStorage(Ce,null)}},beforeDrawFrame({snapshot:b}){var y;const{activeStore:S,sharedStore:x}=b,{scale:C,offsetLeft:E,offsetTop:j,offsetRight:z,offsetBottom:k,width:F,height:U,contextHeight:L,contextWidth:O,devicePixelRatio:$}=S,R=e.sharer,G={scale:C,offsetLeft:E,offsetTop:j,offsetRight:z,offsetBottom:k},N={width:F,height:U,contextHeight:L,contextWidth:O,devicePixelRatio:$},w=x[xr][0],P=x[wr],V=x[Yi],M=x[Ce],Y=x[da],H=x[ua],_=x[Fe],T=x[Xi],I=x[fa],B={calculator:a,viewScaleInfo:G,viewSizeInfo:N},ee=w?la(w,{groupQueue:_,controllerSize:10,viewScaleInfo:G}):null,ut=!!(!((y=P==null?void 0:P.operations)===null||y===void 0)&&y.lock);if((_==null?void 0:_.length)>0)_p(o,T,B),P&&M!=="drag"&&(ut?Ol(o,V,Object.assign(Object.assign({},B),{controller:la(P,{groupQueue:_,controllerSize:10,viewScaleInfo:G})})):_l(o,V,B)),!ut&&w&&["select","drag","resize"].includes(M)&&Tl(o,ee,Object.assign(Object.assign({},B),{element:w,groupQueue:_,hideControllers:!!I&&M==="drag"}));else if(P&&M!=="drag"&&(ut?Ol(o,V,Object.assign(Object.assign({},B),{controller:la(P,{groupQueue:_,controllerSize:10,viewScaleInfo:G})})):_l(o,V,B)),!ut&&w&&["select","drag","resize"].includes(M))Tl(o,ee,Object.assign(Object.assign({},B),{element:w,groupQueue:_,hideControllers:!!I&&M==="drag"}));else if(M==="area"&&Y&&H)Mp(o,{start:Y,end:H});else if(["drag-list","drag-list-end"].includes(M)){const It=Zi(d(),{viewScaleInfo:R.getActiveViewScaleInfo(),viewSizeInfo:R.getActiveViewSizeInfo(),calculator:a});It&&Ap(o,{areaSize:It})}}}},Ur="SCROLL",Wa=Symbol(`${Ur}_xThumbRect`),Ga=Symbol(`${Ur}_yThumbRect`),Tn=Symbol(`${Ur}_prevPoint`),Ao=Symbol(`${Ur}_activePoint`),Ir=Symbol(`${Ur}_activeThumbType`),Rp=12,Pl=16,Dp=.36,Il={width:Rp,thumbColor:"#000000AA",scrollBarColor:"#FFFFFF60",showScrollBar:!1};function zl(e,t,n){const r=e,{x:a,y:i,w:o,h:s}=n;return r.beginPath(),r.rect(a,i,o,s),r.closePath(),!!r.isPointInPath(t.x,t.y)}function Np(e,t,n){let r=null;const{xThumbRect:a,yThumbRect:i}=n;return a&&zl(e,t,a)?r="X":i&&zl(e,t,i)&&(r="Y"),r}function jp(e){const{sharedStore:t}=e;return{activePoint:t[Ao]||null,prevPoint:t[Tn]||null,activeThumbType:t[Ir]||null,xThumbRect:t[Wa]||null,yThumbRect:t[Ga]||null}}function Lp(e,t){const{width:n,height:r}=t,{offsetTop:a,offsetBottom:i,offsetLeft:o,offsetRight:s}=e,c=Pl*2.5,d=Pl;let u=0,f=0;u=Math.max(c,n-d*2-(Math.abs(o)+Math.abs(s))),u>=n&&(u=n),f=Math.max(c,r-d*2-(Math.abs(a)+Math.abs(i))),f>=r&&(f=r);const h=d,p=n-u-d;let v=h;o>0?v=h:s>0?v=p:o<=0&&u>0&&!(o===0&&s===0)&&(v=h+(n-u)*Math.abs(o)/(Math.abs(o)+Math.abs(s)),v=Math.min(Math.max(0,v-h),n-u));const g=d,m=r-f-d;let b=g;a>0?b=g:i>0?b=m:a<=0&&f>0&&!(a===0&&i===0)&&(b=g+(r-f)*Math.abs(a)/(Math.abs(a)+Math.abs(i)),b=Math.min(Math.max(0,b-g),r-f));const y={x:v,y:r-d,w:u,h:d},S={x:n-d,y:b,w:d,h:f};return{lineSize:d,xSize:u,ySize:f,translateY:b,translateX:v,thumbColor:Il.thumbColor,scrollBarColor:Il.scrollBarColor,xThumbRect:y,yThumbRect:S}}function Rl(e,t){let{x:n,y:r,h:a,w:i}=t;e.save(),e.shadowColor="#FFFFFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=1;{const{color:o,axis:s}=t;s==="X"?(r=r+a/4+0,a=a/2):s==="Y"&&(n=n+i/4+0,i=i/2);let c=t.r;c=Math.min(c,i/2,a/2),(i{const{viewer:t,boardContent:n,sharer:r}=e,{helperContext:a}=n;r.setSharedStorage(Wa,null),r.setSharedStorage(Ga,null);const i=()=>{r.setSharedStorage(Tn,null),r.setSharedStorage(Ao,null),r.setSharedStorage(Ir,null)};i();const o=d=>{const u=r.getSharedStorage(Tn);if(u){const{offsetLeft:f,offsetRight:h}=r.getActiveViewScaleInfo(),{width:p}=r.getActiveViewSizeInfo(),v=-(d.x-u.x),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveX:m}),t.drawFrame()}},s=d=>{const u=r.getSharedStorage(Tn);if(u){const{offsetTop:f,offsetBottom:h}=r.getActiveViewScaleInfo(),{height:p}=r.getActiveViewSizeInfo(),v=-(d.y-u.y),g=p+Math.abs(f)+Math.abs(h),m=v*g/p;t.scroll({moveY:m}),t.drawFrame()}},c=d=>Np(a,d,{xThumbRect:r.getSharedStorage(Wa),yThumbRect:r.getSharedStorage(Ga)});return{name:"@middleware/scroller",wheel:d=>{t.scroll({moveX:0-d.deltaX,moveY:0-d.deltaY}),t.drawFrame()},pointStart:d=>{const{point:u}=d,f=c(u);if(f==="X"||f==="Y")return r.setSharedStorage(Ir,f),r.setSharedStorage(Tn,u),!1},pointMove:d=>{const{point:u}=d,f=r.getSharedStorage(Ir);if(f==="X"||f==="Y")return r.setSharedStorage(Ao,u),f==="X"?o(u):f==="Y"&&s(u),r.setSharedStorage(Tn,u),!1},pointEnd:()=>{const d=r.getSharedStorage(Ir);if(i(),d==="X"||d==="Y")return t.scroll({moveX:0,moveY:0}),t.drawFrame(),!1},beforeDrawFrame({snapshot:d}){const{xThumbRect:u,yThumbRect:f}=Bp(a,{snapshot:d});r.setSharedStorage(Wa,u),r.setSharedStorage(Ga,f)}}},yu="@middleware/scale",Oo=e=>{const{viewer:t,sharer:n,eventHub:r}=e,a=50,i=.05;return{name:"@middleware/scaler",wheelScale(o){const{deltaY:s,point:c}=o,{scale:d}=n.getActiveViewScaleInfo();let u=d;if(s<0?u=d*1.1:s>0&&(u=d*.9),ua)return;const{moveX:f,moveY:h}=t.scale({scale:u,point:c});t.scroll({moveX:f,moveY:h}),t.drawFrame();const p=$e(d);r.trigger(yu,{scale:p})}}},Ne=16,Fp="#FFFFFFA8",Hp="#00000080",wu="#000000",xu="#00000080",Eu="monospace",To=10,Su=100,Dl="#AAAAAA20",Nl="#AAAAAA40",wi=1;function Cu(e){const{scale:t,viewLength:n,viewOffset:r}=e,a=[];let i=10;i=$e(i/t,{decimalPlaces:0}),i=Math.max(10,Math.min(i,1e3));const o=i*10,s=i*5;let c=0;const d=i*t,u=0-r,f=0,h=u%d,p=(u-h+d)/t,v=f+(d-h);for(;v+c*d{e.fillStyle=xu,e.textBaseline="top",e.$setFont({fontWeight:Su,fontSize:To,fontFamily:Eu}),e.fillText(h,s+To,d.position+s)})}}}function Yp(e,t){const{viewSizeInfo:n}=t,{width:r,height:a}=n;e.beginPath(),e.moveTo(0,0),e.lineTo(r+1,0),e.lineTo(r+1,Ne),e.lineTo(Ne,Ne),e.lineTo(Ne,a+1),e.lineTo(0,a+1),e.lineTo(0,0),e.closePath(),e.fillStyle=Fp,e.fill(),e.lineWidth=wi,e.setLineDash([]),e.strokeStyle=Hp,e.stroke()}function Xp(e,t){const{xList:n,yList:r,viewSizeInfo:a}=t,{width:i,height:o}=a;for(let s=0;s{const{boardContent:t,viewer:n,eventHub:r}=e,{helperContext:a,underContext:i}=t;let o=!0,s=!0;const c=d=>{typeof(d==null?void 0:d.show)=="boolean"&&(o=d.show),typeof(d==null?void 0:d.showGrid)=="boolean"&&(s=d.showGrid),(typeof(d==null?void 0:d.show)=="boolean"||typeof(d==null?void 0:d.showGrid)=="boolean")&&n.drawFrame()};return{name:"@middleware/ruler",use(){r.on($o,c)},disuse(){r.off($o,c)},beforeDrawFrame:({snapshot:d})=>{if(o===!0){const u=Nd(d),f=jd(d);Yp(a,{viewScaleInfo:u,viewSizeInfo:f});const h=Wp({viewScaleInfo:u,viewSizeInfo:f});Vp(a,{scaleList:h});const p=Gp({viewScaleInfo:u,viewSizeInfo:f});Up(a,{scaleList:p}),s===!0&&Xp(i,{xList:h,yList:p,viewScaleInfo:u,viewSizeInfo:f})}}}},Zp="DRAG",pa=Symbol(`${Zp}_prevPoint`),Io=e=>{const{eventHub:t,sharer:n,viewer:r}=e;let a=!1;return{name:"@middleware/dragger",hover(){a!==!0&&t.trigger("cursor",{type:"drag-default"})},pointStart(i){const{point:o}=i;n.setSharedStorage(pa,o),a=!0,t.trigger("cursor",{type:"drag-active"})},pointMove(i){const{point:o}=i,s=n.getSharedStorage(pa);if(o&&s){const c=o.x-s.x,d=o.y-s.y;r.scroll({moveX:c,moveY:d}),r.drawFrame()}n.setSharedStorage(pa,o)},pointEnd(){a=!1,n.setSharedStorage(pa,null),t.trigger("cursor",{type:"drag-default"})}}};var Ki=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},_e=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},zo,Oe,Va,ii,Mu;class Kp{constructor(t,n){zo.add(this),Oe.set(this,void 0),Va.set(this,void 0),ii.set(this,void 0);const{devicePixelRatio:r=1,width:a,height:i,createCustomContext2D:o}=n;Ki(this,ii,t,"f");const s=document.createElement("canvas");Ki(this,Va,s,"f"),_e(this,zo,"m",Mu).call(this),t.appendChild(s);const c=yh(s,{width:a,height:i,devicePixelRatio:r,offscreen:!0,createCustomContext2D:o}),d=new gp({boardContent:c,container:t}),u=d.getSharer();u.setActiveViewSizeInfo({width:a,height:i,devicePixelRatio:r,contextWidth:a,contextHeight:i}),Ki(this,Oe,d,"f"),this.resize(u.getActiveViewSizeInfo());const f=d.getEventHub();new wp(t,{eventHub:f})}isDestroyed(){return _e(this,Oe,"f").isDestroyed()}destroy(){_e(this,Oe,"f").destroy(),_e(this,Va,"f").remove()}use(t){_e(this,Oe,"f").use(t)}disuse(t){_e(this,Oe,"f").disuse(t)}setData(t){Fd((t==null?void 0:t.elements)||[]),_e(this,Oe,"f").setData(t)}getData(){return _e(this,Oe,"f").getData()}scale(t){_e(this,Oe,"f").scale(t),_e(this,Oe,"f").getViewer().drawFrame()}resize(t){const n=_e(this,Oe,"f"),a=n.getSharer().getActiveViewSizeInfo();n.resize(Object.assign(Object.assign({},a),t))}clear(){_e(this,Oe,"f").clear()}on(t,n){_e(this,Oe,"f").getEventHub().on(t,n)}off(t,n){_e(this,Oe,"f").getEventHub().off(t,n)}trigger(t,n){_e(this,Oe,"f").getEventHub().trigger(t,n)}getViewInfo(){const n=_e(this,Oe,"f").getSharer(),r=n.getActiveViewSizeInfo(),a=n.getActiveViewScaleInfo();return{viewSizeInfo:r,viewScaleInfo:a}}refresh(){_e(this,Oe,"f").getViewer().drawFrame()}setViewScale(t){_e(this,Oe,"f").updateViewScaleInfo(t)}getLoadItemMap(){return _e(this,Oe,"f").getRenderer().getLoadItemMap()}onBoardWatcherEvents(){_e(this,Oe,"f").onWatcherEvents()}offBoardWatcherEvents(){_e(this,Oe,"f").offWatcherEvents()}}Oe=new WeakMap,Va=new WeakMap,ii=new WeakMap,zo=new WeakSet,Mu=function(){const t=_e(this,ii,"f");t.style.position="relative"};const Qp={enableScroll:!0,enableSelect:!0,enableScale:!0,enableRuler:!0,enableTextEdit:!0,enableDrag:!1};var Jp=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function qp(e){return Jp(this,void 0,void 0,function*(){const{data:t,width:n,height:r,devicePixelRatio:a,viewScaleInfo:i,viewSizeInfo:o,loadItemMap:s}=e;let c=Ca({width:n,height:r,devicePixelRatio:a}),d=new iu({viewContext:c}),u=new au({viewContext:c,calculator:d});u.setLoadItemMap(s),u.drawData(t,{viewScaleInfo:i,viewSizeInfo:o,forceDrawAll:!0});let f=null,h=c.$getOffscreenCanvas();if(h){const p=yield h.convertToBlob();f=window.URL.createObjectURL(p)}return h=null,c=null,d=null,u=null,{blobURL:f,width:n,height:r,devicePixelRatio:a}})}const e3="change",jl={change:e3,ruler:$o,scale:yu,select:Ha,clearSelect:Co,textEdit:ai,textChange:Eo},Se={};Object.keys(jl).forEach(e=>{Object.defineProperty(Se,e,{value:jl[e],writable:!1})});var t3=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})},Qi=function(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},me=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},Ro,be,qn,Au;class n3{constructor(t,n){Ro.add(this),be.set(this,void 0),qn.set(this,void 0);const r=Object.assign(Object.assign({},Qp),n),{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s}=r,c=new Kp(t,{width:a,height:i,devicePixelRatio:o,createCustomContext2D:s});Qi(this,be,c,"f"),Qi(this,qn,r,"f"),me(this,Ro,"m",Au).call(this)}reset(t){const n=me(this,be,"f"),{enableRuler:r,enableScale:a,enableScroll:i,enableSelect:o,enableTextEdit:s,enableDrag:c}=t;i===!0?n.use(_o):i===!1&&n.disuse(_o),o===!0?n.use(Mo):o===!1&&n.disuse(Mo),a===!0?n.use(Oo):a===!1&&n.disuse(Oo),r===!0?n.use(Po):r===!1&&n.disuse(Po),s===!0?n.use(So):s===!1&&n.disuse(So),c===!0?n.use(Io):c===!1&&n.disuse(Io),n.refresh(),Qi(this,qn,Object.assign(Object.assign({},me(this,qn,"f")),t),"f")}setData(t){const n=me(this,be,"f");n.setData(t),n.trigger(Se.change,{data:t,type:"setData"})}getData(t){const n=me(this,be,"f").getData();return n&&(t==null?void 0:t.compact)===!0?Vf(n,{loadItemMap:me(this,be,"f").getLoadItemMap()}):n}getViewInfo(){return me(this,be,"f").getViewInfo()}scale(t){me(this,be,"f").scale(t)}setViewScale(t){const n=me(this,be,"f");n.setViewScale(t),n.refresh()}centerContent(t){const n=(t==null?void 0:t.data)||me(this,be,"f").getData(),{viewSizeInfo:r}=this.getViewInfo();if(Array.isArray(n==null?void 0:n.elements)&&(n==null?void 0:n.elements.length)>0){const a=Uh(n,{viewSizeInfo:r});this.setViewScale(a)}}resize(t){me(this,be,"f").resize(t)}on(t,n){me(this,be,"f").on(t,n)}off(t,n){me(this,be,"f").off(t,n)}trigger(t,n){me(this,be,"f").trigger(t,n)}selectElement(t){this.selectElements([t])}selectElements(t){this.trigger(Se.select,{uuids:t})}selectElementByPosition(t){this.selectElementsByPositions([t])}selectElementsByPositions(t){this.trigger(Se.select,{positions:t})}cancelElements(){this.trigger(Se.select,{uuids:[]})}createElement(t,n){const{viewScaleInfo:r,viewSizeInfo:a}=me(this,be,"f").getViewInfo();return Wh(t,(n==null?void 0:n.element)||{},(n==null?void 0:n.viewCenter)===!0?{viewScaleInfo:r,viewSizeInfo:a}:void 0)}updateElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};Hr(t.uuid,t,r.elements),n.setData(r),n.refresh(),n.trigger(Se.change,{data:r,type:"updateElement"})}addElement(t,n){var r;const a=me(this,be,"f"),i=a.getData()||{elements:[]};if(!n||!(!((r=n==null?void 0:n.position)===null||r===void 0)&&r.length))i.elements.push(t);else if(n!=null&&n.position){const o=[...n==null?void 0:n.position];Qd(t,o,i.elements)}return a.setData(i),a.refresh(),a.trigger(Se.change,{data:i,type:"addElement"}),i}deleteElement(t){const n=me(this,be,"f"),r=n.getData()||{elements:[]};Gh(t,r.elements),n.setData(r),n.refresh(),n.trigger(Se.change,{data:r,type:"deleteElement"})}moveElement(t,n){const r=me(this,be,"f"),a=r.getData()||{elements:[]},i=tn(t,a.elements),{elements:o}=qd(a.elements,{from:i,to:n});a.elements=o,r.setData(a),r.refresh(),r.trigger(Se.change,{data:a,type:"moveElement"})}getImageBlobURL(t){return t3(this,void 0,void 0,function*(){const n=this.getData()||{elements:[]},{devicePixelRatio:r}=t,a=Ch(n.elements),{viewSizeInfo:i}=this.getViewInfo();return yield qp({width:a.w,height:a.h,devicePixelRatio:r,data:n,viewScaleInfo:{scale:1,offsetLeft:-a.x,offsetTop:-a.y,offsetBottom:0,offsetRight:0},viewSizeInfo:Object.assign(Object.assign({},i),{devicePixelRatio:r}),loadItemMap:me(this,be,"f").getLoadItemMap()})})}isDestroyed(){return me(this,be,"f").isDestroyed()}destroy(){me(this,be,"f").destroy()}getViewCenter(){const{viewScaleInfo:t,viewSizeInfo:n}=this.getViewInfo();return Yh({viewScaleInfo:t,viewSizeInfo:n})}$onBoardWatcherEvents(){me(this,be,"f").onBoardWatcherEvents()}$offBoardWatcherEvents(){me(this,be,"f").offBoardWatcherEvents()}}be=new WeakMap,qn=new WeakMap,Ro=new WeakSet,Au=function(){const{enableRuler:t,enableScale:n,enableScroll:r,enableSelect:a,enableTextEdit:i,enableDrag:o}=me(this,qn,"f"),s=me(this,be,"f");r===!0&&s.use(_o),a===!0&&s.use(Mo),n===!0&&s.use(Oo),t===!0&&s.use(Po),i===!0&&s.use(So),o===!0&&s.use(Io)};const r3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}),l.createElement("path",{d:"M921 867L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}))),a3="base-scale-selector",i3=e=>{const{className:t,style:n,defaultValue:r,value:a,onChange:i}=e,{createPrefixName:o}=A.useContext(le),s=o(a3),c=s("menu-item"),d=s("input"),[u,f]=A.useState(100);A.useEffect(()=>{const m=$e(parseFloat(a||"1")*100);f(m)},[a]);const h=m=>{const{key:b}=m;i==null||i(b)},p=m=>{m.stopPropagation()},g={items:[{label:l.createElement("span",{className:c},l.createElement(se,{className:d,size:"small",value:u,suffix:"%",onClick:p,step:1,min:10,max:1e4,controls:!1,onChange:m=>{if(m&&m>0){const b=$e(m/100);i==null||i(`${b}`)}}})),key:"custom"},...[.5,1,2,3].map(m=>({key:`${m}`,label:l.createElement("span",{className:c},`${$e(m*100)}%`)}))],onClick:h,selectedKeys:[`${a||r}`]};return A.useMemo(()=>l.createElement(vi,{className:pe(s(),t),menu:g},l.createElement(Ve,{icon:l.createElement(r3,null),size:"small"},`${$e(parseFloat(a||"1")*100)}%`)),[t,n,r,a,i,u])},o3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M508 512m-112 0a112 112 0 1 0 224 0 112 112 0 1 0-224 0Z"}),l.createElement("path",{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3-7.7 16.2-7.7 35.2 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}))),s3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M942.3 486.4l-0.1-0.1-0.1-0.1c-36.4-76.7-80-138.7-130.7-186L760.7 351c43.7 40.2 81.5 93.7 114.1 160.9C791.5 684.2 673.4 766 512 766c-51.3 0-98.3-8.3-141.2-25.1l-54.7 54.7C374.6 823.8 439.8 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0.1-51.3zM878.3 154.2l-42.4-42.4c-3.1-3.1-8.2-3.1-11.3 0L707.8 228.5C649.4 200.2 584.2 186 512 186c-192.2 0-335.4 100.5-430.2 300.3v0.1c-7.7 16.2-7.7 35.2 0 51.5 36.4 76.7 80 138.7 130.7 186.1L111.8 824.5c-3.1 3.1-3.1 8.2 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0l712.8-712.8c3.1-3 3.1-8.1 0-11.2zM398.9 537.4c-1.9-8.2-2.9-16.7-2.9-25.4 0-61.9 50.1-112 112-112 8.7 0 17.3 1 25.4 2.9L398.9 537.4z m184.5-184.5C560.5 342.1 535 336 508 336c-97.2 0-176 78.8-176 176 0 27 6.1 52.5 16.9 75.4L263.3 673c-43.7-40.2-81.5-93.7-114.1-160.9C232.6 339.8 350.7 258 512 258c51.3 0 98.3 8.3 141.2 25.1l-69.8 69.8z"}),l.createElement("path",{d:"M508 624c-6.4 0-12.7-0.5-18.8-1.6l-51.1 51.1c21.4 9.3 45.1 14.4 69.9 14.4 97.2 0 176-78.8 176-176 0-24.8-5.1-48.5-14.4-69.9l-51.1 51.1c1 6.1 1.6 12.4 1.6 18.8C620 573.9 569.9 624 508 624z"}))),_u=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32z m-40 728H184V184h656v656z"}))),Ou=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Tu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M853.333333 170.666667H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666666v128a42.666667 42.666667 0 0 0 85.333333 0V256h256v554.666667H384a42.666667 42.666667 0 0 0 0 85.333333h256a42.666667 42.666667 0 0 0 0-85.333333h-85.333333V256h256v85.333333a42.666667 42.666667 0 0 0 85.333333 0V213.333333a42.666667 42.666667 0 0 0-42.666667-42.666666z"}))),$u=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M0.00592 521.157814v-103.646801l430.267025 235.101281c36.191582 13.567843 70.207188 15.615819 111.870706 0.191998l440.986902-258.365013v103.614802l-435.386966 258.877007c-42.175512 18.303788-91.326944 18.303788-126.398539 0L0.00592 521.157814z"}),l.createElement("path",{d:"M0.00592 743.651242v-104.798789l406.427301 221.43744c17.2798 9.439891 40.511532 17.599797 65.119247 20.383764h27.999676c32.511624-5.023942 47.103455-10.207882 67.615218-22.943735l415.931191-258.173014v98.974855l-430.875018 268.95689c-42.111513 17.439798-95.806892 18.079791-130.878487 0.575994L0.00592 743.619242zM20.069688 246.024995L399.073306 20.971598c41.279523-26.303696 90.430954-27.967677 133.342458-4.35195l421.083131 198.621703c35.743587 17.599797 37.18357 61.311291 2.655969 81.151062l-414.043212 226.205384a165.758083 165.758083 0 0 1-133.374458 4.415949L22.725657 327.208057C9.157814 318.664155 0.90191 303.56033 0.229917 285.000545c-0.607993-18.911781 10.719876-32.159628 19.807771-38.94355z"})," ")),Pu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9 0.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-0.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"}))),Iu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32z m-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792z m0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z"}),l.createElement("path",{d:"M304 456c48.6 0 88-39.4 88-88s-39.4-88-88-88-88 39.4-88 88 39.4 88 88 88z m0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}))),l3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M256 682.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0zM768 170.666667a85.333333 85.333333 0 1 0 0 170.666666 85.333333 85.333333 0 0 0 0-170.666666z m-170.666667 85.333333a170.666667 170.666667 0 1 1 341.333334 0 170.666667 170.666667 0 0 1-341.333334 0z"}),l.createElement("path",{d:"M707.84 316.16a42.666667 42.666667 0 0 1 0 60.330667l-331.178667 331.178666a42.666667 42.666667 0 0 1-60.330666-60.330666l331.178666-331.178667a42.666667 42.666667 0 0 1 60.330667 0z"}))),zu=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M145 96l66 746.6L511.8 928l299.6-85.4L878.7 96H145z m610.9 700.6l-244.1 69.6-245.2-69.6-56.7-641.2h603.8l-57.8 641.2z"}),l.createElement("path",{d:"M281 249l1.7 24.3 22.7 253.5h206.5v-0.1h112.9l-11.4 118.5L511 672.9v0.2h-0.8l-102.4-27.7-6.5-73.2h-91l11.3 144.7 188.6 52h1.7v-0.4l187.7-51.7 1.7-16.3 21.2-242.2 3.2-24.3H511v0.2H389.9l-8.2-94.2h352.1l1.7-19.5 4.8-47.2L742 249H511z"}))),c3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-0.7 5.2-2L869 536.2c14.7-12.8 14.7-35.6 0-48.4z"}))),d3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}),l.createElement("path",{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}))),Ut="node",u3=e=>{const{className:t,style:n,type:r,uuid:a,nodeKey:i,title:o,position:s,generateClassName:c,onTitleChange:d,onOperationToggle:u,onDelete:f,onSelect:h,onGoToGroup:p,operations:v,isSelected:g}=e,[m,b]=A.useState(!1),[y,S]=A.useState(!1),x=A.useRef(o),C=c(Ut),E=c(Ut,"icon"),j=c(Ut,"title"),z=c(Ut,"title","input"),k=c(Ut,"title","icon"),F=c(Ut,"action"),U=c(Ut,"selected"),L=A.useRef(0),O=A.useRef(null);A.useEffect(()=>{var H;m===!0&&((H=O.current)===null||H===void 0||H.focus())},[m]);const $=H=>{b(!1),d==null||d({uuid:i,value:H.target.value||""})},R=H=>{x.current=H.target.value||""},G=H=>{var _;H.code==="Enter"&&(b(!1),d==null||d({uuid:i,value:((_=H==null?void 0:H.target)===null||_===void 0?void 0:_.value)||""}))},N=H=>{H.stopPropagation(),H.preventDefault()},D=H=>{H.stopPropagation(),S(!0)},w=H=>{H.stopPropagation(),S(!1)},P=H=>{const _=Date.now(),T=_-L.current;L.current=_,h==null||h({uuids:[a],positions:[s]}),T<=300&&T>0&&(H.stopPropagation(),H.preventDefault(),b(!0))},V=H=>{H.stopPropagation(),H.preventDefault(),f==null||f({uuid:i})},M=H=>{H.stopPropagation(),H.preventDefault(),u==null||u({uuid:i,operations:{invisible:!v.invisible}})},Y=H=>{H.stopPropagation(),H.preventDefault(),p==null||p({uuid:a,position:s})};return A.useMemo(()=>{x.current=o;function H(_){return _==="rect"?l.createElement(_u,{className:k}):_==="circle"?l.createElement(Ou,{className:k}):_==="text"?l.createElement(Tu,{className:k}):_==="path"?l.createElement(l3,{className:k}):_==="image"?l.createElement(Iu,{className:k}):_==="svg"?l.createElement(Pu,{className:k}):_==="group"?l.createElement($u,{className:k}):_==="html"?l.createElement(zu,{className:k}):l.createElement("span",{className:k})}return l.createElement("span",{key:i,style:n,className:pe(C,t,g?U:null),onClick:P,onMouseOver:D,onMouseLeave:w},l.createElement("span",{className:j},H(r),l.createElement("span",null,o)),y&&l.createElement("span",{className:F},r==="group"&&l.createElement(c3,{className:E,onClick:Y}),v.invisible?l.createElement(s3,{className:E,onClick:M}):l.createElement(o3,{className:E,onClick:M}),l.createElement(d3,{className:E,onClick:V})),m&&l.createElement("span",{className:z},l.createElement(Jt,{ref:O,size:"small",defaultValue:o,onBlur:$,onClick:N,onKeyDown:G,onChange:R})))},[i,o,m,r,y,v,g])};function f3(e,t){const n=[],{position:r}=t;if(Array.isArray(e)){const a=[...r];e.forEach((i,o)=>{a.push(o),n.push(Ru(i,Object.assign(Object.assign({},t),{position:[...a]}))),a.pop()})}return n}const Ru=(e,t)=>{const{onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,position:s,selectedKeys:c}=t,d={key:e.key,title:l.createElement(u3,{uuid:e.key,title:e.title,position:s,operations:e.operations,nodeKey:e.key,type:e.type,generateClassName:t.generateClassName,onTitleChange:n,onOperationToggle:r,onDelete:a,onSelect:i,onGoToGroup:o,isSelected:c==null?void 0:c.includes(e.key)}),children:[]};if(Array.isArray(e.children)){const u=[...s];e.children.forEach((f,h)=>{u.push(h),d.children.push(Ru(f,Object.assign(Object.assign({},t),{position:[...u]}))),u.pop()})}return d},h3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"}),l.createElement("path",{d:"M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8C574.1 404.4 544.1 392 512 392z"}))),p3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M264 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM760 654c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),g3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M120 230h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM120 654h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),v3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M904 158H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 582H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 794H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM904 370H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),m3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}))),b3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333zM128 469.333333v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM128 640v85.333333h85.333333v-85.333333z m0-341.333333v85.333333h85.333333v-85.333333z m341.333333 341.333333v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128zM128 810.666667v85.333333h768v-85.333333z"}))),y3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M592 928H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96zM976 0H784a48 48 0 1 0 0 96h144v144.016a48 48 0 1 0 96 0V48a48 48 0 0 0-48-48zM240 928H96v-144a48 48 0 1 0-96 0v192a48 48 0 0 0 48 48h192a48 48 0 1 0 0-96zM48 640a48 48 0 0 0 48-48V432a48 48 0 1 0-96 0v160a48 48 0 0 0 48 48zM240 0H48a48 48 0 0 0-48 48v192a48 48 0 1 0 96 0V96h144a48 48 0 1 0 0-96z m784 592V432a48 48 0 1 0-96 0v160a48 48 0 1 0 96 0zM592 0H432a48 48 0 1 0 0 96h160a48 48 0 1 0 0-96z m384 736a48 48 0 0 0-48 48v144h-144a48 48 0 1 0 0 96h192a48 48 0 0 0 48-48V784a48 48 0 0 0-48-48z"}))),w3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M554.666667 469.333333v85.333334h-85.333334v-85.333334z m85.333333 0v85.333334h85.333333v-85.333334z m170.666667 0v85.333334h85.333333v-85.333334z m0 170.666667v85.333333h85.333333v-85.333333z m-512-170.666667v85.333334h85.333333v-85.333334z m170.666666-341.333333v85.333333h85.333334V128z m170.666667 0v85.333333h85.333333V128z m170.666667 0v85.333333h85.333333V128z m0 170.666667v85.333333h85.333333v-85.333333zM469.333333 640v85.333333h85.333334v-85.333333z m0-341.333333v85.333333h85.333334v-85.333333zM128 128v768h85.333333V128z m170.666667 0v85.333333h85.333333V128z m170.666666 682.666667v85.333333h85.333334v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m170.666667 0v85.333333h85.333333v-85.333333z m-512 0v85.333333h85.333333v-85.333333z"}))),x3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333zM128 213.333333h85.333333V128H128v85.333333z m170.666667 0h85.333333V128h-85.333333v85.333333z m0 341.333334h85.333333v-85.333334h-85.333333v85.333334zM128 896h85.333333v-85.333333H128v85.333333z m341.333333 0h85.333334v-85.333333h-85.333334v85.333333zM128 554.666667h85.333333v-85.333334H128v85.333334z m0 170.666666h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m170.666667-170.666666h85.333333v-85.333334h-85.333333v85.333334z m170.666667-426.666667v768h85.333333V128h-85.333333z m-170.666667 768h85.333333v-85.333333h-85.333333v85.333333z m0-682.666667h85.333333V128h-85.333333v85.333333z m-170.666667 341.333334h85.333334v-85.333334h-85.333334v85.333334z m0-341.333334h85.333334V128h-85.333334v85.333333z m0 170.666667h85.333334v-85.333333h-85.333334v85.333333z"}))),E3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M298.666667 896h85.333333v-85.333333h-85.333333v85.333333z m0-341.333333h85.333333v-85.333334h-85.333333v85.333334z m170.666666 0h85.333334v-85.333334h-85.333334v85.333334z m0 341.333333h85.333334v-85.333333h-85.333334v85.333333zM128 725.333333h85.333333v-85.333333H128v85.333333z m0 170.666667h85.333333v-85.333333H128v85.333333z m0-341.333333h85.333333v-85.333334H128v85.333334z m0-170.666667h85.333333v-85.333333H128v85.333333z m341.333333 341.333333h85.333334v-85.333333h-85.333334v85.333333z m341.333334-341.333333h85.333333v-85.333333h-85.333333v85.333333z m0 170.666667h85.333333v-85.333334h-85.333333v85.333334zM128 128v85.333333h768V128H128z m682.666667 597.333333h85.333333v-85.333333h-85.333333v85.333333z m-170.666667 170.666667h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-512h85.333334v-85.333333h-85.333334v85.333333z m341.333334 512h85.333333v-85.333333h-85.333333v85.333333z m-170.666667-341.333333h85.333333v-85.333334h-85.333333v85.333334z"}))),S3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M341.333333 512a42.666667 42.666667 0 0 0 42.666667 42.666667h256a42.666667 42.666667 0 0 0 0-85.333334H384a42.666667 42.666667 0 0 0-42.666667 42.666667z"}),l.createElement("path",{d:"M384 682.666667H307.626667A176.213333 176.213333 0 0 1 128 527.786667 170.666667 170.666667 0 0 1 298.666667 341.333333h85.333333a42.666667 42.666667 0 0 0 0-85.333333H307.626667a262.4 262.4 0 0 0-262.826667 222.293333A256 256 0 0 0 298.666667 768h85.333333a42.666667 42.666667 0 0 0 0-85.333333zM981.333333 479.573333A262.826667 262.826667 0 0 0 715.093333 256h-64.426666C616.106667 256 597.333333 275.2 597.333333 298.666667a42.666667 42.666667 0 0 0 42.666667 42.666666h76.373333A176.213333 176.213333 0 0 1 896 496.213333 170.666667 170.666667 0 0 1 725.333333 682.666667h-85.333333a42.666667 42.666667 0 0 0 0 85.333333h85.333333a256 256 0 0 0 256-288.426667z"}))),C3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M712 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM136 374h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM136 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM540 824H358c-87.3 0-158-70.7-158-158V484c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v182c0 127 103 230 230 230h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),M3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM310 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM484 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM658 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 476h-56c-4.4 0-8 3.6-8 8v182c0 87.3-70.7 158-158 158H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c127 0 230-103 230-230V484c0-4.4-3.6-8-8-8z"}))),A3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M656 200h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 128H358c-127 0-230 103-230 230v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-87.3 70.7-158 158-158h182c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}))),_3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M368 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM366 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM888 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 128h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 302h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 476h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 650h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM192 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM540 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM714 824h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM666 128H484c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h182c87.3 0 158 70.7 158 158v182c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V358c0-127-103-230-230-230z"}))),Ll=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M896 810.666667v85.333333h-85.333333v-85.333333h85.333333z m-170.666667 0v85.333333h-85.333333v-85.333333h85.333333z m-170.666666 0v85.333333h-85.333334v-85.333333h85.333334z m-170.666667 0v85.333333H298.666667v-85.333333h85.333333z m-170.666667 0v85.333333H128v-85.333333h85.333333z m682.666667-170.666667v85.333333h-85.333333v-85.333333h85.333333zM213.333333 640v85.333333H128v-85.333333h85.333333z m0-170.666667v85.333334H128v-85.333334h85.333333z m469.333334-341.333333a213.418667 213.418667 0 0 1 213.12 204.074667L896 341.333333v213.333334h-85.333333V341.333333a128.426667 128.426667 0 0 0-120.490667-127.786666L682.666667 213.333333h-213.333334V128h213.333334zM213.333333 298.666667v85.333333H128V298.666667h85.333333z m0-170.666667v85.333333H128V128h85.333333z m170.666667 0v85.333333H298.666667V128h85.333333z"}))),O3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72z"}),l.createElement("path",{d:"M864 256H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}))),T3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M510.762667 970.666667A458.666667 458.666667 0 1 1 969.429333 512a459.178667 459.178667 0 0 1-458.666666 458.666667z m0-853.333334a394.666667 394.666667 0 1 0 394.666666 394.666667 395.093333 395.093333 0 0 0-394.666666-394.666667z"}),l.createElement("path",{d:"M512 724.48A212.48 212.48 0 1 1 724.48 512 212.736 212.736 0 0 1 512 724.48z m0-360.96A148.48 148.48 0 1 0 660.48 512 148.608 148.608 0 0 0 512 363.52z"}))),$3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M272.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512z"}),l.createElement("path",{d:"M576.9 512l265.4-339.1c4.1-5.2 0.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3c-9.1 11.6-9.1 27.9 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}))),Du=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z"}))),P3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M841.065412 337.317647v352.015059c0 46.802824-23.070118 74.752-39.936 95.111529-14.095059 17.106824-21.443765 26.684235-21.443765 41.803294V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-107.39953c0-37.526588 19.576471-61.199059 35.297882-80.173176 14.576941-17.648941 26.142118-31.563294 26.142118-56.681412V337.317647c0-18.793412-16.143059-36.502588-33.189647-36.502588-19.817412 0-24.033882 3.072-24.214588 3.19247-3.975529 5.360941-3.855059 34.273882-3.794824 57.584942 0.060235 11.384471 0.120471 24.094118-0.12047 38.068705-0.240941 16.504471-12.830118 28.792471-30.358589 29.696a30.117647 30.117647 0 0 1-29.876706-30.117647v-127.698823c0-18.492235-13.372235-32.406588-31.081411-32.406588-16.263529 0-28.190118 12.107294-29.635765 29.394823v120.651294a30.117647 30.117647 0 0 1-60.235294 0V268.047059l-0.120471-0.602353v-46.561882c0-3.975529-0.843294-38.671059-28.551529-38.671059-27.105882 0-31.201882 24.214588-31.201883 38.671059v42.345411c0 1.686588-0.662588 3.252706-0.963764 4.879059v156.250353a30.117647 30.117647 0 0 1-60.235294 0V262.686118c-2.891294-11.685647-11.324235-23.491765-28.069647-23.491765-17.227294 0-31.744 15.721412-31.744 34.334118v201.788235c0 0.421647-0.361412 0.783059-0.361412 1.204706v66.319059a30.117647 30.117647 0 0 1-60.235294 0v-50.236236c-10.601412-3.855059-25.961412-6.987294-34.755765-4.999529-7.107765 1.385412-14.275765 7.649882-18.733176 16.323765a43.309176 43.309176 0 0 0-0.542118 38.369882L345.148235 766.192941a31.563294 31.563294 0 0 1 2.108236 6.505412 32.888471 32.888471 0 0 0 35.418353 25.961412 30.238118 30.238118 0 0 1 33.310117 29.936941V933.647059a30.117647 30.117647 0 0 1-60.235294 0v-77.462588a92.521412 92.521412 0 0 1-66.680471-67.764706L187.934118 567.055059a104.448 104.448 0 0 1 1.927529-90.774588c12.890353-24.877176 35.418353-42.706824 60.295529-47.766589 12.649412-2.590118 29.756235-1.867294 46.682353 1.566118v-43.369412c0-0.602353 0.301176-1.144471 0.361412-1.746823v-111.435294c0-52.163765 41.321412-94.569412 91.979294-94.569412 12.047059 0 23.612235 2.409412 34.093177 6.746353 11.986824-38.791529 44.152471-63.668706 86.317176-63.668706 40.237176 0 71.800471 25.419294 83.666824 63.909647 10.721882-4.517647 22.467765-6.987294 34.876235-6.987294 41.502118 0 75.776 26.744471 87.160471 64.572235 11.023059-2.409412 22.226824-2.951529 32.286117-2.951529 50.718118 0 93.485176 44.272941 93.485177 96.737882z"}))),I3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M170.666667 298.666667a42.666667 42.666667 0 1 1-85.333334 0V256a170.666667 170.666667 0 0 1 170.666667-170.666667h42.666667a42.666667 42.666667 0 1 1 0 85.333334H256a85.333333 85.333333 0 0 0-85.333333 85.333333v42.666667z m554.666666-128a42.666667 42.666667 0 0 1 0-85.333334h42.666667a170.666667 170.666667 0 0 1 170.666667 170.666667v42.666667a42.666667 42.666667 0 0 1-85.333334 0V256a85.333333 85.333333 0 0 0-85.333333-85.333333h-42.666667z m128 554.666666a42.666667 42.666667 0 0 1 85.333334 0v42.666667a170.666667 170.666667 0 0 1-170.666667 170.666667h-42.666667a42.666667 42.666667 0 0 1 0-85.333334h42.666667a85.333333 85.333333 0 0 0 85.333333-85.333333v-42.666667zM298.666667 853.333333a42.666667 42.666667 0 0 1 0 85.333334H256a170.666667 170.666667 0 0 1-170.666667-170.666667v-42.666667a42.666667 42.666667 0 0 1 85.333334 0v42.666667a85.333333 85.333333 0 0 0 85.333333 85.333333h42.666667z"}))),z3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M118.979048 637.074286l137.99619 66.243047 255.171048 123.587048 246.076952-119.222857 147.163429-70.485334a73.142857 73.142857 0 0 1-34.230857 97.109334l-327.119239 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 734.305524A73.142857 73.142857 0 0 1 118.979048 637.074286z m786.090666-153.063619a73.142857 73.142857 0 0 1-33.913904 97.767619L544.01219 740.205714a73.142857 73.142857 0 0 1-63.780571 0L153.136762 581.778286A73.142857 73.142857 0 0 1 117.51619 487.862857l362.300953 170.886095 32.329143 15.652572 327.119238-158.427429 65.80419-31.939047zM544.036571 139.190857l327.094858 158.403048a73.142857 73.142857 0 0 1 0 131.657143l-327.094858 158.427428a73.142857 73.142857 0 0 1-63.780571 0L153.136762 429.251048a73.142857 73.142857 0 0 1 0-131.657143L480.256 139.215238a73.142857 73.142857 0 0 1 63.780571 0z m-31.890285 65.828572L185.027048 363.422476l327.119238 158.427429 327.119238-158.427429L512.146286 205.04381z"}))),R3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8c-16.4 12.8-16.4 37.5 0 50.3l450.8 352.1c5.3 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}))),D3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 42.666667a469.333333 469.333333 0 1 0 469.333333 469.333333A469.333333 469.333333 0 0 0 512 42.666667z m0 864a394.666667 394.666667 0 1 1 394.666667-394.666667 395.146667 395.146667 0 0 1-394.666667 394.666667z"}),l.createElement("path",{d:"M304.906667 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}),l.createElement("path",{d:"M512 512m-66.666667 0a66.666667 66.666667 0 1 0 133.333334 0 66.666667 66.666667 0 1 0-133.333334 0Z"}),l.createElement("path",{d:"M719.093333 512m-66.666666 0a66.666667 66.666667 0 1 0 133.333333 0 66.666667 66.666667 0 1 0-133.333333 0Z"}))),N3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M935.253333 111.786667a42.666667 42.666667 0 0 0-23.04-23.04A42.666667 42.666667 0 0 0 896 85.333333h-256a42.666667 42.666667 0 0 0 0 85.333334h153.173333L170.666667 793.173333V640a42.666667 42.666667 0 0 0-85.333334 0v256a42.666667 42.666667 0 0 0 3.413334 16.213333 42.666667 42.666667 0 0 0 23.04 23.04A42.666667 42.666667 0 0 0 128 938.666667h256a42.666667 42.666667 0 0 0 0-85.333334H230.826667L853.333333 230.826667V384a42.666667 42.666667 0 0 0 85.333334 0V128a42.666667 42.666667 0 0 0-3.413334-16.213333z"}))),j3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M128 128h64v389.312A384.32 384.32 0 0 1 506.688 832H896v64H192a64 64 0 0 1-64-64V128z m313.6 704A320.384 320.384 0 0 0 192 582.4V832h249.6z"}))),L3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M929.19 352.19c3.12 3.12 3.12 8.19 0 11.31L363.51 929.19c-3.12 3.12-8.19 3.12-11.31 0L94.81 671.81c-3.12-3.12-3.12-8.19 0-11.31L660.49 94.81c3.12-3.12 8.19-3.12 11.31 0l257.39 257.38z m-424.26 5.66l108.89 108.89c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0L456.85 405.93l-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-62.23 62.23 161.22 161.22 469.52-469.52-161.23-161.21-62.23 62.23 62.23 62.23c3.12 3.12 3.12 8.19 0 11.31l-36.77 36.77c-3.12 3.12-8.19 3.12-11.31 0l-62.23-62.23-50.91 50.91z"}))),k3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M725.333333 341.333333a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666666a42.666667 42.666667 0 1 0 42.666667 42.666666 42.666667 42.666667 0 0 0-42.666667-42.666666z"}),l.createElement("path",{d:"M640 256H85.333333a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM938.666667 256h-128a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333zM512 640a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666667 42.666667 42.666667 42.666667 0 0 0-42.666667-42.666667z"}),l.createElement("path",{d:"M426.666667 554.666667H85.333333a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM938.666667 554.666667h-341.333334a42.666667 42.666667 0 0 1 0-85.333334h341.333334a42.666667 42.666667 0 0 1 0 85.333334zM298.666667 938.666667a128 128 0 1 1 128-128 128 128 0 0 1-128 128z m0-170.666667a42.666667 42.666667 0 1 0 42.666666 42.666667 42.666667 42.666667 0 0 0-42.666666-42.666667z"}),l.createElement("path",{d:"M938.666667 853.333333H384a42.666667 42.666667 0 0 1 0-85.333333h554.666667a42.666667 42.666667 0 0 1 0 85.333333zM213.333333 853.333333H85.333333a42.666667 42.666667 0 0 1 0-85.333333h128a42.666667 42.666667 0 0 1 0 85.333333z"}))),B3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M802.742857 777.485714c49.942857 0 90.742857-41.371429 90.742857-92 0-61.142857-90.742857-160.914286-90.742857-160.914285S712 624.342857 712 685.485714c0 50.628571 40.8 92 90.742857 92z m-430.971428-50.4c8.114286 8.114286 21.257143 8.114286 29.257142 0l292.685715-292.571428c8.114286-8.114286 8.114286-21.257143 0-29.257143l-292.571429-292.571429c-0.685714-0.685714-1.485714-1.371429-2.285714-1.942857l-89.371429-89.371428a10.411429 10.411429 0 0 0-14.628571 0l-54.857143 54.857142a10.411429 10.411429 0 0 0 0 14.628572l76.8 76.8-237.485714 237.6c-8.114286 8.114286-8.114286 21.257143 0 29.257143l292.457143 292.571428z m14.742857-512.685714l204.457143 204.457143H182.171429l204.342857-204.457143zM960 859.428571H64c-5.028571 0-9.142857 4.114286-9.142857 9.142858v91.428571c0 5.028571 4.114286 9.142857 9.142857 9.142857h896c5.028571 0 9.142857-4.114286 9.142857-9.142857v-91.428571c0-5.028571-4.114286-9.142857-9.142857-9.142858z"}))),F3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 780H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM505.7 669c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V176c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}))),H3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 474H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM506.3 399.3c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7 0.4-11.7-5.7-11.7H550V104c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v156h-62.8c-6 0-9.4 7-5.7 11.7l100.8 127.6zM517.7 624.7c-2.9-3.7-8.5-3.7-11.3 0L405.6 752.3c-3.7 4.7-0.4 11.7 5.7 11.7H474v156c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V764h62.8c6 0 9.4-7 5.7-11.7L517.7 624.7z"}))),W3=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355c-3.2-4.1-9.4-4.1-12.6 0l-112 141.7c-4.1 5.2-0.4 12.9 6.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"}))),{DirectoryTree:G3}=ff,V3="base-element-tree",Ji=e=>{const t=e.split("-").map(n=>parseInt(n));return t.shift(),t},U3=l.forwardRef((e,t)=>{const{height:n,className:r,style:a,treeData:i,onTitleChange:o,onOperationToggle:s,onSelect:c,selectedKeys:d,onDrop:u,defaultExpandedKeys:f,expandedKeys:h,onDelete:p,onExpand:v,onGoToGroup:g}=e,{createPrefixName:m}=A.useContext(le),b=m(V3),y=(x,C)=>{const j=[Ji(C.node.pos)],z=[x[0]];c==null||c({uuids:z,positions:j})},S=({uuid:x})=>{p==null||p({uuid:x})};return A.useMemo(()=>{const x=f3(i||[],{generateClassName:b,onTitleChange:o,onOperationToggle:s,onDelete:S,onGoToGroup:g,position:[],selectedKeys:d||[]});return l.createElement(G3,{ref:t,height:n,style:a,className:pe(b(),r),showLine:!0,blockNode:!0,multiple:!0,selectedKeys:d,switcherIcon:l.createElement(Du,null),icon:null,onSelect:y,treeData:x,defaultExpandedKeys:f,expandedKeys:h,onExpand:v,draggable:{icon:!1,nodeDraggable:()=>!0},onDrop:C=>{const{dragNode:E,node:j,dropToGap:z,dropPosition:k}=C,F=Ji(E.pos),U=Ji(j.pos);z===!0&&k>=0?U[U.length-1]=k:j.dragOverGapBottom===!0?U[U.length-1]=U[U.length-1]+1:j.dragOverGapTop===!0?U[U.length-1]=Math.max(0,U[U.length-1]-1):j.dragOver===!0&&U.push(0),u==null||u({from:F,to:U})}})},[r,a,y,i,d])});var Y3=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a{const{value:t,onChange:n}=e,r=Y3(e,["value","onChange"]),a=o=>{n==null||n(o)},i=()=>{a(!t)};return l.createElement(Ve,Object.assign({},r,{type:t?"primary":"default",onClick:i}))},Z3="ElementDetail",ln=()=>{const[e]=wf(Z3);return e},K3="base-element-basic-attribute",Nt=e=>At.number(e*1)?$e(e*1):e,kl=e=>{if(At.number(e*1)){const t=$e(e*1);return ht(t)}return e},Q3=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,o=A.useRef(null),{createPrefixName:s}=A.useContext(le),c=s(K3),d=c(),u=c("row"),f=c("col"),h=c("input"),p=c("form-item"),v=ln(),g=m=>{var b;((b=r==null?void 0:r.operations)===null||b===void 0?void 0:b.limitRatio)===!0&&(m!=null&&m.hasOwnProperty("w")?m.h=$e(m.w/r.w*r.h):m!=null&&m.hasOwnProperty("h")&&(m.w=$e(m.h/r.h*r.w))),a==null||a(m)};return A.useEffect(()=>{var m;const{type:b,x:y,y:S,w:x,h:C,angle:E=0,operations:j={}}=r||{},z={x:y,y:S,w:x,h:C,angle:E,operations:{limitRatio:j.limitRatio}};b==="group"&&(z.operations.deepResize=j.deepResize),(m=o.current)===null||m===void 0||m.setFieldsValue(z)},[r]),A.useMemo(()=>l.createElement(J,{ref:o,style:n,className:pe(d,t),onValuesChange:g},l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"x"},l.createElement(se,{className:h,size:"small",placeholder:"X",prefix:"X",disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"y"},l.createElement(se,{className:h,size:"small",placeholder:"Y",prefix:"Y",disabled:i,formatter:Nt,parser:Nt})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"w"},l.createElement(se,{className:h,size:"small",placeholder:"Width",prefix:v.w,disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"h"},l.createElement(se,{className:h,size:"small",placeholder:"Height",prefix:v.h,disabled:i,formatter:Nt,parser:Nt}))),l.createElement(Q,{span:4,className:f},l.createElement(J.Item,{className:p,name:["operations","limitRatio"]},l.createElement(X3,{icon:l.createElement(S3,null),size:"small",disabled:i})))),l.createElement(he,{className:u},l.createElement(Q,{span:10,className:f},l.createElement(J.Item,{className:p,name:"angle"},l.createElement(se,{className:h,size:"small",placeholder:"Angle",prefix:l.createElement(j3,{style:{fontSize:14}}),disabled:i,formatter:kl,parser:kl,suffix:"°"})))),(r==null?void 0:r.type)==="group"&&l.createElement(he,{className:u},l.createElement(Q,{span:18,className:f},v.deepResizeInGroup),l.createElement(Q,{span:6,className:f},l.createElement(J.Item,{className:p,name:["operations","deepResize"]},l.createElement(_d,{size:"small"}))))),[v,i,r])};var Qe={},Yr={},J3=typeof ra=="object"&&ra&&ra.Object===Object&&ra,Nu=J3,q3=Nu,eg=typeof self=="object"&&self&&self.Object===Object&&self,tg=q3||eg||Function("return this")(),mt=tg,ng=mt,rg=ng.Symbol,Xr=rg,Bl=Xr,ju=Object.prototype,ag=ju.hasOwnProperty,ig=ju.toString,Sr=Bl?Bl.toStringTag:void 0;function og(e){var t=ag.call(e,Sr),n=e[Sr];try{e[Sr]=void 0;var r=!0}catch{}var a=ig.call(e);return r&&(t?e[Sr]=n:delete e[Sr]),a}var sg=og,lg=Object.prototype,cg=lg.toString;function dg(e){return cg.call(e)}var ug=dg,Fl=Xr,fg=sg,hg=ug,pg="[object Null]",gg="[object Undefined]",Hl=Fl?Fl.toStringTag:void 0;function vg(e){return e==null?e===void 0?gg:pg:Hl&&Hl in Object(e)?fg(e):hg(e)}var cn=vg,mg=Array.isArray,ct=mg;function bg(e){return e!=null&&typeof e=="object"}var Ot=bg,yg=cn,wg=ct,xg=Ot,Eg="[object String]";function Sg(e){return typeof e=="string"||!wg(e)&&xg(e)&&yg(e)==Eg}var Cg=Sg;function Mg(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++a];if(n(i[c],c,i)===!1)break}return t}}var Ag=Mg,_g=Ag,Og=_g(),Tg=Og;function $g(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ug}var ts=Yg,Xg=cn,Zg=ts,Kg=Ot,Qg="[object Arguments]",Jg="[object Array]",qg="[object Boolean]",ev="[object Date]",tv="[object Error]",nv="[object Function]",rv="[object Map]",av="[object Number]",iv="[object Object]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",cv="[object WeakMap]",dv="[object ArrayBuffer]",uv="[object DataView]",fv="[object Float32Array]",hv="[object Float64Array]",pv="[object Int8Array]",gv="[object Int16Array]",vv="[object Int32Array]",mv="[object Uint8Array]",bv="[object Uint8ClampedArray]",yv="[object Uint16Array]",wv="[object Uint32Array]",xe={};xe[fv]=xe[hv]=xe[pv]=xe[gv]=xe[vv]=xe[mv]=xe[bv]=xe[yv]=xe[wv]=!0;xe[Qg]=xe[Jg]=xe[dv]=xe[qg]=xe[uv]=xe[ev]=xe[tv]=xe[nv]=xe[rv]=xe[av]=xe[iv]=xe[ov]=xe[sv]=xe[lv]=xe[cv]=!1;function xv(e){return Kg(e)&&Zg(e.length)&&!!xe[Xg(e)]}var Ev=xv;function Sv(e){return function(t){return e(t)}}var ns=Sv,si={exports:{}};si.exports;(function(e,t){var n=Nu,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,s=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(si,si.exports);var rs=si.exports,Cv=Ev,Mv=ns,Gl=rs,Vl=Gl&&Gl.isTypedArray,Av=Vl?Mv(Vl):Cv,Fu=Av,_v=Pg,Ov=ku,Tv=ct,$v=es,Pv=Bu,Iv=Fu,zv=Object.prototype,Rv=zv.hasOwnProperty;function Dv(e,t){var n=Tv(e),r=!n&&Ov(e),a=!n&&!r&&$v(e),i=!n&&!r&&!a&&Iv(e),o=n||r||a||i,s=o?_v(e.length,String):[],c=s.length;for(var d in e)(t||Rv.call(e,d))&&!(o&&(d=="length"||a&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Pv(d,c)))&&s.push(d);return s}var Hu=Dv,Nv=Object.prototype;function jv(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Nv;return e===n}var as=jv;function Lv(e,t){return function(n){return e(t(n))}}var Wu=Lv,kv=Wu,Bv=kv(Object.keys,Object),Fv=Bv,Hv=as,Wv=Fv,Gv=Object.prototype,Vv=Gv.hasOwnProperty;function Uv(e){if(!Hv(e))return Wv(e);var t=[];for(var n in Object(e))Vv.call(e,n)&&n!="constructor"&&t.push(n);return t}var Yv=Uv;function Xv(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ir=Xv,Zv=cn,Kv=ir,Qv="[object AsyncFunction]",Jv="[object Function]",qv="[object GeneratorFunction]",e6="[object Proxy]";function t6(e){if(!Kv(e))return!1;var t=Zv(e);return t==Jv||t==qv||t==Qv||t==e6}var Gu=t6,n6=Gu,r6=ts;function a6(e){return e!=null&&r6(e.length)&&!n6(e)}var xi=a6,i6=Hu,o6=Yv,s6=xi;function l6(e){return s6(e)?i6(e):o6(e)}var Zr=l6,c6=Tg,d6=Zr;function u6(e,t){return e&&c6(e,t,d6)}var Vu=u6;function f6(e){return e}var Uu=f6,h6=Uu;function p6(e){return typeof e=="function"?e:h6}var g6=p6,v6=Vu,m6=g6;function b6(e,t){return e&&v6(e,m6(t))}var is=b6,y6=Wu,w6=y6(Object.getPrototypeOf,Object),os=w6,x6=cn,E6=os,S6=Ot,C6="[object Object]",M6=Function.prototype,A6=Object.prototype,Yu=M6.toString,_6=A6.hasOwnProperty,O6=Yu.call(Object);function T6(e){if(!S6(e)||x6(e)!=C6)return!1;var t=E6(e);if(t===null)return!0;var n=_6.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Yu.call(n)==O6}var $6=T6;function P6(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n-1}var Y6=U6,X6=Ei;function Z6(e,t){var n=this.__data__,r=X6(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var K6=Z6,Q6=z6,J6=F6,q6=G6,em=Y6,tm=K6;function or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&hb?new cb:void 0;for(i.set(e,t),i.set(t,e);++f0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,rw.default)(t,function(r){Array.isArray(r)?e(r).map(function(a){return n.push(a)}):(0,tw.default)(r)?(0,q4.default)(r,function(a,i){a===!0&&n.push(i),n.push(i+"-"+a)}):(0,Q4.default)(r)&&n.push(r)}),n};Yr.default=aw;var Kr={};function iw(e,t){for(var n=-1,r=e==null?0:e.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=t.default&&(0,M5.default)(t.default)||{};return n.map(function(a){var i=t[a];return i&&(0,S5.default)(i,function(o,s){r[s]||(r[s]={}),r[s]=A5({},r[s],i[s])}),a}),r};Kr.default=_5;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.autoprefix=void 0;var O5=is,Mc=$5(O5),T5=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){j5(a,r);function a(){var i,o,s,c;N5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){W5(a,r);function a(){var i,o,s,c;H5(this,a);for(var d=arguments.length,u=Array(d),f=0;f1&&arguments[1]!==void 0?arguments[1]:!0;r[o]=s};return t===0&&a("first-child"),t===n-1&&a("last-child"),(t===0||t%2===0)&&a("even"),Math.abs(t%2)===1&&a("odd"),a("nth-child",t),r};ms.default=V5;Object.defineProperty(Qe,"__esModule",{value:!0});Qe.ReactCSS=Qe.loop=Qe.handleActive=bs=Qe.handleHover=Qe.hover=void 0;var U5=Yr,Y5=ur(U5),X5=Kr,Z5=ur(X5),K5=Qr,Q5=ur(K5),J5=Jr,b0=ur(J5),q5=qr,eE=ur(q5),tE=ms,nE=ur(tE);function ur(e){return e&&e.__esModule?e:{default:e}}Qe.hover=b0.default;var bs=Qe.handleHover=b0.default;Qe.handleActive=eE.default;Qe.loop=nE.default;var rE=Qe.ReactCSS=function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;as?h=1:h=Math.round(f*100/s)/100,n.a!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}else{var p=void 0;if(u<0?p=0:u>o?p=1:p=Math.round(u*100/o)/100,a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}return null},ao={},iE=function(t,n,r,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=r*2,i.height=r*2;var o=i.getContext("2d");return o?(o.fillStyle=t,o.fillRect(0,0,i.width,i.height),o.fillStyle=n,o.fillRect(0,0,r,r),o.translate(r,r),o.fillRect(0,0,r,r),i.toDataURL()):null},oE=function(t,n,r,a){var i=t+"-"+n+"-"+r+(a?"-server":"");if(ao[i])return ao[i];var o=iE(t,n,r,a);return ao[i]=o,o},Oc=Object.assign||function(e){for(var t=1;t-1},wE=function(t){return Number(String(t).replace(/%/g,""))},xE=1,oe=function(e){gE(t,e);function t(n){hE(this,t);var r=pE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(a){r.setUpdatedValue(a.target.value,a)},r.handleKeyDown=function(a){var i=wE(a.target.value);if(!isNaN(i)&&yE(a.keyCode)){var o=r.getArrowOffset(),s=a.keyCode===y0?i+o:i-o;r.setUpdatedValue(s,a)}},r.handleDrag=function(a){if(r.props.dragLabel){var i=Math.round(r.props.value+a.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),a)}},r.handleMouseDown=function(a){r.props.dragLabel&&(a.preventDefault(),r.handleDrag(a),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+xE++,r}return uE(t,[{key:"componentDidUpdate",value:function(r,a){this.props.value!==this.state.value&&(r.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return fE({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||vE}},{key:"setUpdatedValue",value:function(r,a){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,a),this.setState({value:r})}},{key:"render",value:function(){var r=this,a=ie({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return l.createElement("div",{style:a.wrap},l.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return r.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?l.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(A.PureComponent||A.Component),EE=function(t,n,r,a){var i=a.clientWidth,o=a.clientHeight,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(a.getBoundingClientRect().left+window.pageXOffset),u=c-(a.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var f=void 0;if(u<0)f=359;else if(u>o)f=0;else{var h=-(u*100/o)+100;f=360*h/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var p=void 0;if(d<0)p=0;else if(d>i)p=359;else{var v=d*100/i;p=360*v/100}if(r.h!==p)return{h:p,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},SE=function(){function e(t,n){for(var r=0;r1?$n("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):$n("Invalid argument supplied to oneOf, expected an array."),va;function $(R,G,N,D,w){for(var P=R[G],V=0;V0?", expected one of type ["+M.join(", ")+"]":"";return new c("Invalid "+P+" `"+V+"` supplied to "+("`"+w+"`"+T+"."))}return d(G)}function S(){function O($,R,G,N,D){return j($[R])?null:new c("Invalid "+N+" `"+D+"` supplied to "+("`"+G+"`, expected a ReactNode."))}return d(O)}function x(O,$,R,G,N){return new c((O||"React class")+": "+$+" type `"+R+"."+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function C(O){function $(R,G,N,D,w){var P=R[G],V=k(P);if(V!=="object")return new c("Invalid "+D+" `"+w+"` of type `"+V+"` "+("supplied to `"+N+"`, expected `object`."));for(var M in O){var Y=O[M];if(typeof Y!="function")return x(N,D,w,M,F(Y));var H=Y(P,M,N,D,w+"."+M,bn);if(H)return H}return null}return d($)}function E(O){function $(R,G,N,D,w){var P=R[G],V=k(P);if(V!=="object")return new c("Invalid "+D+" `"+w+"` of type `"+V+"` "+("supplied to `"+N+"`, expected `object`."));var M=NE({},R[G],O);for(var Y in M){var H=O[Y];if(io(O,Y)&&typeof H!="function")return x(N,D,w,Y,F(H));if(!H)return new c("Invalid "+D+" `"+w+"` key `"+Y+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(R[G],null," ")+` -Valid keys: `+JSON.stringify(Object.keys(O),null," "));var _=H(P,Y,N,D,w+"."+Y,bn);if(_)return _}return null}return d($)}function j(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(j);if(O===null||e(O))return!0;var $=a(O);if($){var R=$.call(O),G;if($!==O.entries){for(;!(G=R.next()).done;)if(!j(G.value))return!1}else for(;!(G=R.next()).done;){var N=G.value;if(N&&!j(N[1]))return!1}}else return!1;return!0;default:return!1}}function z(O,$){return O==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function k(O){var $=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":z($,O)?"symbol":$}function F(O){if(typeof O>"u"||O===null)return""+O;var $=k(O);if($==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return $}function U(O){var $=F(O);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function L(O){return!O.constructor||!O.constructor.name?i:O.constructor.name}return o.checkPropTypes=Ic,o.resetWarningCache=Ic.resetWarningCache,o.PropTypes=o,o};{var LE=E0,kE=!0;w0.exports=jE(LE.isElement,kE)}var BE=w0.exports;const X=df(BE);function FE(){this.__data__=[],this.size=0}function ea(e,t){return e===t||e!==e&&t!==t}function $i(e,t){for(var n=e.length;n--;)if(ea(e[n][0],t))return n;return-1}var HE=Array.prototype,WE=HE.splice;function GE(e){var t=this.__data__,n=$i(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():WE.call(t,n,1),--this.size,!0}function VE(e){var t=this.__data__,n=$i(t,e);return n<0?void 0:t[n][1]}function UE(e){return $i(this.__data__,e)>-1}function YE(e,t){var n=this.__data__,r=$i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Tt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=n7}function pr(e){return e!=null&&Ss(e.length)&&!ws(e)}function r7(e){return Wt(e)&&pr(e)}function a7(){return!1}var z0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Bc=z0&&typeof module=="object"&&module&&!module.nodeType&&module,i7=Bc&&Bc.exports===z0,Fc=i7?dt.Buffer:void 0,o7=Fc?Fc.isBuffer:void 0,hi=o7||a7,s7="[object Object]",l7=Function.prototype,c7=Object.prototype,R0=l7.toString,d7=c7.hasOwnProperty,u7=R0.call(Object);function f7(e){if(!Wt(e)||un(e)!=s7)return!1;var t=P0(e);if(t===null)return!0;var n=d7.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&R0.call(n)==u7}var h7="[object Arguments]",p7="[object Array]",g7="[object Boolean]",v7="[object Date]",m7="[object Error]",b7="[object Function]",y7="[object Map]",w7="[object Number]",x7="[object Object]",E7="[object RegExp]",S7="[object Set]",C7="[object String]",M7="[object WeakMap]",A7="[object ArrayBuffer]",_7="[object DataView]",O7="[object Float32Array]",T7="[object Float64Array]",$7="[object Int8Array]",P7="[object Int16Array]",I7="[object Int32Array]",z7="[object Uint8Array]",R7="[object Uint8ClampedArray]",D7="[object Uint16Array]",N7="[object Uint32Array]",Ee={};Ee[O7]=Ee[T7]=Ee[$7]=Ee[P7]=Ee[I7]=Ee[z7]=Ee[R7]=Ee[D7]=Ee[N7]=!0;Ee[h7]=Ee[p7]=Ee[A7]=Ee[g7]=Ee[_7]=Ee[v7]=Ee[m7]=Ee[b7]=Ee[y7]=Ee[w7]=Ee[x7]=Ee[E7]=Ee[S7]=Ee[C7]=Ee[M7]=!1;function j7(e){return Wt(e)&&Ss(e.length)&&!!Ee[un(e)]}function L7(e){return function(t){return e(t)}}var D0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Br=D0&&typeof module=="object"&&module&&!module.nodeType&&module,k7=Br&&Br.exports===D0,so=k7&&A0.process,Hc=function(){try{var e=Br&&Br.require&&Br.require("util").types;return e||so&&so.binding&&so.binding("util")}catch{}}(),Wc=Hc&&Hc.isTypedArray,Cs=Wc?L7(Wc):j7;function Wo(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var B7=Object.prototype,F7=B7.hasOwnProperty;function H7(e,t,n){var r=e[t];(!(F7.call(e,t)&&ea(r,n))||n===void 0&&!(t in e))&&xs(e,t,n)}function W7(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i-1&&e%1==0&&e0){if(++t>=oC)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var dC=cC(iC);function uC(e,t){return dC(nC(e,t,Ii),e+"")}function fC(e,t,n){if(!qe(n))return!1;var r=typeof t;return(r=="number"?pr(n)&&Ms(t,n.length):r=="string"&&t in n)?ea(n[t],e):!1}function hC(e){return uC(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&fC(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r=t||j<0||f&&z>=i}function b(){var E=lo();if(m(E))return y(E);s=setTimeout(b,g(E))}function y(E){return s=void 0,h&&r?p(E):(r=a=void 0,o)}function S(){s!==void 0&&clearTimeout(s),d=0,r=c=a=s=void 0}function x(){return s===void 0?o:y(lo())}function C(){var E=lo(),j=m(E);if(r=arguments,a=this,c=E,j){if(s===void 0)return v(c);if(f)return clearTimeout(s),s=setTimeout(b,t),p(c)}return s===void 0&&(s=setTimeout(b,t)),o}return C.cancel=S,C.flush=x,C}var AC="Expected a function";function _C(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(AC);return qe(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),k0(e,t,{leading:r,maxWait:t,trailing:a})}var OC=function(t,n,r){var a=r.getBoundingClientRect(),i=a.width,o=a.height,s=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,c=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,d=s-(r.getBoundingClientRect().left+window.pageXOffset),u=c-(r.getBoundingClientRect().top+window.pageYOffset);d<0?d=0:d>i&&(d=i),u<0?u=0:u>o&&(u=o);var f=d/i,h=1-u/o;return{h:n.h,s:f,v:h,a:n.a,source:"hsv"}},TC=function(){function e(t,n){for(var r=0;r=0,i=!n&&a&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(qC,arguments)},brighten:function(){return this._applyModification(eM,arguments)},darken:function(){return this._applyModification(tM,arguments)},desaturate:function(){return this._applyModification(KC,arguments)},saturate:function(){return this._applyModification(QC,arguments)},greyscale:function(){return this._applyModification(JC,arguments)},spin:function(){return this._applyModification(nM,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(iM,arguments)},complement:function(){return this._applyCombination(rM,arguments)},monochromatic:function(){return this._applyCombination(oM,arguments)},splitcomplement:function(){return this._applyCombination(aM,arguments)},triad:function(){return this._applyCombination(Qc,[3])},tetrad:function(){return this._applyCombination(Qc,[4])}};q.fromRatio=function(e,t){if(pi(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=zr(e[r]));e=n}return q(e,t)};function VC(e){var t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=uM(e)),pi(e)=="object"&&(yt(e.r)&&yt(e.g)&&yt(e.b)?(t=UC(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):yt(e.h)&&yt(e.s)&&yt(e.v)?(r=zr(e.s),a=zr(e.v),t=XC(e.h,r,a),o=!0,s="hsv"):yt(e.h)&&yt(e.s)&&yt(e.l)&&(r=zr(e.s),i=zr(e.l),t=YC(e.h,r,i),o=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=F0(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function UC(e,t,n){return{r:Me(e,255)*255,g:Me(t,255)*255,b:Me(n,255)*255}}function Yc(e,t,n){e=Me(e,255),t=Me(t,255),n=Me(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=(r+a)/2;if(r==a)i=o=0;else{var c=r-a;switch(o=s>.5?c/(2-r-a):c/(r+a),r){case e:i=(t-n)/c+(t1&&(f-=1),f<1/6?d+(u-d)*6*f:f<1/2?u:f<2/3?d+(u-d)*(2/3-f)*6:d}if(t===0)r=a=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),a=o(c,s,e),i=o(c,s,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function Xc(e,t,n){e=Me(e,255),t=Me(t,255),n=Me(n,255);var r=Math.max(e,t,n),a=Math.min(e,t,n),i,o,s=r,c=r-a;if(o=r===0?0:c/r,r==a)i=0;else{switch(r){case e:i=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(q(r));return i}function oM(e,t){t=t||6;for(var n=q(e).toHsv(),r=n.h,a=n.s,i=n.v,o=[],s=1/t;t--;)o.push(q({h:r,s:a,v:i})),i=(i+s)%1;return o}q.mix=function(e,t,n){n=n===0?0:n||50;var r=q(e).toRgb(),a=q(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return q(o)};q.readability=function(e,t){var n=q(e),r=q(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};q.isReadable=function(e,t,n){var r=q.readability(e,t),a,i;switch(i=!1,a=fM(n),a.level+a.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};q.mostReadable=function(e,t,n){var r=null,a=0,i,o,s,c;n=n||{},o=n.includeFallbackColors,s=n.level,c=n.size;for(var d=0;da&&(a=i,r=q(t[d]));return q.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],n))};var Go=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sM=q.hexNames=lM(Go);function lM(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function F0(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Me(e,t){cM(e)&&(e="100%");var n=dM(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Di(e){return Math.min(1,Math.max(0,e))}function He(e){return parseInt(e,16)}function cM(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function dM(e){return typeof e=="string"&&e.indexOf("%")!=-1}function lt(e){return e.length==1?"0"+e:""+e}function zr(e){return e<=1&&(e=e*100+"%"),e}function H0(e){return Math.round(parseFloat(e)*255).toString(16)}function Jc(e){return He(e)/255}var it=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function yt(e){return!!it.CSS_UNIT.exec(e)}function uM(e){e=e.replace(WC,"").replace(GC,"").toLowerCase();var t=!1;if(Go[e])e=Go[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=it.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=it.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=it.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=it.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=it.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=it.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=it.hex8.exec(e))?{r:He(n[1]),g:He(n[2]),b:He(n[3]),a:Jc(n[4]),format:t?"name":"hex8"}:(n=it.hex6.exec(e))?{r:He(n[1]),g:He(n[2]),b:He(n[3]),format:t?"name":"hex"}:(n=it.hex4.exec(e))?{r:He(n[1]+""+n[1]),g:He(n[2]+""+n[2]),b:He(n[3]+""+n[3]),a:Jc(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=it.hex3.exec(e))?{r:He(n[1]+""+n[1]),g:He(n[2]+""+n[2]),b:He(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function fM(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}var qc=function(t){var n=["r","g","b","a","h","s","l","v"],r=0,a=0;return HC(n,function(i){if(t[i]&&(r+=1,isNaN(t[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(t[i])&&(a+=1)}}),r===a?t:!1},Rr=function(t,n){var r=t.hex?q(t.hex):q(t),a=r.toHsl(),i=r.toHsv(),o=r.toRgb(),s=r.toHex();a.s===0&&(a.h=n||0,i.h=n||0);var c=s==="000000"&&o.a===0;return{hsl:a,hex:c?"transparent":"#"+s,rgb:o,hsv:i,oldHue:t.h||n||a.h,source:t.source}},Gt=function(t){if(t==="transparent")return!0;var n=String(t).charAt(0)==="#"?1:0;return t.length!==4+n&&t.length<7+n&&q(t).isValid()},_s=function(t){if(!t)return"#fff";var n=Rr(t);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},co=function(t,n){var r=t.replace("°","");return q(n+" ("+r+")")._ok},Mr=Object.assign||function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){wM(a,r);function a(){var i,o,s,c;yM(this,a);for(var d=arguments.length,u=Array(d),f=0;fs))return!1;var d=i.get(e),u=i.get(t);if(d&&u)return d==t&&u==e;var f=-1,h=!0,p=n&IM?new gi:void 0;for(i.set(e,t),i.set(t,e);++f=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var ba=24,ZA=J0.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?ba:r,i=e.height,o=i===void 0?ba:i,s=e.style,c=s===void 0?{}:s,d=XA(e,["fill","width","height","style"]);return bd.default.createElement("svg",md({viewBox:"0 0 "+ba+" "+ba,style:md({fill:n,width:a,height:o},c)},d),bd.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},KA=function(){function e(t,n){for(var r=0;r1&&(a.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),r.props.onChange({h:a.h||r.props.hsl.h,s:Number(vd(a.s)?r.props.hsl.s:a.s),l:Number(vd(a.l)?r.props.hsl.l:a.l),source:"hsl"},i))},r.showHighlight=function(a){a.currentTarget.style.background="#eee"},r.hideHighlight=function(a){a.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return KA(t,[{key:"render",value:function(){var r=this,a=ie({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=l.createElement("div",{style:a.fields,className:"flexbox-fix"},l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.field},l.createElement(oe,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),l.createElement("div",{style:a.alpha},l.createElement(oe,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),l.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,l.createElement("div",{style:a.toggle},l.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},l.createElement(ZA,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),t}(l.Component);q0.defaultProps={view:"hex"};var yd=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return l.createElement("div",{style:t.picker})},e_=function(){var t=ie({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return l.createElement("div",{style:t.picker})},zs=function(t){var n=t.width,r=t.onChange,a=t.disableAlpha,i=t.rgb,o=t.hsl,s=t.hsv,c=t.hex,d=t.renderers,u=t.styles,f=u===void 0?{}:u,h=t.className,p=h===void 0?"":h,v=t.defaultView,g=ie(ke({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},f),{disableAlpha:a});return l.createElement("div",{style:g.picker,className:"chrome-picker "+p},l.createElement("div",{style:g.saturation},l.createElement(Ri,{style:g.Saturation,hsl:o,hsv:s,pointer:e_,onChange:r})),l.createElement("div",{style:g.body},l.createElement("div",{style:g.controls,className:"flexbox-fix"},l.createElement("div",{style:g.color},l.createElement("div",{style:g.swatch},l.createElement("div",{style:g.active}),l.createElement(fr,{renderers:d}))),l.createElement("div",{style:g.toggles},l.createElement("div",{style:g.hue},l.createElement(hr,{style:g.Hue,hsl:o,pointer:yd,onChange:r})),l.createElement("div",{style:g.alpha},l.createElement(ys,{style:g.Alpha,rgb:i,hsl:o,pointer:yd,renderers:d,onChange:r})))),l.createElement(q0,{rgb:i,hsl:o,hex:c,view:v,onChange:r,disableAlpha:a})))};zs.propTypes={width:X.oneOfType([X.string,X.number]),disableAlpha:X.bool,styles:X.object,defaultView:X.oneOf(["hex","rgb","hsl"])};zs.defaultProps={width:225,disableAlpha:!1,styles:{}};const t_=Be(zs);var n_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.active,s=ie({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:_s(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(pn,{style:s.color,color:n,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:s.dot}))},r_=function(t){var n=t.hex,r=t.rgb,a=t.onChange,i=ie({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(c,d){c.r||c.g||c.b?a({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,source:"rgb"},d):a({hex:c.hex,source:"hex"},d)};return l.createElement("div",{style:i.fields,className:"flexbox-fix"},l.createElement("div",{style:i.active}),l.createElement(oe,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:o}),l.createElement(oe,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:o}))},Rs=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.colors,i=t.hex,o=t.rgb,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(ke({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),h=function(v,g){v.hex?Gt(v.hex)&&n({hex:v.hex,source:"hex"},g):n(v,g)};return l.createElement(ta,{style:f.Compact,styles:c},l.createElement("div",{style:f.compact,className:"compact-picker "+u},l.createElement("div",null,gn(a,function(p){return l.createElement(n_,{key:p,color:p,active:p.toLowerCase()===i,onClick:h,onSwatchHover:r})}),l.createElement("div",{style:f.clear})),l.createElement(r_,{hex:i,rgb:o,onChange:h})))};Rs.propTypes={colors:X.arrayOf(X.string),styles:X.object};Rs.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Be(Rs);var a_=function(t){var n=t.hover,r=t.color,a=t.onClick,i=t.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ie({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:n});return l.createElement("div",{style:s.swatch},l.createElement(pn,{color:r,onClick:a,onHover:i,focusStyle:o}))};const i_=bs(a_);var Ds=function(t){var n=t.width,r=t.colors,a=t.onChange,i=t.onSwatchHover,o=t.triangle,s=t.styles,c=s===void 0?{}:s,d=t.className,u=d===void 0?"":d,f=ie(ke({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),h=function(v,g){return a({hex:v,source:"hex"},g)};return l.createElement("div",{style:f.card,className:"github-picker "+u},l.createElement("div",{style:f.triangleShadow}),l.createElement("div",{style:f.triangle}),gn(r,function(p){return l.createElement(i_,{color:p,key:p,onClick:h,onSwatchHover:i})}))};Ds.propTypes={width:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.string),triangle:X.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:X.object};Ds.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Be(Ds);var o_=function(t){var n=t.direction,r=ie({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return l.createElement("div",{style:r.picker})},s_=Object.assign||function(e){for(var t=1;t.5});return l.createElement("div",{style:r.picker})},u_=function(){var t=ie({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return l.createElement("div",{style:t.pointer},l.createElement("div",{style:t.left},l.createElement("div",{style:t.leftInside})),l.createElement("div",{style:t.right},l.createElement("div",{style:t.rightInside})))},wd=function(t){var n=t.onClick,r=t.label,a=t.children,i=t.active,o=ie({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return l.createElement("div",{style:o.button,onClick:n},r||a)},f_=function(t){var n=t.rgb,r=t.currentColor,a=ie({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return l.createElement("div",null,l.createElement("div",{style:a.label},"new"),l.createElement("div",{style:a.swatches},l.createElement("div",{style:a.new}),l.createElement("div",{style:a.current})),l.createElement("div",{style:a.label},"current"))},h_=function(){function e(t,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:a.h,s:a.s,l:a.l,a:u.a,source:"rgb"},f))};return l.createElement("div",{style:s.fields,className:"flexbox-fix"},l.createElement("div",{style:s.double},l.createElement(oe,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:c})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.single},l.createElement(oe,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:c,dragLabel:"true",dragMax:"255"})),l.createElement("div",{style:s.alpha},l.createElement(oe,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:c,dragLabel:"true",dragMax:"100"})))},b_=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var ya=24,M_=tf.default=function(e){var t=e.fill,n=t===void 0?"currentColor":t,r=e.width,a=r===void 0?ya:r,i=e.height,o=i===void 0?ya:i,s=e.style,c=s===void 0?{}:s,d=C_(e,["fill","width","height","style"]);return Ed.default.createElement("svg",xd({viewBox:"0 0 "+ya+" "+ya,style:xd({fill:n,width:a,height:o},c)},d),Ed.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},A_=function(t){var n=t.color,r=t.onClick,a=r===void 0?function(){}:r,i=t.onSwatchHover,o=t.first,s=t.last,c=t.active,d=ie({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:_s(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:s,active:c,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return l.createElement(pn,{color:n,style:d.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},l.createElement("div",{style:d.check},l.createElement(M_,null)))},__=function(t){var n=t.onClick,r=t.onSwatchHover,a=t.group,i=t.active,o=ie({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return l.createElement("div",{style:o.group},gn(a,function(s,c){return l.createElement(A_,{key:s,color:s,active:s.toLowerCase()===i,first:c===0,last:c===a.length-1,onClick:n,onSwatchHover:r})}))},Bs=function(t){var n=t.width,r=t.height,a=t.onChange,i=t.onSwatchHover,o=t.colors,s=t.hex,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(ke({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},d)),p=function(g,m){return a({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.picker,className:"swatches-picker "+f},l.createElement(ta,null,l.createElement("div",{style:h.overflow},l.createElement("div",{style:h.body},gn(o,function(v){return l.createElement(__,{key:v.toString(),group:v,active:s,onClick:p,onSwatchHover:i})}),l.createElement("div",{style:h.clear})))))};Bs.propTypes={width:X.oneOfType([X.string,X.number]),height:X.oneOfType([X.string,X.number]),colors:X.arrayOf(X.arrayOf(X.string)),styles:X.object};Bs.defaultProps={width:320,height:240,colors:[[Pn[900],Pn[700],Pn[500],Pn[300],Pn[100]],[In[900],In[700],In[500],In[300],In[100]],[zn[900],zn[700],zn[500],zn[300],zn[100]],[Rn[900],Rn[700],Rn[500],Rn[300],Rn[100]],[Dn[900],Dn[700],Dn[500],Dn[300],Dn[100]],[Nn[900],Nn[700],Nn[500],Nn[300],Nn[100]],[jn[900],jn[700],jn[500],jn[300],jn[100]],[Ln[900],Ln[700],Ln[500],Ln[300],Ln[100]],[kn[900],kn[700],kn[500],kn[300],kn[100]],["#194D33",Dr[700],Dr[500],Dr[300],Dr[100]],[Bn[900],Bn[700],Bn[500],Bn[300],Bn[100]],[Fn[900],Fn[700],Fn[500],Fn[300],Fn[100]],[Hn[900],Hn[700],Hn[500],Hn[300],Hn[100]],[Wn[900],Wn[700],Wn[500],Wn[300],Wn[100]],[Gn[900],Gn[700],Gn[500],Gn[300],Gn[100]],[Vn[900],Vn[700],Vn[500],Vn[300],Vn[100]],[Un[900],Un[700],Un[500],Un[300],Un[100]],[Yn[900],Yn[700],Yn[500],Yn[300],Yn[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Be(Bs);var Fs=function(t){var n=t.onChange,r=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,c=t.styles,d=c===void 0?{}:c,u=t.className,f=u===void 0?"":u,h=ie(ke({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},d),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),p=function(g,m){Gt(g)&&n({hex:g,source:"hex"},m)};return l.createElement("div",{style:h.card,className:"twitter-picker "+f},l.createElement("div",{style:h.triangleShadow}),l.createElement("div",{style:h.triangle}),l.createElement("div",{style:h.body},gn(i,function(v,g){return l.createElement(pn,{key:g,color:v,hex:v,style:h.swatch,onClick:p,onHover:r,focusStyle:{boxShadow:"0 0 4px "+v}})}),l.createElement("div",{style:h.hash},"#"),l.createElement(oe,{label:null,style:{input:h.input},value:a.replace("#",""),onChange:p}),l.createElement("div",{style:h.clear})))};Fs.propTypes={width:X.oneOfType([X.string,X.number]),triangle:X.oneOf(["hide","top-left","top-right"]),colors:X.arrayOf(X.string),styles:X.object};Fs.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Be(Fs);var Hs=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return l.createElement("div",{style:n.picker})};Hs.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};Hs.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Ws=function(t){var n=ie({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return l.createElement("div",{style:n.picker})};Ws.propTypes={hsl:X.shape({h:X.number,s:X.number,l:X.number,a:X.number})};Ws.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var O_=function(t){var n=t.onChange,r=t.rgb,a=t.hsl,i=t.hex,o=t.hsv,s=function(p,v){if(p.hex)Gt(p.hex)&&n({hex:p.hex,source:"hex"},v);else if(p.rgb){var g=p.rgb.split(",");co(p.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},v)}else if(p.hsv){var m=p.hsv.split(",");co(p.hsv,"hsv")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),m[1]==1?m[1]=.01:m[2]==1&&(m[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsv"},v))}else if(p.hsl){var b=p.hsl.split(",");co(p.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),f[1]==1?f[1]=.01:f[2]==1&&(f[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},v))}},c=ie({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),d=r.r+", "+r.g+", "+r.b,u=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",f=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return l.createElement("div",{style:c.wrap,className:"flexbox-fix"},l.createElement("div",{style:c.fields},l.createElement("div",{style:c.double},l.createElement(oe,{style:{input:c.input,label:c.label},label:"hex",value:i,onChange:s})),l.createElement("div",{style:c.column},l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"rgb",value:d,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsv",value:f,onChange:s})),l.createElement("div",{style:c.single},l.createElement(oe,{style:{input:c.input2,label:c.label2},label:"hsl",value:u,onChange:s})))))},Gs=function(t){var n=t.width,r=t.onChange,a=t.rgb,i=t.hsl,o=t.hsv,s=t.hex,c=t.header,d=t.styles,u=d===void 0?{}:d,f=t.className,h=f===void 0?"":f,p=ie(ke({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return l.createElement("div",{style:p.picker,className:"google-picker "+h},l.createElement("div",{style:p.head},c),l.createElement("div",{style:p.swatch}),l.createElement("div",{style:p.saturation},l.createElement(Ri,{hsl:i,hsv:o,pointer:Hs,onChange:r})),l.createElement("div",{style:p.body},l.createElement("div",{style:p.controls,className:"flexbox-fix"},l.createElement("div",{style:p.hue},l.createElement(hr,{style:p.Hue,hsl:i,radius:"4px",pointer:Ws,onChange:r}))),l.createElement(O_,{rgb:a,hsl:i,hex:s,hsv:o,onChange:r})))};Gs.propTypes={width:X.oneOfType([X.string,X.number]),styles:X.object,header:X.string};Gs.defaultProps={width:652,styles:{},header:"Color picker"};Be(Gs);function T_(e){let t=e.toLocaleUpperCase();const n={r:0,g:0,b:0,a:1};return/^\#[0-9a-f]{3,3}$/i.test(t)?t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}FF`:/^\#[0-9a-f]{6,6}$/i.test(t)&&(t=`${t}FF`),/^\#[0-9a-f]{8,8}$/i.test(t)&&(n.r=parseInt(`${t[1]}${t[2]}`,16),n.g=parseInt(`${t[3]}${t[4]}`,16),n.b=parseInt(`${t[5]}${t[6]}`,16),n.a=parseInt(`${t[7]}${t[8]}`,16)/255),n}function $_(e){const t=[];return t.push(e.r.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.g.toString(16).padStart(2,"0").toLocaleUpperCase()),t.push(e.b.toString(16).padStart(2,"0").toLocaleUpperCase()),e.a<1&&t.push(Math.floor(e.a*255).toString(16).padStart(2,"0").toLocaleUpperCase()),`#${t.join("")}`}const P_=({value:e="",onChange:t,className:n})=>l.createElement(t_,{className:n,color:T_(e),onChangeComplete:r=>{const a=$_(r==null?void 0:r.rgb);t==null||t(a)}}),nf="base-element-field-multiple-color-picker",rf=16,Sd=e=>{var t,n;const r=(t=e.currentTarget.parentElement)===null||t===void 0?void 0:t.getBoundingClientRect(),a=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.x-rf/2;let o=parseFloat((n=i/a.width)===null||n===void 0?void 0:n.toFixed(2));return o=Math.min(Math.max(o,0),1),o};function I_(e){const{mode:t,value:n,internalColor:r,internalLinearGradient:a,internalRadialGradient:i,currentPickedColor:o,onChange:s,onSelectStop:c}=e,[d,u]=A.useState(Qa(n)),[f,h]=A.useState(null),p=A.useRef(!1),{createPrefixName:v}=A.useContext(le),g=v(nf),m=g("gradient-root"),b=g("gradient-delete"),y=g("gradient"),S=g("gradient-bar"),x=g("gradient-point"),C=g("gradient-point-active");A.useEffect(()=>{var L;const O=Qa(n);u(O),["linear-gradient","radial-gradient"].includes(n==null?void 0:n.type)&&(f||h((L=n==null?void 0:n.stops)===null||L===void 0?void 0:L[0]))},[n]),A.useEffect(()=>{f?c==null||c(Object.assign({},f)):c==null||c(f)},[f]);const E=L=>{L.stopPropagation(),p.current=!0;const O=Sd(L);let $=null;if(t==="linear-gradient"?$=a:t==="radial-gradient"&&($=i),$){const R=[...$.stops];for(let N=0;ND.offset&&!w){R.push(P),h(P);break}if(!w)break}const G=Object.assign(Object.assign({},$),{stops:R});s==null||s(G)}},j=L=>{if(p.current===!0&&f){const O=Sd(L);let $=null;if(t==="linear-gradient"?$=a:t==="radial-gradient"&&($=i),$){const R=[...$.stops];for(let D=0;DD.offset-w.offset),N=Object.assign(Object.assign({},$),{stops:G});s==null||s(N)}}},z=L=>{L.stopPropagation(),p.current=!1},k=(L,O)=>{L.stopPropagation(),h(O),p.current=!0},F=()=>{let L=null;t==="linear-gradient"?L=a:t==="radial-gradient"&&(L=i);let O=-1;if(L&&f){const $=[...L.stops];for(let R=0;R<$.length;R++)if($[R].offset===f.offset){O=R;break}if(O>=0){$.splice(O,1);const R=Object.assign(Object.assign({},L),{stops:$});s==null||s(R)}}},U=L=>{p.current=!1};return A.useMemo(()=>{var L,O,$;return l.createElement(l.Fragment,null,(t==="linear-gradient"||t==="radial-gradient")&&l.createElement("div",{className:m},l.createElement("div",{className:y,"data-css":d,style:{background:d}},l.createElement("div",{className:S,onMouseDown:E,onMouseUp:z,onMouseMove:j,onMouseLeave:z},($=(O=(L=t==="linear-gradient"?a:i)===null||L===void 0?void 0:L.stops)===null||O===void 0?void 0:O.map)===null||$===void 0?void 0:$.call(O,(R,G)=>l.createElement("span",{key:G,className:pe({[x]:!0,[C]:(f==null?void 0:f.offset)===R.offset}),style:{left:`calc(${R.offset*100}% - ${rf/2}px)`,background:R.color},onMouseDown:N=>{k(N,R)},onMouseUp:U})))),l.createElement("div",{className:b,onClick:R=>{R.stopPropagation(),F()}},l.createElement(O3,null))))},[t,d,o,r,a,i,f])}function Cd(e){let t="solid";return e&&(e!=null&&e.type)&&(t=e.type),t}function z_(e){const{value:t,onChange:n,elementSize:r,disabledLinearGradient:a,disabledRadialGradient:i}=e,[o,s]=A.useState(Qa(t)),[c,d]=A.useState(Cd(t)),[u,f]=A.useState("#000000"),[h,p]=A.useState(null),[v,g]=A.useState(null),[m,b]=A.useState(null),y=A.useRef(null),S=A.useRef(null),x=A.useRef(null),{createPrefixName:C}=A.useContext(le),E=C(nf),j=E(),z=E("header"),k=E("internal-picker"),F=E("radio-group"),U=E("row"),L=E("col"),O=E("input"),$=E("form-item");A.useEffect(()=>{s(Qa(t)),d(Cd(t)),typeof t=="string"?(p(t),f(t)):(t==null?void 0:t.type)==="linear-gradient"?g(t):(t==null?void 0:t.type)==="radial-gradient"&&b(t)},[t]),A.useEffect(()=>{var w,P;c==="linear-gradient"&&(t==null?void 0:t.type)===c?(w=S.current)===null||w===void 0||w.setFieldsValue(t):c==="radial-gradient"&&(t==null?void 0:t.type)===c&&((P=x.current)===null||P===void 0||P.setFieldsValue(t))},[c,t]);const R=w=>{var P,V,M,Y,H,_;let T;w==="linear-gradient"?(T={type:"linear-gradient",start:{x:0,y:0},end:{x:0,y:(r==null?void 0:r.h)||0},stops:[]},typeof t=="string"?(T.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],g(T)):(t==null?void 0:t.type)==="radial-gradient"&&(T.stops=[...(t==null?void 0:t.stops)||[]],g(T)),(P=S.current)===null||P===void 0||P.setFieldsValue(T)):w==="radial-gradient"?(T={type:"radial-gradient",inner:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:0},outer:{x:((r==null?void 0:r.w)||0)/2,y:((r==null?void 0:r.h)||0)/2,radius:Math.min(((r==null?void 0:r.w)||0)/2,((r==null?void 0:r.h)||0)/2)},stops:[]},typeof t=="string"?(T.stops=[{offset:0,color:t},{offset:.5,color:t},{offset:1,color:t}],b(T)):(t==null?void 0:t.type)==="linear-gradient"&&(T.stops=[...(t==null?void 0:t.stops)||[]],b(T)),(V=x.current)===null||V===void 0||V.setFieldsValue(T)):w==="solid"&&(T=t,(t==null?void 0:t.type)==="linear-gradient"?(T=((Y=(M=t==null?void 0:t.stops)===null||M===void 0?void 0:M[0])===null||Y===void 0?void 0:Y.color)||"#000000",p(T)):(t==null?void 0:t.type)==="radial-gradient"&&(T=((_=(H=t==null?void 0:t.stops)===null||H===void 0?void 0:H[0])===null||_===void 0?void 0:_.color)||"#000000",p(T))),T&&(n==null||n(T))},G=w=>{if(c==="solid")n==null||n(w.color);else if(y.current){if(c==="linear-gradient"&&v&&Array.isArray(v==null?void 0:v.stops)){const P=[...v.stops];for(let M=0;M{const P=Object.assign({},v);w!=null&&w.start&&(P.start=Object.assign(Object.assign({},P.start),w.start)),w!=null&&w.end&&(P.end=Object.assign(Object.assign({},P.end),w.end)),n==null||n(P)},D=w=>{const P=Object.assign({},m);w!=null&&w.inner&&(P.inner=Object.assign(Object.assign({},P.inner),w.inner)),w!=null&&w.outer&&(P.outer=Object.assign(Object.assign({},P.outer),w.outer)),n==null||n(P)};return A.useMemo(()=>l.createElement("div",{className:j},!a&&!i&&l.createElement("div",{className:z},l.createElement(Xe.Group,{className:F,size:"small",buttonStyle:"solid",value:c,onChange:({target:{value:w}})=>{R(w)}},l.createElement(Xe.Button,{value:"solid"},l.createElement(B3,null)),!a&&l.createElement(Xe.Button,{value:"linear-gradient"},l.createElement(N3,null)),!i&&l.createElement(Xe.Button,{value:"radial-gradient"},l.createElement(T3,null)))),!a&&c==="linear-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:S,onValuesChange:N},l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Start"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["start","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["start","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"End"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["end","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["end","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))))),!i&&c==="radial-gradient"&&l.createElement("div",{style:{marginBottom:10}},l.createElement(J,{ref:x,onValuesChange:D},l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Inner"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["inner","radius"]},l.createElement(se,{className:O,size:"small",prefix:"R"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"},"Outer"),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","x"]},l.createElement(se,{className:O,size:"small",prefix:"X"}))),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","y"]},l.createElement(se,{className:O,size:"small",prefix:"Y"})))),l.createElement(he,{className:U},l.createElement(Q,{className:L,span:"4"}),l.createElement(Q,{className:L,span:"10"},l.createElement(J.Item,{className:$,name:["outer","radius"]},l.createElement(se,{className:O,size:"small",prefix:"R"})))))),(!a||!i)&&(c==="linear-gradient"||c==="radial-gradient")&&l.createElement(I_,{mode:c,value:t,currentPickedColor:u,internalColor:h,internalLinearGradient:v,internalRadialGradient:m,onChange:w=>{(w==null?void 0:w.type)==="linear-gradient"?(g(w),n==null||n(w)):(w==null?void 0:w.type)==="radial-gradient"&&(b(w),n==null||n(w))},onSelectStop:w=>{w!=null&&w.color&&f(w.color),y.current=w}}),l.createElement(P_,{value:u,className:k,onChange:w=>{f(w),G({color:w})}})),[c,o,h,v,m,u,a,i])}const R_="base-element-field-multiple-color";function ji(e){const{value:t,onChange:n,disabled:r,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o}=e,s=ln(),d=(y=>{let S="";return typeof y=="string"?S=y:["linear-gradient","radial-gradient"].includes(y==null?void 0:y.type)&&(S=s.gradient),S})(t),u=typeof t=="string",f=A.useRef(null),{createPrefixName:h,container:p}=A.useContext(le),v=h(R_),g=v(),m=v("preview"),b=()=>p||document.body;return A.useMemo(()=>{const y=Wf(t||"transparent");return l.createElement(l.Fragment,null,l.createElement(Jt,{className:g,size:"small",disabled:r,prefix:r?l.createElement("span",null):l.createElement(Od,{placement:"left",content:l.createElement(z_,{value:t,elementSize:a,disabledLinearGradient:i,disabledRadialGradient:o,onChange:n}),trigger:"click",getPopupContainer:b,getTooltipContainer:b},l.createElement("span",{className:m,style:{background:y}})),readOnly:!u,value:d,onChange:S=>{n==null||n(S.target.value)}}),l.createElement("div",{ref:f}))},[t,n,r,a])}const fo=e=>l.createElement(ae,Object.assign({},e),l.createElement("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor"},l.createElement("path",{d:"M512 384a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m0 170.666667a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m170.666667 0a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m-170.666667 170.666666a42.666667 42.666667 0 1 0-42.666667-42.666666 42.666667 42.666667 0 0 0 42.666667 42.666666z m341.333333-597.333333H170.666667a42.666667 42.666667 0 0 0-42.666667 42.666667v682.666666a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667V170.666667a42.666667 42.666667 0 0 0-42.666667-42.666667z m-42.666666 682.666667H213.333333V213.333333h597.333334zM341.333333 554.666667a42.666667 42.666667 0 1 0-42.666666-42.666667 42.666667 42.666667 0 0 0 42.666666 42.666667z"}))),D_="base-element-border-attribute",Zo=4;function _r(e){const{borderRadius:t,borderWidth:n,borderColor:r,boxSizing:a,borderDash:i}=(e==null?void 0:e.detail)||{};let o="solid",s=Zo;Array.isArray(i)&&(i==null?void 0:i.length)>0&&i[0]>=1&&typeof n=="number"&&(o="dash",s=Math.ceil(i[0]));const c={borderRadiusList:[0,0,0,0],borderWidthList:[0,0,0,0],borderColor:r,borderType:o,boxSizing:a,borderDashNum:s};return typeof t=="number"?(c.borderRadius=t,c.borderRadiusList=[t,t,t,t]):Array.isArray(t)?c.borderRadiusList=[t[0]||0,t[1]||0,t[2]||0,t[3]||0]:c.borderRadius=0,typeof n=="number"?(c.borderWidth=n,c.borderWidthList=[n,n,n,n]):Array.isArray(n)?c.borderWidthList=[n[0]||0,n[1]||0,n[2]||0,n[3]||0]:c.borderWidth=0,c}const N_=e=>{var t,n;const{className:r,style:a,element:i,disabled:o,onChange:s}=e,c=A.useRef(null),{createPrefixName:d}=A.useContext(le),u=d(D_),f=u(),h=u("row"),p=u("col"),v=u("input"),g=u("form-item"),[m,b]=A.useState(Array.isArray((t=i==null?void 0:i.detail)===null||t===void 0?void 0:t.borderRadius)),[y,S]=A.useState(Array.isArray((n=i==null?void 0:i.detail)===null||n===void 0?void 0:n.borderWidth)),[x,C]=A.useState(y),E=ln(),j=z=>{var k,F;const U=_r(i),{borderColor:L,boxSizing:O,borderType:$,borderDashNum:R}=z,G={};if(L&&(G.borderColor=L),O&&(G.boxSizing=O),y===!0&&z.borderWidthList){const N=[0,0,0,0],D=Array.from((z==null?void 0:z.borderWidthList)||[null,null,null,null]);for(let w=0;w<4;w++){const P=D[w];typeof P=="number"?N[w]=P:N[w]=((k=U==null?void 0:U.borderWidthList)===null||k===void 0?void 0:k[w])||0,G.borderWidth=N}}else typeof z.borderWidth=="number"&&(G.borderWidth=z.borderWidth);if(m===!0&&z.borderRadiusList){const N=[0,0,0,0],D=Array.from((z==null?void 0:z.borderRadiusList)||[null,null,null,null]);for(let w=0;w<4;w++){const P=D[w];typeof P=="number"?N[w]=P:N[w]=((F=U==null?void 0:U.borderRadiusList)===null||F===void 0?void 0:F[w])||0,G.borderRadius=N}}else typeof z.borderRadius=="number"&&(G.borderRadius=z.borderRadius);y===!0?G.borderDash=[]:$==="solid"?G.borderDash=[]:$==="dash"?G.borderDash=[Zo,Zo]:R&&R>0&&(G.borderDash=[R,R]),s==null||s({detail:G})};return A.useEffect(()=>{var z,k,F;const U=Array.isArray((z=i==null?void 0:i.detail)===null||z===void 0?void 0:z.borderWidth),L=Array.isArray((k=i==null?void 0:i.detail)===null||k===void 0?void 0:k.borderRadius);S(U),b(L),C(U);const O=_r(i);(F=c.current)===null||F===void 0||F.setFieldsValue(O)},[i]),A.useMemo(()=>{const z=_r(i);return l.createElement(J,{ref:c,style:a,className:pe(f,r),onValuesChange:j},l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},y?l.createElement(Jt,{className:v,size:"small",prefix:l.createElement(fo,{style:{fontSize:14}}),disabled:!0,value:E.mixedBorderWidth}):l.createElement(J.Item,{className:g,name:"borderWidth"},l.createElement(se,{className:v,size:"small",min:0,placeholder:"Border Width",prefix:l.createElement(fo,{style:{fontSize:14}}),disabled:o||y}))),l.createElement(Q,{span:4,className:p},l.createElement(Ve,{icon:l.createElement(fo,null),size:"small",disabled:o,type:y?"primary":"default",onClick:()=>{var k;const F=!y;if(S(F),C(F),!F){const U=_r(i),L=U.borderWidth||((k=U.borderWidthList)===null||k===void 0?void 0:k[0])||0;j({borderWidth:L})}}}))),y&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",0]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(E3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",1]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(x3,null),disabled:o||!y,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",2]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(b3,null),disabled:o||!y,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderWidthList",3]},l.createElement(se,{className:v,size:"small",prefix:l.createElement(w3,null),disabled:o||!y,min:0})))))),!["circle"].includes(i==null?void 0:i.type)&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:16,className:p},m?l.createElement(Jt,{className:v,size:"small",prefix:l.createElement(Ll,{style:{fontSize:14}}),disabled:!0,value:E.mixedBorderRadius}):l.createElement(J.Item,{className:g,name:"borderRadius"},l.createElement(se,{className:v,size:"small",placeholder:"Radius",prefix:l.createElement(Ll,{style:{fontSize:14}}),disabled:o||m||x,min:0}))),l.createElement(Q,{span:4,className:p},l.createElement(Ve,{icon:l.createElement(I3,null),size:"small",disabled:o||x,type:m?"primary":"default",onClick:()=>{var k;const F=!m;if(b(F),!F){const U=_r(i),L=U.borderRadius||((k=U.borderRadiusList)===null||k===void 0?void 0:k[0])||0;j({borderRadius:L})}}}))),m&&l.createElement(l.Fragment,null,l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",0]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(A3,null),disabled:o||!m||x,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",1]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(_3,null),disabled:o||!m||x,min:0})))),l.createElement(he,{className:h},l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",2]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(C3,null),disabled:o||!m||x,min:0}))),l.createElement(Q,{span:12,className:p},l.createElement(J.Item,{className:g,name:["borderRadiusList",3]},l.createElement(se,{className:v,size:"small",placeholder:"",prefix:l.createElement(M3,null),disabled:o||!m||x,min:0})))))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"boxSizing"},l.createElement(Ge,{size:"small",disabled:o},l.createElement(Ge.Option,{value:"border-box"},E.inside),l.createElement(Ge.Option,{value:"content-box"},E.outside),l.createElement(Ge.Option,{value:"center-line"},E.centerLine)))),l.createElement(Q,{className:p,span:"13"},l.createElement(J.Item,{className:g,name:"borderColor"},l.createElement(ji,{elementSize:i?yi(i):void 0,disabled:o,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:h},l.createElement(Q,{className:p,span:"11"},l.createElement(J.Item,{className:g,name:"borderType"},l.createElement(Ge,{size:"small",disabled:o||y},l.createElement(Ge.Option,{value:"solid"},E.solid),l.createElement(Ge.Option,{value:"dash"},E.dash)))),l.createElement(Q,{className:p,span:"13"},z.borderType==="dash"&&l.createElement(J.Item,{className:g,name:"borderDashNum"},l.createElement(se,{disabled:o||y,className:v,size:"small",style:{width:"100%"},prefix:l.createElement(y3,{style:{fontSize:14}})})))))},[E,i,o,m,y,x])},j_="base-element-detail-circle",L_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(j_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var k_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const{TextArea:B_}=Jt,F_="base-element-field-image-picker",{useCallback:Md}=l,H_=["image/png","image/jpeg","image/jpg","image/png"],W_=({value:e="",onChange:t})=>{const[n,r]=A.useState(e),[a,i]=A.useState("free"),{createPrefixName:o}=A.useContext(le),s=o(F_),c=s(),d=s("box"),u=s("entity"),f=s("action"),h=s("action-text"),p=s("action-upload"),v=Md(y=>{const S=y||"";let x=3,C=300;return S.length>128&&(x=10),{rows:x,width:C}},[n]),g=y=>{t==null||t(y||e)},m=y=>{r(y),At.imageSrc(y)&&g(y)},b=Md(()=>{a!=="picking"&&(Ko({success:y=>k_(void 0,void 0,void 0,function*(){if(H_.includes(y.file.type)!==!0){Ya.error(`File's type "${y.file.type}" is not supported!`);return}try{const S=yield kf(y.file);m(S.toString())}catch{Ya.error(`Failed to parse file ${y.file.name}`)}i("free")}),error:y=>{console.log(y),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return A.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("img",{className:u,src:e||n}),l.createElement("div",{className:f},l.createElement("div",{className:h},l.createElement(Od,{content:()=>l.createElement("div",null,l.createElement(B_,{value:e||n,style:{width:v(e||n).width},rows:v(e||n).rows,onChange:y=>{m(y.target.value||"")}})),trigger:"click"},l.createElement("span",{style:{display:"inline-block",width:"100%",height:"100%",lineHeight:"50px"}},"URL"))),l.createElement("div",{onClick:b,className:p},l.createElement("span",null,"Upload"))))),[e,n])},G_="base-element-detail-image",V_=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=A.useContext(le),u=c(G_)(),f=A.useRef(null),h=v=>{const{src:g=""}=(v==null?void 0:v.detail)||{};return{src:g,imageResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.imageResource){const{assetId:m}=o({type:"image",value:v.imageResource});m&&Qt(m)&&(g.src=m)}a==null||a({detail:g})};return A.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),A.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"imageResource"},l.createElement(W_,null)))),[r,s])},U_="base-element-detail-path",Y_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(U_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])},X_="base-element-detail-rect",Z_=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),i=r(X_)();return A.useMemo(()=>l.createElement("div",{style:n,className:pe(i,t)}),[n,t])};var K_=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};const Q_="base-element-field-svg-picker",J_=["image/svg+xml"];function q_(e){const t=document.createElement("div");return t.innerHTML=e,document.querySelector("svg").setAttribute("_t",Date.now()+""),{__html:t.innerHTML}}const e9=({value:e="",onChange:t})=>{const[n,r]=A.useState(e),[a,i]=A.useState("free"),{createPrefixName:o}=A.useContext(le),s=o(Q_),c=s(),d=s("box"),u=s("entity"),f=s("action");s("action-text");const h=s("action-upload"),p=m=>{t==null||t(m||e)},v=m=>{r(m),At.svg(m)&&p(m)},g=A.useCallback(()=>{a!=="picking"&&(Ko({success:m=>K_(void 0,void 0,void 0,function*(){if(J_.includes(m.file.type)!==!0){Ya.error(`File's type "${m.file.type}" is not supported!`);return}try{let b=(yield Bf(m.file)).toString();b=b.substring(b.indexOf("{console.log(m),i("free")}}),i("picking"),setTimeout(()=>{i("free")},500))},[a]);return A.useMemo(()=>l.createElement("div",{className:c},l.createElement("div",{className:d},l.createElement("div",{className:u,dangerouslySetInnerHTML:q_(e||n)}),l.createElement("div",{className:f},l.createElement("div",{onClick:g,className:h},l.createElement("span",null,"Upload"))))),[e,n])},t9="base-element-detail-svg",n9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o,disabled:s}=e,{createPrefixName:c}=A.useContext(le),u=c(t9)(),f=A.useRef(null),h=v=>{const{svg:g=""}=(v==null?void 0:v.detail)||{};return{svg:g,svgResource:(i==null?void 0:i(g))||""}},p=v=>{const g={};if(v!=null&&v.svgResource){const{assetId:m}=o({type:"svg",value:v.svgResource});m&&Qt(m)&&(g.svg=m)}a==null||a({detail:g})};return A.useEffect(()=>{var v;const g=h(r);(v=f.current)===null||v===void 0||v.setFieldsValue(g)},[r]),A.useMemo(()=>l.createElement("div",{style:n,className:pe(u,t)},l.createElement(J,{ref:f,onValuesChange:p},l.createElement(J.Item,{name:"svgResource"},l.createElement(e9,null)))),[r,s])},r9="base-element-detail-text",yn={fontSize:20},{TextArea:a9}=Jt,wn=e=>At.number(e*1)?$e(e*1):e,i9=e=>{const{color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o,text:s=""}=(e==null?void 0:e.detail)||{};return{text:s,color:t,textAlign:n,verticalAlign:r,fontSize:a,fontWeight:i,lineHeight:o}},o9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=A.useContext(le),s=o(r9),c=s(),d=s("row"),u=s("col"),f=s("switch"),h=s("form-item"),p=A.useRef(null);A.useEffect(()=>{var g;const m=i9(r);(g=p.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:p,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"verticalAlign"},l.createElement(Xe.Group,{disabled:i,className:f,size:"small"},l.createElement(Xe.Button,{value:"top"},l.createElement(W3,{style:yn})),l.createElement(Xe.Button,{value:"middle"},l.createElement(H3,{style:yn})),l.createElement(Xe.Button,{value:"bottom"},l.createElement(F3,{style:yn}))))),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:h,name:"textAlign"},l.createElement(Xe.Group,{disabled:i,className:f,size:"small"},l.createElement(Xe.Button,{value:"left"},l.createElement(g3,{style:yn})),l.createElement(Xe.Button,{value:"center"},l.createElement(p3,{style:yn})),l.createElement(Xe.Button,{value:"right"},l.createElement(v3,{style:yn})))))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Text Color"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"color"},l.createElement(ji,{elementSize:r?yi(r):void 0,disabled:i,disabledLinearGradient:!0,disabledRadialGradient:!0})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Size"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontSize"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Font Weight"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"fontWeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:100,max:1e3,min:100,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"10",className:u},"Line Height"),l.createElement(Q,{span:"14",className:u},l.createElement(J.Item,{className:h,name:"lineHeight"},l.createElement(se,{disabled:i,size:"small",style:{width:"100%"},step:1,min:0,formatter:wn,parser:wn})))),l.createElement(he,{className:d},l.createElement(Q,{span:"24",className:u},l.createElement(J.Item,{className:h,name:"text",style:{width:"100%"}},l.createElement(a9,{disabled:i,style:{width:"100%"},rows:3})))))),[n,t])},s9="base-element-detail-group",l9=e=>{const{overflow:t}=(e==null?void 0:e.detail)||{};return{overflow:t}},c9=e=>{const{className:t,style:n,element:r,onChange:a,disabled:i}=e,{createPrefixName:o}=A.useContext(le),s=o(s9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=A.useRef(null),p=ln();A.useEffect(()=>{var g;const m=l9(r);(g=h.current)===null||g===void 0||g.setFieldsValue(m)},[r]);const v=g=>{a==null||a({detail:g})};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c,t)},l.createElement(J,{ref:h,style:n,className:c,onValuesChange:v},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"10"},p.overflow),l.createElement(Q,{span:"12",className:u},l.createElement(J.Item,{className:f,name:"overflow"},l.createElement(Ge,{size:"small",disabled:i},l.createElement(Ge.Option,{value:"visible"},p.visible),l.createElement(Ge.Option,{value:"hidden"},p.hidden))))))),[n,t,p])},d9="base-element-detail-attribute",u9=e=>{const{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}=e,{createPrefixName:o}=A.useContext(le),c=o(d9)();return A.useMemo(()=>l.createElement("div",{className:c},(t==null?void 0:t.type)==="circle"&&l.createElement(L_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="image"&&l.createElement(V_,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="svg"&&l.createElement(n9,{element:t,onChange:n,disabled:r,getElementAsset:a,createElementAsset:i}),(t==null?void 0:t.type)==="group"&&l.createElement(c9,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="path"&&l.createElement(Y_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="rect"&&l.createElement(Z_,{element:t,onChange:n,disabled:r}),(t==null?void 0:t.type)==="text"&&l.createElement(o9,{element:t,onChange:n})),[r,t])},f9="base-element-content-attribute",h9=e=>{let{opacity:t}=(e==null?void 0:e.detail)||{};const{background:n}=(e==null?void 0:e.detail)||{};return typeof t=="number"&&t>=0&&t<=1||(t=1),{background:n,opacity:t}},p9=e=>{const{style:t,element:n,disabled:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,s=A.useRef(null),{createPrefixName:c}=A.useContext(le),d=c(f9),u=d(),f=d("row"),h=d("col"),p=d("form-item"),v=b=>{const y=b;a==null||a({detail:y})},g=b=>{a==null||a(b)},m=ln();return A.useEffect(()=>{var b;const y=h9(n);(b=s.current)===null||b===void 0||b.setFieldsValue(y)},[n]),A.useMemo(()=>l.createElement(l.Fragment,null,l.createElement(J,{ref:s,style:t,className:u,onValuesChange:v},["rect","circle","text","group","path"].includes(n==null?void 0:n.type)&&l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.background),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"background"},l.createElement(ji,{elementSize:n?yi(n):void 0,disabled:r})))),l.createElement(he,{className:f},l.createElement(Q,{className:h,span:"10"},m.opacity),l.createElement(Q,{className:h,span:"14"},l.createElement(J.Item,{className:p,name:"opacity"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},step:.1}))))),l.createElement(u9,{element:n,disabled:r,onChange:g,getElementAsset:i,createElementAsset:o})),[m,n,r,a])},g9="base-element-shadow-attribute",v9=e=>{const{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}=(e==null?void 0:e.detail)||{};return{shadowColor:t,shadowBlur:n,shadowOffsetX:r,shadowOffsetY:a}},m9=e=>{const{style:t,element:n,disabled:r,onChange:a}=e,i=A.useRef(null),{createPrefixName:o}=A.useContext(le),s=o(g9),c=s(),d=s("row"),u=s("col"),f=s("form-item"),h=v=>{const g=v;a==null||a({detail:g})},p=ln();return A.useEffect(()=>{var v;const g=v9(n);(v=i.current)===null||v===void 0||v.setFieldsValue(g)},[n]),A.useMemo(()=>l.createElement(J,{ref:i,style:t,className:c,onValuesChange:h},l.createElement(he,{className:d},l.createElement(Q,{className:u,span:"14"},l.createElement(J.Item,{className:f,name:"shadowColor"},l.createElement(ji,{elementSize:n?yi(n):void 0,disabled:r,disabledLinearGradient:!0,disabledRadialGradient:!0}))),l.createElement(Q,{className:u,span:"10"},l.createElement(J.Item,{className:f,name:"shadowBlur"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"}})))),l.createElement(he,null,l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetX"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"X"}))),l.createElement(Q,{className:u,span:"12"},l.createElement(J.Item,{className:f,name:"shadowOffsetY"},l.createElement(se,{disabled:r,size:"small",style:{width:"100%"},prefix:"Y"}))))),[p,n,r])},b9="base-element-detail",y9=sn(),w9=e=>{const{className:t,style:n,element:r,onChange:a,getElementAsset:i,createElementAsset:o}=e,{createPrefixName:s}=A.useContext(le),c=s(b9),d=ln();let u=r;r&&(u=Object.assign(Object.assign({},r||{}),{detail:Object.assign(Object.assign({},y9),r==null?void 0:r.detail)}));const f=[{key:"basic-attribute",label:d.basicAttributes,children:l.createElement(Q3,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}})},{key:"border-attribute",label:d.borderAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(N_,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(aa,{image:aa.PRESENTED_IMAGE_SIMPLE,description:!1})},{key:"content-attribute",label:d.contentAttribute,children:l.createElement(p9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)},getElementAsset:i,createElementAsset:o})},{key:"shadow-attribute",label:d.shadowAttribute,children:["rect","circle","text","image","group"].includes(r==null?void 0:r.type)?l.createElement(m9,{element:u,disabled:!u,onChange:h=>{a==null||a(h)}}):l.createElement(aa,{image:aa.PRESENTED_IMAGE_SIMPLE,description:!1})}];return A.useMemo(()=>l.createElement("div",{style:n,className:pe(c(),t)},l.createElement(hf,{ghost:!0,items:f,size:"small",defaultActiveKey:f.map(h=>h.key)})),[u,d])},af=e=>{var t;const n={uuid:e.uuid,key:e.uuid,title:e.name||e.detail.text||e.type||"unamed",type:e.type,children:[],operations:e.operations||{}};return e.type==="group"&&Array.isArray((t=e==null?void 0:e.detail)===null||t===void 0?void 0:t.children)&&e.detail.children.forEach(r=>{n.children.push(af(r))}),n};function Ie(e){const t=[];return e.elements.forEach(n=>{const r=af(n);t.push(r)}),t}var x9=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a0){const r=pt(e,n.elements);(r==null?void 0:r.type)==="group"&&(r.detail.children=t.elements)}}const S9="dark",C9="en-US";function M9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});let n=[],r=t;e!=null&&e.defaultEditingGroupUUID&&(n=tn(e.defaultEditingGroupUUID,t.elements)),r=er(n,t);const a=Ie(r);return{localeCode:(e==null?void 0:e.defaultLocale)||C9,themeMode:(e==null?void 0:e.defaultThemeMode)||S9,data:t,editingData:r,editingDataPosition:n,treeData:a,selectedUUIDs:(e==null?void 0:e.defaultSelectedElementUUIDs)||[],scaleInfo:Object.assign({scale:1,from:"init"},(e==null?void 0:e.defaultScaleInfo)||{})}}function A9(e){const t=Object.assign({elements:[]},(e==null?void 0:e.data)||{});return{localeCode:"en-US",themeMode:(e==null?void 0:e.themeMode)||"light",data:Object.assign({elements:[]},(e==null?void 0:e.data)||{}),editingData:er([],t),editingDataPosition:[],treeData:[],selectedUUIDs:[],scaleInfo:Object.assign({scale:1,from:"control"},(e==null?void 0:e.scaleInfo)||{})}}function _9(e,t){var n,r;switch(t.type){case"update":return t!=null&&t.payload?Object.assign(Object.assign({},e),t==null?void 0:t.payload):e;case"updateThemeMode":return!((n=t==null?void 0:t.payload)===null||n===void 0)&&n.themeMode?Object.assign(Object.assign({},e),{themeMode:(r=t==null?void 0:t.payload)===null||r===void 0?void 0:r.themeMode}):e;default:return e}}const gr=A.createContext({state:A9(),dispatch:()=>{}}),O9=gr.Provider,T9={locale:"en-US",NavMenu:{about:"About @idraw/studio",file:"File",importJSONFile:"Import JSON file",exportJSONFile:"Export JSON file",exportImage:"Export image",preferences:"Preferences",rect:"Rect",circle:"Circle",text:"Text",image:"Image",html:"HTML",svg:"SVG",group:"Group",devicePixelRatio:"Device pixel ratio"},Toolbar:{layers:"Layers",ruler:"Ruler",attributes:"Attributes",hand:"Hand tool",centerContent:"Center content"},contextMenu:{copy:"Copy",paste:"Paste",cut:"Cut",delete:"Delete"}},$9={locale:"zh-CN",NavMenu:{about:"关于 @idraw/studio",file:"文件",importJSONFile:"导入JSON文件",exportJSONFile:"导出JSON文件",exportImage:"导出图片",preferences:"预设",rect:"矩形",circle:"圆形",text:"文本",image:"图片",html:"HTML片段",svg:"SVG片段",group:"群组",devicePixelRatio:"设备像素比例"},Toolbar:{layers:"图层",ruler:"标尺",attributes:"属性",hand:"拖拽工具",centerContent:"内容居中"},contextMenu:{copy:"复制",paste:"粘贴",cut:"剪切",delete:"删除"}},P9={"en-US":T9,"zh-CN":$9},Vs=e=>{const{state:t}=A.useContext(gr),n=t.localeCode;return[A.useMemo(()=>{const i=P9[n][e];return Object.assign({},i)},[n,e])]},I9="mod-toolbar",z9=()=>{const[e]=Vs("Toolbar");return e},R9=e=>{const{className:t,style:n,openLeftSider:r,openRightSider:a,onClickToggleLayer:i,onClickToggleSetting:o,sharedStore:s}=e,c={fontSize:16},{createPrefixName:d}=A.useContext(le),u=d(I9),f=u(),h=u("left"),p=u("right"),v=u("btn"),[g,m]=A.useState(!1),[b,y]=A.useState(!0),S=z9();A.useEffect(()=>{const C=s.get("idraw");C==null||C.reset({enableRuler:b,enableDrag:g,enableSelect:!g})},[g,b]);const x={size:"small",className:v,shape:"default"};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(f,t)},l.createElement("div",{className:h}),l.createElement("div",{className:p},l.createElement(vr,{title:S.layers},l.createElement(Ve,Object.assign({},x,{type:r?"primary":"default",icon:l.createElement(z3,{style:c}),onClick:i}))),l.createElement(vr,{title:S.attributes},l.createElement(Ve,Object.assign({},x,{type:a?"primary":"default",icon:l.createElement(k3,{style:c}),onClick:o}))),l.createElement(vr,{title:S.ruler},l.createElement(Ve,Object.assign({},x,{type:b?"primary":"default",icon:l.createElement(L3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{y(!b)}}))),l.createElement(vr,{title:S.hand},l.createElement(Ve,Object.assign({},x,{type:g?"primary":"default",icon:l.createElement(P3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{m(!g)}}))),l.createElement(vr,{title:S.centerContent},l.createElement(Ve,Object.assign({},x,{type:"text",icon:l.createElement(h3,{style:Object.assign(Object.assign({},c),{fontSize:20})}),onClick:()=>{const C=s.get("idraw");C==null||C.centerContent()}}))))),[r,a,i,o,g,b,S])},D9="mod-panel-layer",N9=e=>{const{className:t,style:n,height:r,defaultSelectedElementUUIDs:a=[],sharedStore:i,sharedEvent:o,useContextMenuOptions:s}=e,{state:c,dispatch:d}=A.useContext(gr),{createPrefixName:u}=A.useContext(le),f=u(D9),{treeData:h,selectedUUIDs:p,editingData:v}=c,g=A.useRef(null),[m,b]=A.useState(a),y=f(),S=f("content"),x=f("header"),C=f("header","title"),E=f("header","btn"),[j]=s({sharedEvent:o,sharedStore:i}),z=()=>{if(c.editingDataPosition.length===0)return"";const L=pt(c.editingDataPosition,c.data.elements);return(L==null?void 0:L.name)||(L==null?void 0:L.type)||""},k=L=>{const O=i.get("idraw");O==null||O.selectElementsByPositions(L)};A.useEffect(()=>{o.on("scrollToLayer",({uuid:L})=>{var O;L&&((O=g.current)===null||O===void 0||O.scrollTo({key:L,align:"top"}))})},[]),A.useEffect(()=>{if(p[0]&&p.length===1){const O=Gd(p[0],v.elements).map(R=>R.uuid);p[0]&&O.push(p[0]);const $=[...m];O.forEach(R=>{$.includes(R)||$.push(R)}),b($)}},[p,v]);const F=()=>{o.trigger("resetEditingView",{type:"back-root",position:null})},U=()=>{o.trigger("resetEditingView",{type:"back-one",position:null})};return A.useMemo(()=>Array.isArray(h)&&h.length>0?l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:x},l.createElement(Ve,{className:E,size:"small",icon:l.createElement($3,null),disabled:!(c.editingDataPosition.length>0),onClick:F}),l.createElement(Ve,{className:E,size:"small",icon:l.createElement(R3,null),disabled:!(c.editingDataPosition.length>0),onClick:U}),l.createElement("span",{className:C},z())),l.createElement(vi,{menu:{items:j},trigger:["contextMenu"]},l.createElement("div",{className:S},l.createElement(U3,{ref:g,height:r,treeData:h,selectedKeys:p,expandedKeys:m,onTitleChange:({uuid:L,value:O})=>{Hr(L,{name:O},c.editingData.elements);const $=Ie(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:$}})},onOperationToggle:({uuid:L,operations:O})=>{Hr(L,{operations:O},c.editingData.elements);const $=Ie(v);d({type:"update",payload:{editingData:Object.assign({},v),treeData:$}})},onSelect:L=>{p!=null&&p.includes(L.uuids[0])||k(L.positions)},onDrop:L=>{const{elements:O}=qd(v.elements,{from:L.from,to:L.to}),$=pt(L.to,v.elements);$&&($.x=0,$.y=0);const R=Ie(v);d({type:"update",payload:{editingData:Object.assign(Object.assign({},v),{elements:[...O]}),treeData:R}})},onDelete:({uuid:L})=>{o.trigger("deleteElement",{uuid:L})},onGoToGroup:L=>{o.trigger("resetEditingView",{type:"go-to-group",position:L.position})},onExpand:(L,{node:O})=>{const $=O.key;if($){let R=[...m];m.includes($)?R.splice(R.indexOf($),1):R=[...R,$],b(R)}}})))):l.createElement("div",{style:n,className:pe(y,t),onContextMenu:L=>{L.preventDefault()}},l.createElement("div",{className:x},"..."),l.createElement("div",{className:S},l.createElement("div",{style:{padding:"20px 0",textAlign:"center"}},"Empty"))),[h,p,m,v.elements,c.editingDataPosition,j])},j9="mod-panel-detail",L9=e=>{const{className:t,style:n}=e,{createPrefixName:r}=A.useContext(le),{state:a,dispatch:i}=A.useContext(gr),o=r(j9),{selectedUUIDs:s,editingData:c}=a,d=o(),u=A.useCallback(v=>{if((s==null?void 0:s.length)===1&&s[0]){const g=s[0];Hr(g,v,c.elements),i({type:"update",payload:{editingData:Object.assign({},c)}})}},[c,s]),f=A.useCallback(v=>(s==null?void 0:s.length)>1?null:Wd(v,c.elements),[c,s[0]]),h=A.useCallback(v=>{var g,m;let b=null;return v&&Qt(v)&&(b=((m=(g=c.assets)===null||g===void 0?void 0:g[v])===null||m===void 0?void 0:m.value)||null),b},[c,s[0]]),p=A.useCallback(v=>{const g=nr(v.value);return c.assets||(c.assets={}),c.assets[g]=v,{assetId:g,assetItem:v}},[c,s[0]]);return A.useMemo(()=>{const v=f(s[0]);return l.createElement("div",{style:n,className:pe(d,t),onContextMenu:g=>{g.preventDefault()}},l.createElement(w9,{element:v,onChange:u,getElementAsset:h,createElementAsset:p}))},[s[0]])},k9="mod-export-image-file",Us=700,B9=Us+48,Nr=500,F9=Us-Nr,wa={devicePixelRatio:1,fileName:"download.png"},H9=e=>{const{className:t,style:n,sharedStore:r}=e,{createPrefixName:a}=A.useContext(le),i=a(k9),o=i(),s=i("preview"),c=i("options"),d=i("canvas"),[u,f]=A.useState(null),[h,p]=A.useState(!0),[v,g]=A.useState(null),[m]=J.useForm(),b=A.useCallback(S=>{const x=r.get("idraw");x&&(p(!0),x.getImageBlobURL({devicePixelRatio:S}).then(({blobURL:C,width:E,height:j,devicePixelRatio:z})=>{C&&(g(C),f({width:E,height:j,devicePixelRatio:z}))}).catch(C=>{console.log(C)}).finally(()=>{p(!1)}))},[]);A.useEffect(()=>{m.setFieldsValue({devicePixelRatio:wa.devicePixelRatio,fileName:wa.fileName}),setTimeout(()=>{b(wa.devicePixelRatio)},10)},[]);const y=()=>{if(!v)return;const S=m.getFieldsValue(),x=document.createElement("a");x.href=v,x.download=S.fileName||wa.fileName,document.body.appendChild(x),x.click(),document.body.removeChild(x)};return A.useMemo(()=>l.createElement("div",{style:Object.assign(Object.assign({},n),{width:Us}),className:pe(o,t)},l.createElement(pf,{tip:"Loading...",spinning:h},l.createElement("div",{className:s,style:{width:Nr,height:Nr*3/4}},v&&l.createElement("img",{className:d,style:{maxWidth:Nr,maxHeight:Nr*3/4},src:v}))),l.createElement("div",{className:c,style:{width:F9}},l.createElement("div",{style:{marginBottom:6}},"Width: ",u==null?void 0:u.width),l.createElement("div",null,"Height: ",u==null?void 0:u.height),l.createElement(gf,null),l.createElement("div",null,l.createElement(J,{form:m,layout:"vertical",onValuesChange:S=>{S.devicePixelRatio>0&&setTimeout(()=>{b(S.devicePixelRatio)},10)},disabled:h},l.createElement(J.Item,{label:"Device pixel ratio",name:"devicePixelRatio"},l.createElement(Ge,{size:"small",options:[1,2,3,4].map(S=>({label:`x${S}`,value:S}))})),l.createElement(J.Item,{label:"File name",name:"fileName"},l.createElement(Jt,{size:"small",placeholder:"File name"})),l.createElement(Ve,{type:"primary",onClick:y,disabled:h||!v,loading:h},"Download"))))),[u,h,v,b])};var W9=function(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function s(u){try{d(r.next(u))}catch(f){o(f)}}function c(u){try{d(r.throw(u))}catch(f){o(f)}}function d(u){u.done?i(u.value):a(u.value).then(s,c)}d((r=r.apply(e,t||[])).next())})};function G9(e){return new Promise(function(t,n){const r=new FileReader;r.onload=function(){t(r)},r.onerror=n,e.type==="application/json"?r.readAsText(e):r.readAsArrayBuffer(e)})}function V9(e){Ko({accept:"application/json",success:t=>W9(this,void 0,void 0,function*(){var n,r,a;const o=(yield G9(t.file)).result;if(typeof o=="string")try{const s=JSON.parse(o);(n=e==null?void 0:e.success)===null||n===void 0||n.call(e,{json:s})}catch(s){(r=e==null?void 0:e.error)===null||r===void 0||r.call(e,s)}else(a=e==null?void 0:e.error)===null||a===void 0||a.call(e,Error("ERROR_PICK_FILE_FAIL"))}),error:e==null?void 0:e.error})}const U9=()=>{const[e]=Vs("NavMenu");return e},Y9="mod-nav-menu",X9=e=>{const{className:t,style:n,sharedStore:r,sharedEvent:a}=e,[i,o]=vf.useModal(),{createPrefixName:s}=A.useContext(le),c=s(Y9),d=c(),u=c("dropdown"),[f,h]=A.useState([]),p=U9(),v=({key:x,domEvent:C})=>{C.preventDefault(),a.trigger("createElement",{type:x,element:{name:x}})},g=x=>{const C=r.get("idraw");C==null||C.resize({devicePixelRatio:x})},m={more:[{key:"about-idraw-stuido",label:p.about,disabled:!0},{key:"line",type:"divider"},{key:"file",label:p.file,children:[{key:"import-json-file",label:p.importJSONFile,onClick:()=>{V9({success:({json:x})=>{a.trigger("resetData",{data:x})},error:()=>{}})}},{key:"export-image",label:p.exportImage,onClick:()=>{i.info({icon:null,title:"Whole image file",width:B9,content:l.createElement(H9,{sharedEvent:a,sharedStore:r}),footer:null,closable:!0})}},{key:"export-json-file",label:p.exportJSONFile,onClick:()=>{const x=r.get("idraw"),C=x==null?void 0:x.getData({compact:!0});if(C){const E=JSON.stringify(C);Hf(E,{fileName:"downdown.json"})}}}]},{key:"preferences",label:p.preferences,children:[{key:"device-pixel-ratio",label:p.devicePixelRatio,type:"group",children:[{key:"device-pixel-ratio-x1",label:"x1",onClick:()=>{g(1)}},{key:"device-pixel-ratio-x2",label:"x2",onClick:()=>{g(2)}},{key:"device-pixel-ratio-x3",label:"x3",onClick:()=>{g(3)}}]}]}],element:[{key:"rect",label:p.rect,icon:l.createElement(_u,null),onClick:v},{key:"circle",label:p.circle,icon:l.createElement(Ou,null),onClick:v},{key:"text",label:p.text,icon:l.createElement(Tu,null),onClick:v},{key:"image",label:p.image,icon:l.createElement(Iu,null),onClick:v},{key:"svg",label:p.svg,icon:l.createElement(Pu,null),onClick:v},{key:"html",label:p.html,disabled:!0,icon:l.createElement(zu,null),onClick:v},{key:"group",label:p.group,icon:l.createElement($u,null),onClick:v}]},b={size:"small",type:"text"},y=[{key:"more",button:l.createElement(D3,{style:{fontSize:20}})},{key:"element",button:l.createElement(m3,{style:{fontSize:20}})}],S=()=>{const x=r.get("idraw"),C=[];if(x){const{viewSizeInfo:E}=x.getViewInfo(),{devicePixelRatio:j}=E;C.push(`device-pixel-ratio-x${j}`)}h(C)};return A.useMemo(()=>l.createElement("div",{style:n,className:pe(d,t)},y.map((x,C)=>l.createElement(vi,{key:C,trigger:["click","click"],menu:{items:m[x.key]||[],selectedKeys:f},placement:"bottom",overlayClassName:u,onOpenChange:E=>{E===!0&&S()}},l.createElement(Ve,Object.assign({},b,{onClick:E=>E.preventDefault()}),l.createElement(mf.Compact,null,x.button,l.createElement(Du,{style:{fontSize:10,marginLeft:4}}))))),o),[f,p])},Z9="mod-header",K9=e=>{const{logo:t,navigationMenu:n,navigationCenter:r,className:a,style:i,openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f}=e,{state:h,dispatch:p}=A.useContext(gr),{createPrefixName:v}=A.useContext(le),g=v(Z9),m=g(),b=g("left"),y=g("right"),S=g("center"),x=g("locale"),C=g("scale"),E=g("switch"),{localeCode:j,scaleInfo:z}=h;return A.useMemo(()=>l.createElement("div",{style:i,className:pe(m,a)},l.createElement("div",{className:b},t,n||l.createElement(X9,{sharedStore:u,sharedEvent:f}),l.createElement(R9,{openLeftSider:o,openRightSider:s,onClickToggleLayer:c,onClickToggleSetting:d,sharedStore:u,sharedEvent:f})),r&&l.createElement("div",{className:S},r),l.createElement("div",{className:y},l.createElement(i3,{className:C,value:`${$e(z.scale)}`,onChange:k=>{const F=parseFloat(k);F>0&&(p==null||p({type:"update",payload:{scaleInfo:{scale:$e(F),from:"control"}}}))}}),l.createElement(Lf,{className:x,value:j,onChange:k=>{p==null||p({type:"update",payload:{localeCode:k}})}}),l.createElement(Nf,{className:E,theme:h==null?void 0:h.themeMode,onChange:({theme:k})=>{p==null||p({type:"updateThemeMode",payload:{themeMode:k}})}}))),[j,z,o,s,c,d])},Q9="mod-sketch",J9=e=>{const t=A.useRef(null),n=A.useRef(null),r=A.useRef(!1),{className:a,style:i,width:o,height:s,sharedEvent:c,sharedStore:d,useContextMenuOptions:u}=e,{generateClassName:f}=A.useContext(le),{state:h,dispatch:p}=A.useContext(gr),{editingData:v}=h,g=f(Q9),m=A.useRef([]),b=A.useRef(h.editingData),y=A.useRef(h.data),S=A.useRef([]),[x]=u({sharedEvent:c,sharedStore:d});return A.useEffect(()=>{m.current=[...h.editingDataPosition],y.current=h.data,b.current=h.editingData,S.current=[...h.selectedUUIDs]},[h.editingDataPosition,h.data,h.editingData,h.selectedUUIDs]),A.useEffect(()=>{if(!(t!=null&&t.current)||n!=null&&n.current)return;const C={width:o,height:s,devicePixelRatio:window.devicePixelRatio},E=new n3(t.current,C);n.current=E;const j=N=>{const D=b.current;let{uuids:w}=N;const{positions:P}=N;P&&Array.isArray(P)&&(w=Vd(P,D.elements).map(M=>M.uuid)),p({type:"update",payload:{selectedUUIDs:w}})},z=N=>{const{data:D,type:w}=N,P=b.current;if(["addElement","updateElement","deleteElement","moveElement","dragElement","resizeElement"].includes(w)){const V={editingData:Object.assign({},D)};["addElement","deleteElement","moveElement"].includes(w)&&(V.treeData=Ie(P)),p({type:"update",payload:V})}},k=N=>{const{scale:D}=N;p({type:"update",payload:{scaleInfo:{scale:D,from:"event"}}})},F=N=>{const{element:D}=N;E.updateElement(D);const w=Object.assign({},E.getData()),P=Ie(w);p({type:"update",payload:{editingData:Object.assign({},w),treeData:P}})},U=N=>{const{type:D,element:w}=N,P=E.createElement(D,{element:w,viewCenter:!0});let V=E.getViewCenter();const M=S.current;let Y=[];const H=E.getData();if(Array.isArray(M)&&M.length===1){const I=M[0],B=tn(I,H.elements);let ee=pt(B,H.elements);if(B.length>1){Y=[...B];let ut=Y.pop();ut+=1;const It=[...Y];Y.push(ut),ee=pt(It,H.elements),V=vt(ee),P.x=V.x-P.w/2,P.y=V.y-P.h/2}}const _=E.addElement(P,{position:Y}),T=Ie(_);p({type:"update",payload:{editingData:Object.assign({},_),treeData:T}}),E.selectElements([P.uuid])},L=N=>{const{element:D,position:w=[]}=N;let P=E.getViewCenter();const V=S.current;let M=w;const Y=E.getData();if(Array.isArray(V)&&V.length===1){const T=V[0],I=tn(T,Y.elements),B=pt(I,Y.elements);I.length>0&&(B==null?void 0:B.type)==="group"&&Array.isArray(B.detail.children)&&(M=[...I],M.push(B.detail.children.length),P=vt(B))}const H=E.addElement(Object.assign(Object.assign({},D),{x:P.x-D.w/2,y:P.y-D.h/2}),{position:M}),_=Ie(H);p({type:"update",payload:{editingData:Object.assign({},H),treeData:_}}),E.selectElements([D.uuid])},O=N=>{const{uuid:D}=N;E==null||E.deleteElement(D);const w=E==null?void 0:E.getData();if(w){const P=Ie(w);p({type:"update",payload:{editingData:Object.assign({},w),treeData:P}}),E.trigger(Se.clearSelect,{})}},$=N=>{const{type:D,position:w}=N,P=n==null?void 0:n.current;if(!P)return;const V=m.current,M=y.current,Y=b.current;if(V.length>0&&E9(V,Y,M),D==="go-to-group"&&w){const H=[...V,...w],_=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:Object.assign({},_),editingDataPosition:H,treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}else if(D==="back-one"&&V.length>0){const H=[...V];H.pop();const _=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:Object.assign({},_),editingDataPosition:[...H],treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}else if(D==="back-root"){const H=[],_=er(H,M),T=Ie(_);p({type:"update",payload:{data:Object.assign({},M),editingData:_,editingDataPosition:H,treeData:T}}),P.centerContent({data:_}),P.trigger(Se.clearSelect,{})}},R=N=>{const{data:D}=N,w=[],P=er(w,D),V=Ie(P);p({type:"update",payload:{data:Object.assign({},D),editingData:Object.assign({},P),editingDataPosition:w,treeData:V}}),E.setViewScale({scale:1,offsetX:0,offsetY:0}),E.trigger(Se.clearSelect,{})},G=N=>{const{editingData:D}=N,w=Ie(D);p({type:"update",payload:{editingData:Object.assign({},D),treeData:w}}),E.trigger(Se.clearSelect,{})};if(E.on(Se.select,j),E.on(Se.change,z),E.on(Se.scale,k),E.on(Se.textChange,F),c.on("createElement",U),c.on("addElement",L),c.on("deleteElement",O),c.on("resetEditingView",$),c.on("resetData",R),c.on("resetEditingData",G),c.on("dispatch",p),!r.current){if(h.scaleInfo){const{scale:N,offsetX:D,offsetY:w}=h.scaleInfo;N&&D&&w&&E.setViewScale({scale:N,offsetX:D,offsetY:w})}r.current=!0}return d.set("idraw",E),()=>{r.current=!1,E.off(Se.select,j),E.off(Se.change,z),E.off(Se.scale,k),E.off(Se.textChange,F),d.set("idraw",null)}},[]),A.useEffect(()=>{n!=null&&n.current&&n.current.setData(v)},[v]),A.useEffect(()=>{if(n!=null&&n.current){const C=n.current;h.scaleInfo.from==="control"&&C.scale({scale:h.scaleInfo.scale,point:{x:o/2,y:s/2}})}},[h.scaleInfo]),A.useEffect(()=>{const C=n.current,E=t.current;C&&C.resize({width:o,height:s}),E&&(E.style.width=`${o}px`,E.style.height=`${s}px`)},[o,s]),A.useMemo(()=>l.createElement(vi,{menu:{items:x},trigger:["contextMenu"]},l.createElement("div",{ref:t,className:pe(g,a),style:Object.assign(Object.assign({},i),{width:o,height:s,padding:0})})),[x])},q9="mod-dashboard",xa=240,Ea=240,Or=36,eO=A.forwardRef((e,t)=>{const{className:n,style:r,width:a,height:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,sharedStore:u,sharedEvent:f,useContextMenuOptions:h,handleKeyboard:p}=e,{createPrefixName:v}=A.useContext(le),g=v(q9),[m,b]=A.useState(!0),[y,S]=A.useState(!0);A.useEffect(()=>{const E=j=>{["INPUT","TEXTAREA"].includes(j.target.nodeName)||p(j,{sharedEvent:f,sharedStore:u})};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E)}},[]);const[x,C]=A.useState({leftWidth:m?xa:0,rightWidth:y?Ea:0,centerWidth:a-(m?xa:0)-(y?Ea:0)});return A.useEffect(()=>{const E=m?xa:0,j=y?Ea:0,z=a-E-j;C({leftWidth:E,rightWidth:j,centerWidth:z})},[i,a,m,y]),A.useMemo(()=>{const{leftWidth:E,rightWidth:j,centerWidth:z}=x;return l.createElement("div",{ref:t,className:pe(g(),n),style:Object.assign(Object.assign({},r),{width:a,height:i,padding:0})},l.createElement("div",{className:g("header"),style:{height:Or}},l.createElement(K9,{sharedEvent:f,sharedStore:u,logo:o,navigationMenu:s,navigationCenter:c,openLeftSider:m,openRightSider:y,onClickToggleLayer:()=>{const k=!m;let F=E;k?F=xa:F=0,C({leftWidth:F,rightWidth:j,centerWidth:a-F-j}),b(k)},onClickToggleSetting:()=>{const k=!y;let F=j;k?F=Ea:F=0,C({leftWidth:E,rightWidth:F,centerWidth:a-E-F}),S(k)}})),l.createElement("div",{className:g("content"),style:{top:Or}},l.createElement(Za,{split:"vertical",defaultSize:z+j,allowResize:!0,onChange:k=>{const F=a-k,U=k-j;U<100||C({leftWidth:F,rightWidth:j,centerWidth:U})},pane1Style:{width:E},pane2Style:{width:z+j}},l.createElement("div",null,m&&l.createElement(N9,{height:i-Or,className:g("left"),defaultSelectedElementUUIDs:d,sharedEvent:f,sharedStore:u,useContextMenuOptions:h})),l.createElement("div",{style:{width:x.centerWidth+x.rightWidth,display:"flex",flexDirection:"row"}},l.createElement(J9,{className:g("center"),width:z,height:i-Or,sharedStore:u,sharedEvent:f,useContextMenuOptions:h}),l.createElement("div",{className:g("right"),style:{width:j,height:i-Or}},l.createElement(L9,null))))))},[n,m,y,x,i])});function Ad(){return{idraw:null,clipboard:{type:"default",data:null},selectedUUIDs:[]}}function tO(e){const{sharedEvent:t,sharedStore:n}=e;t.on("copy",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Aa(a,i.elements);o.length>0&&n.set("clipboard",{type:"copy-elements",data:o})}}),t.on("paste",()=>{const r=n.get("idraw"),a=n.get("clipboard"),i=n.get("selectedUUIDs");if(r&&["copy-elements","cut-elements"].includes(a==null?void 0:a.type)&&Array.isArray(a.data)){const o=a.data,s=[];if(a.type==="copy-elements"){for(let h=0;h0&&d[d.length-1]++,s.forEach(h=>{r.addElement(h,{position:d})});const u=r==null?void 0:r.getData(),f=Ie(u);t.trigger("dispatch",{type:"update",payload:{editingData:u,treeData:f}}),r.selectElement(s[0].uuid),setTimeout(()=>{t.trigger("scrollToLayer",{uuid:s[0].uuid})},100)}}),t.on("cut",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const c=Aa(a,i.elements);c.length>0&&n.set("clipboard",{type:"cut-elements",data:c.map(d=>Bi(d))}),c.forEach(d=>{r==null||r.deleteElement(d.uuid)})}const o=r==null?void 0:r.getData(),s=Ie(o);t.trigger("dispatch",{type:"update",payload:{editingData:o,treeData:s}}),r==null||r.trigger(Se.clearSelect)}),t.on("delete",()=>{const r=n.get("idraw"),a=n.get("selectedUUIDs"),i=r==null?void 0:r.getData();if(i&&Array.isArray(a)&&a.length>0){const o=Aa(a,i.elements);if(o.length>0){for(let d=0;d{const[t]=Vs("contextMenu"),{sharedEvent:n}=e;return[[{label:t.copy,key:"copy",onClick:()=>{n.trigger("copy")}},{label:t.paste,key:"paste-here",onClick:()=>{n.trigger("paste")}},{label:t.cut,key:"cut",onClick:()=>{n.trigger("cut")}},{label:t.delete,key:"delete",onClick:()=>{n.trigger("delete")}}]]};var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});var rO=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ho={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},of={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:rO?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},Ys={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var Sa=1;Sa<20;Sa++)Ys["f"+Sa]=111+Sa;function Li(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(o){return sf(o,t)}),a=function(s){return r.some(function(c){return lf(c,s)})},i=n==null?a:a(n);return i}function aO(e,t){return Li(e,t)}function iO(e,t){return Li(e,{byKey:!0},t)}function sf(e,t){var n=t&&t.byKey,r={};e=e.replace("++","+add");var a=e.split("+"),i=a.length;for(var o in ho)r[ho[o]]=!1;var s=!0,c=!1,d=void 0;try{for(var u=a[Symbol.iterator](),f;!(s=(f=u.next()).done);s=!0){var h=f.value,p=h.endsWith("?")&&h.length>1;p&&(h=h.slice(0,-1));var v=Xs(h),g=ho[v];if(h.length>1&&!g&&!of[h]&&!Ys[v])throw new TypeError('Unknown modifier: "'+h+'"');(i===1||!g)&&(n?r.key=v:r.which=cf(h)),g&&(r[g]=p?null:!0)}}catch(m){c=!0,d=m}finally{try{!s&&u.return&&u.return()}finally{if(c)throw d}}return r}function lf(e,t){for(var n in e){var r=e[n],a=void 0;if(r!=null&&(n==="key"&&t.key!=null?a=t.key.toLowerCase():n==="which"?a=r===91&&t.which===93?91:t.which:a=t[n],!(a==null&&r===!1)&&a!==r))return!1}return!0}function cf(e){e=Xs(e);var t=Ys[e]||e.toUpperCase().charCodeAt(0);return t}function Xs(e){return e=e.toLowerCase(),e=of[e]||e,e}var xn=Pt.default=Li;Pt.isHotkey=Li;Pt.isCodeHotkey=aO;Pt.isKeyHotkey=iO;Pt.parseHotkey=sf;Pt.compareHotkey=lf;Pt.toKeyCode=cf;Pt.toKeyName=Xs;const oO=(e,t)=>{const{sharedEvent:n}=t;xn("mod+c",e)?n.trigger("copy",void 0):xn("mod+v",e)?n.trigger("paste",void 0):xn("mod+x",e)?n.trigger("cut",void 0):xn("del",e)||xn("backspace",e)?n.trigger("delete",void 0):xn("mod+s",e)&&console.log("Save ... ")},cO=l.forwardRef((e,t)=>{const{width:n=1e3,height:r=600,style:a,className:i,logo:o,navigationMenu:s,navigationCenter:c,defaultSelectedElementUUIDs:d,prefiexName:u,onEditGroupElement:f,useContextMenuOptions:h=nO,handleKeyboard:p=oO}=e,[v,g]=A.useReducer(_9,M9(e)),m=A.useRef(null),b=A.useRef(new en),y=A.useRef(new Fr({defaultStorage:Ad()}));return A.useEffect(()=>{const S=pt(v.editingDataPosition,v.data.elements);f==null||f({uuid:S==null?void 0:S.uuid,position:[...v.editingDataPosition]})},[v.editingDataPosition]),A.useImperativeHandle(t,()=>({getSharedEvent(){return b.current},getSharedStore(){return y.current},dispatch(x){const{type:C,payload:E}=x;g({type:C,payload:E})}}),[]),A.useEffect(()=>(b.current||(b.current=new en),y.current||(y.current=new Fr({defaultStorage:Ad()})),tO({sharedEvent:b.current,sharedStore:y.current}),()=>{var S,x;(S=y.current)===null||S===void 0||S.clear(),(x=b.current)===null||x===void 0||x.destroy(),b.current=null,y.current=null}),[]),A.useEffect(()=>{const S=y.current;S&&S.set("selectedUUIDs",[...v.selectedUUIDs])},[v.selectedUUIDs]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("switchTheme",{theme:v.themeMode})},[v.themeMode]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("changeLocale",{locale:v.localeCode})},[v.localeCode]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("trackDataChange",{data:v.data})},[v.data]),A.useEffect(()=>{const S=b.current;S==null||S.trigger("trackEditingDataChange",{editingData:v.editingData,editingDataPosition:v.editingDataPosition})},[v.editingData,v.editingDataPosition]),A.useMemo(()=>l.createElement(Ef,{localeCode:v.localeCode,container:m.current,topPrefix:u,themeMode:v.themeMode},l.createElement(O9,{value:{state:v,dispatch:g}},l.createElement(eO,{logo:o,navigationMenu:s,navigationCenter:c,ref:m,width:n,height:r,style:a,className:i,defaultSelectedElementUUIDs:d,sharedEvent:b.current,sharedStore:y.current,useContextMenuOptions:h,handleKeyboard:p}))),[u,n,r,v,g,m])});export{cO as S}; diff --git a/package.json b/package.json index 9d78dcb..a5bd701 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "vite-node": "^1.2.2" }, "dependencies": { - "@idraw/studio": "0.4.0-alpha.15", + "@idraw/studio": "0.4.0-alpha.18", "antd": "^5.14.0", - "idraw": "0.4.0-beta.15", + "idraw": "0.4.0-beta.18", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8148d9f..a7fa3c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,14 +6,14 @@ settings: dependencies: '@idraw/studio': - specifier: 0.4.0-alpha.15 - version: 0.4.0-alpha.15(antd@5.14.0)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) + specifier: 0.4.0-alpha.18 + version: 0.4.0-alpha.18(antd@5.14.0)(idraw@0.4.0-beta.18)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) antd: specifier: ^5.14.0 version: 5.14.0(react-dom@18.2.0)(react@18.2.0) idraw: - specifier: 0.4.0-beta.15 - version: 0.4.0-beta.15 + specifier: 0.4.0-beta.18 + version: 0.4.0-beta.18 react: specifier: ^18.2.0 version: 18.2.0 @@ -567,79 +567,79 @@ packages: react: 18.2.0 dev: false - /@idraw/board@0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15): - resolution: {integrity: sha512-p6LbruqZehOhwav5C8E060zrP7cfR8Wm/8nEKR4gtxQKbX6UaOQI5qFPEwpPJmvVglBkq/GO3omdwUq8k67vqg==} + /@idraw/board@0.4.0-beta.18(@idraw/renderer@0.4.0-beta.18)(@idraw/util@0.4.0-beta.18): + resolution: {integrity: sha512-FK/osT8pEokUVvJm3ZPdeqvc6C+sLr8DAMUZLZx2uMoObH9Y0XPBUSd9UIUxyAVO3V5h9oXQUBWQrnXvt+lDCA==} peerDependencies: - '@idraw/renderer': ^0.4.0-beta.15 - '@idraw/util': ^0.4.0-beta.15 + '@idraw/renderer': ^0.4.0-beta.18 + '@idraw/util': ^0.4.0-beta.18 dependencies: - '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) - '@idraw/util': 0.4.0-beta.15 + '@idraw/renderer': 0.4.0-beta.18(@idraw/util@0.4.0-beta.18) + '@idraw/util': 0.4.0-beta.18 dev: false - /@idraw/core@0.4.0-beta.15(@idraw/board@0.4.0-beta.15)(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15): - resolution: {integrity: sha512-j9ECmfZ51BfuHilpF7f4glijxBrYqALVN5EUZrsknPAyWcoO4gtpoyTv1MwpX1MJ/I4jivhn9J0HJriRTHkHaA==} + /@idraw/core@0.4.0-beta.18(@idraw/board@0.4.0-beta.18)(@idraw/renderer@0.4.0-beta.18)(@idraw/util@0.4.0-beta.18): + resolution: {integrity: sha512-WOEeS6y0Per1euTFsUQ7Wt2+eCTKl4mZ7WHZWO9ekJQfOecoGmGXGZOMpy+S19orAcH8j7qWmoFS7iMwU9HpCA==} peerDependencies: - '@idraw/board': ^0.4.0-beta.15 - '@idraw/renderer': ^0.4.0-beta.15 - '@idraw/util': ^0.4.0-beta.15 + '@idraw/board': ^0.4.0-beta.18 + '@idraw/renderer': ^0.4.0-beta.18 + '@idraw/util': ^0.4.0-beta.18 dependencies: - '@idraw/board': 0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) - '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) - '@idraw/util': 0.4.0-beta.15 + '@idraw/board': 0.4.0-beta.18(@idraw/renderer@0.4.0-beta.18)(@idraw/util@0.4.0-beta.18) + '@idraw/renderer': 0.4.0-beta.18(@idraw/util@0.4.0-beta.18) + '@idraw/util': 0.4.0-beta.18 dev: false - /@idraw/renderer@0.4.0-beta.15(@idraw/util@0.4.0-beta.15): - resolution: {integrity: sha512-9U+McaaPO98JJQhHJKGKqKEPEiQD5KtOQgx/xfkmnMMl1z/B2OBiY9G8IgZzkQY8OI2fjvqgm4opmWIbPeSmkA==} + /@idraw/renderer@0.4.0-beta.18(@idraw/util@0.4.0-beta.18): + resolution: {integrity: sha512-vKa3Uu/ou0kEBhNPLk6UeOMcN6bO2ujDSFRFps6w8EjZcDoJbjgiif41YZYxJueR/PAla9Fyfuk75k+Wbc55uQ==} peerDependencies: - '@idraw/util': ^0.4.0-beta.15 + '@idraw/util': ^0.4.0-beta.18 dependencies: - '@idraw/util': 0.4.0-beta.15 + '@idraw/util': 0.4.0-beta.18 dev: false - /@idraw/studio-base@0.4.0-alpha.15(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-NsX5XamyssJJLdlBvrHlDdY0i+7sO1EmgYkS+lyurCZJLKUWaFlsO88QvEZzUrpbbWOy8WZeQeP9ADCd9Pi3xw==} + /@idraw/studio-base@0.4.0-alpha.18(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.18)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-qYC+zVSGjbdWeKLRtHq5yr6zyB65xx1hD9J6Y6+X3Q/pEtOFCTyfvCjxLQpJhhyvWDPVsUn2V2LNSjbBQ01a1w==} peerDependencies: antd: ^5.12.1 classnames: ^2.3.2 - idraw: ^0.4.0-beta.15 + idraw: ^0.4.0-beta.18 react: ^18.2.0 react-color: ^2.19.3 react-dom: ^18.2.0 dependencies: antd: 5.14.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - idraw: 0.4.0-beta.15 + idraw: 0.4.0-beta.18 react: 18.2.0 react-color: 2.19.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) dev: false - /@idraw/studio@0.4.0-alpha.15(antd@5.14.0)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-22CUYoy5QOkc/2DKWtWSp4I4AMC4WatHd8ulLno12Wv4/IwcxIuCkJfAdUcA/Hk0ZAfXiqF16VCJGB4dHPbcEQ==} + /@idraw/studio@0.4.0-alpha.18(antd@5.14.0)(idraw@0.4.0-beta.18)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-3V/si7xlsP6Iy/rj44mQWdzo8g6xxgzGg9iK+mnLGs1RTTEyXbAdxuat/9yo6GCIeiaQ2t1s0d7cATqHYlUDSQ==} peerDependencies: antd: ^5.12.1 - idraw: ^0.4.0-beta.15 + idraw: ^0.4.0-beta.18 react: ^18.2.0 react-color: ^2.19.3 react-dom: ^18.2.0 dependencies: - '@idraw/studio-base': 0.4.0-alpha.15(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.15)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) + '@idraw/studio-base': 0.4.0-alpha.18(antd@5.14.0)(classnames@2.5.1)(idraw@0.4.0-beta.18)(react-color@2.19.3)(react-dom@18.2.0)(react@18.2.0) antd: 5.14.0(react-dom@18.2.0)(react@18.2.0) classnames: 2.5.1 - idraw: 0.4.0-beta.15 + idraw: 0.4.0-beta.18 is-hotkey: 0.2.0 react: 18.2.0 react-color: 2.19.3(react@18.2.0) react-dom: 18.2.0(react@18.2.0) dev: false - /@idraw/types@0.4.0-beta.15: - resolution: {integrity: sha512-Tmuwrp1nNVmb6KoxSREB/nhcTMj+dwfwF02fqkHlWBDOnACQ1JlsuvN/YTIxXi55OteUKGNggxZuQ1fV+S7qJg==} + /@idraw/types@0.4.0-beta.18: + resolution: {integrity: sha512-iPzQ1+aONP4iQJkLiz73B5KpTepeQXP7LRPblVppoe7RD73Be9yJKGFjmKoXxzmoCzdAGHFnLx5dBWh/wKSC2Q==} dev: false - /@idraw/util@0.4.0-beta.15: - resolution: {integrity: sha512-0NVkYVXMWS/VdmC43lCz2AtLFyZCp1deGQKLUidoNLR/0EiAdKuPMbPRGXnxOZ83BEpwlIxP3ZozmcZuR9asyQ==} + /@idraw/util@0.4.0-beta.18: + resolution: {integrity: sha512-qQqtEKztW0eKxHX4kT45MRHhhnE79yd5gnbSYNmh8iPBtknB3Ot7XsabIaSgxoGn4f77RutDLUyMipSptGyvyg==} dev: false /@jridgewell/gen-mapping@0.3.3: @@ -1202,14 +1202,14 @@ packages: dev: true optional: true - /idraw@0.4.0-beta.15: - resolution: {integrity: sha512-Sx+9kUI5rw+p5CxELU3LkDYgx3o2X+GAhLm7NN5dzdgxGy3pjhwCgcoPujt9mUYgHTTgBKZqCcwqkr33mMSA2A==} + /idraw@0.4.0-beta.18: + resolution: {integrity: sha512-bxVoAcw7ZxlnxPluZz3Za+sThxXfPpEP8QQeARCOhm5J3w8loitjlUK5pYZnfhIGW9gTz8bfMvyeMVOEgii16w==} dependencies: - '@idraw/board': 0.4.0-beta.15(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) - '@idraw/core': 0.4.0-beta.15(@idraw/board@0.4.0-beta.15)(@idraw/renderer@0.4.0-beta.15)(@idraw/util@0.4.0-beta.15) - '@idraw/renderer': 0.4.0-beta.15(@idraw/util@0.4.0-beta.15) - '@idraw/types': 0.4.0-beta.15 - '@idraw/util': 0.4.0-beta.15 + '@idraw/board': 0.4.0-beta.18(@idraw/renderer@0.4.0-beta.18)(@idraw/util@0.4.0-beta.18) + '@idraw/core': 0.4.0-beta.18(@idraw/board@0.4.0-beta.18)(@idraw/renderer@0.4.0-beta.18)(@idraw/util@0.4.0-beta.18) + '@idraw/renderer': 0.4.0-beta.18(@idraw/util@0.4.0-beta.18) + '@idraw/types': 0.4.0-beta.18 + '@idraw/util': 0.4.0-beta.18 dev: false /image-size@0.5.5: