whiteboard-v2 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1378,6 +1378,8 @@ const bi = ["data-testid", "width", "height"], wi = ["data-testid", "stroke", "f
1378
1378
  return "50,0 100,38 82,100 18,100 0,38";
1379
1379
  case "line":
1380
1380
  return "0,100 100,0";
1381
+ case "horizontal-line":
1382
+ return "0,50 100,50";
1381
1383
  case "arrow":
1382
1384
  return "0,30 60,30 60,0 100,50 60,100 60,70 0,70";
1383
1385
  default:
@@ -8904,19 +8906,15 @@ const Gc = /* @__PURE__ */ I({
8904
8906
  __name: "ExpandedSidebar",
8905
8907
  emits: ["clear-all"],
8906
8908
  setup(e) {
8907
- const t = V(!1), o = ie(), n = [
8908
- "rectangle",
8909
- "chevron",
8910
- "ellipse",
8911
- "line",
8912
- "arrow"
8913
- ], s = [
8909
+ const t = V(!1), o = ie(), n = ["rectangle", "chevron", "ellipse", "arrow"], s = [
8914
8910
  "triangle",
8915
8911
  "trapezoid",
8916
8912
  "hexagon",
8917
8913
  "diamond",
8918
8914
  "parallelogram",
8919
- "pentagon"
8915
+ "pentagon",
8916
+ "line",
8917
+ "horizontal-line"
8920
8918
  ];
8921
8919
  return (a, i) => (g(), $("aside", cu, [
8922
8920
  i[6] || (i[6] = _("div", { class: "p-3 border-b border-ma-grey-300" }, [
@@ -1,4 +1,4 @@
1
- (function(U,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","vue-router"],e):(U=typeof globalThis<"u"?globalThis:U||self,e(U.WhiteboardEditor={},U.Vue,U.Pinia,U.VueRouter))})(this,(function(U,e,Ae,tr){"use strict";function or(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const ro=or(e),J=Ae.defineStore("zoom",{state:()=>({zoom:1}),getters:{zoomPercentage:t=>Math.round(t.zoom*100)},actions:{zoomIn(){this.zoom<3&&(this.zoom=Math.min(this.zoom+.1,3))},zoomOut(){this.zoom>.1&&(this.zoom=Math.max(this.zoom-.1,.1))},setZoom(t){this.zoom=Math.max(.1,Math.min(3,t))},resetZoom(){this.zoom=1},autoFit(t,o,n,r=100){if(t.length===0){this.resetZoom();return}const s=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y)),i=Math.max(...t.map(p=>p.x+p.width)),l=Math.max(...t.map(p=>p.y+p.height)),d=i-s,c=l-a,f=(o-r)/d,u=(n-r)/c,m=Math.min(f,u,3);this.setZoom(Math.max(.1,m))}}}),nr=["width","height"],rr=["d"],so=e.defineComponent({__name:"GridCanvas",props:{contentWidth:{},contentHeight:{}},emits:["canvas-click","delete-selected","copy-selected","paste","duplicate","undo","redo"],setup(t,{emit:o}){const n=t,r=o,s=J(),a=e.computed(()=>s.zoom*20),i=e.computed(()=>n.contentWidth&&n.contentWidth>0?n.contentWidth:null),l=e.computed(()=>n.contentHeight&&n.contentHeight>0?n.contentHeight:null),d=e.computed(()=>({width:i.value?`${i.value*s.zoom}px`:"100%",height:l.value?`${l.value*s.zoom}px`:"100%",minWidth:"100%",minHeight:"100%"})),c=e.computed(()=>({width:i.value?`${i.value}px`:"100%",height:l.value?`${l.value}px`:"100%",transform:`scale(${s.zoom})`,transformOrigin:"top left"})),f=e.computed(()=>({width:d.value.width,height:d.value.height,minWidth:"100%",minHeight:"100%"})),u=p=>{(p.target===p.currentTarget||p.target.classList.contains("grid-pattern")||p.target.classList.contains("zoom-container")||p.target.classList.contains("zoom-content"))&&r("canvas-click")},m=p=>{const y=navigator.platform.toUpperCase().indexOf("MAC")>=0?p.metaKey:p.ctrlKey;y&&p.key==="z"&&!p.shiftKey?(p.preventDefault(),r("undo")):y&&p.key==="z"&&p.shiftKey||y&&p.key==="y"?(p.preventDefault(),r("redo")):y&&p.key==="c"?(p.preventDefault(),r("copy-selected")):y&&p.key==="v"?(p.preventDefault(),r("paste")):y&&p.key==="d"&&(p.preventDefault(),r("duplicate"))};return(p,h)=>(e.openBlock(),e.createElementBlock("div",{"data-testid":"canvas-container",class:"flex-1 relative bg-bg-maincontent overflow-auto outline-none",tabindex:"0",onMousedown:u,onKeydown:[h[0]||(h[0]=e.withKeys(y=>p.$emit("delete-selected"),["delete"])),h[1]||(h[1]=e.withKeys(y=>p.$emit("delete-selected"),["backspace"])),m]},[(e.openBlock(),e.createElementBlock("svg",{"data-testid":"grid-svg",class:"absolute top-0 left-0 pointer-events-none z-0 text-ma-grey-700",style:e.normalizeStyle(d.value),xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("defs",null,[e.createElementVNode("pattern",{id:"grid",width:a.value,height:a.value,patternUnits:"userSpaceOnUse"},[e.createElementVNode("path",{"data-testid":"grid-pattern-path",d:`M ${a.value} 0 L 0 0 0 ${a.value}`,fill:"none",stroke:"currentColor","stroke-width":"0.5"},null,8,rr)],8,nr)]),h[2]||(h[2]=e.createElementVNode("rect",{width:"100%",height:"100%",fill:"url(#grid)"},null,-1))],4)),e.createElementVNode("div",{class:"zoom-container absolute top-0 left-0",style:e.normalizeStyle(d.value)},[e.createElementVNode("div",{class:"zoom-content",style:e.normalizeStyle(c.value)},[e.renderSlot(p.$slots,"default")],4)],4),e.createElementVNode("div",{class:"absolute top-0 left-0 pointer-events-none",style:e.normalizeStyle(f.value)},[e.renderSlot(p.$slots,"overlay")],4)],32))}});function sr(t){if(!t||!t.trim())return[];const o=[],n=t.trim().split(/\s+/);for(const r of n){const s=r.split(","),a=s[0],i=s[1];if(!a||!i)return[];const l=parseFloat(a),d=parseFloat(i);if(isNaN(l)||isNaN(d))return[];o.push({x:l,y:d})}return o}function ar(t){const o=sr(t);if(o.length===0)return"";const n=o.map(u=>u.x),r=o.map(u=>u.y),s=Math.min(...n),a=Math.max(...n),i=Math.min(...r),l=Math.max(...r),d=a-s,c=l-i;return d===0||c===0?t:o.map(u=>({x:Math.round((u.x-s)/d*100),y:Math.round((u.y-i)/c*100)})).map(u=>`${u.x},${u.y}`).join(" ")}const Ue=30;function ir(t,o,n){switch((n%360+360)%360){case 90:return{x:o,y:-t};case 180:return{x:-t,y:-o};case 270:return{x:-o,y:t};default:return{x:t,y:o}}}function lr(t,o,n){switch((n%360+360)%360){case 90:return{x:-o,y:t};case 180:return{x:-t,y:-o};case 270:return{x:o,y:-t};default:return{x:t,y:o}}}function dr(t,o,n,r){const{x:s,y:a,width:i,height:l,rotation:d}=t,c={x:s+i/2,y:a+l/2},f=ir(n,r,d);let u=i,m=l,p=0,h=0;if(o.includes("nw")||o.includes("se")?Math.abs(f.x)<Math.abs(f.y)?f.x=f.y:f.y=f.x:(o.includes("ne")||o.includes("sw"))&&(Math.abs(f.x)<Math.abs(f.y)?f.x=-f.y:f.y=-f.x),o.includes("e"))u=Math.max(Ue,i+f.x),p=(u-i)/2;else if(o.includes("w")){const g=i-f.x;u=Math.max(Ue,g),p=-(u-i)/2}if(o.includes("s"))m=Math.max(Ue,l+f.y),h=(m-l)/2;else if(o.includes("n")){const g=l-f.y;m=Math.max(Ue,g),h=-(m-l)/2}const y=lr(p,h,d);return{x:c.x+y.x-u/2,y:c.y+y.y-m/2,width:u,height:m,rotation:d}}function He(t){const{x:o,y:n,width:r,height:s,rotation:a}=t,i=(a%360+360)%360;if(i===90||i===270){const l={x:o+r/2,y:n+s/2};return{x:l.x-s/2,y:l.y-r/2,width:s,height:r,rotation:i}}return t}function ao(t,o){const n=o.find(s=>s.id===t);if(!n)return[];const r=[n];return n.type==="group"&&n.childIds.forEach(a=>{const i=o.find(l=>l.id===a);i&&!r.some(l=>l.id===i.id)&&r.push(i)}),r}function Me(t,o){const n=[],r=new Set;return t.forEach(s=>{ao(s,o).forEach(i=>{r.has(i.id)||(r.add(i.id),n.push(i))})}),n}function io(t,o){t.forEach(n=>{if(n.groupId&&o[n.groupId]&&(n.groupId=o[n.groupId]),n.type==="group"){const r=n;r.childIds=r.childIds.map(s=>o[s]||s)}})}function lo(t){let o=1/0,n=1/0,r=-1/0,s=-1/0;return t.forEach(a=>{const i=He(a);o=Math.min(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x+i.width),s=Math.max(s,i.y+i.height)}),{x:o,y:n,width:r-o,height:s-n}}function cr(t,o,n,r){const s=o.width>0?n.width/o.width:1,a=o.height>0?n.height/o.height:1,i=[];return t.childIds.forEach(l=>{const d=r.find(w=>w.id===l);if(!d)return;const c=He(d),f=c.x-o.x,u=c.y-o.y,m=n.x+f*s,p=n.y+u*a,h=Math.max(10,c.width*s),y=Math.max(10,c.height*a),g=(d.rotation%360+360)%360;if(g===90||g===270){const w=y,k=h,I=m+h/2,S=p+y/2;i.push({id:l,updates:{x:I-w/2,y:S-k/2,width:w,height:k}})}else i.push({id:l,updates:{x:m,y:p,width:h,height:y}})}),i}function fr(t,o){const n=t.x+t.width/2,r=t.y+t.height/2,s=[],a=[];t.childIds.forEach(l=>{const d=o.find(k=>k.id===l);if(!d)return;const c=d.x+d.width/2,f=d.y+d.height/2,u=c-n,p=-(f-r),h=u,y=n+p,g=r+h,x=(d.rotation+90)%360,w={x:y-d.width/2,y:g-d.height/2,rotation:x};s.push({id:l,updates:w}),a.push({...d,...w})});const i=lo(a);return{childUpdates:s,newGroupBounds:i}}const Ke="#cfe4ed",ae="#279ac8",Ge="#073446",pr=50,W=Ae.defineStore("elements",{state:()=>({elements:[],selectedElementIds:[],nextId:1,history:[[]],historyIndex:0,clipboard:[],customShapes:[]}),getters:{selectedElement:t=>t.selectedElementIds.length===0?null:t.elements.find(o=>o.id===t.selectedElementIds[0])||null,selectedElementId:t=>t.selectedElementIds.length>0?t.selectedElementIds[0]:null,selectedElements:t=>t.elements.filter(o=>t.selectedElementIds.includes(o.id)),hasMultipleSelected:t=>t.selectedElementIds.length>1,sortedElements:t=>[...t.elements].sort((o,n)=>o.zIndex-n.zIndex),topLevelElements:t=>t.elements.filter(o=>!o.groupId),canUndo:t=>t.historyIndex>0,canRedo:t=>t.historyIndex<t.history.length-1,hasCopiedElement:t=>t.clipboard!==null&&t.clipboard.length>0},actions:{saveCustomShape(t,o){this.customShapes.push({name:t,points:ar(o)})},saveSnapshot(){this.canRedo&&(this.history=this.history.slice(0,this.historyIndex+1));const t=JSON.parse(JSON.stringify(this.elements));this.history.push(t),this.historyIndex=this.history.length-1,this.history.length>pr&&(this.history.shift(),this.historyIndex=this.history.length-1)},undo(){this.canUndo&&(this.historyIndex--,this.elements=JSON.parse(JSON.stringify(this.history[this.historyIndex])),this.selectedElementIds=this.selectedElementIds.filter(t=>this.elements.some(o=>o.id===t)))},redo(){this.canRedo&&(this.historyIndex++,this.elements=JSON.parse(JSON.stringify(this.history[this.historyIndex])),this.selectedElementIds=this.selectedElementIds.filter(t=>this.elements.some(o=>o.id===t)))},addElement(t){this.elements.push(t),this.selectedElementIds=[t.id],this.saveSnapshot()},addShape(t,o=100,n=100,r){const s={id:`shape-${this.nextId++}`,type:"shape",shapeType:t,x:o,y:n,width:100,height:100,outline:ae,fill:Ke,strokeWeight:3,fontSize:16,fontFamily:"Arial",color:Ge,zIndex:this.elements.length,rotation:0,customPoints:t==="custom"?r:void 0};this.addElement(s)},addText(t=100,o=100){const n={id:`text-${this.nextId++}`,type:"text",content:"Text element",x:t,y:o,width:200,height:50,fontSize:16,fontFamily:"Arial",color:Ge,zIndex:this.elements.length,rotation:0};this.addElement(n)},addIcon(t,o=100,n=100){const r={id:`icon-${this.nextId++}`,type:"icon",iconType:t,x:o,y:n,width:50,height:50,color:ae,strokeWeight:2,zIndex:this.elements.length,rotation:0};this.addElement(r)},updateElement(t,o,n=!0){const r=this.elements.findIndex(s=>s.id===t);r!==-1&&(this.elements[r]={...this.elements[r],...o},n&&this.saveSnapshot())},deleteElement(t){const o=this.elements.findIndex(n=>n.id===t);o!==-1&&(this.elements.splice(o,1),this.selectedElementIds=this.selectedElementIds.filter(n=>n!==t),this.saveSnapshot())},deleteSelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements),o=new Set(t.map(n=>n.id));this.elements=this.elements.filter(n=>!o.has(n.id)),this.selectedElementIds=[],this.saveSnapshot()},selectElement(t){this.selectedElementIds=t?[t]:[]},toggleElementSelection(t){const o=this.selectedElementIds.indexOf(t);o===-1?this.selectedElementIds.push(t):this.selectedElementIds.splice(o,1)},addToSelection(t){this.selectedElementIds.includes(t)||this.selectedElementIds.push(t)},clearSelection(){this.selectedElementIds=[]},groupSelectedElements(){if(this.selectedElementIds.length<2)return;const t=[],o=[];if(this.selectedElementIds.forEach(a=>{const i=this.elements.find(l=>l.id===a);i&&(i.type==="group"?(i.childIds.forEach(d=>{const c=this.elements.find(f=>f.id===d);c&&!t.includes(c)&&(c.groupId=void 0,t.push(c))}),o.push(i.id)):i.groupId||t.includes(i)||t.push(i))}),t.length<2)return;this.elements=this.elements.filter(a=>!o.includes(a.id));const n=lo(t),r=`group-${this.nextId++}`,s={id:r,type:"group",x:n.x,y:n.y,width:n.width,height:n.height,rotation:0,zIndex:Math.max(...t.map(a=>a.zIndex))+1,childIds:t.map(a=>a.id)};t.forEach(a=>{a.groupId=r}),this.elements.push(s),this.selectedElementIds=[r],this.saveSnapshot()},ungroupElement(t){const o=this.elements.find(r=>r.id===t&&r.type==="group");if(!o)return;o.childIds.forEach(r=>{const s=this.elements.find(a=>a.id===r);s&&(s.groupId=void 0)});const n=this.elements.findIndex(r=>r.id===t);n!==-1&&this.elements.splice(n,1),this.selectedElementIds=[...o.childIds],this.saveSnapshot()},ungroupSelectedElements(){const t=this.elements.filter(n=>this.selectedElementIds.includes(n.id)&&n.type==="group");if(t.length===0)return;const o=[];t.forEach(n=>{if(n.type==="group"){n.childIds.forEach(a=>{const i=this.elements.find(l=>l.id===a);i&&(i.groupId=void 0,o.push(a))});const s=this.elements.findIndex(a=>a.id===n.id);s!==-1&&this.elements.splice(s,1)}}),this.selectedElementIds=o,this.saveSnapshot()},copySelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);t.length>0&&(this.clipboard=JSON.parse(JSON.stringify(t)))},pasteElement(){if(!this.clipboard||this.clipboard.length===0)return;const t=[],o=this.elements.length,n={},r=[...this.clipboard].sort((a,i)=>a.zIndex-i.zIndex);r.forEach(a=>{n[a.id]=`${a.type}-${this.nextId++}`});const s=r.map((a,i)=>({...JSON.parse(JSON.stringify(a)),id:n[a.id],x:a.x+20,y:a.y+20,zIndex:o+i}));io(s,n),s.forEach(a=>{this.elements.push(a),a.groupId||t.push(a.id)}),this.clipboard.forEach(a=>{a.x+=20,a.y+=20}),this.selectedElementIds=t,this.saveSnapshot()},duplicateSelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=[],n=this.elements.length,r={};t.forEach(i=>{r[i.id]=`${i.type}-${this.nextId++}`});const a=[...t].sort((i,l)=>i.zIndex-l.zIndex).map((i,l)=>({...JSON.parse(JSON.stringify(i)),id:r[i.id],x:i.x+20,y:i.y+20,zIndex:n+l}));io(a,r),a.forEach(i=>{this.elements.push(i),i.groupId||o.push(i.id)}),this.selectedElementIds=o,this.saveSnapshot()},updateElementPosition(t,o,n){ao(t,this.elements).forEach(s=>{s.x+=o,s.y+=n})},bringToFront(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=Math.max(...this.elements.map(r=>r.zIndex));Math.max(...t.map(r=>r.zIndex))!==o&&(t.sort((r,s)=>r.zIndex-s.zIndex),t.forEach((r,s)=>{r.zIndex=o+1+s}),this.saveSnapshot())},bringToBack(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=new Set(t.map(s=>s.id)),n=Math.min(...this.elements.map(s=>s.zIndex));Math.min(...t.map(s=>s.zIndex))!==n&&(t.sort((s,a)=>s.zIndex-a.zIndex),this.elements.forEach(s=>{o.has(s.id)||(s.zIndex+=t.length)}),t.forEach((s,a)=>{s.zIndex=a}),this.saveSnapshot())},endDrag(){this.saveSnapshot()},endResize(){this.saveSnapshot()},clearAll(){this.elements=[],this.selectedElementIds=[],this.saveSnapshot()},exportSnapshot(){return{version:1,timestamp:Date.now(),elements:JSON.parse(JSON.stringify(this.elements)),nextId:this.nextId}},importSnapshot(t){if(!t||typeof t!="object"||!("elements"in t)||!Array.isArray(t.elements)){console.error("Invalid snapshot data");return}const o=t;this.elements=JSON.parse(JSON.stringify(o.elements)),this.nextId=o.nextId||this.nextId,this.selectedElementIds=[],this.history=[JSON.parse(JSON.stringify(this.elements))],this.historyIndex=0}}}),Ee=100,Xe=Ae.defineStore("drag",{state:()=>({isDragging:!1,draggedShapeType:null,draggedCustomPoints:void 0,ghostPosition:{x:0,y:0},canvasElement:null}),actions:{startDrag(t,o,n){this.isDragging=!0,this.draggedShapeType=t,this.draggedCustomPoints=n;const r=J();this.ghostPosition={x:o.clientX-Ee*r.zoom/2,y:o.clientY-Ee*r.zoom/2},document.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp),document.addEventListener("keydown",this._handleKeyDown)},cancelDrag(){this._cleanup()},setCanvasElement(t){this.canvasElement=t},_handleMouseMove(t){if(!this.isDragging)return;const o=J();this.ghostPosition={x:t.clientX-Ee*o.zoom/2,y:t.clientY-Ee*o.zoom/2}},_handleMouseUp(t){if(!this.isDragging||!this.draggedShapeType){this._cleanup();return}if(this.canvasElement){const o=this.canvasElement.getBoundingClientRect(),n=t.clientX,r=t.clientY;if(n>=o.left&&n<=o.right&&r>=o.top&&r<=o.bottom){const a=J(),i=(n-o.left+this.canvasElement.scrollLeft)/a.zoom-Ee/2,l=(r-o.top+this.canvasElement.scrollTop)/a.zoom-Ee/2;W().addShape(this.draggedShapeType,i,l,this.draggedCustomPoints)}}this._cleanup()},_handleKeyDown(t){t.key==="Escape"&&this.isDragging&&this.cancelDrag()},_cleanup(){this.isDragging=!1,this.draggedShapeType=null,this.draggedCustomPoints=void 0,document.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),document.removeEventListener("keydown",this._handleKeyDown)}}});const co=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ur=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,n,r)=>r?r.toUpperCase():n.toLowerCase()),mr=t=>{const o=ur(t);return o.charAt(0).toUpperCase()+o.slice(1)},hr=(...t)=>t.filter((o,n,r)=>!!o&&o.trim()!==""&&r.indexOf(o)===n).join(" ").trim(),fo=t=>t==="";var $e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const yr=({name:t,iconNode:o,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":a,size:i=$e.width,color:l=$e.stroke,...d},{slots:c})=>e.h("svg",{...$e,...d,width:i,height:i,stroke:l,"stroke-width":fo(n)||fo(r)||n===!0||r===!0?Number(s||a||$e["stroke-width"])*24/Number(i):s||a||$e["stroke-width"],class:hr("lucide",d.class,...t?[`lucide-${co(mr(t))}-icon`,`lucide-${co(t)}`]:["lucide-icon"])},[...o.map(f=>e.h(...f)),...c.default?[c.default()]:[]]);const V=(t,o)=>(n,{slots:r,attrs:s})=>e.h(yr,{...s,...n,iconNode:o,name:t},r);const gr=V("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const kt=V("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const po=V("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const uo=V("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ct=V("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const xr=V("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);const br=V("building",[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);const wr=V("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const kr=V("chart-no-axes-column-increasing",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]]);const Cr=V("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);const Er=V("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const mo=V("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Sr=V("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const zr=V("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const _r=V("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]);const Br=V("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Vr=V("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const vr=V("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Pr=V("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);const Ir=V("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);const Nr=V("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Or=V("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);const Ar=V("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Mr=V("factory",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z",key:"1iv0i2"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const $r=V("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Tr=V("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const Dr=V("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const ho=V("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);const Fr=V("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);const Rr=V("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const Lr=V("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);const qr=V("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Wr=V("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const jr=V("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const yo=V("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Ur=V("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const Hr=V("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);const Kr=V("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);const Gr=V("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const Xr=V("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Yr=V("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const Zr=V("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Jr=V("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);const Et=V("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Qr=V("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);const es=V("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);const ts=V("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const os=V("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ns=V("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const rs=V("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const go=V("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);const ss=V("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);const as=V("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);const xo=V("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const is=V("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);const ls=V("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const ds=V("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);const bo=V("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);const cs=V("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);const fs=V("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const ps=V("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const us=V("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const ms=V("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);const St=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hs=["href"],ys=e.defineComponent({__name:"ElementLink",props:{link:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",class:"absolute -top-3 -right-3 pointer-events-auto text-ma-text-01 bg-white border border-ma-grey-300 rounded-full p-1 shadow-md z-10 hover:bg-ma-grey-100 transition-colors",onMousedown:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(Rr),{class:"w-4 h-4 text-blue-600"})],40,hs))}}),gs=e.defineComponent({__name:"ElementTextOverlay",props:{element:{}},setup(t){const o=t,n=e.computed(()=>{const s=o.element,a=s.rotation||0,i=Math.abs(a%180)===90;return{position:"absolute",top:"50%",left:"50%",width:`${i?s.height:s.width}px`,height:`${i?s.width:s.height}px`,transform:`translate(-50%, -50%) rotate(${-a}deg)`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",overflow:"hidden"}}),r=e.computed(()=>{const s=o.element;return{color:s.color||"#000000",fontSize:`${s.fontSize||16}px`,fontFamily:s.fontFamily||"Arial",textAlign:"center",whiteSpace:"pre-wrap",overflowWrap:"break-word",lineHeight:"1.2",userSelect:"none",maxWidth:"100%",maxHeight:"100%"}});return(s,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(n.value)},[e.createElementVNode("span",{style:e.normalizeStyle(r.value)},e.toDisplayString(t.element.content),5)],4))}}),wo=["nw","n","ne","e","se","s","sw","w"],xs=t=>{switch(t){case"nw":return{left:"-10px",top:"-10px"};case"n":return{left:"50%",top:"-10px"};case"ne":return{left:"calc(100% + 10px)",top:"-10px"};case"e":return{left:"calc(100% + 11px)",top:"50%"};case"se":return{left:"calc(100% + 10px)",top:"calc(100% + 10px)"};case"s":return{left:"50%",top:"calc(100% + 11px)"};case"sw":return{left:"-10px",top:"calc(100% + 10px)"};case"w":return{left:"-11px",top:"50%"}}},ko=3;function bs(t){const o=J(),n=e.ref(!1);let r=!1,s=0,a=0,i=0,l=0;const d=u=>{if(!n.value)return;if(!r){const h=Math.abs(u.clientX-s),y=Math.abs(u.clientY-a);(h>=ko||y>=ko)&&(r=!0,t("drag-start",u),i=u.clientX,l=u.clientY);return}const m=u.clientX-i,p=u.clientY-l;i=u.clientX,l=u.clientY,t("drag",m/o.zoom,p/o.zoom,u)},c=()=>{n.value&&(n.value=!1,r&&t("drag-end")),r=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c)},f=u=>{t("click",u),n.value=!0,r=!1,s=u.clientX,a=u.clientY,i=u.clientX,l=u.clientY,document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)};return e.onUnmounted(()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c)}),{isDragging:n,startDrag:f}}function ws(t){const o=e.ref(!1);let n="",r=0,s=0;const a=c=>{if(!o.value)return;const f=c.clientX-r,u=c.clientY-s;r=c.clientX,s=c.clientY,t("resize",n,f,u)},i=()=>{o.value&&(o.value=!1,t("resize-end")),document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},l=(c,f)=>{o.value=!0,n=c,r=f.clientX,s=f.clientY,document.body.style.cursor=d(c),document.body.style.userSelect="none",t("resize-start",c,f),document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)},d=c=>({nw:"nwse-resize",se:"nwse-resize",ne:"nesw-resize",sw:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"})[c]||"pointer";return e.onUnmounted(()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}),{isResizing:o,startResize:l}}function ks(t){const o=e.computed(()=>{const s=t.value;return s.type!=="shape"?null:{width:s.width,height:s.height,fill:s.fill,outline:s.outline,strokeWeight:s.strokeWeight,rotation:0,shapeType:s.shapeType,customPoints:s.customPoints}}),n=e.computed(()=>{const s=t.value;return s.type!=="text"?null:{content:s.content,color:s.color,fontSize:s.fontSize,fontFamily:s.fontFamily}}),r=e.computed(()=>{const s=t.value;return s.type!=="icon"?null:{iconType:s.iconType,color:s.color,strokeWeight:s.strokeWeight}});return{shapeProps:o,textProps:n,iconProps:r}}const Cs=["data-testid","width","height"],Es=["data-testid","stroke","fill","stroke-width"],Ss=["data-testid","points","stroke","fill","stroke-width"],Ye=e.defineComponent({__name:"GenericShape",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},shapeType:{type:String,required:!0},strokeWeight:{type:Number,default:3},outline:{type:String,default:"defaultOutlineColor"},fill:{type:String,default:"defaultFillColor"},customPoints:{type:String,default:""}},setup(t){const o=t,n=e.computed(()=>{switch(o.shapeType){case"custom":return o.customPoints;case"rectangle":return"0,0 100,0 100,100 0,100";case"triangle":return"50,0 100,100 0,100";case"trapezoid":return"20,0 80,0 100,100 0,100";case"chevron":return"0,0 60,0 100,50 60,100 0,100 40,50";case"hexagon":return"25,0 75,0 100,50 75,100 25,100 0,50";case"diamond":return"50,0 100,50 50,100 0,50";case"parallelogram":return"20,0 100,0 80,100 0,100";case"pentagon":return"50,0 100,38 82,100 18,100 0,38";case"line":return"0,100 100,0";case"arrow":return"0,30 60,30 60,0 100,50 60,100 60,70 0,70";default:return""}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{"data-testid":`${t.shapeType}-shape`,width:t.width,height:t.height,viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{overflow:"visible"}},[t.shapeType==="ellipse"?(e.openBlock(),e.createElementBlock("ellipse",{key:0,"data-testid":`${t.shapeType}-ellipse`,cx:"50",cy:"50",rx:"50",ry:"50",stroke:t.outline,fill:t.fill,"stroke-width":t.strokeWeight,"vector-effect":"non-scaling-stroke"},null,8,Es)):(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-testid":`${t.shapeType}-polygon`,points:n.value,stroke:t.outline,fill:t.fill,"stroke-width":t.strokeWeight,"vector-effect":"non-scaling-stroke"},null,8,Ss))],8,Cs))}}),zs=e.defineComponent({__name:"TextElement",props:{content:{},color:{},fontSize:{},fontFamily:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full h-full flex items-center justify-center p-2 overflow-hidden",style:e.normalizeStyle({color:t.color,fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily})},e.toDisplayString(t.content),5))}}),Co={arrowUp:Ct,arrowDown:kt,arrowLeft:po,arrowRight:uo,user:ps,users:us,building:br,factory:Mr,briefcase:xr,fileText:$r,folder:Tr,database:Nr,clipboardList:zr,server:os,monitor:Ur,smartphone:rs,mail:Lr,messageSquare:Wr,phone:Jr,checkCircle:Sr,alertTriangle:ls,info:Dr,settings:ns,activity:gr,barChart:kr,pieChart:Cr,trendingUp:is,dollarSign:Or,creditCard:Pr,truck:ds,package:Kr,mapPin:qr,clock:Br,calendar:wr,target:as},_s=e.defineComponent({__name:"IconElement",props:{iconType:{},color:{},strokeWeight:{}},setup(t){const o=t,n=e.computed(()=>Co[o.iconType]||null);return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full h-full flex items-center justify-center overflow-hidden",style:e.normalizeStyle({color:t.color})},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{class:"w-full h-full","stroke-width":t.strokeWeight},null,8,["stroke-width"]))],4))}}),Bs={class:"w-full h-full"},Vs={key:0,class:"absolute inset-0 pointer-events-none"},vs=["onMousedown"],Eo=e.defineComponent({__name:"ElementWrapper",props:{element:{},selected:{type:Boolean}},emits:["select","click","drag-start","drag","drag-end","resize-start","resize","resize-end"],setup(t,{emit:o}){const n=t,r=o,{startDrag:s}=bs(r),{startResize:a}=ws(r),{shapeProps:i,textProps:l,iconProps:d}=ks(e.toRef(n,"element")),c=e.computed(()=>n.element.type==="icon"?wo.filter(p=>["nw","ne","sw","se"].includes(p)):wo),f=e.computed(()=>({left:`${n.element.x}px`,top:`${n.element.y}px`,width:`${n.element.width}px`,height:`${n.element.height}px`,transform:`rotate(${n.element.rotation}deg)`,transformOrigin:"center center"})),u=p=>{r("select",p),s(p)},m=(p,h)=>{a(p,h)};return(p,h)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute",style:e.normalizeStyle(f.value),onMousedown:e.withModifiers(u,["stop"])},[e.createElementVNode("div",Bs,[e.unref(i)?(e.openBlock(),e.createBlock(Ye,e.normalizeProps(e.mergeProps({key:0},e.unref(i))),null,16)):e.unref(l)?(e.openBlock(),e.createBlock(zs,e.normalizeProps(e.mergeProps({key:1},e.unref(l))),null,16)):e.unref(d)?(e.openBlock(),e.createBlock(_s,e.normalizeProps(e.mergeProps({key:2},e.unref(d))),null,16)):e.createCommentVNode("",!0)]),t.selected?(e.openBlock(),e.createElementBlock("div",Vs,[h[0]||(h[0]=e.createElementVNode("div",{class:"absolute -inset-3 border-2 border-ma-primary-500 pointer-events-none"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"absolute w-2 h-2 bg-ma-primary-500 border border-white rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-auto cursor-pointer",style:e.normalizeStyle(e.unref(xs)(y)),onMousedown:e.withModifiers(g=>m(y,g),["stop"])},null,44,vs))),128))])):e.createCommentVNode("",!0),t.element.type==="shape"?(e.openBlock(),e.createBlock(gs,{key:1,element:t.element},null,8,["element"])):e.createCommentVNode("",!0),t.element.link&&!t.selected?(e.openBlock(),e.createBlock(ys,{key:2,link:t.element.link},null,8,["link"])):e.createCommentVNode("",!0)],36))}});function So(t){var o,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(o=0;o<s;o++)t[o]&&(n=So(t[o]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function zo(){for(var t,o,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(o=So(t))&&(r&&(r+=" "),r+=o);return r}const _o=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Bo=zo,Ps=(t,o)=>n=>{var r;if(o?.variants==null)return Bo(t,n?.class,n?.className);const{variants:s,defaultVariants:a}=o,i=Object.keys(s).map(c=>{const f=n?.[c],u=a?.[c];if(f===null)return null;const m=_o(f)||_o(u);return s[c][m]}),l=n&&Object.entries(n).reduce((c,f)=>{let[u,m]=f;return m===void 0||(c[u]=m),c},{}),d=o==null||(r=o.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:m,...p}=f;return Object.entries(p).every(h=>{let[y,g]=h;return Array.isArray(g)?g.includes({...a,...l}[y]):{...a,...l}[y]===g})?[...c,u,m]:c},[]);return Bo(t,i,d,n?.class,n?.className)};function Te(t,o){const n=typeof t=="string"&&!o?`${t}Context`:o,r=Symbol(n);return[i=>{const l=e.inject(r,i);if(l||l===null)return l;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(e.provide(r,i),i)]}function pe(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Vo(t,o,n){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});o&&r.addEventListener(t,o,{once:!0}),r.dispatchEvent(s)}function Is(t){return t==null}function zt(t){return t?t.flatMap(o=>o.type===e.Fragment?zt(o.children):[o]):[]}const[vo]=Te("ConfigProvider");function Ns(t,o){var n;const r=e.shallowRef();return e.watchEffect(()=>{r.value=t()},{...o,flush:(n=void 0)!=null?n:"sync"}),e.readonly(r)}function Po(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Os(t){let o=!1,n;const r=e.effectScope(!0);return(...s)=>(o||(n=r.run(()=>t(...s)),o=!0),n)}function As(t){let o=0,n,r;const s=()=>{o-=1,r&&o<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(o+=1,r||(r=e.effectScope(!0),n=r.run(()=>t(...a))),Po(s),n)}function Ms(t){if(!e.isRef(t))return e.reactive(t);const o=new Proxy({},{get(n,r,s){return e.unref(Reflect.get(t.value,r,s))},set(n,r,s){return e.isRef(t.value[r])&&!e.isRef(s)?t.value[r].value=s:t.value[r]=s,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return e.reactive(o)}function $s(t){return Ms(e.computed(t))}function Ts(t,...o){const n=o.flat(),r=n[0];return $s(()=>Object.fromEntries(typeof r=="function"?Object.entries(e.toRefs(t)).filter(([s,a])=>!r(e.toValue(a),s)):Object.entries(e.toRefs(t)).filter(s=>!n.includes(s[0]))))}const ue=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ds=t=>typeof t<"u",Fs=Object.prototype.toString,Rs=t=>Fs.call(t)==="[object Object]",Io=Ls();function Ls(){var t,o;return ue&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window?.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function qs(t){return e.getCurrentInstance()}function _t(t){return Array.isArray(t)?t:[t]}function Ws(t,o){qs()&&e.onBeforeUnmount(t,o)}function js(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const Bt=ue?window:void 0;function De(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}function No(...t){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},r=(l,d,c,f)=>(l.addEventListener(d,c,f),()=>l.removeEventListener(d,c,f)),s=e.computed(()=>{const l=_t(e.toValue(t[0])).filter(d=>d!=null);return l.every(d=>typeof d!="string")?l:void 0}),a=js(()=>{var l,d;return[(d=(l=s.value)==null?void 0:l.map(c=>De(c)))!=null?d:[Bt].filter(c=>c!=null),_t(e.toValue(s.value?t[1]:t[0])),_t(e.unref(s.value?t[2]:t[1])),e.toValue(s.value?t[3]:t[2])]},([l,d,c,f])=>{if(n(),!l?.length||!d?.length||!c?.length)return;const u=Rs(f)?{...f}:f;o.push(...l.flatMap(m=>d.flatMap(p=>c.map(h=>r(m,p,h,u)))))},{flush:"post"}),i=()=>{a(),n()};return Po(n),i}function Us(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function Hs(t){return typeof t=="function"?t:typeof t=="string"?o=>o.key===t:Array.isArray(t)?o=>t.includes(o.key):()=>!0}function Ks(...t){let o,n,r={};t.length===3?(o=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(o=!0,n=t[0],r=t[1]):(o=t[0],n=t[1]):(o=!0,n=t[0]);const{target:s=Bt,eventName:a="keydown",passive:i=!1,dedupe:l=!1}=r,d=Hs(o);return No(s,a,f=>{f.repeat&&e.toValue(l)||d(f)&&n(f)},i)}function Gs(t){return JSON.parse(JSON.stringify(t))}function Oo(t,o,n,r={}){var s,a,i;const{clone:l=!1,passive:d=!1,eventName:c,deep:f=!1,defaultValue:u,shouldEmit:m}=r,p=e.getCurrentInstance(),h=n||p?.emit||((s=p?.$emit)==null?void 0:s.bind(p))||((i=(a=p?.proxy)==null?void 0:a.$emit)==null?void 0:i.bind(p?.proxy));let y=c;y=y||`update:${o.toString()}`;const g=k=>l?typeof l=="function"?l(k):Gs(k):k,x=()=>Ds(t[o])?g(t[o]):u,w=k=>{m?m(k)&&h(y,k):h(y,k)};if(d){const k=x(),I=e.ref(k);let S=!1;return e.watch(()=>t[o],z=>{S||(S=!0,I.value=g(z),e.nextTick(()=>S=!1))}),e.watch(I,z=>{!S&&(z!==t[o]||f)&&w(z)},{deep:f}),I}else return e.computed({get(){return x()},set(k){w(k)}})}function Vt(t){if(t===null||typeof t!="object")return!1;const o=Object.getPrototypeOf(t);return o!==null&&o!==Object.prototype&&Object.getPrototypeOf(o)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function vt(t,o,n=".",r){if(!Vt(o))return vt(t,{},n,r);const s=Object.assign({},o);for(const a in t){if(a==="__proto__"||a==="constructor")continue;const i=t[a];i!=null&&(r&&r(s,a,i,n)||(Array.isArray(i)&&Array.isArray(s[a])?s[a]=[...i,...s[a]]:Vt(i)&&Vt(s[a])?s[a]=vt(i,s[a],(n?`${n}.`:"")+a.toString(),r):s[a]=i))}return s}function Xs(t){return(...o)=>o.reduce((n,r)=>vt(n,r,"",t),{})}const Ys=Xs(),Zs=As(()=>{const t=e.ref(new Map),o=e.ref(),n=e.computed(()=>{for(const i of t.value.values())if(i)return!0;return!1}),r=vo({scrollBody:e.ref(!0)});let s=null;const a=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=o.value??"",Io&&s?.(),o.value=void 0};return e.watch(n,(i,l)=>{if(!ue)return;if(!i){l&&a();return}o.value===void 0&&(o.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,c={padding:d,margin:0},f=r.scrollBody?.value?typeof r.scrollBody.value=="object"?Ys({padding:r.scrollBody.value.padding===!0?d:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?d:r.scrollBody.value.margin},c):c:{padding:0,margin:0};d>0&&(document.body.style.paddingRight=typeof f.padding=="number"?`${f.padding}px`:String(f.padding),document.body.style.marginRight=typeof f.margin=="number"?`${f.margin}px`:String(f.margin),document.documentElement.style.setProperty("--scrollbar-width",`${d}px`),document.body.style.overflow="hidden"),Io&&(s=No(document,"touchmove",u=>Js(u),{passive:!1})),e.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Ao(t){const o=Math.random().toString(36).substring(2,7),n=Zs();n.value.set(o,t);const r=e.computed({get:()=>n.value.get(o)??!1,set:s=>n.value.set(o,s)});return Ws(()=>{n.value.delete(o)}),r}function Mo(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth<t.scrollWidth||o.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:Mo(n)}}function Js(t){const o=t||window.event,n=o.target;return n instanceof Element&&Mo(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}function Ze(t){const o=e.getCurrentInstance(),n=o?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${o?.type.__name}`),n?.forEach(s=>{r[e.toHandlerKey(e.camelize(s))]=(...a)=>t(s,...a)}),r}let Pt=0;function Qs(){e.watchEffect(t=>{if(!ue)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??$o()),document.body.insertAdjacentElement("beforeend",o[1]??$o()),Pt++,t(()=>{Pt===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Pt--})})}function $o(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function j(){const t=e.getCurrentInstance(),o=e.ref(),n=e.computed(()=>["#text","#comment"].includes(o.value?.$el.nodeName)?o.value?.$el.nextElementSibling:De(o)),r=Object.assign({},t.exposed),s={};for(const i in t.props)Object.defineProperty(s,i,{enumerable:!0,configurable:!0,get:()=>t.props[i]});if(Object.keys(r).length>0)for(const i in r)Object.defineProperty(s,i,{enumerable:!0,configurable:!0,get:()=>r[i]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function a(i){if(o.value=i,!!i&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>i instanceof Element?i:i.$el}),!(i instanceof Element)&&!Object.hasOwn(i,"$el"))){const l=i.$.exposed,d=Object.assign({},s);for(const c in l)Object.defineProperty(d,c,{enumerable:!0,configurable:!0,get:()=>l[c]});t.exposed=d}}return{forwardRef:a,currentRef:o,currentElement:n}}function It(t){const o=e.getCurrentInstance(),n=Object.keys(o?.type.props??{}).reduce((s,a)=>{const i=(o?.type.props[a]).default;return i!==void 0&&(s[a]=i),s},{}),r=e.toRef(t);return e.computed(()=>{const s={},a=o?.vnode.props??{};return Object.keys(a).forEach(i=>{s[e.camelize(i)]=a[i]}),Object.keys({...n,...s}).reduce((i,l)=>(r.value[l]!==void 0&&(i[l]=r.value[l]),i),{})})}function be(t,o){const n=It(t),r=o?Ze(o):{};return e.computed(()=>({...n.value,...r}))}var ea=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},Se=new WeakMap,Je=new WeakMap,Qe={},Nt=0,To=function(t){return t&&(t.host||To(t.parentNode))},ta=function(t,o){return o.map(function(n){if(t.contains(n))return n;var r=To(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},oa=function(t,o,n,r){var s=ta(o,Array.isArray(t)?t:[t]);Qe[n]||(Qe[n]=new WeakMap);var a=Qe[n],i=[],l=new Set,d=new Set(s),c=function(u){!u||l.has(u)||(l.add(u),c(u.parentNode))};s.forEach(c);var f=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(m){if(l.has(m))f(m);else try{var p=m.getAttribute(r),h=p!==null&&p!=="false",y=(Se.get(m)||0)+1,g=(a.get(m)||0)+1;Se.set(m,y),a.set(m,g),i.push(m),y===1&&h&&Je.set(m,!0),g===1&&m.setAttribute(n,"true"),h||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(o),l.clear(),Nt++,function(){i.forEach(function(u){var m=Se.get(u)-1,p=a.get(u)-1;Se.set(u,m),a.set(u,p),m||(Je.has(u)||u.removeAttribute(r),Je.delete(u)),p||u.removeAttribute(n)}),Nt--,Nt||(Se=new WeakMap,Se=new WeakMap,Je=new WeakMap,Qe={})}},na=function(t,o,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=ea(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),oa(r,s,n,"aria-hidden")):function(){return null}};function Do(t){let o;e.watch(()=>De(t),n=>{n?o=na(n):o&&o()}),e.onUnmounted(()=>{o&&o()})}let ra=0;function et(t,o="reka"){if("useId"in ro)return`${o}-${ro.useId?.()}`;const n=vo({useId:void 0});return n.useId?`${o}-${n.useId()}`:`${o}-${++ra}`}function sa(t){const o=e.ref(),n=e.computed(()=>o.value?.width??0),r=e.computed(()=>o.value?.height??0);return e.onMounted(()=>{const s=De(t);if(s){o.value={width:s.offsetWidth,height:s.offsetHeight};const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let d,c;if("borderBoxSize"in l){const f=l.borderBoxSize,u=Array.isArray(f)?f[0]:f;d=u.inlineSize,c=u.blockSize}else d=s.offsetWidth,c=s.offsetHeight;o.value={width:d,height:c}});return a.observe(s,{box:"border-box"}),()=>a.unobserve(s)}else o.value=void 0}),{width:n,height:r}}function aa(t,o){const n=e.ref(t);function r(a){return o[n.value][a]??n.value}return{state:n,dispatch:a=>{n.value=r(a)}}}function ia(t,o){const n=e.ref({}),r=e.ref("none"),s=e.ref(t),a=t.value?"mounted":"unmounted";let i;const l=o.value?.ownerDocument.defaultView??Bt,{state:d,dispatch:c}=aa(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),f=g=>{if(ue){const x=new CustomEvent(g,{bubbles:!1,cancelable:!1});o.value?.dispatchEvent(x)}};e.watch(t,async(g,x)=>{const w=x!==g;if(await e.nextTick(),w){const k=r.value,I=tt(o.value);g?(c("MOUNT"),f("enter"),I==="none"&&f("after-enter")):I==="none"||I==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),f("leave"),f("after-leave")):x&&k!==I?(c("ANIMATION_OUT"),f("leave")):(c("UNMOUNT"),f("after-leave"))}},{immediate:!0});const u=g=>{const x=tt(o.value),w=x.includes(CSS.escape(g.animationName)),k=d.value==="mounted"?"enter":"leave";if(g.target===o.value&&w&&(f(`after-${k}`),c("ANIMATION_END"),!s.value)){const I=o.value.style.animationFillMode;o.value.style.animationFillMode="forwards",i=l?.setTimeout(()=>{o.value?.style.animationFillMode==="forwards"&&(o.value.style.animationFillMode=I)})}g.target===o.value&&x==="none"&&c("ANIMATION_END")},m=g=>{g.target===o.value&&(r.value=tt(o.value))},p=e.watch(o,(g,x)=>{g?(n.value=getComputedStyle(g),g.addEventListener("animationstart",m),g.addEventListener("animationcancel",u),g.addEventListener("animationend",u)):(c("ANIMATION_END"),i!==void 0&&l?.clearTimeout(i),x?.removeEventListener("animationstart",m),x?.removeEventListener("animationcancel",u),x?.removeEventListener("animationend",u))},{immediate:!0}),h=e.watch(d,()=>{const g=tt(o.value);r.value=d.value==="mounted"?g:"none"});return e.onUnmounted(()=>{p(),h()}),{isPresent:e.computed(()=>["mounted","unmountSuspended"].includes(d.value))}}function tt(t){return t&&getComputedStyle(t).animationName||"none"}var Ot=e.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:o,expose:n}){const{present:r,forceMount:s}=e.toRefs(t),a=e.ref(),{isPresent:i}=ia(r,a);n({present:i});let l=o.default({present:i.value});l=zt(l||[]);const d=e.getCurrentInstance();if(l&&l?.length>1){const c=d?.parent?.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(`
1
+ (function(U,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","vue-router"],e):(U=typeof globalThis<"u"?globalThis:U||self,e(U.WhiteboardEditor={},U.Vue,U.Pinia,U.VueRouter))})(this,(function(U,e,Ae,tr){"use strict";function or(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const ro=or(e),J=Ae.defineStore("zoom",{state:()=>({zoom:1}),getters:{zoomPercentage:t=>Math.round(t.zoom*100)},actions:{zoomIn(){this.zoom<3&&(this.zoom=Math.min(this.zoom+.1,3))},zoomOut(){this.zoom>.1&&(this.zoom=Math.max(this.zoom-.1,.1))},setZoom(t){this.zoom=Math.max(.1,Math.min(3,t))},resetZoom(){this.zoom=1},autoFit(t,o,n,r=100){if(t.length===0){this.resetZoom();return}const s=Math.min(...t.map(p=>p.x)),a=Math.min(...t.map(p=>p.y)),i=Math.max(...t.map(p=>p.x+p.width)),l=Math.max(...t.map(p=>p.y+p.height)),d=i-s,c=l-a,f=(o-r)/d,u=(n-r)/c,m=Math.min(f,u,3);this.setZoom(Math.max(.1,m))}}}),nr=["width","height"],rr=["d"],so=e.defineComponent({__name:"GridCanvas",props:{contentWidth:{},contentHeight:{}},emits:["canvas-click","delete-selected","copy-selected","paste","duplicate","undo","redo"],setup(t,{emit:o}){const n=t,r=o,s=J(),a=e.computed(()=>s.zoom*20),i=e.computed(()=>n.contentWidth&&n.contentWidth>0?n.contentWidth:null),l=e.computed(()=>n.contentHeight&&n.contentHeight>0?n.contentHeight:null),d=e.computed(()=>({width:i.value?`${i.value*s.zoom}px`:"100%",height:l.value?`${l.value*s.zoom}px`:"100%",minWidth:"100%",minHeight:"100%"})),c=e.computed(()=>({width:i.value?`${i.value}px`:"100%",height:l.value?`${l.value}px`:"100%",transform:`scale(${s.zoom})`,transformOrigin:"top left"})),f=e.computed(()=>({width:d.value.width,height:d.value.height,minWidth:"100%",minHeight:"100%"})),u=p=>{(p.target===p.currentTarget||p.target.classList.contains("grid-pattern")||p.target.classList.contains("zoom-container")||p.target.classList.contains("zoom-content"))&&r("canvas-click")},m=p=>{const y=navigator.platform.toUpperCase().indexOf("MAC")>=0?p.metaKey:p.ctrlKey;y&&p.key==="z"&&!p.shiftKey?(p.preventDefault(),r("undo")):y&&p.key==="z"&&p.shiftKey||y&&p.key==="y"?(p.preventDefault(),r("redo")):y&&p.key==="c"?(p.preventDefault(),r("copy-selected")):y&&p.key==="v"?(p.preventDefault(),r("paste")):y&&p.key==="d"&&(p.preventDefault(),r("duplicate"))};return(p,h)=>(e.openBlock(),e.createElementBlock("div",{"data-testid":"canvas-container",class:"flex-1 relative bg-bg-maincontent overflow-auto outline-none",tabindex:"0",onMousedown:u,onKeydown:[h[0]||(h[0]=e.withKeys(y=>p.$emit("delete-selected"),["delete"])),h[1]||(h[1]=e.withKeys(y=>p.$emit("delete-selected"),["backspace"])),m]},[(e.openBlock(),e.createElementBlock("svg",{"data-testid":"grid-svg",class:"absolute top-0 left-0 pointer-events-none z-0 text-ma-grey-700",style:e.normalizeStyle(d.value),xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("defs",null,[e.createElementVNode("pattern",{id:"grid",width:a.value,height:a.value,patternUnits:"userSpaceOnUse"},[e.createElementVNode("path",{"data-testid":"grid-pattern-path",d:`M ${a.value} 0 L 0 0 0 ${a.value}`,fill:"none",stroke:"currentColor","stroke-width":"0.5"},null,8,rr)],8,nr)]),h[2]||(h[2]=e.createElementVNode("rect",{width:"100%",height:"100%",fill:"url(#grid)"},null,-1))],4)),e.createElementVNode("div",{class:"zoom-container absolute top-0 left-0",style:e.normalizeStyle(d.value)},[e.createElementVNode("div",{class:"zoom-content",style:e.normalizeStyle(c.value)},[e.renderSlot(p.$slots,"default")],4)],4),e.createElementVNode("div",{class:"absolute top-0 left-0 pointer-events-none",style:e.normalizeStyle(f.value)},[e.renderSlot(p.$slots,"overlay")],4)],32))}});function sr(t){if(!t||!t.trim())return[];const o=[],n=t.trim().split(/\s+/);for(const r of n){const s=r.split(","),a=s[0],i=s[1];if(!a||!i)return[];const l=parseFloat(a),d=parseFloat(i);if(isNaN(l)||isNaN(d))return[];o.push({x:l,y:d})}return o}function ar(t){const o=sr(t);if(o.length===0)return"";const n=o.map(u=>u.x),r=o.map(u=>u.y),s=Math.min(...n),a=Math.max(...n),i=Math.min(...r),l=Math.max(...r),d=a-s,c=l-i;return d===0||c===0?t:o.map(u=>({x:Math.round((u.x-s)/d*100),y:Math.round((u.y-i)/c*100)})).map(u=>`${u.x},${u.y}`).join(" ")}const Ue=30;function ir(t,o,n){switch((n%360+360)%360){case 90:return{x:o,y:-t};case 180:return{x:-t,y:-o};case 270:return{x:-o,y:t};default:return{x:t,y:o}}}function lr(t,o,n){switch((n%360+360)%360){case 90:return{x:-o,y:t};case 180:return{x:-t,y:-o};case 270:return{x:o,y:-t};default:return{x:t,y:o}}}function dr(t,o,n,r){const{x:s,y:a,width:i,height:l,rotation:d}=t,c={x:s+i/2,y:a+l/2},f=ir(n,r,d);let u=i,m=l,p=0,h=0;if(o.includes("nw")||o.includes("se")?Math.abs(f.x)<Math.abs(f.y)?f.x=f.y:f.y=f.x:(o.includes("ne")||o.includes("sw"))&&(Math.abs(f.x)<Math.abs(f.y)?f.x=-f.y:f.y=-f.x),o.includes("e"))u=Math.max(Ue,i+f.x),p=(u-i)/2;else if(o.includes("w")){const g=i-f.x;u=Math.max(Ue,g),p=-(u-i)/2}if(o.includes("s"))m=Math.max(Ue,l+f.y),h=(m-l)/2;else if(o.includes("n")){const g=l-f.y;m=Math.max(Ue,g),h=-(m-l)/2}const y=lr(p,h,d);return{x:c.x+y.x-u/2,y:c.y+y.y-m/2,width:u,height:m,rotation:d}}function He(t){const{x:o,y:n,width:r,height:s,rotation:a}=t,i=(a%360+360)%360;if(i===90||i===270){const l={x:o+r/2,y:n+s/2};return{x:l.x-s/2,y:l.y-r/2,width:s,height:r,rotation:i}}return t}function ao(t,o){const n=o.find(s=>s.id===t);if(!n)return[];const r=[n];return n.type==="group"&&n.childIds.forEach(a=>{const i=o.find(l=>l.id===a);i&&!r.some(l=>l.id===i.id)&&r.push(i)}),r}function Me(t,o){const n=[],r=new Set;return t.forEach(s=>{ao(s,o).forEach(i=>{r.has(i.id)||(r.add(i.id),n.push(i))})}),n}function io(t,o){t.forEach(n=>{if(n.groupId&&o[n.groupId]&&(n.groupId=o[n.groupId]),n.type==="group"){const r=n;r.childIds=r.childIds.map(s=>o[s]||s)}})}function lo(t){let o=1/0,n=1/0,r=-1/0,s=-1/0;return t.forEach(a=>{const i=He(a);o=Math.min(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.x+i.width),s=Math.max(s,i.y+i.height)}),{x:o,y:n,width:r-o,height:s-n}}function cr(t,o,n,r){const s=o.width>0?n.width/o.width:1,a=o.height>0?n.height/o.height:1,i=[];return t.childIds.forEach(l=>{const d=r.find(w=>w.id===l);if(!d)return;const c=He(d),f=c.x-o.x,u=c.y-o.y,m=n.x+f*s,p=n.y+u*a,h=Math.max(10,c.width*s),y=Math.max(10,c.height*a),g=(d.rotation%360+360)%360;if(g===90||g===270){const w=y,k=h,I=m+h/2,S=p+y/2;i.push({id:l,updates:{x:I-w/2,y:S-k/2,width:w,height:k}})}else i.push({id:l,updates:{x:m,y:p,width:h,height:y}})}),i}function fr(t,o){const n=t.x+t.width/2,r=t.y+t.height/2,s=[],a=[];t.childIds.forEach(l=>{const d=o.find(k=>k.id===l);if(!d)return;const c=d.x+d.width/2,f=d.y+d.height/2,u=c-n,p=-(f-r),h=u,y=n+p,g=r+h,x=(d.rotation+90)%360,w={x:y-d.width/2,y:g-d.height/2,rotation:x};s.push({id:l,updates:w}),a.push({...d,...w})});const i=lo(a);return{childUpdates:s,newGroupBounds:i}}const Ke="#cfe4ed",ae="#279ac8",Ge="#073446",pr=50,W=Ae.defineStore("elements",{state:()=>({elements:[],selectedElementIds:[],nextId:1,history:[[]],historyIndex:0,clipboard:[],customShapes:[]}),getters:{selectedElement:t=>t.selectedElementIds.length===0?null:t.elements.find(o=>o.id===t.selectedElementIds[0])||null,selectedElementId:t=>t.selectedElementIds.length>0?t.selectedElementIds[0]:null,selectedElements:t=>t.elements.filter(o=>t.selectedElementIds.includes(o.id)),hasMultipleSelected:t=>t.selectedElementIds.length>1,sortedElements:t=>[...t.elements].sort((o,n)=>o.zIndex-n.zIndex),topLevelElements:t=>t.elements.filter(o=>!o.groupId),canUndo:t=>t.historyIndex>0,canRedo:t=>t.historyIndex<t.history.length-1,hasCopiedElement:t=>t.clipboard!==null&&t.clipboard.length>0},actions:{saveCustomShape(t,o){this.customShapes.push({name:t,points:ar(o)})},saveSnapshot(){this.canRedo&&(this.history=this.history.slice(0,this.historyIndex+1));const t=JSON.parse(JSON.stringify(this.elements));this.history.push(t),this.historyIndex=this.history.length-1,this.history.length>pr&&(this.history.shift(),this.historyIndex=this.history.length-1)},undo(){this.canUndo&&(this.historyIndex--,this.elements=JSON.parse(JSON.stringify(this.history[this.historyIndex])),this.selectedElementIds=this.selectedElementIds.filter(t=>this.elements.some(o=>o.id===t)))},redo(){this.canRedo&&(this.historyIndex++,this.elements=JSON.parse(JSON.stringify(this.history[this.historyIndex])),this.selectedElementIds=this.selectedElementIds.filter(t=>this.elements.some(o=>o.id===t)))},addElement(t){this.elements.push(t),this.selectedElementIds=[t.id],this.saveSnapshot()},addShape(t,o=100,n=100,r){const s={id:`shape-${this.nextId++}`,type:"shape",shapeType:t,x:o,y:n,width:100,height:100,outline:ae,fill:Ke,strokeWeight:3,fontSize:16,fontFamily:"Arial",color:Ge,zIndex:this.elements.length,rotation:0,customPoints:t==="custom"?r:void 0};this.addElement(s)},addText(t=100,o=100){const n={id:`text-${this.nextId++}`,type:"text",content:"Text element",x:t,y:o,width:200,height:50,fontSize:16,fontFamily:"Arial",color:Ge,zIndex:this.elements.length,rotation:0};this.addElement(n)},addIcon(t,o=100,n=100){const r={id:`icon-${this.nextId++}`,type:"icon",iconType:t,x:o,y:n,width:50,height:50,color:ae,strokeWeight:2,zIndex:this.elements.length,rotation:0};this.addElement(r)},updateElement(t,o,n=!0){const r=this.elements.findIndex(s=>s.id===t);r!==-1&&(this.elements[r]={...this.elements[r],...o},n&&this.saveSnapshot())},deleteElement(t){const o=this.elements.findIndex(n=>n.id===t);o!==-1&&(this.elements.splice(o,1),this.selectedElementIds=this.selectedElementIds.filter(n=>n!==t),this.saveSnapshot())},deleteSelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements),o=new Set(t.map(n=>n.id));this.elements=this.elements.filter(n=>!o.has(n.id)),this.selectedElementIds=[],this.saveSnapshot()},selectElement(t){this.selectedElementIds=t?[t]:[]},toggleElementSelection(t){const o=this.selectedElementIds.indexOf(t);o===-1?this.selectedElementIds.push(t):this.selectedElementIds.splice(o,1)},addToSelection(t){this.selectedElementIds.includes(t)||this.selectedElementIds.push(t)},clearSelection(){this.selectedElementIds=[]},groupSelectedElements(){if(this.selectedElementIds.length<2)return;const t=[],o=[];if(this.selectedElementIds.forEach(a=>{const i=this.elements.find(l=>l.id===a);i&&(i.type==="group"?(i.childIds.forEach(d=>{const c=this.elements.find(f=>f.id===d);c&&!t.includes(c)&&(c.groupId=void 0,t.push(c))}),o.push(i.id)):i.groupId||t.includes(i)||t.push(i))}),t.length<2)return;this.elements=this.elements.filter(a=>!o.includes(a.id));const n=lo(t),r=`group-${this.nextId++}`,s={id:r,type:"group",x:n.x,y:n.y,width:n.width,height:n.height,rotation:0,zIndex:Math.max(...t.map(a=>a.zIndex))+1,childIds:t.map(a=>a.id)};t.forEach(a=>{a.groupId=r}),this.elements.push(s),this.selectedElementIds=[r],this.saveSnapshot()},ungroupElement(t){const o=this.elements.find(r=>r.id===t&&r.type==="group");if(!o)return;o.childIds.forEach(r=>{const s=this.elements.find(a=>a.id===r);s&&(s.groupId=void 0)});const n=this.elements.findIndex(r=>r.id===t);n!==-1&&this.elements.splice(n,1),this.selectedElementIds=[...o.childIds],this.saveSnapshot()},ungroupSelectedElements(){const t=this.elements.filter(n=>this.selectedElementIds.includes(n.id)&&n.type==="group");if(t.length===0)return;const o=[];t.forEach(n=>{if(n.type==="group"){n.childIds.forEach(a=>{const i=this.elements.find(l=>l.id===a);i&&(i.groupId=void 0,o.push(a))});const s=this.elements.findIndex(a=>a.id===n.id);s!==-1&&this.elements.splice(s,1)}}),this.selectedElementIds=o,this.saveSnapshot()},copySelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);t.length>0&&(this.clipboard=JSON.parse(JSON.stringify(t)))},pasteElement(){if(!this.clipboard||this.clipboard.length===0)return;const t=[],o=this.elements.length,n={},r=[...this.clipboard].sort((a,i)=>a.zIndex-i.zIndex);r.forEach(a=>{n[a.id]=`${a.type}-${this.nextId++}`});const s=r.map((a,i)=>({...JSON.parse(JSON.stringify(a)),id:n[a.id],x:a.x+20,y:a.y+20,zIndex:o+i}));io(s,n),s.forEach(a=>{this.elements.push(a),a.groupId||t.push(a.id)}),this.clipboard.forEach(a=>{a.x+=20,a.y+=20}),this.selectedElementIds=t,this.saveSnapshot()},duplicateSelectedElement(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=[],n=this.elements.length,r={};t.forEach(i=>{r[i.id]=`${i.type}-${this.nextId++}`});const a=[...t].sort((i,l)=>i.zIndex-l.zIndex).map((i,l)=>({...JSON.parse(JSON.stringify(i)),id:r[i.id],x:i.x+20,y:i.y+20,zIndex:n+l}));io(a,r),a.forEach(i=>{this.elements.push(i),i.groupId||o.push(i.id)}),this.selectedElementIds=o,this.saveSnapshot()},updateElementPosition(t,o,n){ao(t,this.elements).forEach(s=>{s.x+=o,s.y+=n})},bringToFront(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=Math.max(...this.elements.map(r=>r.zIndex));Math.max(...t.map(r=>r.zIndex))!==o&&(t.sort((r,s)=>r.zIndex-s.zIndex),t.forEach((r,s)=>{r.zIndex=o+1+s}),this.saveSnapshot())},bringToBack(){if(this.selectedElementIds.length===0)return;const t=Me(this.selectedElementIds,this.elements);if(t.length===0)return;const o=new Set(t.map(s=>s.id)),n=Math.min(...this.elements.map(s=>s.zIndex));Math.min(...t.map(s=>s.zIndex))!==n&&(t.sort((s,a)=>s.zIndex-a.zIndex),this.elements.forEach(s=>{o.has(s.id)||(s.zIndex+=t.length)}),t.forEach((s,a)=>{s.zIndex=a}),this.saveSnapshot())},endDrag(){this.saveSnapshot()},endResize(){this.saveSnapshot()},clearAll(){this.elements=[],this.selectedElementIds=[],this.saveSnapshot()},exportSnapshot(){return{version:1,timestamp:Date.now(),elements:JSON.parse(JSON.stringify(this.elements)),nextId:this.nextId}},importSnapshot(t){if(!t||typeof t!="object"||!("elements"in t)||!Array.isArray(t.elements)){console.error("Invalid snapshot data");return}const o=t;this.elements=JSON.parse(JSON.stringify(o.elements)),this.nextId=o.nextId||this.nextId,this.selectedElementIds=[],this.history=[JSON.parse(JSON.stringify(this.elements))],this.historyIndex=0}}}),Ee=100,Xe=Ae.defineStore("drag",{state:()=>({isDragging:!1,draggedShapeType:null,draggedCustomPoints:void 0,ghostPosition:{x:0,y:0},canvasElement:null}),actions:{startDrag(t,o,n){this.isDragging=!0,this.draggedShapeType=t,this.draggedCustomPoints=n;const r=J();this.ghostPosition={x:o.clientX-Ee*r.zoom/2,y:o.clientY-Ee*r.zoom/2},document.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp),document.addEventListener("keydown",this._handleKeyDown)},cancelDrag(){this._cleanup()},setCanvasElement(t){this.canvasElement=t},_handleMouseMove(t){if(!this.isDragging)return;const o=J();this.ghostPosition={x:t.clientX-Ee*o.zoom/2,y:t.clientY-Ee*o.zoom/2}},_handleMouseUp(t){if(!this.isDragging||!this.draggedShapeType){this._cleanup();return}if(this.canvasElement){const o=this.canvasElement.getBoundingClientRect(),n=t.clientX,r=t.clientY;if(n>=o.left&&n<=o.right&&r>=o.top&&r<=o.bottom){const a=J(),i=(n-o.left+this.canvasElement.scrollLeft)/a.zoom-Ee/2,l=(r-o.top+this.canvasElement.scrollTop)/a.zoom-Ee/2;W().addShape(this.draggedShapeType,i,l,this.draggedCustomPoints)}}this._cleanup()},_handleKeyDown(t){t.key==="Escape"&&this.isDragging&&this.cancelDrag()},_cleanup(){this.isDragging=!1,this.draggedShapeType=null,this.draggedCustomPoints=void 0,document.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),document.removeEventListener("keydown",this._handleKeyDown)}}});const co=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ur=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,n,r)=>r?r.toUpperCase():n.toLowerCase()),mr=t=>{const o=ur(t);return o.charAt(0).toUpperCase()+o.slice(1)},hr=(...t)=>t.filter((o,n,r)=>!!o&&o.trim()!==""&&r.indexOf(o)===n).join(" ").trim(),fo=t=>t==="";var $e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const yr=({name:t,iconNode:o,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":a,size:i=$e.width,color:l=$e.stroke,...d},{slots:c})=>e.h("svg",{...$e,...d,width:i,height:i,stroke:l,"stroke-width":fo(n)||fo(r)||n===!0||r===!0?Number(s||a||$e["stroke-width"])*24/Number(i):s||a||$e["stroke-width"],class:hr("lucide",d.class,...t?[`lucide-${co(mr(t))}-icon`,`lucide-${co(t)}`]:["lucide-icon"])},[...o.map(f=>e.h(...f)),...c.default?[c.default()]:[]]);const V=(t,o)=>(n,{slots:r,attrs:s})=>e.h(yr,{...s,...n,iconNode:o,name:t},r);const gr=V("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const kt=V("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const po=V("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const uo=V("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const Ct=V("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const xr=V("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);const br=V("building",[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);const wr=V("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const kr=V("chart-no-axes-column-increasing",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]]);const Cr=V("chart-pie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);const Er=V("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const mo=V("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Sr=V("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const zr=V("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const _r=V("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]);const Br=V("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Vr=V("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const vr=V("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Pr=V("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);const Ir=V("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);const Nr=V("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Or=V("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);const Ar=V("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Mr=V("factory",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M16 16h.01",key:"1f9h7w"}],["path",{d:"M3 19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a.5.5 0 0 0-.769-.422l-4.462 2.844A.5.5 0 0 1 15 10.5v-2a.5.5 0 0 0-.769-.422L9.77 10.922A.5.5 0 0 1 9 10.5V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z",key:"1iv0i2"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const $r=V("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Tr=V("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const Dr=V("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const ho=V("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);const Fr=V("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);const Rr=V("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const Lr=V("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);const qr=V("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);const Wr=V("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);const jr=V("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const yo=V("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Ur=V("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const Hr=V("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);const Kr=V("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);const Gr=V("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const Xr=V("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Yr=V("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const Zr=V("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Jr=V("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);const Et=V("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Qr=V("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);const es=V("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);const ts=V("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const os=V("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ns=V("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const rs=V("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const go=V("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);const ss=V("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);const as=V("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);const xo=V("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);const is=V("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);const ls=V("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const ds=V("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);const bo=V("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);const cs=V("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);const fs=V("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);const ps=V("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const us=V("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);const ms=V("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);const St=V("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hs=["href"],ys=e.defineComponent({__name:"ElementLink",props:{link:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",class:"absolute -top-3 -right-3 pointer-events-auto text-ma-text-01 bg-white border border-ma-grey-300 rounded-full p-1 shadow-md z-10 hover:bg-ma-grey-100 transition-colors",onMousedown:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(e.unref(Rr),{class:"w-4 h-4 text-blue-600"})],40,hs))}}),gs=e.defineComponent({__name:"ElementTextOverlay",props:{element:{}},setup(t){const o=t,n=e.computed(()=>{const s=o.element,a=s.rotation||0,i=Math.abs(a%180)===90;return{position:"absolute",top:"50%",left:"50%",width:`${i?s.height:s.width}px`,height:`${i?s.width:s.height}px`,transform:`translate(-50%, -50%) rotate(${-a}deg)`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",overflow:"hidden"}}),r=e.computed(()=>{const s=o.element;return{color:s.color||"#000000",fontSize:`${s.fontSize||16}px`,fontFamily:s.fontFamily||"Arial",textAlign:"center",whiteSpace:"pre-wrap",overflowWrap:"break-word",lineHeight:"1.2",userSelect:"none",maxWidth:"100%",maxHeight:"100%"}});return(s,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(n.value)},[e.createElementVNode("span",{style:e.normalizeStyle(r.value)},e.toDisplayString(t.element.content),5)],4))}}),wo=["nw","n","ne","e","se","s","sw","w"],xs=t=>{switch(t){case"nw":return{left:"-10px",top:"-10px"};case"n":return{left:"50%",top:"-10px"};case"ne":return{left:"calc(100% + 10px)",top:"-10px"};case"e":return{left:"calc(100% + 11px)",top:"50%"};case"se":return{left:"calc(100% + 10px)",top:"calc(100% + 10px)"};case"s":return{left:"50%",top:"calc(100% + 11px)"};case"sw":return{left:"-10px",top:"calc(100% + 10px)"};case"w":return{left:"-11px",top:"50%"}}},ko=3;function bs(t){const o=J(),n=e.ref(!1);let r=!1,s=0,a=0,i=0,l=0;const d=u=>{if(!n.value)return;if(!r){const h=Math.abs(u.clientX-s),y=Math.abs(u.clientY-a);(h>=ko||y>=ko)&&(r=!0,t("drag-start",u),i=u.clientX,l=u.clientY);return}const m=u.clientX-i,p=u.clientY-l;i=u.clientX,l=u.clientY,t("drag",m/o.zoom,p/o.zoom,u)},c=()=>{n.value&&(n.value=!1,r&&t("drag-end")),r=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c)},f=u=>{t("click",u),n.value=!0,r=!1,s=u.clientX,a=u.clientY,i=u.clientX,l=u.clientY,document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)};return e.onUnmounted(()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c)}),{isDragging:n,startDrag:f}}function ws(t){const o=e.ref(!1);let n="",r=0,s=0;const a=c=>{if(!o.value)return;const f=c.clientX-r,u=c.clientY-s;r=c.clientX,s=c.clientY,t("resize",n,f,u)},i=()=>{o.value&&(o.value=!1,t("resize-end")),document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},l=(c,f)=>{o.value=!0,n=c,r=f.clientX,s=f.clientY,document.body.style.cursor=d(c),document.body.style.userSelect="none",t("resize-start",c,f),document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)},d=c=>({nw:"nwse-resize",se:"nwse-resize",ne:"nesw-resize",sw:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"})[c]||"pointer";return e.onUnmounted(()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}),{isResizing:o,startResize:l}}function ks(t){const o=e.computed(()=>{const s=t.value;return s.type!=="shape"?null:{width:s.width,height:s.height,fill:s.fill,outline:s.outline,strokeWeight:s.strokeWeight,rotation:0,shapeType:s.shapeType,customPoints:s.customPoints}}),n=e.computed(()=>{const s=t.value;return s.type!=="text"?null:{content:s.content,color:s.color,fontSize:s.fontSize,fontFamily:s.fontFamily}}),r=e.computed(()=>{const s=t.value;return s.type!=="icon"?null:{iconType:s.iconType,color:s.color,strokeWeight:s.strokeWeight}});return{shapeProps:o,textProps:n,iconProps:r}}const Cs=["data-testid","width","height"],Es=["data-testid","stroke","fill","stroke-width"],Ss=["data-testid","points","stroke","fill","stroke-width"],Ye=e.defineComponent({__name:"GenericShape",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},shapeType:{type:String,required:!0},strokeWeight:{type:Number,default:3},outline:{type:String,default:"defaultOutlineColor"},fill:{type:String,default:"defaultFillColor"},customPoints:{type:String,default:""}},setup(t){const o=t,n=e.computed(()=>{switch(o.shapeType){case"custom":return o.customPoints;case"rectangle":return"0,0 100,0 100,100 0,100";case"triangle":return"50,0 100,100 0,100";case"trapezoid":return"20,0 80,0 100,100 0,100";case"chevron":return"0,0 60,0 100,50 60,100 0,100 40,50";case"hexagon":return"25,0 75,0 100,50 75,100 25,100 0,50";case"diamond":return"50,0 100,50 50,100 0,50";case"parallelogram":return"20,0 100,0 80,100 0,100";case"pentagon":return"50,0 100,38 82,100 18,100 0,38";case"line":return"0,100 100,0";case"horizontal-line":return"0,50 100,50";case"arrow":return"0,30 60,30 60,0 100,50 60,100 60,70 0,70";default:return""}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{"data-testid":`${t.shapeType}-shape`,width:t.width,height:t.height,viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{overflow:"visible"}},[t.shapeType==="ellipse"?(e.openBlock(),e.createElementBlock("ellipse",{key:0,"data-testid":`${t.shapeType}-ellipse`,cx:"50",cy:"50",rx:"50",ry:"50",stroke:t.outline,fill:t.fill,"stroke-width":t.strokeWeight,"vector-effect":"non-scaling-stroke"},null,8,Es)):(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-testid":`${t.shapeType}-polygon`,points:n.value,stroke:t.outline,fill:t.fill,"stroke-width":t.strokeWeight,"vector-effect":"non-scaling-stroke"},null,8,Ss))],8,Cs))}}),zs=e.defineComponent({__name:"TextElement",props:{content:{},color:{},fontSize:{},fontFamily:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full h-full flex items-center justify-center p-2 overflow-hidden",style:e.normalizeStyle({color:t.color,fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily})},e.toDisplayString(t.content),5))}}),Co={arrowUp:Ct,arrowDown:kt,arrowLeft:po,arrowRight:uo,user:ps,users:us,building:br,factory:Mr,briefcase:xr,fileText:$r,folder:Tr,database:Nr,clipboardList:zr,server:os,monitor:Ur,smartphone:rs,mail:Lr,messageSquare:Wr,phone:Jr,checkCircle:Sr,alertTriangle:ls,info:Dr,settings:ns,activity:gr,barChart:kr,pieChart:Cr,trendingUp:is,dollarSign:Or,creditCard:Pr,truck:ds,package:Kr,mapPin:qr,clock:Br,calendar:wr,target:as},_s=e.defineComponent({__name:"IconElement",props:{iconType:{},color:{},strokeWeight:{}},setup(t){const o=t,n=e.computed(()=>Co[o.iconType]||null);return(r,s)=>(e.openBlock(),e.createElementBlock("div",{class:"w-full h-full flex items-center justify-center overflow-hidden",style:e.normalizeStyle({color:t.color})},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),{class:"w-full h-full","stroke-width":t.strokeWeight},null,8,["stroke-width"]))],4))}}),Bs={class:"w-full h-full"},Vs={key:0,class:"absolute inset-0 pointer-events-none"},vs=["onMousedown"],Eo=e.defineComponent({__name:"ElementWrapper",props:{element:{},selected:{type:Boolean}},emits:["select","click","drag-start","drag","drag-end","resize-start","resize","resize-end"],setup(t,{emit:o}){const n=t,r=o,{startDrag:s}=bs(r),{startResize:a}=ws(r),{shapeProps:i,textProps:l,iconProps:d}=ks(e.toRef(n,"element")),c=e.computed(()=>n.element.type==="icon"?wo.filter(p=>["nw","ne","sw","se"].includes(p)):wo),f=e.computed(()=>({left:`${n.element.x}px`,top:`${n.element.y}px`,width:`${n.element.width}px`,height:`${n.element.height}px`,transform:`rotate(${n.element.rotation}deg)`,transformOrigin:"center center"})),u=p=>{r("select",p),s(p)},m=(p,h)=>{a(p,h)};return(p,h)=>(e.openBlock(),e.createElementBlock("div",{class:"absolute",style:e.normalizeStyle(f.value),onMousedown:e.withModifiers(u,["stop"])},[e.createElementVNode("div",Bs,[e.unref(i)?(e.openBlock(),e.createBlock(Ye,e.normalizeProps(e.mergeProps({key:0},e.unref(i))),null,16)):e.unref(l)?(e.openBlock(),e.createBlock(zs,e.normalizeProps(e.mergeProps({key:1},e.unref(l))),null,16)):e.unref(d)?(e.openBlock(),e.createBlock(_s,e.normalizeProps(e.mergeProps({key:2},e.unref(d))),null,16)):e.createCommentVNode("",!0)]),t.selected?(e.openBlock(),e.createElementBlock("div",Vs,[h[0]||(h[0]=e.createElementVNode("div",{class:"absolute -inset-3 border-2 border-ma-primary-500 pointer-events-none"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"absolute w-2 h-2 bg-ma-primary-500 border border-white rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-auto cursor-pointer",style:e.normalizeStyle(e.unref(xs)(y)),onMousedown:e.withModifiers(g=>m(y,g),["stop"])},null,44,vs))),128))])):e.createCommentVNode("",!0),t.element.type==="shape"?(e.openBlock(),e.createBlock(gs,{key:1,element:t.element},null,8,["element"])):e.createCommentVNode("",!0),t.element.link&&!t.selected?(e.openBlock(),e.createBlock(ys,{key:2,link:t.element.link},null,8,["link"])):e.createCommentVNode("",!0)],36))}});function So(t){var o,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(o=0;o<s;o++)t[o]&&(n=So(t[o]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function zo(){for(var t,o,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(o=So(t))&&(r&&(r+=" "),r+=o);return r}const _o=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Bo=zo,Ps=(t,o)=>n=>{var r;if(o?.variants==null)return Bo(t,n?.class,n?.className);const{variants:s,defaultVariants:a}=o,i=Object.keys(s).map(c=>{const f=n?.[c],u=a?.[c];if(f===null)return null;const m=_o(f)||_o(u);return s[c][m]}),l=n&&Object.entries(n).reduce((c,f)=>{let[u,m]=f;return m===void 0||(c[u]=m),c},{}),d=o==null||(r=o.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:m,...p}=f;return Object.entries(p).every(h=>{let[y,g]=h;return Array.isArray(g)?g.includes({...a,...l}[y]):{...a,...l}[y]===g})?[...c,u,m]:c},[]);return Bo(t,i,d,n?.class,n?.className)};function Te(t,o){const n=typeof t=="string"&&!o?`${t}Context`:o,r=Symbol(n);return[i=>{const l=e.inject(r,i);if(l||l===null)return l;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(e.provide(r,i),i)]}function pe(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Vo(t,o,n){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});o&&r.addEventListener(t,o,{once:!0}),r.dispatchEvent(s)}function Is(t){return t==null}function zt(t){return t?t.flatMap(o=>o.type===e.Fragment?zt(o.children):[o]):[]}const[vo]=Te("ConfigProvider");function Ns(t,o){var n;const r=e.shallowRef();return e.watchEffect(()=>{r.value=t()},{...o,flush:(n=void 0)!=null?n:"sync"}),e.readonly(r)}function Po(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Os(t){let o=!1,n;const r=e.effectScope(!0);return(...s)=>(o||(n=r.run(()=>t(...s)),o=!0),n)}function As(t){let o=0,n,r;const s=()=>{o-=1,r&&o<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(o+=1,r||(r=e.effectScope(!0),n=r.run(()=>t(...a))),Po(s),n)}function Ms(t){if(!e.isRef(t))return e.reactive(t);const o=new Proxy({},{get(n,r,s){return e.unref(Reflect.get(t.value,r,s))},set(n,r,s){return e.isRef(t.value[r])&&!e.isRef(s)?t.value[r].value=s:t.value[r]=s,!0},deleteProperty(n,r){return Reflect.deleteProperty(t.value,r)},has(n,r){return Reflect.has(t.value,r)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return e.reactive(o)}function $s(t){return Ms(e.computed(t))}function Ts(t,...o){const n=o.flat(),r=n[0];return $s(()=>Object.fromEntries(typeof r=="function"?Object.entries(e.toRefs(t)).filter(([s,a])=>!r(e.toValue(a),s)):Object.entries(e.toRefs(t)).filter(s=>!n.includes(s[0]))))}const ue=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ds=t=>typeof t<"u",Fs=Object.prototype.toString,Rs=t=>Fs.call(t)==="[object Object]",Io=Ls();function Ls(){var t,o;return ue&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((o=window?.navigator)==null?void 0:o.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function qs(t){return e.getCurrentInstance()}function _t(t){return Array.isArray(t)?t:[t]}function Ws(t,o){qs()&&e.onBeforeUnmount(t,o)}function js(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const Bt=ue?window:void 0;function De(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}function No(...t){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},r=(l,d,c,f)=>(l.addEventListener(d,c,f),()=>l.removeEventListener(d,c,f)),s=e.computed(()=>{const l=_t(e.toValue(t[0])).filter(d=>d!=null);return l.every(d=>typeof d!="string")?l:void 0}),a=js(()=>{var l,d;return[(d=(l=s.value)==null?void 0:l.map(c=>De(c)))!=null?d:[Bt].filter(c=>c!=null),_t(e.toValue(s.value?t[1]:t[0])),_t(e.unref(s.value?t[2]:t[1])),e.toValue(s.value?t[3]:t[2])]},([l,d,c,f])=>{if(n(),!l?.length||!d?.length||!c?.length)return;const u=Rs(f)?{...f}:f;o.push(...l.flatMap(m=>d.flatMap(p=>c.map(h=>r(m,p,h,u)))))},{flush:"post"}),i=()=>{a(),n()};return Po(n),i}function Us(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function Hs(t){return typeof t=="function"?t:typeof t=="string"?o=>o.key===t:Array.isArray(t)?o=>t.includes(o.key):()=>!0}function Ks(...t){let o,n,r={};t.length===3?(o=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(o=!0,n=t[0],r=t[1]):(o=t[0],n=t[1]):(o=!0,n=t[0]);const{target:s=Bt,eventName:a="keydown",passive:i=!1,dedupe:l=!1}=r,d=Hs(o);return No(s,a,f=>{f.repeat&&e.toValue(l)||d(f)&&n(f)},i)}function Gs(t){return JSON.parse(JSON.stringify(t))}function Oo(t,o,n,r={}){var s,a,i;const{clone:l=!1,passive:d=!1,eventName:c,deep:f=!1,defaultValue:u,shouldEmit:m}=r,p=e.getCurrentInstance(),h=n||p?.emit||((s=p?.$emit)==null?void 0:s.bind(p))||((i=(a=p?.proxy)==null?void 0:a.$emit)==null?void 0:i.bind(p?.proxy));let y=c;y=y||`update:${o.toString()}`;const g=k=>l?typeof l=="function"?l(k):Gs(k):k,x=()=>Ds(t[o])?g(t[o]):u,w=k=>{m?m(k)&&h(y,k):h(y,k)};if(d){const k=x(),I=e.ref(k);let S=!1;return e.watch(()=>t[o],z=>{S||(S=!0,I.value=g(z),e.nextTick(()=>S=!1))}),e.watch(I,z=>{!S&&(z!==t[o]||f)&&w(z)},{deep:f}),I}else return e.computed({get(){return x()},set(k){w(k)}})}function Vt(t){if(t===null||typeof t!="object")return!1;const o=Object.getPrototypeOf(t);return o!==null&&o!==Object.prototype&&Object.getPrototypeOf(o)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function vt(t,o,n=".",r){if(!Vt(o))return vt(t,{},n,r);const s=Object.assign({},o);for(const a in t){if(a==="__proto__"||a==="constructor")continue;const i=t[a];i!=null&&(r&&r(s,a,i,n)||(Array.isArray(i)&&Array.isArray(s[a])?s[a]=[...i,...s[a]]:Vt(i)&&Vt(s[a])?s[a]=vt(i,s[a],(n?`${n}.`:"")+a.toString(),r):s[a]=i))}return s}function Xs(t){return(...o)=>o.reduce((n,r)=>vt(n,r,"",t),{})}const Ys=Xs(),Zs=As(()=>{const t=e.ref(new Map),o=e.ref(),n=e.computed(()=>{for(const i of t.value.values())if(i)return!0;return!1}),r=vo({scrollBody:e.ref(!0)});let s=null;const a=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=o.value??"",Io&&s?.(),o.value=void 0};return e.watch(n,(i,l)=>{if(!ue)return;if(!i){l&&a();return}o.value===void 0&&(o.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,c={padding:d,margin:0},f=r.scrollBody?.value?typeof r.scrollBody.value=="object"?Ys({padding:r.scrollBody.value.padding===!0?d:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?d:r.scrollBody.value.margin},c):c:{padding:0,margin:0};d>0&&(document.body.style.paddingRight=typeof f.padding=="number"?`${f.padding}px`:String(f.padding),document.body.style.marginRight=typeof f.margin=="number"?`${f.margin}px`:String(f.margin),document.documentElement.style.setProperty("--scrollbar-width",`${d}px`),document.body.style.overflow="hidden"),Io&&(s=No(document,"touchmove",u=>Js(u),{passive:!1})),e.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Ao(t){const o=Math.random().toString(36).substring(2,7),n=Zs();n.value.set(o,t);const r=e.computed({get:()=>n.value.get(o)??!1,set:s=>n.value.set(o,s)});return Ws(()=>{n.value.delete(o)}),r}function Mo(t){const o=window.getComputedStyle(t);if(o.overflowX==="scroll"||o.overflowY==="scroll"||o.overflowX==="auto"&&t.clientWidth<t.scrollWidth||o.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:Mo(n)}}function Js(t){const o=t||window.event,n=o.target;return n instanceof Element&&Mo(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}function Ze(t){const o=e.getCurrentInstance(),n=o?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${o?.type.__name}`),n?.forEach(s=>{r[e.toHandlerKey(e.camelize(s))]=(...a)=>t(s,...a)}),r}let Pt=0;function Qs(){e.watchEffect(t=>{if(!ue)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??$o()),document.body.insertAdjacentElement("beforeend",o[1]??$o()),Pt++,t(()=>{Pt===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Pt--})})}function $o(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function j(){const t=e.getCurrentInstance(),o=e.ref(),n=e.computed(()=>["#text","#comment"].includes(o.value?.$el.nodeName)?o.value?.$el.nextElementSibling:De(o)),r=Object.assign({},t.exposed),s={};for(const i in t.props)Object.defineProperty(s,i,{enumerable:!0,configurable:!0,get:()=>t.props[i]});if(Object.keys(r).length>0)for(const i in r)Object.defineProperty(s,i,{enumerable:!0,configurable:!0,get:()=>r[i]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function a(i){if(o.value=i,!!i&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>i instanceof Element?i:i.$el}),!(i instanceof Element)&&!Object.hasOwn(i,"$el"))){const l=i.$.exposed,d=Object.assign({},s);for(const c in l)Object.defineProperty(d,c,{enumerable:!0,configurable:!0,get:()=>l[c]});t.exposed=d}}return{forwardRef:a,currentRef:o,currentElement:n}}function It(t){const o=e.getCurrentInstance(),n=Object.keys(o?.type.props??{}).reduce((s,a)=>{const i=(o?.type.props[a]).default;return i!==void 0&&(s[a]=i),s},{}),r=e.toRef(t);return e.computed(()=>{const s={},a=o?.vnode.props??{};return Object.keys(a).forEach(i=>{s[e.camelize(i)]=a[i]}),Object.keys({...n,...s}).reduce((i,l)=>(r.value[l]!==void 0&&(i[l]=r.value[l]),i),{})})}function be(t,o){const n=It(t),r=o?Ze(o):{};return e.computed(()=>({...n.value,...r}))}var ea=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},Se=new WeakMap,Je=new WeakMap,Qe={},Nt=0,To=function(t){return t&&(t.host||To(t.parentNode))},ta=function(t,o){return o.map(function(n){if(t.contains(n))return n;var r=To(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},oa=function(t,o,n,r){var s=ta(o,Array.isArray(t)?t:[t]);Qe[n]||(Qe[n]=new WeakMap);var a=Qe[n],i=[],l=new Set,d=new Set(s),c=function(u){!u||l.has(u)||(l.add(u),c(u.parentNode))};s.forEach(c);var f=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(m){if(l.has(m))f(m);else try{var p=m.getAttribute(r),h=p!==null&&p!=="false",y=(Se.get(m)||0)+1,g=(a.get(m)||0)+1;Se.set(m,y),a.set(m,g),i.push(m),y===1&&h&&Je.set(m,!0),g===1&&m.setAttribute(n,"true"),h||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(o),l.clear(),Nt++,function(){i.forEach(function(u){var m=Se.get(u)-1,p=a.get(u)-1;Se.set(u,m),a.set(u,p),m||(Je.has(u)||u.removeAttribute(r),Je.delete(u)),p||u.removeAttribute(n)}),Nt--,Nt||(Se=new WeakMap,Se=new WeakMap,Je=new WeakMap,Qe={})}},na=function(t,o,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=ea(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),oa(r,s,n,"aria-hidden")):function(){return null}};function Do(t){let o;e.watch(()=>De(t),n=>{n?o=na(n):o&&o()}),e.onUnmounted(()=>{o&&o()})}let ra=0;function et(t,o="reka"){if("useId"in ro)return`${o}-${ro.useId?.()}`;const n=vo({useId:void 0});return n.useId?`${o}-${n.useId()}`:`${o}-${++ra}`}function sa(t){const o=e.ref(),n=e.computed(()=>o.value?.width??0),r=e.computed(()=>o.value?.height??0);return e.onMounted(()=>{const s=De(t);if(s){o.value={width:s.offsetWidth,height:s.offsetHeight};const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let d,c;if("borderBoxSize"in l){const f=l.borderBoxSize,u=Array.isArray(f)?f[0]:f;d=u.inlineSize,c=u.blockSize}else d=s.offsetWidth,c=s.offsetHeight;o.value={width:d,height:c}});return a.observe(s,{box:"border-box"}),()=>a.unobserve(s)}else o.value=void 0}),{width:n,height:r}}function aa(t,o){const n=e.ref(t);function r(a){return o[n.value][a]??n.value}return{state:n,dispatch:a=>{n.value=r(a)}}}function ia(t,o){const n=e.ref({}),r=e.ref("none"),s=e.ref(t),a=t.value?"mounted":"unmounted";let i;const l=o.value?.ownerDocument.defaultView??Bt,{state:d,dispatch:c}=aa(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),f=g=>{if(ue){const x=new CustomEvent(g,{bubbles:!1,cancelable:!1});o.value?.dispatchEvent(x)}};e.watch(t,async(g,x)=>{const w=x!==g;if(await e.nextTick(),w){const k=r.value,I=tt(o.value);g?(c("MOUNT"),f("enter"),I==="none"&&f("after-enter")):I==="none"||I==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),f("leave"),f("after-leave")):x&&k!==I?(c("ANIMATION_OUT"),f("leave")):(c("UNMOUNT"),f("after-leave"))}},{immediate:!0});const u=g=>{const x=tt(o.value),w=x.includes(CSS.escape(g.animationName)),k=d.value==="mounted"?"enter":"leave";if(g.target===o.value&&w&&(f(`after-${k}`),c("ANIMATION_END"),!s.value)){const I=o.value.style.animationFillMode;o.value.style.animationFillMode="forwards",i=l?.setTimeout(()=>{o.value?.style.animationFillMode==="forwards"&&(o.value.style.animationFillMode=I)})}g.target===o.value&&x==="none"&&c("ANIMATION_END")},m=g=>{g.target===o.value&&(r.value=tt(o.value))},p=e.watch(o,(g,x)=>{g?(n.value=getComputedStyle(g),g.addEventListener("animationstart",m),g.addEventListener("animationcancel",u),g.addEventListener("animationend",u)):(c("ANIMATION_END"),i!==void 0&&l?.clearTimeout(i),x?.removeEventListener("animationstart",m),x?.removeEventListener("animationcancel",u),x?.removeEventListener("animationend",u))},{immediate:!0}),h=e.watch(d,()=>{const g=tt(o.value);r.value=d.value==="mounted"?g:"none"});return e.onUnmounted(()=>{p(),h()}),{isPresent:e.computed(()=>["mounted","unmountSuspended"].includes(d.value))}}function tt(t){return t&&getComputedStyle(t).animationName||"none"}var Ot=e.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:o,expose:n}){const{present:r,forceMount:s}=e.toRefs(t),a=e.ref(),{isPresent:i}=ia(r,a);n({present:i});let l=o.default({present:i.value});l=zt(l||[]);const d=e.getCurrentInstance();if(l&&l?.length>1){const c=d?.parent?.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(`
2
2
  `)].join(`
3
3
  `))}return()=>s.value||r.value||i.value?e.h(o.default({present:i.value})[0],{ref:c=>{const f=De(c);return typeof f?.hasAttribute>"u"||(f?.hasAttribute("data-reka-popper-content-wrapper")?a.value=f.firstElementChild:a.value=f),f}}):null}});const la=e.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:o,slots:n}){return()=>{if(!n.default)return null;const r=zt(n.default()),s=r.findIndex(d=>d.type!==e.Comment);if(s===-1)return r;const a=r[s];delete a.props?.ref;const i=a.props?e.mergeProps(o,a.props):o,l=e.cloneVNode({...a,props:{}},i);return r.length===1?l:(r[s]=l,r)}}}),da=["area","img","input"],Q=e.defineComponent({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:o,slots:n}){const r=t.asChild?"template":t.as;return typeof r=="string"&&da.includes(r)?()=>e.h(r,o):r!=="template"?()=>e.h(t.as,o,{default:n.default}):()=>e.h(la,o,{default:n.default})}}),[me,ca]=Te("DialogRoot");var fa=e.defineComponent({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=t,s=Oo(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=e.ref(),i=e.ref(),{modal:l}=e.toRefs(n);return ca({open:s,modal:l,openModal:()=>{s.value=!0},onOpenChange:d=>{s.value=d},onOpenToggle:()=>{s.value=!s.value},contentId:"",titleId:"",descriptionId:"",triggerElement:a,contentElement:i}),(d,c)=>e.renderSlot(d.$slots,"default",{open:e.unref(s),close:()=>s.value=!1})}}),pa=fa,ua=e.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t;j();const n=me();return(r,s)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{type:r.as==="button"?"button":void 0,onClick:s[0]||(s[0]=a=>e.unref(n).onOpenChange(!1))}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["type"]))}}),ma=ua;const ha="dismissableLayer.pointerDownOutside",ya="dismissableLayer.focusOutside";function Fo(t,o){const n=o.closest("[data-dismissable-layer]"),r=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),s=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(r===n||s.indexOf(r)<s.indexOf(n)))}function ga(t,o,n=!0){const r=o?.value?.ownerDocument??globalThis?.document,s=e.ref(!1),a=e.ref(()=>{});return e.watchEffect(i=>{if(!ue||!e.toValue(n))return;const l=async c=>{const f=c.target;if(!(!o?.value||!f)){if(Fo(o.value,f)){s.value=!1;return}if(c.target&&!s.value){let m=function(){Vo(ha,t,u)};const u={originalEvent:c};c.pointerType==="touch"?(r.removeEventListener("click",a.value),a.value=m,r.addEventListener("click",a.value,{once:!0})):m()}else r.removeEventListener("click",a.value);s.value=!1}},d=window.setTimeout(()=>{r.addEventListener("pointerdown",l)},0);i(()=>{window.clearTimeout(d),r.removeEventListener("pointerdown",l),r.removeEventListener("click",a.value)})}),{onPointerDownCapture:()=>{e.toValue(n)&&(s.value=!0)}}}function xa(t,o,n=!0){const r=o?.value?.ownerDocument??globalThis?.document,s=e.ref(!1);return e.watchEffect(a=>{if(!ue||!e.toValue(n))return;const i=async l=>{if(!o?.value)return;await e.nextTick(),await e.nextTick();const d=l.target;!o.value||!d||Fo(o.value,d)||l.target&&!s.value&&Vo(ya,t,{originalEvent:l})};r.addEventListener("focusin",i),a(()=>r.removeEventListener("focusin",i))}),{onFocusCapture:()=>{e.toValue(n)&&(s.value=!0)},onBlurCapture:()=>{e.toValue(n)&&(s.value=!1)}}}const Z=e.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var ba=e.defineComponent({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:o}){const n=t,r=o,{forwardRef:s,currentElement:a}=j(),i=e.computed(()=>a.value?.ownerDocument??globalThis.document),l=e.computed(()=>Z.layersRoot),d=e.computed(()=>a.value?Array.from(l.value).indexOf(a.value):-1),c=e.computed(()=>Z.layersWithOutsidePointerEventsDisabled.size>0),f=e.computed(()=>{const p=Array.from(l.value),[h]=[...Z.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(h);return d.value>=y}),u=ga(async p=>{const h=[...Z.branches].some(y=>y?.contains(p.target));!f.value||h||(r("pointerDownOutside",p),r("interactOutside",p),await e.nextTick(),p.defaultPrevented||r("dismiss"))},a),m=xa(p=>{[...Z.branches].some(y=>y?.contains(p.target))||(r("focusOutside",p),r("interactOutside",p),p.defaultPrevented||r("dismiss"))},a);return Ks("Escape",p=>{d.value===l.value.size-1&&(r("escapeKeyDown",p),p.defaultPrevented||r("dismiss"))}),e.watchEffect(p=>{a.value&&(n.disableOutsidePointerEvents&&(Z.layersWithOutsidePointerEventsDisabled.size===0&&(Z.originalBodyPointerEvents=i.value.body.style.pointerEvents,i.value.body.style.pointerEvents="none"),Z.layersWithOutsidePointerEventsDisabled.add(a.value)),l.value.add(a.value),p(()=>{n.disableOutsidePointerEvents&&Z.layersWithOutsidePointerEventsDisabled.size===1&&!Is(Z.originalBodyPointerEvents)&&(i.value.body.style.pointerEvents=Z.originalBodyPointerEvents)}))}),e.watchEffect(p=>{p(()=>{a.value&&(l.value.delete(a.value),Z.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(p,h)=>(e.openBlock(),e.createBlock(e.unref(Q),{ref:e.unref(s),"as-child":p.asChild,as:p.as,"data-dismissable-layer":"",style:e.normalizeStyle({pointerEvents:c.value?f.value?"auto":"none":void 0}),onFocusCapture:e.unref(m).onFocusCapture,onBlurCapture:e.unref(m).onBlurCapture,onPointerdownCapture:e.unref(u).onPointerDownCapture},{default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ro=ba;const wa=Os(()=>e.ref([]));function ka(){const t=wa();return{add(o){const n=t.value[0];o!==n&&n?.pause(),t.value=Lo(t.value,o),t.value.unshift(o)},remove(o){t.value=Lo(t.value,o),t.value[0]?.resume()}}}function Lo(t,o){const n=[...t],r=n.indexOf(o);return r!==-1&&n.splice(r,1),n}function Ca(t){return t.filter(o=>o.tagName!=="A")}const At="focusScope.autoFocusOnMount",Mt="focusScope.autoFocusOnUnmount",qo={bubbles:!1,cancelable:!0};function Ea(t,{select:o=!1}={}){const n=pe();for(const r of t)if(he(r,{select:o}),pe()!==n)return!0}function Sa(t){const o=Wo(t),n=jo(o,t),r=jo(o.reverse(),t);return[n,r]}function Wo(t){const o=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)o.push(n.currentNode);return o}function jo(t,o){for(const n of t)if(!za(n,{upTo:o}))return n}function za(t,{upTo:o}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(o!==void 0&&t===o)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function _a(t){return t instanceof HTMLInputElement&&"select"in t}function he(t,{select:o=!1}={}){if(t&&t.focus){const n=pe();t.focus({preventScroll:!0}),t!==n&&_a(t)&&o&&t.select()}}var Ba=e.defineComponent({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:o}){const n=t,r=o,{currentRef:s,currentElement:a}=j(),i=e.ref(null),l=ka(),d=e.reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});e.watchEffect(f=>{if(!ue)return;const u=a.value;if(!n.trapped)return;function m(g){if(d.paused||!u)return;const x=g.target;u.contains(x)?i.value=x:he(i.value,{select:!0})}function p(g){if(d.paused||!u)return;const x=g.relatedTarget;x!==null&&(u.contains(x)||he(i.value,{select:!0}))}function h(g){u.contains(i.value)||he(u)}document.addEventListener("focusin",m),document.addEventListener("focusout",p);const y=new MutationObserver(h);u&&y.observe(u,{childList:!0,subtree:!0}),f(()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",p),y.disconnect()})}),e.watchEffect(async f=>{const u=a.value;if(await e.nextTick(),!u)return;l.add(d);const m=pe();if(!u.contains(m)){const h=new CustomEvent(At,qo);u.addEventListener(At,y=>r("mountAutoFocus",y)),u.dispatchEvent(h),h.defaultPrevented||(Ea(Ca(Wo(u)),{select:!0}),pe()===m&&he(u))}f(()=>{u.removeEventListener(At,g=>r("mountAutoFocus",g));const h=new CustomEvent(Mt,qo),y=g=>{r("unmountAutoFocus",g)};u.addEventListener(Mt,y),u.dispatchEvent(h),setTimeout(()=>{h.defaultPrevented||he(m??document.body,{select:!0}),u.removeEventListener(Mt,y),l.remove(d)},0)})});function c(f){if(!n.loop&&!n.trapped||d.paused)return;const u=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,m=pe();if(u&&m){const p=f.currentTarget,[h,y]=Sa(p);h&&y?!f.shiftKey&&m===y?(f.preventDefault(),n.loop&&he(h,{select:!0})):f.shiftKey&&m===h&&(f.preventDefault(),n.loop&&he(y,{select:!0})):m===p&&f.preventDefault()}}return(f,u)=>(e.openBlock(),e.createBlock(e.unref(Q),{ref_key:"currentRef",ref:s,tabindex:"-1","as-child":f.asChild,as:f.as,onKeydown:c},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default")]),_:3},8,["as-child","as"]))}}),Uo=Ba;function Va(t){return t?"open":"closed"}const va="DialogTitle",Pa="DialogContent";function Ia({titleName:t=va,contentName:o=Pa,componentLink:n="dialog.html#title",titleId:r,descriptionId:s,contentElement:a}){const i=`Warning: \`${o}\` requires a \`${t}\` for the component to be accessible for screen reader users.
4
4
 
@@ -9,4 +9,4 @@ abschluss`,fontSize:14,color:"#ffffff"},{id:"shape-83",type:"shape",shapeType:"c
9
9
  Reklamation`,fontSize:14},{id:"shape-84",type:"shape",shapeType:"custom",x:721,y:202,width:90,height:44,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:16,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Baustelle",fontSize:14},{id:"shape-85",type:"shape",shapeType:"trapezoid",x:142.37373737373738,y:393.99999999999994,width:100,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:17,rotation:0,content:"Orga",fontSize:14,color:"#ffffff"},{id:"shape-86",type:"shape",shapeType:"trapezoid",x:232.95959595959584,y:393.99999999999994,width:100,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:18,rotation:180,content:"IT",fontSize:14,color:"#ffffff"},{id:"shape-87",type:"shape",shapeType:"trapezoid",x:323.3636363636364,y:393.99999999999994,width:100,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:19,rotation:0,content:"Mitarbeiter",fontSize:14,color:"#ffffff"},{id:"shape-88",type:"shape",shapeType:"trapezoid",x:414.47474747474723,y:393.99999999999994,width:100,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:20,rotation:180,content:"Einkauf",fontSize:14,color:"#ffffff"},{id:"shape-89",type:"shape",shapeType:"trapezoid",x:504.7878787878787,y:393.99999999999994,width:95,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:21,rotation:0,content:"Finanzen",fontSize:14,color:"#ffffff"},{id:"shape-98",type:"shape",shapeType:"custom",x:592.636363636364,y:393.99999999999994,width:87,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:21,rotation:180,customPoints:"0,100 100,100 80,0 20,0",content:"Operations",fontSize:14,color:"#ffffff"},{id:"shape-99",type:"shape",shapeType:"custom",x:530.4747474747472,y:101,width:151,height:62,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:22,rotation:0,customPoints:"9,100 100,100 100,0 9,0 0,50",content:`Normen, Recht
10
10
  und Literatur`,fontSize:14,color:"#ffffff"},{id:"shape-101",type:"shape",shapeType:"custom",x:165,y:101,width:151,height:62,outline:"#74a7fe",fill:"#74a7fe",strokeWeight:3,zIndex:24,rotation:180,customPoints:"9,100 100,100 100,0 9,0 0,50",content:`Ziele und Politik
11
11
  QM / UM / SGA`,fontSize:14,color:"#ffffff"},{id:"shape-102",type:"shape",shapeType:"custom",x:310.3636363636364,y:133,width:225,height:30,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:24,rotation:0,customPoints:"0,100 100,100 93,0 7,0",content:"Steuerung",fontSize:14,color:"#ffffff"},{id:"shape-103",type:"shape",shapeType:"custom",x:310.8636363636364,y:102,width:225,height:30,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:25,rotation:180,customPoints:"0,100 100,100 93,0 7,0",content:"Organisationsstruktur",fontSize:14,color:"#ffffff"},{id:"icon-104",type:"icon",iconType:"arrowUp",x:232.5,y:257,width:30,height:30,color:"#000",strokeWeight:2,zIndex:26,rotation:0},{id:"icon-105",type:"icon",iconType:"arrowUp",x:319.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:27,rotation:0},{id:"icon-106",type:"icon",iconType:"arrowUp",x:408.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:28,rotation:0},{id:"icon-107",type:"icon",iconType:"arrowUp",x:495.7878787878787,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:29,rotation:0},{id:"icon-108",type:"icon",iconType:"arrowUp",x:585.2878787878788,y:257,width:30,height:30,color:"#000",strokeWeight:2,zIndex:30,rotation:0},{id:"icon-109",type:"icon",iconType:"arrowUp",x:259.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:31,rotation:180},{id:"icon-110",type:"icon",iconType:"arrowUp",x:347.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:32,rotation:180},{id:"icon-111",type:"icon",iconType:"arrowUp",x:435.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:33,rotation:180},{id:"icon-112",type:"icon",iconType:"arrowUp",x:523.5,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:34,rotation:180},{id:"icon-113",type:"icon",iconType:"arrowUp",x:612.636363636364,y:258,width:30,height:30,color:"#000",strokeWeight:2,zIndex:35,rotation:180},{id:"text-114",type:"text",content:"Kunden",x:8,y:238,width:226,height:76,fontSize:18,fontFamily:"Arial",color:"#000000",zIndex:36,rotation:270},{id:"text-115",type:"text",content:"Kunden",x:757,y:238,width:226,height:76,fontSize:18,fontFamily:"Arial",color:"#000000",zIndex:37,rotation:270}],nextId:116}},{name:"Prozesslandschaft IMS Markt",description:"Process landscape diagram with red color scheme (German)",snapshot:{version:1,timestamp:1770390010560,elements:[{id:"shape-6",type:"shape",shapeType:"chevron",x:76,y:206,width:87,height:423,outline:"#b8f3ff",fill:"#b8f3ff",strokeWeight:3,zIndex:2,rotation:0},{id:"shape-7",type:"shape",shapeType:"chevron",x:974,y:200,width:87,height:423,outline:"#b8f3ff",fill:"#b8f3ff",strokeWeight:3,zIndex:3,rotation:0},{id:"shape-8",type:"shape",shapeType:"custom",x:193,y:205,width:288,height:413,outline:"#b8f3ff",fill:"#b8f3ff",strokeWeight:3,zIndex:4,rotation:0,customPoints:"0,0 80,10 100,50 80,90 0,100 10,50"},{id:"shape-9",type:"shape",shapeType:"custom",x:714,y:204,width:269,height:411,outline:"#b8f3ff",fill:"#b8f3ff",strokeWeight:3,zIndex:5,rotation:0,customPoints:"0,10 90,0 100,50 90,100 0,90 20,50"},{id:"shape-10",type:"shape",shapeType:"custom",x:451,y:255,width:297,height:312,outline:"#b8f3ff",fill:"#b8f3ff",strokeWeight:3,zIndex:6,rotation:0,customPoints:"0,0 80,0 100,50 80,100 0,100 20,50"},{id:"shape-11",type:"shape",shapeType:"rectangle",x:477,y:590,width:189,height:93,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:7,rotation:0},{id:"shape-12",type:"shape",shapeType:"custom",x:331,y:599,width:133,height:85,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:8,rotation:0,customPoints:"0,20 100,0 100,100 0,100"},{id:"shape-13",type:"shape",shapeType:"custom",x:194,y:619,width:124,height:62,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:9,rotation:0,customPoints:"0,20 100,0 100,100 0,100"},{id:"shape-14",type:"shape",shapeType:"custom",x:677,y:593,width:144,height:91,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:10,rotation:0,customPoints:"0,0 100,20 100,100 0,100"},{id:"shape-15",type:"shape",shapeType:"custom",x:834,y:615,width:126,height:69,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:11,rotation:0,customPoints:"0,0 100,20 100,100 0,100"},{id:"shape-16",type:"shape",shapeType:"trapezoid",x:444,y:129,width:253,height:51,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:12,rotation:180},{id:"shape-17",type:"shape",shapeType:"trapezoid",x:442,y:190,width:253,height:51,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:13,rotation:0},{id:"shape-18",type:"shape",shapeType:"custom",x:194,y:130,width:285,height:102,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:14,rotation:0,customPoints:"0,50 80,100 100,50 80,0 0,0"},{id:"shape-19",type:"shape",shapeType:"custom",x:659,y:129,width:289,height:100,outline:"#3584e4",fill:"#3584e4",strokeWeight:3,zIndex:0,rotation:0,customPoints:"20,100 100,60 100,0 20,0 0,60"},{id:"icon-28",type:"icon",iconType:"arrowRight",x:147,y:237,width:50,height:50,color:"#1c71d8",strokeWeight:2,zIndex:16,rotation:0},{id:"icon-29",type:"icon",iconType:"arrowRight",x:166,y:393,width:50,height:50,color:"#1c71d8",strokeWeight:2,zIndex:17,rotation:0},{id:"icon-30",type:"icon",iconType:"arrowRight",x:148,y:535,width:50,height:50,color:"#1c71d8",strokeWeight:2,zIndex:18,rotation:0},{id:"text-32",type:"text",content:"IMS Markt",x:29,y:388,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#000",zIndex:19,rotation:90},{id:"text-33",type:"text",content:"Kunden",x:930,y:391,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#000",zIndex:20,rotation:90},{id:"text-34",type:"text",content:"Mitarbeiter",x:474,y:612,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:23,rotation:0},{id:"text-35",type:"text",content:`IT Service
12
- Management`,x:345,y:624,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:24,rotation:0},{id:"text-36",type:"text",content:"Vorlagen & Templates",x:208,y:629,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:25,rotation:0},{id:"text-37",type:"text",content:"interne Organisation",x:697,y:621,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:26,rotation:0},{id:"text-38",type:"text",content:"Finanzen",x:798,y:630,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"text-39",type:"text",content:"Organisationsstruktur",x:472,y:127,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:25,rotation:0},{id:"text-40",type:"text",content:"Management / Kennzahlen",x:462,y:200,width:213,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:26,rotation:0},{id:"text-41",type:"text",content:"Vorgaben & Richtlinien",x:743,y:146,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"text-42",type:"text",content:"Ziele & Strategien",x:256,y:141,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"icon-43",type:"icon",iconType:"arrowUp",x:278,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:28,rotation:0},{id:"icon-44",type:"icon",iconType:"arrowDown",x:323.43396226415075,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:29,rotation:0},{id:"icon-47",type:"icon",iconType:"arrowDown",x:603.4339622641508,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:30,rotation:0},{id:"icon-48",type:"icon",iconType:"arrowUp",x:567,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:31,rotation:0},{id:"icon-50",type:"icon",iconType:"arrowUp",x:781,y:390,width:63,height:65,color:"#1c71d8",strokeWeight:2,zIndex:32,rotation:0},{id:"icon-51",type:"icon",iconType:"arrowUp",x:874,y:386,width:63,height:65,color:"#1c71d8",strokeWeight:2,zIndex:33,rotation:180},{id:"shape-52",type:"shape",shapeType:"custom",x:230,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:34,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-53",type:"shape",shapeType:"custom",x:780,y:305,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:35,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-54",type:"shape",shapeType:"custom",x:333,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:36,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-55",type:"shape",shapeType:"custom",x:504,y:306,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:37,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-56",type:"shape",shapeType:"custom",x:605,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:38,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-57",type:"shape",shapeType:"custom",x:762,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:39,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-58",type:"shape",shapeType:"custom",x:507,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:40,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-59",type:"shape",shapeType:"custom",x:243,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:41,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"text-60",type:"text",content:"Leads begeistern",x:247,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:42,rotation:0},{id:"text-61",type:"text",content:"Kunden gewinnen",x:354,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:43,rotation:0},{id:"text-62",type:"text",content:"Kunden beraten",x:628,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:44,rotation:0},{id:"text-64",type:"text",content:"Q.wiki bereitstellen",x:521,y:312,width:106,height:50,fontSize:13,fontFamily:"Arial",color:"#1b63bb",zIndex:45,rotation:0},{id:"text-66",type:"text",content:"Kunden betreuen und entwickeln",x:814,y:315,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:46,rotation:0},{id:"text-67",type:"text",content:"Feedback erheben",x:773,y:469,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:47,rotation:0},{id:"text-68",type:"text",content:"Q.wiki entwickeln",x:520,y:469,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:48,rotation:0},{id:"text-69",type:"text",content:"Kontinuierlich verbessern",x:283,y:468,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:49,rotation:0}],nextId:70}}],zd={"data-testid":"collapsed-sidebar",class:"flex flex-col h-full w-14 border-r border-ma-grey-300 bg-ma-grey-100"},_d={class:"p-3 border-b border-ma-grey-300 flex items-center justify-center"},Bd={class:"flex-1 overflow-y-auto p-1"},Vd={class:"flex flex-col gap-1"},vd=e.defineComponent({__name:"CollapsedSidebar",emits:["clear-all"],setup(t){const o=["rectangle","triangle","trapezoid","chevron","hexagon","ellipse","diamond","parallelogram","pentagon"],n=W();return(r,s)=>(e.openBlock(),e.createElementBlock("aside",zd,[e.createElementVNode("div",_d,[e.createVNode(e.unref(ms),{class:"w-5 h-5 text-ma-text-01"})]),e.createElementVNode("div",Bd,[e.createElementVNode("div",Vd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,a=>e.createVNode(ut,{key:a,"shape-type":a,collapsed:""},null,8,["shape-type"])),64)),s[2]||(s[2]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-10 ml-1",onClick:s[0]||(s[0]=a=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(bo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"])]),_:1}),s[3]||(s[3]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),e.createVNode(Tn,{collapsed:""}),s[4]||(s[4]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qn),a=>(e.openBlock(),e.createBlock(Ln,{key:a.name,template:a,collapsed:""},null,8,["template"]))),128))])]),e.createVNode(Dn,{collapsed:""}),e.createVNode(Rn,{collapsed:"",onClearAll:s[1]||(s[1]=a=>r.$emit("clear-all"))})]))}}),Pd={class:"mb-2","data-testid":"sidebar-group"},Id={class:"flex flex-col gap-1"},fe=e.defineComponent({__name:"SidebarGroup",props:{title:{},sidebarCollapsed:{type:Boolean},defaultOpen:{type:Boolean,default:!0}},setup(t){const o=t,n=e.ref(o.defaultOpen);return(r,s)=>(e.openBlock(),e.createElementBlock("div",Pd,[t.sidebarCollapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-testid":"sidebar-group-toggle",class:"flex items-center justify-between w-full py-1 text-xs text-ma-text-02 hover:text-ma-text-01 transition-colors",onClick:s[0]||(s[0]=a=>n.value=!n.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createVNode(e.unref(mo),{class:e.normalizeClass(["w-3 h-3 transition-transform",{"rotate-180":!n.value}])},null,8,["class"])])),e.withDirectives(e.createElementVNode("div",Id,[e.renderSlot(r.$slots,"default")],512),[[e.vShow,n.value||t.sidebarCollapsed]])]))}}),Nd=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const s=be(t,o);return(a,i)=>(e.openBlock(),e.createBlock(e.unref(pa),e.mergeProps({"data-slot":"dialog"},e.unref(s)),{default:e.withCtx(l=>[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(l)))]),_:3},16))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Od=t=>typeof t<"u";function Ad(t){return e.isRef(t)?e.reactive(new Proxy({},{get(o,n,r){return e.unref(Reflect.get(t.value,n,r))},set(o,n,r){return e.isRef(t.value[n])&&!e.isRef(r)?t.value[n].value=r:t.value[n]=r,!0},deleteProperty(o,n){return Reflect.deleteProperty(t.value,n)},has(o,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):e.reactive(t)}function Md(t){return Ad(e.computed(t))}function eo(t,...o){const n=o.flat(),r=n[0];return Md(()=>Object.fromEntries(typeof r=="function"?Object.entries(e.toRefs(t)).filter(([s,a])=>!r(e.toValue(a),s)):Object.entries(e.toRefs(t)).filter(s=>!n.includes(s[0]))))}function $d(t){return JSON.parse(JSON.stringify(t))}function Td(t,o,n,r={}){var s,a;const{clone:i=!1,passive:l=!1,eventName:d,deep:c=!1,defaultValue:f,shouldEmit:u}=r,m=e.getCurrentInstance(),p=n||m?.emit||(m==null||(s=m.$emit)===null||s===void 0?void 0:s.bind(m))||(m==null||(a=m.proxy)===null||a===void 0||(a=a.$emit)===null||a===void 0?void 0:a.bind(m?.proxy));let h=d;h=h||`update:${o.toString()}`;const y=w=>i?typeof i=="function"?i(w):$d(w):w,g=()=>Od(t[o])?y(t[o]):f,x=w=>{u?u(w)&&p(h,w):p(h,w)};if(l){const w=e.ref(g());let k=!1;return e.watch(()=>t[o],I=>{k||(k=!0,w.value=y(I),e.nextTick(()=>k=!1))}),e.watch(w,I=>{!k&&(I!==t[o]||c)&&x(I)},{deep:c}),w}else return e.computed({get(){return g()},set(w){x(w)}})}const Dd=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=e.computed(()=>{const{class:r,...s}=o;return s});return(r,s)=>(e.openBlock(),e.createBlock(e.unref(qa),e.mergeProps(n.value,{class:e.unref(ce)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o.class)}),null,16,["class"]))}}),Fd=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},showCloseButton:{type:Boolean,default:!0}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=eo(n,"class"),a=be(s,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ua),null,{default:e.withCtx(()=>[e.createVNode(Dd),e.createVNode(e.unref(Da),e.mergeProps({"data-slot":"dialog-content"},{...i.$attrs,...e.unref(a)},{class:e.unref(ce)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),t.showCloseButton?(e.openBlock(),e.createBlock(e.unref(ma),{key:0,"data-slot":"dialog-close",class:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(St)),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})):e.createCommentVNode("",!0)]),_:3},16,["class"])]),_:3}))}}),Rd=e.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createElementBlock("div",{"data-slot":"dialog-header",class:e.normalizeClass(e.unref(ce)("flex flex-col gap-2 text-center sm:text-left",o.class))},[e.renderSlot(n.$slots,"default")],2))}}),Ld=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=eo(o,"class"),r=It(n);return(s,a)=>(e.openBlock(),e.createBlock(e.unref(Ka),e.mergeProps({"data-slot":"dialog-title"},e.unref(r),{class:e.unref(ce)("text-lg leading-none font-semibold",o.class)}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["class"]))}}),qd=e.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createElementBlock("div",{"data-slot":"dialog-footer",class:e.normalizeClass(e.unref(ce)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o.class))},[e.renderSlot(n.$slots,"default")],2))}}),to=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,s=Td(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue});return(a,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(s)?s.value=l:null),"data-slot":"input",class:e.normalizeClass(e.unref(ce)("file:text-ma-text-01 placeholder:text-ma-text-03 selection:bg-ma-primary-300 selection:text-ma-text-01 border-ma-grey-400 bg-ma-grey-100 h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base text-ma-text-01 shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ma-primary-500 focus-visible:ring-ma-primary-500/50 focus-visible:ring-[3px]",n.class))},null,2)),[[e.vModelText,e.unref(s)]])}}),Oe=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=eo(o,"class");return(r,s)=>(e.openBlock(),e.createBlock(e.unref(Cl),e.mergeProps({"data-slot":"label"},e.unref(n),{class:e.unref(ce)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",o.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Wd={class:"grid gap-4 py-4"},jd={class:"grid grid-cols-4 items-center gap-4"},Ud={class:"space-y-4"},Hd={class:"col-span-2 space-y-1"},Kd={key:0,class:"text-[10px] text-red-500"},Gd={class:"col-span-2 space-y-1"},Xd={key:0,class:"text-[10px] text-red-500"},Yd={class:"flex justify-end gap-2 mb-4"},Zd={class:"flex w-full justify-center border border-ma-grey-600 rounded-md p-4 bg-ma-grey-400"},Jd={class:"border border-ma-grey-200 rounded-md p-4 bg-ma-grey-100 w-[150px] h-[150px] flex items-center justify-center"},Qd=e.defineComponent({__name:"CustomShapeDialog",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const n=o,r=W(),s=e.ref(""),a=e.ref([{x:0,y:0},{x:100,y:0},{x:100,y:100}]),i=p=>p<0||p>100||isNaN(p),l=()=>{a.value.length<6&&a.value.push({x:50,y:50})},d=e.computed(()=>a.value.map(p=>{const h=Math.min(Math.max(p.x,0),100),y=100-Math.min(Math.max(p.y,0),100);return`${h},${y}`}).join(" ")),c=e.computed(()=>a.value.map(p=>`${p.x},${100-p.y}`).join(" ")),f=e.computed(()=>{const p=s.value.trim()!=="",h=a.value.length>=2,y=a.value.every(g=>!i(g.x)&&!i(g.y));return p&&h&&y}),u=()=>{a.value.length>2&&a.value.pop()},m=()=>{f.value&&(r.saveCustomShape(s.value,c.value),s.value="",a.value=[{x:0,y:0},{x:100,y:0},{x:100,y:100}],n("update:open",!1))};return(p,h)=>(e.openBlock(),e.createBlock(e.unref(Nd),{open:t.open,"onUpdate:open":h[1]||(h[1]=y=>p.$emit("update:open",y))},{default:e.withCtx(()=>[e.createVNode(e.unref(Fd),{class:"lg:max-w-[450px] bg-ma-white text-ma-text-01 border-ma-grey-200"},{default:e.withCtx(()=>[e.createVNode(e.unref(Rd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ld),{class:"text-ma-text-01"},{default:e.withCtx(()=>[...h[2]||(h[2]=[e.createTextVNode("Add Custom Shape",-1)])]),_:1})]),_:1}),e.createElementVNode("div",Wd,[e.createElementVNode("div",jd,[e.createVNode(e.unref(Oe),{"html-for":"name",class:"text-left text-ma-text-01"},{default:e.withCtx(()=>[...h[3]||(h[3]=[e.createTextVNode("Name: ",-1)])]),_:1}),e.createVNode(e.unref(to),{id:"name",modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=y=>s.value=y),class:"col-span-3 bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",placeholder:"Shape Name"},null,8,["modelValue"])]),e.createElementVNode("div",Ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(y,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"grid grid-cols-4 gap-2 items-start"},[e.createElementVNode("div",Hd,[e.createVNode(e.unref(to),{modelValue:y.x,"onUpdate:modelValue":x=>y.x=x,modelModifiers:{number:!0},type:"number",placeholder:"X",class:e.normalizeClass(["bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",{"border-red-500":i(y.x)}])},null,8,["modelValue","onUpdate:modelValue","class"]),i(y.x)?(e.openBlock(),e.createElementBlock("p",Kd," Must be 0-100 ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gd,[e.createVNode(e.unref(to),{modelValue:y.y,"onUpdate:modelValue":x=>y.y=x,modelModifiers:{number:!0},type:"number",placeholder:"Y",class:e.normalizeClass(["bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",{"border-red-500":i(y.y)}])},null,8,["modelValue","onUpdate:modelValue","class"]),i(y.y)?(e.openBlock(),e.createElementBlock("p",Xd," Must be 0-100 ")):e.createCommentVNode("",!0)])]))),128))]),e.createElementVNode("div",Yd,[e.createVNode(e.unref(M),{type:"button",variant:"default",size:"sm",disabled:a.value.length>=6,"data-testid":"add-point-button",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),a.value.length>2?(e.openBlock(),e.createBlock(e.unref(M),{key:0,type:"button",variant:"destructive",size:"sm",disabled:a.value.length<=2,"data-testid":"remove-point-button",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(yo),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[e.createElementVNode("div",Jd,[e.createVNode(Ye,{width:100,height:100,"shape-type":"custom","custom-points":d.value,outline:e.unref(ae),fill:e.unref(Ke),class:"text-ma-text-01"},null,8,["custom-points","outline","fill"])])])]),e.createVNode(e.unref(qd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(M),{type:"submit",disabled:!f.value,onClick:m},{default:e.withCtx(()=>[...h[4]||(h[4]=[e.createTextVNode("Add Shape",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]))}}),ec={"data-testid":"expanded-sidebar",class:"flex flex-col h-full w-56 border-r border-ma-grey-300 bg-ma-grey-100"},tc={class:"flex-1 overflow-y-auto p-2"},oc=e.defineComponent({__name:"ExpandedSidebar",emits:["clear-all"],setup(t){const o=e.ref(!1),n=W(),r=["rectangle","chevron","ellipse","line","arrow"],s=["triangle","trapezoid","hexagon","diamond","parallelogram","pentagon"];return(a,i)=>(e.openBlock(),e.createElementBlock("aside",ec,[i[6]||(i[6]=e.createElementVNode("div",{class:"p-3 border-b border-ma-grey-300"},[e.createElementVNode("h2",{class:"font-semibold text-ma-text-01"},"Tools")],-1)),e.createElementVNode("div",tc,[e.createVNode(fe,{title:"Basic Shapes","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,l=>e.createVNode(ut,{key:l,"shape-type":l,collapsed:!1},null,8,["shape-type"])),64))]),_:1}),e.createVNode(fe,{title:"Advanced Shapes","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,l=>e.createVNode(ut,{key:l,"shape-type":l,collapsed:!1},null,8,["shape-type"])),64))]),_:1}),e.createVNode(fe,{title:"Custom Shapes","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).customShapes,l=>(e.openBlock(),e.createBlock(ut,{key:l.name,"shape-type":"custom","custom-points":l.points,label:l.name,collapsed:!1},null,8,["custom-points","label"]))),128)),e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-9 px-2 text-ma-text-01",title:"Add Custom Shape",onClick:i[0]||(i[0]=l=>o.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-6 h-6"}),i[4]||(i[4]=e.createElementVNode("span",{class:"text-xs"},"Add",-1))]),_:1})]),_:1}),e.createVNode(fe,{title:"Text","sidebar-collapsed":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-9 px-2 text-ma-text-01",title:"Add Text",onClick:i[1]||(i[1]=l=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(bo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"]),i[5]||(i[5]=e.createElementVNode("span",{class:"text-sm text-ma-text-01"},"Text",-1))]),_:1})]),_:1}),e.createVNode(fe,{title:"Icons","sidebar-collapsed":!1},{default:e.withCtx(()=>[e.createVNode(Tn,{collapsed:!1,class:"w-full"})]),_:1}),e.createVNode(fe,{title:"Templates","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qn),l=>(e.openBlock(),e.createBlock(Ln,{key:l.name,template:l,collapsed:!1},null,8,["template"]))),128))]),_:1}),e.createVNode(Qd,{open:o.value,"onUpdate:open":i[2]||(i[2]=l=>o.value=l)},null,8,["open"])]),e.createVNode(Dn),e.createVNode(Rn,{onClearAll:i[3]||(i[3]=l=>a.$emit("clear-all"))})]))}}),nc=e.defineComponent({__name:"LeftSidebar",props:{isCollapsed:{type:Boolean}},setup(t){const o=W(),n=()=>{confirm("Are you sure you want to clear all shapes?")&&o.clearAll()};return(r,s)=>t.isCollapsed?(e.openBlock(),e.createBlock(vd,{key:0,"data-testid":"app-sidebar",onClearAll:n})):(e.openBlock(),e.createBlock(oc,{key:1,"data-testid":"app-sidebar",onClearAll:n}))}}),rc={class:"flex flex-col gap-2"},sc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden"},ac={class:"flex flex-1 items-center h-8 border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},ic=["value"],lc=["id","value"],je=e.defineComponent({__name:"PropertyColorInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",sc,[e.createElementVNode("div",ac,[e.createElementVNode("input",{type:"color",class:"w-8 h-full border-none p-0 cursor-pointer",value:t.modelValue,onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value)),onChange:n[1]||(n[1]=r=>o.$emit("change",r.target.value))},null,40,ic),e.createElementVNode("input",{id:t.id,value:t.modelValue,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-transparent text-ma-text-01 placeholder:text-muted-foreground uppercase",onInput:n[2]||(n[2]=r=>o.$emit("update:modelValue",r.target.value)),onChange:n[3]||(n[3]=r=>o.$emit("change",r.target.value))},null,40,lc)])])]))}}),dc={class:"flex flex-col gap-2"},cc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},fc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},pc=["id","value"],mt=e.defineComponent({__name:"PropertyNumericInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",cc,[e.createElementVNode("div",fc,[e.createElementVNode("input",{id:t.id,type:"number",class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 placeholder:text-muted-foreground",value:t.modelValue,min:"0",onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",Number(r.target.value))),onChange:n[1]||(n[1]=r=>o.$emit("change",Number(r.target.value)))},null,40,pc)])])]))}}),uc={class:"flex flex-col gap-2"},mc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},hc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-[--ma-grey-200] overflow-hidden h-8"},yc=["id","value"],gc={class:"flex flex-row gap-1 mt-2"},xc={key:0,class:"text-[10px] text-green-600 font-medium"},bc={key:1,class:"text-[10px] text-red-600 font-medium"},wc={key:2,class:"text-[10px] text-ma-text-02"},kc=e.defineComponent({__name:"PropertyLinkInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","save","remove"],setup(t,{emit:o}){const n=t,r=o,s=e.ref(""),a=e.ref("");e.watch(()=>n.modelValue,c=>{c?s.value=c.replace(/^https?:\/\//,""):s.value="",a.value=""},{immediate:!0});const i=c=>{s.value=c},l=()=>{let c=s.value.trim();c=c.replace(/^https?:\/\//,"");let f;c.length>0&&(f=`https://${c}`),r("save",f),a.value="Link saved!",setTimeout(()=>{a.value=""},2e3)},d=()=>{r("remove"),a.value="Link removed!",setTimeout(()=>{a.value=""},2e3)};return(c,f)=>(e.openBlock(),e.createElementBlock("div",uc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",mc,[e.createElementVNode("div",hc,[f[1]||(f[1]=e.createElementVNode("div",{class:"bg-ma-grey-300 px-2 flex items-center h-full text-xs text-ma-text-02 font-medium border-r border-ma-grey-300 select-none"}," https:// ",-1)),e.createElementVNode("input",{id:t.id,value:s.value,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-transparent text-ma-text-01 placeholder:text-muted-foreground",placeholder:"example.com",onInput:f[0]||(f[0]=u=>i(u.target.value)),onKeyup:e.withKeys(l,["enter"])},null,40,yc)])]),e.createElementVNode("div",gc,[e.createVNode(e.unref(M),{size:"icon-sm",class:"h-8 w-8 shrink-0 bg-ma-grey-700 hover:bg-ma-grey-500",title:"Save link",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(Er),{class:"w-4 h-4 text-ma-white-01"})]),_:1}),e.createVNode(e.unref(M),{size:"icon-sm",class:"h-8 w-8 shrink-0 bg-ma-grey-700 hover:bg-ma-grey-500",title:"Remove link",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(St),{class:"w-4 h-4 text-ma-white-01"})]),_:1})]),a.value==="Link saved!"?(e.openBlock(),e.createElementBlock("p",xc,e.toDisplayString(a.value),1)):a.value==="Link removed!"?(e.openBlock(),e.createElementBlock("p",bc,e.toDisplayString(a.value),1)):(e.openBlock(),e.createElementBlock("p",wc," Enter a URL and click the check to save. Click the X to remove the link from element. "))]))}}),Cc={class:"flex flex-col gap-2"},Ec={class:"flex flex-col border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},Sc=["id","value"],Wn=e.defineComponent({__name:"PropertyTextInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",Cc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",Ec,[e.createElementVNode("textarea",{id:t.id,class:"flex-1 p-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 resize-y min-h-[60px]",value:t.modelValue,onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value))},null,40,Sc)])]))}}),zc={class:"flex flex-col gap-2"},_c={class:"flex items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},Bc=["id","value"],Vc=["value"],vc={class:"px-2 pointer-events-none text-ma-text-02"},jn=e.defineComponent({__name:"PropertySelectInput",props:{modelValue:{},label:{},id:{},options:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",zc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",_c,[e.createElementVNode("select",{id:t.id,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 appearance-none cursor-pointer",value:t.modelValue,onChange:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,r=>(e.openBlock(),e.createElementBlock("option",{key:r.value,value:r.value},e.toDisplayString(r.label),9,Vc))),128))],40,Bc),e.createElementVNode("div",vc,[e.createVNode(e.unref(mo),{class:"w-4 h-4"})])])]))}}),Pc={class:"p-4 flex flex-col gap-4"},Ic={key:1,class:"border-t border-ma-grey-300 my-2 pt-2 flex flex-col gap-4"},Nc=e.defineComponent({__name:"RightSidebar",props:{isCollapsed:{type:Boolean}},setup(t){const o=W(),n=e.computed(()=>o.selectedElement),r=e.computed(()=>n.value?.type==="group"),s=e.computed(()=>{const _=[];return o.selectedElements.forEach(b=>{b.type==="group"?b.childIds.forEach(D=>{const B=o.elements.find(X=>X.id===D);B&&_.push(B)}):_.push(b)}),_}),a=e.computed(()=>s.value.some(_=>_.type==="shape")),i=e.computed(()=>s.value.some(_=>_.type==="text")),l=e.computed(()=>s.value.some(_=>_.type==="icon")),d=e.ref("defaultOutlineColor"),c=e.ref("defaultFillColor"),f=e.ref(1),u=e.ref(0),m=e.ref(0),p=e.ref(""),h=e.ref("Arial"),y=e.ref("defaultTextColor"),g=e.ref(16),x=e.ref("defaultOutlineColor"),w=e.ref(2),k=[{label:"Arial",value:"Arial"},{label:"Helvetica",value:"Helvetica"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"}];e.watch(n,_=>{if(_&&(u.value=_.x,m.value=_.y),_&&_.type==="shape"){const b=_;d.value=b.outline||ae,c.value=b.fill||Ke,f.value=b.strokeWeight||0,p.value=b.content||"",h.value=b.fontFamily||"Arial",y.value=b.color||Ge,g.value=b.fontSize||16}else if(_&&_.type==="text")p.value=_.content,h.value=_.fontFamily,y.value=_.color||Ge,g.value=_.fontSize;else if(_&&_.type==="icon"){const b=_;x.value=b.color||ae,w.value=b.strokeWeight}},{immediate:!0,deep:!0});const I=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{outline:_}))},S=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{fill:_}))},z=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{strokeWeight:_})),n.value&&n.value.type==="shape"&&(f.value=n.value.strokeWeight)};e.watch(h,_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{fontFamily:_}))});const E=_=>{n.value&&o.updateElement(n.value.id,{link:_})},C=()=>{n.value&&o.updateElement(n.value.id,{link:void 0})},O=_=>{n.value&&o.updateElement(n.value.id,{content:_})},$=_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{color:_}))},F=_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{fontSize:_})),g.value=_},T=_=>{s.value.filter(b=>b.type==="icon").forEach(b=>o.updateElement(b.id,{color:_}))},R=_=>{n.value&&n.value.type==="icon"&&(o.updateElement(n.value.id,{strokeWeight:_}),w.value=_)};return(_,b)=>n.value?(e.openBlock(),e.createElementBlock("aside",{key:0,"data-testid":"right-sidebar",class:e.normalizeClass(["flex flex-col h-full border-l border-ma-grey-300 bg-ma-grey-100 transition-all duration-200 overflow-hidden",t.isCollapsed?"w-0 p-0 border-0":"w-64"])},[b[14]||(b[14]=e.createElementVNode("div",{class:"p-4 border-b border-ma-grey-300"},[e.createElementVNode("h2",{class:"font-semibold text-ma-text-01"},"Properties")],-1)),e.createElementVNode("div",Pc,[a.value||n.value?.type==="shape"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(kc,{key:0,id:"shape-link",label:"Link","model-value":n.value.link,onSave:E,onRemove:C},null,8,["model-value"])),e.createVNode(je,{id:"shape-outline",modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=N=>d.value=N),label:"Outline",onChange:I},null,8,["modelValue"]),e.createVNode(fe,{title:"Fill & Stroke","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(je,{id:"shape-fill",modelValue:c.value,"onUpdate:modelValue":b[1]||(b[1]=N=>c.value=N),label:"Fill",onChange:S},null,8,["modelValue"]),e.createVNode(mt,{id:"shape-stroke-width",modelValue:f.value,"onUpdate:modelValue":b[2]||(b[2]=N=>f.value=N),label:"Stroke Width",onChange:z},null,8,["modelValue"])]),_:1}),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ic,[b[13]||(b[13]=e.createElementVNode("h3",{class:"text-sm font-semibold mb-2 text-ma-text-02"}," Text Overlay ",-1)),e.createVNode(Wn,{id:"shape-text-content",modelValue:p.value,"onUpdate:modelValue":[b[3]||(b[3]=N=>p.value=N),O],label:"Text"},null,8,["modelValue"]),e.createVNode(fe,{title:"Typography","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(jn,{id:"shape-font-family",modelValue:h.value,"onUpdate:modelValue":b[4]||(b[4]=N=>h.value=N),label:"Font Family",options:k},null,8,["modelValue"]),e.createVNode(mt,{id:"shape-font-size",modelValue:g.value,"onUpdate:modelValue":b[5]||(b[5]=N=>g.value=N),label:"Font Size",onChange:F},null,8,["modelValue"]),e.createVNode(je,{id:"shape-text-color",modelValue:y.value,"onUpdate:modelValue":b[6]||(b[6]=N=>y.value=N),label:"Text Color",onChange:$},null,8,["modelValue"])]),_:1})]))],64)):e.createCommentVNode("",!0),!r.value&&(i.value||n.value?.type==="text")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(Wn,{id:"text-content",modelValue:p.value,"onUpdate:modelValue":[b[7]||(b[7]=N=>p.value=N),O],label:"Content"},null,8,["modelValue"]),e.createVNode(fe,{title:"Typography","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(jn,{id:"text-font-family",modelValue:h.value,"onUpdate:modelValue":b[8]||(b[8]=N=>h.value=N),label:"Font Family",options:k},null,8,["modelValue"]),e.createVNode(mt,{id:"text-font-size",modelValue:g.value,"onUpdate:modelValue":b[9]||(b[9]=N=>g.value=N),label:"Font Size",onChange:F},null,8,["modelValue"]),e.createVNode(je,{id:"text-color",modelValue:y.value,"onUpdate:modelValue":b[10]||(b[10]=N=>y.value=N),label:"Color",onChange:$},null,8,["modelValue"])]),_:1})],64)):e.createCommentVNode("",!0),l.value||n.value?.type==="icon"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(je,{id:"icon-color",modelValue:x.value,"onUpdate:modelValue":b[11]||(b[11]=N=>x.value=N),label:"Color",onChange:T},null,8,["modelValue"]),e.createVNode(mt,{id:"icon-stroke-width",modelValue:w.value,"onUpdate:modelValue":b[12]||(b[12]=N=>w.value=N),label:"Stroke Width",onChange:R},null,8,["modelValue"])],64)):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}}),ht=100,Oc=e.defineComponent({__name:"DragGhost",setup(t){const o=J(),n=Xe(),{zoom:r}=Ae.storeToRefs(o),{isDragging:s,draggedShapeType:a,ghostPosition:i,draggedCustomPoints:l}=Ae.storeToRefs(n),d=e.computed(()=>({left:`${i.value.x}px`,top:`${i.value.y}px`,width:`${ht}px`,height:`${ht}px`}));return(c,f)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(s)&&e.unref(a)?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":"drag-ghost",class:"fixed pointer-events-none z-[9999] opacity-70",style:e.normalizeStyle(d.value)},[e.createVNode(Ye,{width:ht*e.unref(r),height:ht*e.unref(r),"shape-type":e.unref(a),"custom-points":e.unref(l),outline:"var(--ma-primary-600)",fill:"var(--ma-primary-100)"},null,8,["width","height","shape-type","custom-points"])],4)):e.createCommentVNode("",!0)]))}}),Ac=e.defineComponent({__name:"CopyButtons",emits:["copy","duplicate"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),{"data-testid":"context-copy-button",variant:"ghost",size:"icon-sm",title:"Copy",onClick:n[0]||(n[0]=r=>o.$emit("copy"))},{default:e.withCtx(()=>[e.createVNode(e.unref(vr),{class:"w-4 h-4"})]),_:1}),e.createVNode(e.unref(M),{"data-testid":"context-duplicate-button",variant:"ghost",size:"icon-sm",title:"Duplicate",onClick:n[1]||(n[1]=r=>o.$emit("duplicate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Vr),{class:"w-4 h-4"})]),_:1})],64))}}),Mc=e.defineComponent({__name:"RotateButton",emits:["rotate"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"context-rotate-button",variant:"ghost",size:"icon-sm",title:"Rotate 90°",onClick:n[0]||(n[0]=r=>o.$emit("rotate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(es),{class:"w-4 h-4"})]),_:1}))}}),$c=e.defineComponent({__name:"LayeringButtons",emits:["up","down"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),{"data-testid":"context-up-button",variant:"ghost",size:"icon-sm",title:"Bring to front",onClick:n[0]||(n[0]=r=>o.$emit("up"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Ct),{class:"w-4 h-4"})]),_:1}),e.createVNode(e.unref(M),{"data-testid":"context-down-button",variant:"ghost",size:"icon-sm",title:"Send to back",onClick:n[1]||(n[1]=r=>o.$emit("down"))},{default:e.withCtx(()=>[e.createVNode(e.unref(kt),{class:"w-4 h-4"})]),_:1})],64))}}),Tc=e.defineComponent({__name:"DeleteButton",emits:["delete"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"context-delete-button",variant:"destructive",size:"icon-sm",title:"Delete",onClick:n[0]||(n[0]=r=>o.$emit("delete"))},{default:e.withCtx(()=>[e.createVNode(e.unref(xo),{class:"w-4 h-4"})]),_:1}))}}),Dc=e.defineComponent({__name:"ElementContextBar",emits:["copy","duplicate","rotate","delete","up","down"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{"data-testid":"element-context-bar",class:"flex gap-1 p-1 bg-ma-grey-200 border border-ma-grey-300 rounded-lg shadow-lg items-center",onMousedown:n[6]||(n[6]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ac,{onCopy:n[0]||(n[0]=r=>o.$emit("copy")),onDuplicate:n[1]||(n[1]=r=>o.$emit("duplicate"))}),n[7]||(n[7]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode(Mc,{onRotate:n[2]||(n[2]=r=>o.$emit("rotate"))}),n[8]||(n[8]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode($c,{onUp:n[3]||(n[3]=r=>o.$emit("up")),onDown:n[4]||(n[4]=r=>o.$emit("down"))}),n[9]||(n[9]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode(Tc,{onDelete:n[5]||(n[5]=r=>o.$emit("delete"))})],32))}}),Fc={key:0,class:"absolute top-0 left-0 w-full h-full pointer-events-none snap-lines","data-testid":"snap-lines-svg"},Rc=["data-testid","x1","y1","x2","y2"],Lc=["data-testid","x1","y1","x2","y2"],qc=Qt(e.defineComponent({__name:"SnapLines",props:{snapLines:{},zoom:{}},setup(t){return(o,n)=>t.snapLines.length>0?(e.openBlock(),e.createElementBlock("svg",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.snapLines,(r,s)=>(e.openBlock(),e.createElementBlock("g",{key:s},[r.axis==="horizontal"?(e.openBlock(),e.createElementBlock("line",{key:0,"data-testid":`snap-line-horizontal-${s}`,x1:`${r.start*t.zoom}px`,y1:`${r.position*t.zoom}px`,x2:`${r.end*t.zoom}px`,y2:`${r.position*t.zoom}px`},null,8,Rc)):(e.openBlock(),e.createElementBlock("line",{key:1,"data-testid":`snap-line-vertical-${s}`,x1:`${r.position*t.zoom}px`,y1:`${r.start*t.zoom}px`,x2:`${r.position*t.zoom}px`,y2:`${r.end*t.zoom}px`},null,8,Lc))]))),128))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-c7baf393"]]),Wc={class:"flex items-center gap-1"},jc=e.defineComponent({__name:"FloatingZoomControls",props:{rightSidebarCollapsed:{type:Boolean},viewMode:{type:Boolean}},setup(t){const o=t,n=J(),r=e.computed(()=>o.viewMode?"right-[50px]":o.rightSidebarCollapsed?"right-4":"right-[272px]"),s=()=>{const a=W(),i=document.querySelector('[data-testid="canvas-container"]');i&&n.autoFit(a.elements,i.clientWidth,i.clientHeight)};return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["fixed bottom-[50px] z-40 transition-all duration-200 bg-ma-grey-100 border border-ma-grey-300 rounded-md shadow-lg p-2",r.value])},[e.createElementVNode("div",Wc,[e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"zoom-out-button",title:"Zoom out",onClick:i[0]||(i[0]=l=>e.unref(n).zoomOut())},{default:e.withCtx(()=>[e.createVNode(e.unref(yo),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"sm","data-testid":"zoom-percentage-button",title:"Zoom percentage",class:"min-w-[3.5rem] justify-center px-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).zoomPercentage)+"% ",1)]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"zoom-in-button",title:"Zoom in",onClick:i[1]||(i[1]=l=>e.unref(n).zoomIn())},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"reset-zoom-button",title:"Reset zoom",onClick:i[2]||(i[2]=l=>e.unref(n).resetZoom())},{default:e.withCtx(()=>[e.createVNode(e.unref(jr),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"auto-fit-button",title:"Fit automatically",onClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(Ir),{class:"w-4 h-4 text-ma-text-01"})]),_:1})])],2))}});function Uc(){const t=W(),o=J();return{contextBarStyle:e.computed(()=>{const r=t.selectedElement,s=o.zoom;if(!r)return{};const a=He(r),l=(a.x+a.width/2)*s;let d=a.y*s-64;return d<10&&(d=(a.y+a.height)*s+20),{left:`${l}px`,top:`${d}px`,transform:"translateX(-50%)"}})}}function Hc(t){const o=W(),n=s=>{const a=s.ctrlKey||s.metaKey;if(a&&s.key==="s"){s.preventDefault(),t.saveToFile(o.exportSnapshot());return}if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(s.key)&&o.selectedElementIds.length>0){s.preventDefault();const i=s.shiftKey?20:5;let l=0,d=0;switch(s.key){case"ArrowUp":d=-i;break;case"ArrowDown":d=i;break;case"ArrowLeft":l=-i;break;case"ArrowRight":l=i;break}o.selectedElementIds.forEach(c=>{o.updateElementPosition(c,l,d)}),o.saveSnapshot()}a&&s.key==="g"&&!s.shiftKey&&(s.preventDefault(),o.groupSelectedElements()),a&&s.shiftKey&&s.key==="G"&&(s.preventDefault(),o.ungroupSelectedElements())};return window.addEventListener("keydown",n),{cleanup:()=>{window.removeEventListener("keydown",n)}}}function Un(t){const o=He(t),{x:n,y:r,width:s,height:a}=o,{id:i}=t;return[{value:n,type:"left",elementId:i},{value:n+s,type:"right",elementId:i},{value:r,type:"top",elementId:i},{value:r+a,type:"bottom",elementId:i},{value:n+s/2,type:"center-x",elementId:i},{value:r+a/2,type:"center-y",elementId:i}]}function Hn(t){return t.filter(o=>o.type==="left"||o.type==="right"||o.type==="center-x")}function Kn(t){return t.filter(o=>o.type==="top"||o.type==="bottom"||o.type==="center-y")}function Gn(t,o,n){let r=null,s=1/0;for(const a of o){const i=Math.abs(t-a.value);i<=n&&i<s&&(s=i,r=a)}return r===null?null:{snappedValue:r.value,snapPoint:r}}function Xn(t){const o=t.type==="top"||t.type==="bottom"||t.type==="center-y",n=J(),r=document.querySelector('[data-testid="canvas-container"]');let s=1e4,a=1e4;return r&&(s=r?.scrollWidth,a=r?.scrollHeight),o?{axis:"horizontal",position:t.value,start:0,end:s/n.zoom}:{axis:"vertical",position:t.value,start:0,end:a/n.zoom}}function Kc(t,o,n){const r=o.filter(x=>x.id!==t.id);if(r.length===0)return{x:t.x,y:t.y,snapLines:[]};const s=Un(t),a=Hn(s),i=Kn(s),l=r.flatMap(Un),d=Hn(l),c=Kn(l);let f=t.x,u=null,m=1/0;for(const x of a){const w=Gn(x.value,d,n);if(w){const k=w.snappedValue-x.value;Math.abs(k)<Math.abs(m)&&(m=k,f=t.x+k,u=w.snapPoint)}}let p=t.y,h=null,y=1/0;for(const x of i){const w=Gn(x.value,c,n);if(w){const k=w.snappedValue-x.value;Math.abs(k)<Math.abs(y)&&(y=k,p=t.y+k,h=w.snapPoint)}}const g=[];return u&&g.push(Xn(u)),h&&g.push(Xn(h)),{x:f,y:p,snapLines:g}}const Yn=5;function Gc(){const t=W(),o=e.ref([]);return{handleDrag:(s,a,i,l)=>{const d=t.elements.find(p=>p.id===s);if(!d)return;const c=d.x+a,f=d.y+i,u={...d,x:c,y:f},m=l?.shiftKey??!1;if(t.selectedElementIds.length===1&&!m){const p=Kc(u,t.topLevelElements,Yn);o.value=p.snapLines;const h=p.x-d.x,y=p.y-d.y;t.updateElementPosition(s,h,y)}else o.value=[],t.selectedElementIds.includes(s)?t.selectedElementIds.forEach(p=>{t.updateElementPosition(p,a,i)}):t.updateElementPosition(s,a,i)},handleDragEnd:()=>{o.value=[],t.endDrag()},activeSnapLines:o}}const Zn=50;function Xc(){const t=W();return{canvasContentSize:e.computed(()=>{if(t.elements.length===0)return{width:0,height:0};const n=Math.max(...t.elements.map(s=>s.x+s.width)),r=Math.max(...t.elements.map(s=>s.y+s.height));return{width:Math.max(0,n+Zn),height:Math.max(0,r+Zn)}})}}const Yc={class:"relative"},Zc={key:1,class:"legend-container backdrop-blur-md border rounded-xl shadow-2xl w-80 overflow-hidden flex flex-col transition-all duration-300 pointer-events-auto origin-bottom-left"},Jc={class:"legend-header flex items-center justify-between p-4 border-b"},Qc={class:"flex items-center gap-2.5"},ef={class:"legend-header-icon shadow-sm border p-1.5 rounded-lg"},tf={class:"p-2 space-y-0.5 max-h-[60vh] overflow-y-auto custom-scrollbar"},of={class:"row"},nf={class:"keys gap-1.5 font-bold"},rf={class:"key leading-none pb-0.5 pt-0.5"},sf={class:"key leading-none pb-0.5 pt-0.5"},af={class:"key leading-none pb-0.5 pt-0.5"},lf={class:"key leading-none pb-0.5 pt-0.5"},df=Qt(e.defineComponent({__name:"KeyboardLegend",setup(t){const o=e.ref(!1);return(n,r)=>(e.openBlock(),e.createElementBlock("div",Yc,[o.value?(e.openBlock(),e.createElementBlock("div",Zc,[e.createElementVNode("div",Jc,[e.createElementVNode("div",Qc,[e.createElementVNode("div",ef,[e.createVNode(e.unref(ho),{class:"w-4 h-4"})]),r[2]||(r[2]=e.createElementVNode("h3",{class:"legend-header-title text-sm font-semibold tracking-wide"}," Keyboard Shortcuts ",-1))]),e.createElementVNode("button",{"aria-label":"Close legend",class:"close-button hover:shadow-sm border border-transparent p-1.5 rounded-md transition-all",onClick:r[1]||(r[1]=s=>o.value=!1)},[e.createVNode(e.unref(St),{class:"w-4 h-4"})])]),e.createElementVNode("div",tf,[r[4]||(r[4]=e.createStaticVNode('<div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Delete</span><div class="keys" data-v-dd253f3b><kbd class="key text-[11px]" data-v-dd253f3b>Del</kbd><span class="plus" data-v-dd253f3b>or</span><kbd class="key text-[14px]" data-v-dd253f3b>⌫</kbd></div></div>',1)),e.createElementVNode("div",of,[r[3]||(r[3]=e.createElementVNode("span",{class:"label"},"Move",-1)),e.createElementVNode("div",nf,[e.createElementVNode("kbd",rf,[e.createVNode(e.unref(Ct),{class:"w-4 h-4"})]),e.createElementVNode("kbd",sf,[e.createVNode(e.unref(kt),{class:"w-4 h-4"})]),e.createElementVNode("kbd",af,[e.createVNode(e.unref(po),{class:"w-4 h-4"})]),e.createElementVNode("kbd",lf,[e.createVNode(e.unref(uo),{class:"w-4 h-4"})])])]),r[5]||(r[5]=e.createStaticVNode('<div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Copy</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>C</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Paste</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>V</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Duplicate</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>D</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Save</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>S</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Undo</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>Z</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Group</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>G</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Multi Select</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[12px] font-sans px-2" data-v-dd253f3b>Click</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Redo</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[13px]" data-v-dd253f3b>⇧</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>Z</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Ungroup</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[13px]" data-v-dd253f3b>⇧</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>G</kbd></div></div>',9))])])):(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":"Show keyboard shortcuts legend",class:"floating-button rounded-full shadow-md p-3 border focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all duration-200 flex items-center justify-center w-[54px] h-[54px] group",onClick:r[0]||(r[0]=s=>o.value=!0)},[e.createVNode(e.unref(ho),{class:"w-7 h-7 transition-colors"})]))]))}}),[["__scopeId","data-v-dd253f3b"]]),cf={"data-testid":"edit-page-container",class:"flex h-screen w-screen overflow-hidden bg-bg-maincontent"},ff={class:"flex flex-col flex-1 relative"},pf={class:"absolute bottom-[50px] left-4 z-20"},uf=e.defineComponent({__name:"EditPage",setup(t){const o=W(),n=Xe(),r=J(),s=e.ref(!1),a=e.ref(!0),{saveToFile:i}=$n(),{contextBarStyle:l}=Uc(),{cleanup:d}=Hc({saveToFile:i}),{handleDrag:c,handleDragEnd:f,activeSnapLines:u}=Gc(),{canvasContentSize:m}=Xc(),p=e.ref(null);e.onMounted(()=>{p.value?.$el&&n.setCanvasElement(p.value.$el)}),e.onUnmounted(()=>{d()}),e.watch(p,S=>{S?.$el&&n.setCanvasElement(S.$el)}),e.watch(()=>o.selectedElement,S=>{S?a.value=!1:a.value=!0});const h=(S,z)=>{if(z?.ctrlKey)o.toggleElementSelection(S);else{if(o.selectedElementIds.includes(S))return;o.selectElement(S)}},y=()=>{o.selectedElementIds.length>0&&o.deleteSelectedElement()},g=()=>{o.selectElement(null)},x=()=>{o.canUndo&&o.undo()},w=()=>{o.canRedo&&o.redo()},k=(S,z,E,C)=>{const O=o.elements.find(F=>F.id===S);if(!O)return;const $=dr(O,z,E,C);if(o.updateElement(S,$,!1),O.type==="group"){const F={x:O.x,y:O.y,width:O.width,height:O.height};cr(O,F,$,o.elements).forEach(R=>o.updateElement(R.id,R.updates,!1))}},I=async(S,z)=>{if(o.selectedElementIds.length>1&&o.selectedElementIds.includes(S))o.selectedElements.forEach(E=>{o.updateElement(E.id,{rotation:(E.rotation+90)%360},!1)});else{const E=o.elements.find(C=>C.id===S);if(!E)return;if(E.type==="group"){const{childUpdates:C,newGroupBounds:O}=fr(E,o.elements);C.forEach($=>o.updateElement($.id,$.updates,!1)),o.updateElement(E.id,O,!1)}else o.updateElement(S,{rotation:(z+90)%360},!1)}o.saveSnapshot()};return(S,z)=>(e.openBlock(),e.createElementBlock("div",cf,[e.createVNode(nc,{"is-collapsed":s.value},null,8,["is-collapsed"]),e.createElementVNode("div",ff,[e.createVNode(Mn,{side:"left","is-collapsed":s.value,onToggle:z[0]||(z[0]=E=>s.value=!s.value)},null,8,["is-collapsed"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock(Mn,{key:0,side:"right","is-collapsed":a.value,onToggle:z[1]||(z[1]=E=>a.value=!a.value)},null,8,["is-collapsed"])):e.createCommentVNode("",!0),e.createVNode(so,{ref_key:"canvasRef",ref:p,"content-width":e.unref(m).width,"content-height":e.unref(m).height,onCanvasClick:g,onDeleteSelected:y,onCopySelected:z[12]||(z[12]=E=>e.unref(o).copySelectedElement()),onPaste:z[13]||(z[13]=E=>e.unref(o).pasteElement()),onDuplicate:z[14]||(z[14]=E=>e.unref(o).duplicateSelectedElement()),onUndo:x,onRedo:w},{overlay:e.withCtx(()=>[e.createVNode(qc,{"snap-lines":e.unref(u),zoom:e.unref(r).zoom},null,8,["snap-lines","zoom"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock(Dc,{key:0,element:e.unref(o).selectedElement,style:e.normalizeStyle(e.unref(l)),class:"absolute z-50 pointer-events-auto",onCopy:z[6]||(z[6]=E=>e.unref(o).copySelectedElement()),onDuplicate:z[7]||(z[7]=E=>e.unref(o).duplicateSelectedElement()),onRotate:z[8]||(z[8]=E=>I(e.unref(o).selectedElement.id,e.unref(o).selectedElement.rotation)),onDelete:z[9]||(z[9]=E=>e.unref(o).deleteSelectedElement()),onUp:z[10]||(z[10]=E=>e.unref(o).bringToFront()),onDown:z[11]||(z[11]=E=>e.unref(o).bringToBack())},null,8,["element","style"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).sortedElements,E=>(e.openBlock(),e.createBlock(Eo,{key:E.id,element:E,selected:e.unref(o).selectedElementIds.includes(E.id),onSelect:C=>h(E.id,C),onDrag:(C,O,$)=>e.unref(c)(E.id,C,O,$),onDragEnd:e.unref(f),onResize:(C,O,$)=>k(E.id,C,O,$),onResizeEnd:z[2]||(z[2]=C=>e.unref(o).endResize()),onRotate:C=>I(E.id,E.rotation),onDelete:z[3]||(z[3]=C=>e.unref(o).deleteSelectedElement()),onCopy:z[4]||(z[4]=C=>e.unref(o).copySelectedElement()),onDuplicate:z[5]||(z[5]=C=>e.unref(o).duplicateSelectedElement())},null,8,["element","selected","onSelect","onDrag","onDragEnd","onResize","onRotate"]))),128))]),_:1},8,["content-width","content-height"]),e.createElementVNode("div",pf,[e.createVNode(df)])]),e.createVNode(Nc,{"is-collapsed":a.value},null,8,["is-collapsed"]),e.createVNode(jc,{"right-sidebar-collapsed":a.value},null,8,["right-sidebar-collapsed"]),e.createVNode(Oc)]))}});U.EditPage=uf,U.ElementWrapper=Eo,U.GridCanvas=so,U.SNAP_THRESHOLD=Yn,U.useDragStore=Xe,U.useElementsStore=W,U.useZoomStore=J,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
12
+ Management`,x:345,y:624,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:24,rotation:0},{id:"text-36",type:"text",content:"Vorlagen & Templates",x:208,y:629,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:25,rotation:0},{id:"text-37",type:"text",content:"interne Organisation",x:697,y:621,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:26,rotation:0},{id:"text-38",type:"text",content:"Finanzen",x:798,y:630,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"text-39",type:"text",content:"Organisationsstruktur",x:472,y:127,width:200,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:25,rotation:0},{id:"text-40",type:"text",content:"Management / Kennzahlen",x:462,y:200,width:213,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:26,rotation:0},{id:"text-41",type:"text",content:"Vorgaben & Richtlinien",x:743,y:146,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"text-42",type:"text",content:"Ziele & Strategien",x:256,y:141,width:153,height:50,fontSize:16,fontFamily:"Arial",color:"#ffffff",zIndex:27,rotation:0},{id:"icon-43",type:"icon",iconType:"arrowUp",x:278,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:28,rotation:0},{id:"icon-44",type:"icon",iconType:"arrowDown",x:323.43396226415075,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:29,rotation:0},{id:"icon-47",type:"icon",iconType:"arrowDown",x:603.4339622641508,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:30,rotation:0},{id:"icon-48",type:"icon",iconType:"arrowUp",x:567,y:390,width:40.566037735849086,height:36.842105263157926,color:"#3584e4",strokeWeight:2,zIndex:31,rotation:0},{id:"icon-50",type:"icon",iconType:"arrowUp",x:781,y:390,width:63,height:65,color:"#1c71d8",strokeWeight:2,zIndex:32,rotation:0},{id:"icon-51",type:"icon",iconType:"arrowUp",x:874,y:386,width:63,height:65,color:"#1c71d8",strokeWeight:2,zIndex:33,rotation:180},{id:"shape-52",type:"shape",shapeType:"custom",x:230,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:34,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-53",type:"shape",shapeType:"custom",x:780,y:305,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:35,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-54",type:"shape",shapeType:"custom",x:333,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:36,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-55",type:"shape",shapeType:"custom",x:504,y:306,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:37,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-56",type:"shape",shapeType:"custom",x:605,y:305,width:108,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:38,rotation:0,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-57",type:"shape",shapeType:"custom",x:762,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:39,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-58",type:"shape",shapeType:"custom",x:507,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:40,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"shape-59",type:"shape",shapeType:"custom",x:243,y:460,width:181,height:67,outline:"#1c71d8",fill:"#ffffff",strokeWeight:3,zIndex:41,rotation:180,customPoints:"0,100 80,100 100,50 80,0 0,0 20,50"},{id:"text-60",type:"text",content:"Leads begeistern",x:247,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:42,rotation:0},{id:"text-61",type:"text",content:"Kunden gewinnen",x:354,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:43,rotation:0},{id:"text-62",type:"text",content:"Kunden beraten",x:628,y:313,width:106,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:44,rotation:0},{id:"text-64",type:"text",content:"Q.wiki bereitstellen",x:521,y:312,width:106,height:50,fontSize:13,fontFamily:"Arial",color:"#1b63bb",zIndex:45,rotation:0},{id:"text-66",type:"text",content:"Kunden betreuen und entwickeln",x:814,y:315,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:46,rotation:0},{id:"text-67",type:"text",content:"Feedback erheben",x:773,y:469,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:47,rotation:0},{id:"text-68",type:"text",content:"Q.wiki entwickeln",x:520,y:469,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:48,rotation:0},{id:"text-69",type:"text",content:"Kontinuierlich verbessern",x:283,y:468,width:138,height:50,fontSize:14,fontFamily:"Arial",color:"#1b63bb",zIndex:49,rotation:0}],nextId:70}}],zd={"data-testid":"collapsed-sidebar",class:"flex flex-col h-full w-14 border-r border-ma-grey-300 bg-ma-grey-100"},_d={class:"p-3 border-b border-ma-grey-300 flex items-center justify-center"},Bd={class:"flex-1 overflow-y-auto p-1"},Vd={class:"flex flex-col gap-1"},vd=e.defineComponent({__name:"CollapsedSidebar",emits:["clear-all"],setup(t){const o=["rectangle","triangle","trapezoid","chevron","hexagon","ellipse","diamond","parallelogram","pentagon"],n=W();return(r,s)=>(e.openBlock(),e.createElementBlock("aside",zd,[e.createElementVNode("div",_d,[e.createVNode(e.unref(ms),{class:"w-5 h-5 text-ma-text-01"})]),e.createElementVNode("div",Bd,[e.createElementVNode("div",Vd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,a=>e.createVNode(ut,{key:a,"shape-type":a,collapsed:""},null,8,["shape-type"])),64)),s[2]||(s[2]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-10 ml-1",onClick:s[0]||(s[0]=a=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(bo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"])]),_:1}),s[3]||(s[3]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),e.createVNode(Tn,{collapsed:""}),s[4]||(s[4]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qn),a=>(e.openBlock(),e.createBlock(Ln,{key:a.name,template:a,collapsed:""},null,8,["template"]))),128))])]),e.createVNode(Dn,{collapsed:""}),e.createVNode(Rn,{collapsed:"",onClearAll:s[1]||(s[1]=a=>r.$emit("clear-all"))})]))}}),Pd={class:"mb-2","data-testid":"sidebar-group"},Id={class:"flex flex-col gap-1"},fe=e.defineComponent({__name:"SidebarGroup",props:{title:{},sidebarCollapsed:{type:Boolean},defaultOpen:{type:Boolean,default:!0}},setup(t){const o=t,n=e.ref(o.defaultOpen);return(r,s)=>(e.openBlock(),e.createElementBlock("div",Pd,[t.sidebarCollapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-testid":"sidebar-group-toggle",class:"flex items-center justify-between w-full py-1 text-xs text-ma-text-02 hover:text-ma-text-01 transition-colors",onClick:s[0]||(s[0]=a=>n.value=!n.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createVNode(e.unref(mo),{class:e.normalizeClass(["w-3 h-3 transition-transform",{"rotate-180":!n.value}])},null,8,["class"])])),e.withDirectives(e.createElementVNode("div",Id,[e.renderSlot(r.$slots,"default")],512),[[e.vShow,n.value||t.sidebarCollapsed]])]))}}),Nd=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const s=be(t,o);return(a,i)=>(e.openBlock(),e.createBlock(e.unref(pa),e.mergeProps({"data-slot":"dialog"},e.unref(s)),{default:e.withCtx(l=>[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(l)))]),_:3},16))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Od=t=>typeof t<"u";function Ad(t){return e.isRef(t)?e.reactive(new Proxy({},{get(o,n,r){return e.unref(Reflect.get(t.value,n,r))},set(o,n,r){return e.isRef(t.value[n])&&!e.isRef(r)?t.value[n].value=r:t.value[n]=r,!0},deleteProperty(o,n){return Reflect.deleteProperty(t.value,n)},has(o,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):e.reactive(t)}function Md(t){return Ad(e.computed(t))}function eo(t,...o){const n=o.flat(),r=n[0];return Md(()=>Object.fromEntries(typeof r=="function"?Object.entries(e.toRefs(t)).filter(([s,a])=>!r(e.toValue(a),s)):Object.entries(e.toRefs(t)).filter(s=>!n.includes(s[0]))))}function $d(t){return JSON.parse(JSON.stringify(t))}function Td(t,o,n,r={}){var s,a;const{clone:i=!1,passive:l=!1,eventName:d,deep:c=!1,defaultValue:f,shouldEmit:u}=r,m=e.getCurrentInstance(),p=n||m?.emit||(m==null||(s=m.$emit)===null||s===void 0?void 0:s.bind(m))||(m==null||(a=m.proxy)===null||a===void 0||(a=a.$emit)===null||a===void 0?void 0:a.bind(m?.proxy));let h=d;h=h||`update:${o.toString()}`;const y=w=>i?typeof i=="function"?i(w):$d(w):w,g=()=>Od(t[o])?y(t[o]):f,x=w=>{u?u(w)&&p(h,w):p(h,w)};if(l){const w=e.ref(g());let k=!1;return e.watch(()=>t[o],I=>{k||(k=!0,w.value=y(I),e.nextTick(()=>k=!1))}),e.watch(w,I=>{!k&&(I!==t[o]||c)&&x(I)},{deep:c}),w}else return e.computed({get(){return g()},set(w){x(w)}})}const Dd=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=e.computed(()=>{const{class:r,...s}=o;return s});return(r,s)=>(e.openBlock(),e.createBlock(e.unref(qa),e.mergeProps(n.value,{class:e.unref(ce)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o.class)}),null,16,["class"]))}}),Fd=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},showCloseButton:{type:Boolean,default:!0}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=eo(n,"class"),a=be(s,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ua),null,{default:e.withCtx(()=>[e.createVNode(Dd),e.createVNode(e.unref(Da),e.mergeProps({"data-slot":"dialog-content"},{...i.$attrs,...e.unref(a)},{class:e.unref(ce)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",n.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),t.showCloseButton?(e.openBlock(),e.createBlock(e.unref(ma),{key:0,"data-slot":"dialog-close",class:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(St)),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})):e.createCommentVNode("",!0)]),_:3},16,["class"])]),_:3}))}}),Rd=e.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createElementBlock("div",{"data-slot":"dialog-header",class:e.normalizeClass(e.unref(ce)("flex flex-col gap-2 text-center sm:text-left",o.class))},[e.renderSlot(n.$slots,"default")],2))}}),Ld=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=eo(o,"class"),r=It(n);return(s,a)=>(e.openBlock(),e.createBlock(e.unref(Ka),e.mergeProps({"data-slot":"dialog-title"},e.unref(r),{class:e.unref(ce)("text-lg leading-none font-semibold",o.class)}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["class"]))}}),qd=e.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createElementBlock("div",{"data-slot":"dialog-footer",class:e.normalizeClass(e.unref(ce)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o.class))},[e.renderSlot(n.$slots,"default")],2))}}),to=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,s=Td(n,"modelValue",o,{passive:!0,defaultValue:n.defaultValue});return(a,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(s)?s.value=l:null),"data-slot":"input",class:e.normalizeClass(e.unref(ce)("file:text-ma-text-01 placeholder:text-ma-text-03 selection:bg-ma-primary-300 selection:text-ma-text-01 border-ma-grey-400 bg-ma-grey-100 h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base text-ma-text-01 shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ma-primary-500 focus-visible:ring-ma-primary-500/50 focus-visible:ring-[3px]",n.class))},null,2)),[[e.vModelText,e.unref(s)]])}}),Oe=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=eo(o,"class");return(r,s)=>(e.openBlock(),e.createBlock(e.unref(Cl),e.mergeProps({"data-slot":"label"},e.unref(n),{class:e.unref(ce)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",o.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Wd={class:"grid gap-4 py-4"},jd={class:"grid grid-cols-4 items-center gap-4"},Ud={class:"space-y-4"},Hd={class:"col-span-2 space-y-1"},Kd={key:0,class:"text-[10px] text-red-500"},Gd={class:"col-span-2 space-y-1"},Xd={key:0,class:"text-[10px] text-red-500"},Yd={class:"flex justify-end gap-2 mb-4"},Zd={class:"flex w-full justify-center border border-ma-grey-600 rounded-md p-4 bg-ma-grey-400"},Jd={class:"border border-ma-grey-200 rounded-md p-4 bg-ma-grey-100 w-[150px] h-[150px] flex items-center justify-center"},Qd=e.defineComponent({__name:"CustomShapeDialog",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const n=o,r=W(),s=e.ref(""),a=e.ref([{x:0,y:0},{x:100,y:0},{x:100,y:100}]),i=p=>p<0||p>100||isNaN(p),l=()=>{a.value.length<6&&a.value.push({x:50,y:50})},d=e.computed(()=>a.value.map(p=>{const h=Math.min(Math.max(p.x,0),100),y=100-Math.min(Math.max(p.y,0),100);return`${h},${y}`}).join(" ")),c=e.computed(()=>a.value.map(p=>`${p.x},${100-p.y}`).join(" ")),f=e.computed(()=>{const p=s.value.trim()!=="",h=a.value.length>=2,y=a.value.every(g=>!i(g.x)&&!i(g.y));return p&&h&&y}),u=()=>{a.value.length>2&&a.value.pop()},m=()=>{f.value&&(r.saveCustomShape(s.value,c.value),s.value="",a.value=[{x:0,y:0},{x:100,y:0},{x:100,y:100}],n("update:open",!1))};return(p,h)=>(e.openBlock(),e.createBlock(e.unref(Nd),{open:t.open,"onUpdate:open":h[1]||(h[1]=y=>p.$emit("update:open",y))},{default:e.withCtx(()=>[e.createVNode(e.unref(Fd),{class:"lg:max-w-[450px] bg-ma-white text-ma-text-01 border-ma-grey-200"},{default:e.withCtx(()=>[e.createVNode(e.unref(Rd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ld),{class:"text-ma-text-01"},{default:e.withCtx(()=>[...h[2]||(h[2]=[e.createTextVNode("Add Custom Shape",-1)])]),_:1})]),_:1}),e.createElementVNode("div",Wd,[e.createElementVNode("div",jd,[e.createVNode(e.unref(Oe),{"html-for":"name",class:"text-left text-ma-text-01"},{default:e.withCtx(()=>[...h[3]||(h[3]=[e.createTextVNode("Name: ",-1)])]),_:1}),e.createVNode(e.unref(to),{id:"name",modelValue:s.value,"onUpdate:modelValue":h[0]||(h[0]=y=>s.value=y),class:"col-span-3 bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",placeholder:"Shape Name"},null,8,["modelValue"])]),e.createElementVNode("div",Ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(y,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"grid grid-cols-4 gap-2 items-start"},[e.createElementVNode("div",Hd,[e.createVNode(e.unref(to),{modelValue:y.x,"onUpdate:modelValue":x=>y.x=x,modelModifiers:{number:!0},type:"number",placeholder:"X",class:e.normalizeClass(["bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",{"border-red-500":i(y.x)}])},null,8,["modelValue","onUpdate:modelValue","class"]),i(y.x)?(e.openBlock(),e.createElementBlock("p",Kd," Must be 0-100 ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Gd,[e.createVNode(e.unref(to),{modelValue:y.y,"onUpdate:modelValue":x=>y.y=x,modelModifiers:{number:!0},type:"number",placeholder:"Y",class:e.normalizeClass(["bg-ma-grey-100 text-ma-text-01 border-ma-grey-300",{"border-red-500":i(y.y)}])},null,8,["modelValue","onUpdate:modelValue","class"]),i(y.y)?(e.openBlock(),e.createElementBlock("p",Xd," Must be 0-100 ")):e.createCommentVNode("",!0)])]))),128))]),e.createElementVNode("div",Yd,[e.createVNode(e.unref(M),{type:"button",variant:"default",size:"sm",disabled:a.value.length>=6,"data-testid":"add-point-button",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),a.value.length>2?(e.openBlock(),e.createBlock(e.unref(M),{key:0,type:"button",variant:"destructive",size:"sm",disabled:a.value.length<=2,"data-testid":"remove-point-button",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(yo),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[e.createElementVNode("div",Jd,[e.createVNode(Ye,{width:100,height:100,"shape-type":"custom","custom-points":d.value,outline:e.unref(ae),fill:e.unref(Ke),class:"text-ma-text-01"},null,8,["custom-points","outline","fill"])])])]),e.createVNode(e.unref(qd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(M),{type:"submit",disabled:!f.value,onClick:m},{default:e.withCtx(()=>[...h[4]||(h[4]=[e.createTextVNode("Add Shape",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]))}}),ec={"data-testid":"expanded-sidebar",class:"flex flex-col h-full w-56 border-r border-ma-grey-300 bg-ma-grey-100"},tc={class:"flex-1 overflow-y-auto p-2"},oc=e.defineComponent({__name:"ExpandedSidebar",emits:["clear-all"],setup(t){const o=e.ref(!1),n=W(),r=["rectangle","chevron","ellipse","arrow"],s=["triangle","trapezoid","hexagon","diamond","parallelogram","pentagon","line","horizontal-line"];return(a,i)=>(e.openBlock(),e.createElementBlock("aside",ec,[i[6]||(i[6]=e.createElementVNode("div",{class:"p-3 border-b border-ma-grey-300"},[e.createElementVNode("h2",{class:"font-semibold text-ma-text-01"},"Tools")],-1)),e.createElementVNode("div",tc,[e.createVNode(fe,{title:"Basic Shapes","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,l=>e.createVNode(ut,{key:l,"shape-type":l,collapsed:!1},null,8,["shape-type"])),64))]),_:1}),e.createVNode(fe,{title:"Advanced Shapes","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,l=>e.createVNode(ut,{key:l,"shape-type":l,collapsed:!1},null,8,["shape-type"])),64))]),_:1}),e.createVNode(fe,{title:"Custom Shapes","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).customShapes,l=>(e.openBlock(),e.createBlock(ut,{key:l.name,"shape-type":"custom","custom-points":l.points,label:l.name,collapsed:!1},null,8,["custom-points","label"]))),128)),e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-9 px-2 text-ma-text-01",title:"Add Custom Shape",onClick:i[0]||(i[0]=l=>o.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-6 h-6"}),i[4]||(i[4]=e.createElementVNode("span",{class:"text-xs"},"Add",-1))]),_:1})]),_:1}),e.createVNode(fe,{title:"Text","sidebar-collapsed":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(M),{variant:"ghost",class:"w-full justify-start gap-2 h-9 px-2 text-ma-text-01",title:"Add Text",onClick:i[1]||(i[1]=l=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(bo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"]),i[5]||(i[5]=e.createElementVNode("span",{class:"text-sm text-ma-text-01"},"Text",-1))]),_:1})]),_:1}),e.createVNode(fe,{title:"Icons","sidebar-collapsed":!1},{default:e.withCtx(()=>[e.createVNode(Tn,{collapsed:!1,class:"w-full"})]),_:1}),e.createVNode(fe,{title:"Templates","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qn),l=>(e.openBlock(),e.createBlock(Ln,{key:l.name,template:l,collapsed:!1},null,8,["template"]))),128))]),_:1}),e.createVNode(Qd,{open:o.value,"onUpdate:open":i[2]||(i[2]=l=>o.value=l)},null,8,["open"])]),e.createVNode(Dn),e.createVNode(Rn,{onClearAll:i[3]||(i[3]=l=>a.$emit("clear-all"))})]))}}),nc=e.defineComponent({__name:"LeftSidebar",props:{isCollapsed:{type:Boolean}},setup(t){const o=W(),n=()=>{confirm("Are you sure you want to clear all shapes?")&&o.clearAll()};return(r,s)=>t.isCollapsed?(e.openBlock(),e.createBlock(vd,{key:0,"data-testid":"app-sidebar",onClearAll:n})):(e.openBlock(),e.createBlock(oc,{key:1,"data-testid":"app-sidebar",onClearAll:n}))}}),rc={class:"flex flex-col gap-2"},sc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden"},ac={class:"flex flex-1 items-center h-8 border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},ic=["value"],lc=["id","value"],je=e.defineComponent({__name:"PropertyColorInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",sc,[e.createElementVNode("div",ac,[e.createElementVNode("input",{type:"color",class:"w-8 h-full border-none p-0 cursor-pointer",value:t.modelValue,onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value)),onChange:n[1]||(n[1]=r=>o.$emit("change",r.target.value))},null,40,ic),e.createElementVNode("input",{id:t.id,value:t.modelValue,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-transparent text-ma-text-01 placeholder:text-muted-foreground uppercase",onInput:n[2]||(n[2]=r=>o.$emit("update:modelValue",r.target.value)),onChange:n[3]||(n[3]=r=>o.$emit("change",r.target.value))},null,40,lc)])])]))}}),dc={class:"flex flex-col gap-2"},cc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},fc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},pc=["id","value"],mt=e.defineComponent({__name:"PropertyNumericInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",cc,[e.createElementVNode("div",fc,[e.createElementVNode("input",{id:t.id,type:"number",class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 placeholder:text-muted-foreground",value:t.modelValue,min:"0",onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",Number(r.target.value))),onChange:n[1]||(n[1]=r=>o.$emit("change",Number(r.target.value)))},null,40,pc)])])]))}}),uc={class:"flex flex-col gap-2"},mc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},hc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-[--ma-grey-200] overflow-hidden h-8"},yc=["id","value"],gc={class:"flex flex-row gap-1 mt-2"},xc={key:0,class:"text-[10px] text-green-600 font-medium"},bc={key:1,class:"text-[10px] text-red-600 font-medium"},wc={key:2,class:"text-[10px] text-ma-text-02"},kc=e.defineComponent({__name:"PropertyLinkInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","save","remove"],setup(t,{emit:o}){const n=t,r=o,s=e.ref(""),a=e.ref("");e.watch(()=>n.modelValue,c=>{c?s.value=c.replace(/^https?:\/\//,""):s.value="",a.value=""},{immediate:!0});const i=c=>{s.value=c},l=()=>{let c=s.value.trim();c=c.replace(/^https?:\/\//,"");let f;c.length>0&&(f=`https://${c}`),r("save",f),a.value="Link saved!",setTimeout(()=>{a.value=""},2e3)},d=()=>{r("remove"),a.value="Link removed!",setTimeout(()=>{a.value=""},2e3)};return(c,f)=>(e.openBlock(),e.createElementBlock("div",uc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",mc,[e.createElementVNode("div",hc,[f[1]||(f[1]=e.createElementVNode("div",{class:"bg-ma-grey-300 px-2 flex items-center h-full text-xs text-ma-text-02 font-medium border-r border-ma-grey-300 select-none"}," https:// ",-1)),e.createElementVNode("input",{id:t.id,value:s.value,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-transparent text-ma-text-01 placeholder:text-muted-foreground",placeholder:"example.com",onInput:f[0]||(f[0]=u=>i(u.target.value)),onKeyup:e.withKeys(l,["enter"])},null,40,yc)])]),e.createElementVNode("div",gc,[e.createVNode(e.unref(M),{size:"icon-sm",class:"h-8 w-8 shrink-0 bg-ma-grey-700 hover:bg-ma-grey-500",title:"Save link",onClick:l},{default:e.withCtx(()=>[e.createVNode(e.unref(Er),{class:"w-4 h-4 text-ma-white-01"})]),_:1}),e.createVNode(e.unref(M),{size:"icon-sm",class:"h-8 w-8 shrink-0 bg-ma-grey-700 hover:bg-ma-grey-500",title:"Remove link",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(St),{class:"w-4 h-4 text-ma-white-01"})]),_:1})]),a.value==="Link saved!"?(e.openBlock(),e.createElementBlock("p",xc,e.toDisplayString(a.value),1)):a.value==="Link removed!"?(e.openBlock(),e.createElementBlock("p",bc,e.toDisplayString(a.value),1)):(e.openBlock(),e.createElementBlock("p",wc," Enter a URL and click the check to save. Click the X to remove the link from element. "))]))}}),Cc={class:"flex flex-col gap-2"},Ec={class:"flex flex-col border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},Sc=["id","value"],Wn=e.defineComponent({__name:"PropertyTextInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",Cc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",Ec,[e.createElementVNode("textarea",{id:t.id,class:"flex-1 p-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 resize-y min-h-[60px]",value:t.modelValue,onInput:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value))},null,40,Sc)])]))}}),zc={class:"flex flex-col gap-2"},_c={class:"flex items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},Bc=["id","value"],Vc=["value"],vc={class:"px-2 pointer-events-none text-ma-text-02"},jn=e.defineComponent({__name:"PropertySelectInput",props:{modelValue:{},label:{},id:{},options:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",zc,[e.createVNode(e.unref(Oe),{for:t.id,class:"text-xs font-medium text-ma-text-01"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["for"]),e.createElementVNode("div",_c,[e.createElementVNode("select",{id:t.id,class:"flex-1 h-full px-2 text-xs outline-none min-w-0 bg-ma-grey-200 text-ma-text-01 appearance-none cursor-pointer",value:t.modelValue,onChange:n[0]||(n[0]=r=>o.$emit("update:modelValue",r.target.value))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,r=>(e.openBlock(),e.createElementBlock("option",{key:r.value,value:r.value},e.toDisplayString(r.label),9,Vc))),128))],40,Bc),e.createElementVNode("div",vc,[e.createVNode(e.unref(mo),{class:"w-4 h-4"})])])]))}}),Pc={class:"p-4 flex flex-col gap-4"},Ic={key:1,class:"border-t border-ma-grey-300 my-2 pt-2 flex flex-col gap-4"},Nc=e.defineComponent({__name:"RightSidebar",props:{isCollapsed:{type:Boolean}},setup(t){const o=W(),n=e.computed(()=>o.selectedElement),r=e.computed(()=>n.value?.type==="group"),s=e.computed(()=>{const _=[];return o.selectedElements.forEach(b=>{b.type==="group"?b.childIds.forEach(D=>{const B=o.elements.find(X=>X.id===D);B&&_.push(B)}):_.push(b)}),_}),a=e.computed(()=>s.value.some(_=>_.type==="shape")),i=e.computed(()=>s.value.some(_=>_.type==="text")),l=e.computed(()=>s.value.some(_=>_.type==="icon")),d=e.ref("defaultOutlineColor"),c=e.ref("defaultFillColor"),f=e.ref(1),u=e.ref(0),m=e.ref(0),p=e.ref(""),h=e.ref("Arial"),y=e.ref("defaultTextColor"),g=e.ref(16),x=e.ref("defaultOutlineColor"),w=e.ref(2),k=[{label:"Arial",value:"Arial"},{label:"Helvetica",value:"Helvetica"},{label:"Times New Roman",value:"Times New Roman"},{label:"Courier New",value:"Courier New"},{label:"Verdana",value:"Verdana"}];e.watch(n,_=>{if(_&&(u.value=_.x,m.value=_.y),_&&_.type==="shape"){const b=_;d.value=b.outline||ae,c.value=b.fill||Ke,f.value=b.strokeWeight||0,p.value=b.content||"",h.value=b.fontFamily||"Arial",y.value=b.color||Ge,g.value=b.fontSize||16}else if(_&&_.type==="text")p.value=_.content,h.value=_.fontFamily,y.value=_.color||Ge,g.value=_.fontSize;else if(_&&_.type==="icon"){const b=_;x.value=b.color||ae,w.value=b.strokeWeight}},{immediate:!0,deep:!0});const I=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{outline:_}))},S=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{fill:_}))},z=_=>{s.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{strokeWeight:_})),n.value&&n.value.type==="shape"&&(f.value=n.value.strokeWeight)};e.watch(h,_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{fontFamily:_}))});const E=_=>{n.value&&o.updateElement(n.value.id,{link:_})},C=()=>{n.value&&o.updateElement(n.value.id,{link:void 0})},O=_=>{n.value&&o.updateElement(n.value.id,{content:_})},$=_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{color:_}))},F=_=>{s.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{fontSize:_})),g.value=_},T=_=>{s.value.filter(b=>b.type==="icon").forEach(b=>o.updateElement(b.id,{color:_}))},R=_=>{n.value&&n.value.type==="icon"&&(o.updateElement(n.value.id,{strokeWeight:_}),w.value=_)};return(_,b)=>n.value?(e.openBlock(),e.createElementBlock("aside",{key:0,"data-testid":"right-sidebar",class:e.normalizeClass(["flex flex-col h-full border-l border-ma-grey-300 bg-ma-grey-100 transition-all duration-200 overflow-hidden",t.isCollapsed?"w-0 p-0 border-0":"w-64"])},[b[14]||(b[14]=e.createElementVNode("div",{class:"p-4 border-b border-ma-grey-300"},[e.createElementVNode("h2",{class:"font-semibold text-ma-text-01"},"Properties")],-1)),e.createElementVNode("div",Pc,[a.value||n.value?.type==="shape"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(kc,{key:0,id:"shape-link",label:"Link","model-value":n.value.link,onSave:E,onRemove:C},null,8,["model-value"])),e.createVNode(je,{id:"shape-outline",modelValue:d.value,"onUpdate:modelValue":b[0]||(b[0]=N=>d.value=N),label:"Outline",onChange:I},null,8,["modelValue"]),e.createVNode(fe,{title:"Fill & Stroke","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(je,{id:"shape-fill",modelValue:c.value,"onUpdate:modelValue":b[1]||(b[1]=N=>c.value=N),label:"Fill",onChange:S},null,8,["modelValue"]),e.createVNode(mt,{id:"shape-stroke-width",modelValue:f.value,"onUpdate:modelValue":b[2]||(b[2]=N=>f.value=N),label:"Stroke Width",onChange:z},null,8,["modelValue"])]),_:1}),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ic,[b[13]||(b[13]=e.createElementVNode("h3",{class:"text-sm font-semibold mb-2 text-ma-text-02"}," Text Overlay ",-1)),e.createVNode(Wn,{id:"shape-text-content",modelValue:p.value,"onUpdate:modelValue":[b[3]||(b[3]=N=>p.value=N),O],label:"Text"},null,8,["modelValue"]),e.createVNode(fe,{title:"Typography","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(jn,{id:"shape-font-family",modelValue:h.value,"onUpdate:modelValue":b[4]||(b[4]=N=>h.value=N),label:"Font Family",options:k},null,8,["modelValue"]),e.createVNode(mt,{id:"shape-font-size",modelValue:g.value,"onUpdate:modelValue":b[5]||(b[5]=N=>g.value=N),label:"Font Size",onChange:F},null,8,["modelValue"]),e.createVNode(je,{id:"shape-text-color",modelValue:y.value,"onUpdate:modelValue":b[6]||(b[6]=N=>y.value=N),label:"Text Color",onChange:$},null,8,["modelValue"])]),_:1})]))],64)):e.createCommentVNode("",!0),!r.value&&(i.value||n.value?.type==="text")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(Wn,{id:"text-content",modelValue:p.value,"onUpdate:modelValue":[b[7]||(b[7]=N=>p.value=N),O],label:"Content"},null,8,["modelValue"]),e.createVNode(fe,{title:"Typography","sidebar-collapsed":!1,"default-open":!1},{default:e.withCtx(()=>[e.createVNode(jn,{id:"text-font-family",modelValue:h.value,"onUpdate:modelValue":b[8]||(b[8]=N=>h.value=N),label:"Font Family",options:k},null,8,["modelValue"]),e.createVNode(mt,{id:"text-font-size",modelValue:g.value,"onUpdate:modelValue":b[9]||(b[9]=N=>g.value=N),label:"Font Size",onChange:F},null,8,["modelValue"]),e.createVNode(je,{id:"text-color",modelValue:y.value,"onUpdate:modelValue":b[10]||(b[10]=N=>y.value=N),label:"Color",onChange:$},null,8,["modelValue"])]),_:1})],64)):e.createCommentVNode("",!0),l.value||n.value?.type==="icon"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(je,{id:"icon-color",modelValue:x.value,"onUpdate:modelValue":b[11]||(b[11]=N=>x.value=N),label:"Color",onChange:T},null,8,["modelValue"]),e.createVNode(mt,{id:"icon-stroke-width",modelValue:w.value,"onUpdate:modelValue":b[12]||(b[12]=N=>w.value=N),label:"Stroke Width",onChange:R},null,8,["modelValue"])],64)):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}}),ht=100,Oc=e.defineComponent({__name:"DragGhost",setup(t){const o=J(),n=Xe(),{zoom:r}=Ae.storeToRefs(o),{isDragging:s,draggedShapeType:a,ghostPosition:i,draggedCustomPoints:l}=Ae.storeToRefs(n),d=e.computed(()=>({left:`${i.value.x}px`,top:`${i.value.y}px`,width:`${ht}px`,height:`${ht}px`}));return(c,f)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(s)&&e.unref(a)?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":"drag-ghost",class:"fixed pointer-events-none z-[9999] opacity-70",style:e.normalizeStyle(d.value)},[e.createVNode(Ye,{width:ht*e.unref(r),height:ht*e.unref(r),"shape-type":e.unref(a),"custom-points":e.unref(l),outline:"var(--ma-primary-600)",fill:"var(--ma-primary-100)"},null,8,["width","height","shape-type","custom-points"])],4)):e.createCommentVNode("",!0)]))}}),Ac=e.defineComponent({__name:"CopyButtons",emits:["copy","duplicate"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),{"data-testid":"context-copy-button",variant:"ghost",size:"icon-sm",title:"Copy",onClick:n[0]||(n[0]=r=>o.$emit("copy"))},{default:e.withCtx(()=>[e.createVNode(e.unref(vr),{class:"w-4 h-4"})]),_:1}),e.createVNode(e.unref(M),{"data-testid":"context-duplicate-button",variant:"ghost",size:"icon-sm",title:"Duplicate",onClick:n[1]||(n[1]=r=>o.$emit("duplicate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Vr),{class:"w-4 h-4"})]),_:1})],64))}}),Mc=e.defineComponent({__name:"RotateButton",emits:["rotate"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"context-rotate-button",variant:"ghost",size:"icon-sm",title:"Rotate 90°",onClick:n[0]||(n[0]=r=>o.$emit("rotate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(es),{class:"w-4 h-4"})]),_:1}))}}),$c=e.defineComponent({__name:"LayeringButtons",emits:["up","down"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(M),{"data-testid":"context-up-button",variant:"ghost",size:"icon-sm",title:"Bring to front",onClick:n[0]||(n[0]=r=>o.$emit("up"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Ct),{class:"w-4 h-4"})]),_:1}),e.createVNode(e.unref(M),{"data-testid":"context-down-button",variant:"ghost",size:"icon-sm",title:"Send to back",onClick:n[1]||(n[1]=r=>o.$emit("down"))},{default:e.withCtx(()=>[e.createVNode(e.unref(kt),{class:"w-4 h-4"})]),_:1})],64))}}),Tc=e.defineComponent({__name:"DeleteButton",emits:["delete"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"context-delete-button",variant:"destructive",size:"icon-sm",title:"Delete",onClick:n[0]||(n[0]=r=>o.$emit("delete"))},{default:e.withCtx(()=>[e.createVNode(e.unref(xo),{class:"w-4 h-4"})]),_:1}))}}),Dc=e.defineComponent({__name:"ElementContextBar",emits:["copy","duplicate","rotate","delete","up","down"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{"data-testid":"element-context-bar",class:"flex gap-1 p-1 bg-ma-grey-200 border border-ma-grey-300 rounded-lg shadow-lg items-center",onMousedown:n[6]||(n[6]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ac,{onCopy:n[0]||(n[0]=r=>o.$emit("copy")),onDuplicate:n[1]||(n[1]=r=>o.$emit("duplicate"))}),n[7]||(n[7]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode(Mc,{onRotate:n[2]||(n[2]=r=>o.$emit("rotate"))}),n[8]||(n[8]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode($c,{onUp:n[3]||(n[3]=r=>o.$emit("up")),onDown:n[4]||(n[4]=r=>o.$emit("down"))}),n[9]||(n[9]=e.createElementVNode("div",{class:"w-px h-4 bg-ma-grey-700 mx-0.5"},null,-1)),e.createVNode(Tc,{onDelete:n[5]||(n[5]=r=>o.$emit("delete"))})],32))}}),Fc={key:0,class:"absolute top-0 left-0 w-full h-full pointer-events-none snap-lines","data-testid":"snap-lines-svg"},Rc=["data-testid","x1","y1","x2","y2"],Lc=["data-testid","x1","y1","x2","y2"],qc=Qt(e.defineComponent({__name:"SnapLines",props:{snapLines:{},zoom:{}},setup(t){return(o,n)=>t.snapLines.length>0?(e.openBlock(),e.createElementBlock("svg",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.snapLines,(r,s)=>(e.openBlock(),e.createElementBlock("g",{key:s},[r.axis==="horizontal"?(e.openBlock(),e.createElementBlock("line",{key:0,"data-testid":`snap-line-horizontal-${s}`,x1:`${r.start*t.zoom}px`,y1:`${r.position*t.zoom}px`,x2:`${r.end*t.zoom}px`,y2:`${r.position*t.zoom}px`},null,8,Rc)):(e.openBlock(),e.createElementBlock("line",{key:1,"data-testid":`snap-line-vertical-${s}`,x1:`${r.position*t.zoom}px`,y1:`${r.start*t.zoom}px`,x2:`${r.position*t.zoom}px`,y2:`${r.end*t.zoom}px`},null,8,Lc))]))),128))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-c7baf393"]]),Wc={class:"flex items-center gap-1"},jc=e.defineComponent({__name:"FloatingZoomControls",props:{rightSidebarCollapsed:{type:Boolean},viewMode:{type:Boolean}},setup(t){const o=t,n=J(),r=e.computed(()=>o.viewMode?"right-[50px]":o.rightSidebarCollapsed?"right-4":"right-[272px]"),s=()=>{const a=W(),i=document.querySelector('[data-testid="canvas-container"]');i&&n.autoFit(a.elements,i.clientWidth,i.clientHeight)};return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["fixed bottom-[50px] z-40 transition-all duration-200 bg-ma-grey-100 border border-ma-grey-300 rounded-md shadow-lg p-2",r.value])},[e.createElementVNode("div",Wc,[e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"zoom-out-button",title:"Zoom out",onClick:i[0]||(i[0]=l=>e.unref(n).zoomOut())},{default:e.withCtx(()=>[e.createVNode(e.unref(yo),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"sm","data-testid":"zoom-percentage-button",title:"Zoom percentage",class:"min-w-[3.5rem] justify-center px-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n).zoomPercentage)+"% ",1)]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"zoom-in-button",title:"Zoom in",onClick:i[1]||(i[1]=l=>e.unref(n).zoomIn())},{default:e.withCtx(()=>[e.createVNode(e.unref(Et),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"reset-zoom-button",title:"Reset zoom",onClick:i[2]||(i[2]=l=>e.unref(n).resetZoom())},{default:e.withCtx(()=>[e.createVNode(e.unref(jr),{class:"w-4 h-4 text-ma-text-01"})]),_:1}),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"auto-fit-button",title:"Fit automatically",onClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(Ir),{class:"w-4 h-4 text-ma-text-01"})]),_:1})])],2))}});function Uc(){const t=W(),o=J();return{contextBarStyle:e.computed(()=>{const r=t.selectedElement,s=o.zoom;if(!r)return{};const a=He(r),l=(a.x+a.width/2)*s;let d=a.y*s-64;return d<10&&(d=(a.y+a.height)*s+20),{left:`${l}px`,top:`${d}px`,transform:"translateX(-50%)"}})}}function Hc(t){const o=W(),n=s=>{const a=s.ctrlKey||s.metaKey;if(a&&s.key==="s"){s.preventDefault(),t.saveToFile(o.exportSnapshot());return}if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(s.key)&&o.selectedElementIds.length>0){s.preventDefault();const i=s.shiftKey?20:5;let l=0,d=0;switch(s.key){case"ArrowUp":d=-i;break;case"ArrowDown":d=i;break;case"ArrowLeft":l=-i;break;case"ArrowRight":l=i;break}o.selectedElementIds.forEach(c=>{o.updateElementPosition(c,l,d)}),o.saveSnapshot()}a&&s.key==="g"&&!s.shiftKey&&(s.preventDefault(),o.groupSelectedElements()),a&&s.shiftKey&&s.key==="G"&&(s.preventDefault(),o.ungroupSelectedElements())};return window.addEventListener("keydown",n),{cleanup:()=>{window.removeEventListener("keydown",n)}}}function Un(t){const o=He(t),{x:n,y:r,width:s,height:a}=o,{id:i}=t;return[{value:n,type:"left",elementId:i},{value:n+s,type:"right",elementId:i},{value:r,type:"top",elementId:i},{value:r+a,type:"bottom",elementId:i},{value:n+s/2,type:"center-x",elementId:i},{value:r+a/2,type:"center-y",elementId:i}]}function Hn(t){return t.filter(o=>o.type==="left"||o.type==="right"||o.type==="center-x")}function Kn(t){return t.filter(o=>o.type==="top"||o.type==="bottom"||o.type==="center-y")}function Gn(t,o,n){let r=null,s=1/0;for(const a of o){const i=Math.abs(t-a.value);i<=n&&i<s&&(s=i,r=a)}return r===null?null:{snappedValue:r.value,snapPoint:r}}function Xn(t){const o=t.type==="top"||t.type==="bottom"||t.type==="center-y",n=J(),r=document.querySelector('[data-testid="canvas-container"]');let s=1e4,a=1e4;return r&&(s=r?.scrollWidth,a=r?.scrollHeight),o?{axis:"horizontal",position:t.value,start:0,end:s/n.zoom}:{axis:"vertical",position:t.value,start:0,end:a/n.zoom}}function Kc(t,o,n){const r=o.filter(x=>x.id!==t.id);if(r.length===0)return{x:t.x,y:t.y,snapLines:[]};const s=Un(t),a=Hn(s),i=Kn(s),l=r.flatMap(Un),d=Hn(l),c=Kn(l);let f=t.x,u=null,m=1/0;for(const x of a){const w=Gn(x.value,d,n);if(w){const k=w.snappedValue-x.value;Math.abs(k)<Math.abs(m)&&(m=k,f=t.x+k,u=w.snapPoint)}}let p=t.y,h=null,y=1/0;for(const x of i){const w=Gn(x.value,c,n);if(w){const k=w.snappedValue-x.value;Math.abs(k)<Math.abs(y)&&(y=k,p=t.y+k,h=w.snapPoint)}}const g=[];return u&&g.push(Xn(u)),h&&g.push(Xn(h)),{x:f,y:p,snapLines:g}}const Yn=5;function Gc(){const t=W(),o=e.ref([]);return{handleDrag:(s,a,i,l)=>{const d=t.elements.find(p=>p.id===s);if(!d)return;const c=d.x+a,f=d.y+i,u={...d,x:c,y:f},m=l?.shiftKey??!1;if(t.selectedElementIds.length===1&&!m){const p=Kc(u,t.topLevelElements,Yn);o.value=p.snapLines;const h=p.x-d.x,y=p.y-d.y;t.updateElementPosition(s,h,y)}else o.value=[],t.selectedElementIds.includes(s)?t.selectedElementIds.forEach(p=>{t.updateElementPosition(p,a,i)}):t.updateElementPosition(s,a,i)},handleDragEnd:()=>{o.value=[],t.endDrag()},activeSnapLines:o}}const Zn=50;function Xc(){const t=W();return{canvasContentSize:e.computed(()=>{if(t.elements.length===0)return{width:0,height:0};const n=Math.max(...t.elements.map(s=>s.x+s.width)),r=Math.max(...t.elements.map(s=>s.y+s.height));return{width:Math.max(0,n+Zn),height:Math.max(0,r+Zn)}})}}const Yc={class:"relative"},Zc={key:1,class:"legend-container backdrop-blur-md border rounded-xl shadow-2xl w-80 overflow-hidden flex flex-col transition-all duration-300 pointer-events-auto origin-bottom-left"},Jc={class:"legend-header flex items-center justify-between p-4 border-b"},Qc={class:"flex items-center gap-2.5"},ef={class:"legend-header-icon shadow-sm border p-1.5 rounded-lg"},tf={class:"p-2 space-y-0.5 max-h-[60vh] overflow-y-auto custom-scrollbar"},of={class:"row"},nf={class:"keys gap-1.5 font-bold"},rf={class:"key leading-none pb-0.5 pt-0.5"},sf={class:"key leading-none pb-0.5 pt-0.5"},af={class:"key leading-none pb-0.5 pt-0.5"},lf={class:"key leading-none pb-0.5 pt-0.5"},df=Qt(e.defineComponent({__name:"KeyboardLegend",setup(t){const o=e.ref(!1);return(n,r)=>(e.openBlock(),e.createElementBlock("div",Yc,[o.value?(e.openBlock(),e.createElementBlock("div",Zc,[e.createElementVNode("div",Jc,[e.createElementVNode("div",Qc,[e.createElementVNode("div",ef,[e.createVNode(e.unref(ho),{class:"w-4 h-4"})]),r[2]||(r[2]=e.createElementVNode("h3",{class:"legend-header-title text-sm font-semibold tracking-wide"}," Keyboard Shortcuts ",-1))]),e.createElementVNode("button",{"aria-label":"Close legend",class:"close-button hover:shadow-sm border border-transparent p-1.5 rounded-md transition-all",onClick:r[1]||(r[1]=s=>o.value=!1)},[e.createVNode(e.unref(St),{class:"w-4 h-4"})])]),e.createElementVNode("div",tf,[r[4]||(r[4]=e.createStaticVNode('<div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Delete</span><div class="keys" data-v-dd253f3b><kbd class="key text-[11px]" data-v-dd253f3b>Del</kbd><span class="plus" data-v-dd253f3b>or</span><kbd class="key text-[14px]" data-v-dd253f3b>⌫</kbd></div></div>',1)),e.createElementVNode("div",of,[r[3]||(r[3]=e.createElementVNode("span",{class:"label"},"Move",-1)),e.createElementVNode("div",nf,[e.createElementVNode("kbd",rf,[e.createVNode(e.unref(Ct),{class:"w-4 h-4"})]),e.createElementVNode("kbd",sf,[e.createVNode(e.unref(kt),{class:"w-4 h-4"})]),e.createElementVNode("kbd",af,[e.createVNode(e.unref(po),{class:"w-4 h-4"})]),e.createElementVNode("kbd",lf,[e.createVNode(e.unref(uo),{class:"w-4 h-4"})])])]),r[5]||(r[5]=e.createStaticVNode('<div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Copy</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>C</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Paste</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>V</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Duplicate</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>D</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Save</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>S</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Undo</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>Z</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Group</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>G</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Multi Select</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[12px] font-sans px-2" data-v-dd253f3b>Click</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Redo</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[13px]" data-v-dd253f3b>⇧</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>Z</kbd></div></div><div class="row" data-v-dd253f3b><span class="label" data-v-dd253f3b>Ungroup</span><div class="keys" data-v-dd253f3b><kbd class="key" data-v-dd253f3b>Ctrl</kbd><span class="plus" data-v-dd253f3b>/</span><kbd class="key font-sans" data-v-dd253f3b>⌘</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key text-[13px]" data-v-dd253f3b>⇧</kbd><span class="plus" data-v-dd253f3b>+</span><kbd class="key" data-v-dd253f3b>G</kbd></div></div>',9))])])):(e.openBlock(),e.createElementBlock("button",{key:0,"aria-label":"Show keyboard shortcuts legend",class:"floating-button rounded-full shadow-md p-3 border focus:outline-none focus:ring-2 focus:ring-blue-500/50 transition-all duration-200 flex items-center justify-center w-[54px] h-[54px] group",onClick:r[0]||(r[0]=s=>o.value=!0)},[e.createVNode(e.unref(ho),{class:"w-7 h-7 transition-colors"})]))]))}}),[["__scopeId","data-v-dd253f3b"]]),cf={"data-testid":"edit-page-container",class:"flex h-screen w-screen overflow-hidden bg-bg-maincontent"},ff={class:"flex flex-col flex-1 relative"},pf={class:"absolute bottom-[50px] left-4 z-20"},uf=e.defineComponent({__name:"EditPage",setup(t){const o=W(),n=Xe(),r=J(),s=e.ref(!1),a=e.ref(!0),{saveToFile:i}=$n(),{contextBarStyle:l}=Uc(),{cleanup:d}=Hc({saveToFile:i}),{handleDrag:c,handleDragEnd:f,activeSnapLines:u}=Gc(),{canvasContentSize:m}=Xc(),p=e.ref(null);e.onMounted(()=>{p.value?.$el&&n.setCanvasElement(p.value.$el)}),e.onUnmounted(()=>{d()}),e.watch(p,S=>{S?.$el&&n.setCanvasElement(S.$el)}),e.watch(()=>o.selectedElement,S=>{S?a.value=!1:a.value=!0});const h=(S,z)=>{if(z?.ctrlKey)o.toggleElementSelection(S);else{if(o.selectedElementIds.includes(S))return;o.selectElement(S)}},y=()=>{o.selectedElementIds.length>0&&o.deleteSelectedElement()},g=()=>{o.selectElement(null)},x=()=>{o.canUndo&&o.undo()},w=()=>{o.canRedo&&o.redo()},k=(S,z,E,C)=>{const O=o.elements.find(F=>F.id===S);if(!O)return;const $=dr(O,z,E,C);if(o.updateElement(S,$,!1),O.type==="group"){const F={x:O.x,y:O.y,width:O.width,height:O.height};cr(O,F,$,o.elements).forEach(R=>o.updateElement(R.id,R.updates,!1))}},I=async(S,z)=>{if(o.selectedElementIds.length>1&&o.selectedElementIds.includes(S))o.selectedElements.forEach(E=>{o.updateElement(E.id,{rotation:(E.rotation+90)%360},!1)});else{const E=o.elements.find(C=>C.id===S);if(!E)return;if(E.type==="group"){const{childUpdates:C,newGroupBounds:O}=fr(E,o.elements);C.forEach($=>o.updateElement($.id,$.updates,!1)),o.updateElement(E.id,O,!1)}else o.updateElement(S,{rotation:(z+90)%360},!1)}o.saveSnapshot()};return(S,z)=>(e.openBlock(),e.createElementBlock("div",cf,[e.createVNode(nc,{"is-collapsed":s.value},null,8,["is-collapsed"]),e.createElementVNode("div",ff,[e.createVNode(Mn,{side:"left","is-collapsed":s.value,onToggle:z[0]||(z[0]=E=>s.value=!s.value)},null,8,["is-collapsed"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock(Mn,{key:0,side:"right","is-collapsed":a.value,onToggle:z[1]||(z[1]=E=>a.value=!a.value)},null,8,["is-collapsed"])):e.createCommentVNode("",!0),e.createVNode(so,{ref_key:"canvasRef",ref:p,"content-width":e.unref(m).width,"content-height":e.unref(m).height,onCanvasClick:g,onDeleteSelected:y,onCopySelected:z[12]||(z[12]=E=>e.unref(o).copySelectedElement()),onPaste:z[13]||(z[13]=E=>e.unref(o).pasteElement()),onDuplicate:z[14]||(z[14]=E=>e.unref(o).duplicateSelectedElement()),onUndo:x,onRedo:w},{overlay:e.withCtx(()=>[e.createVNode(qc,{"snap-lines":e.unref(u),zoom:e.unref(r).zoom},null,8,["snap-lines","zoom"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock(Dc,{key:0,element:e.unref(o).selectedElement,style:e.normalizeStyle(e.unref(l)),class:"absolute z-50 pointer-events-auto",onCopy:z[6]||(z[6]=E=>e.unref(o).copySelectedElement()),onDuplicate:z[7]||(z[7]=E=>e.unref(o).duplicateSelectedElement()),onRotate:z[8]||(z[8]=E=>I(e.unref(o).selectedElement.id,e.unref(o).selectedElement.rotation)),onDelete:z[9]||(z[9]=E=>e.unref(o).deleteSelectedElement()),onUp:z[10]||(z[10]=E=>e.unref(o).bringToFront()),onDown:z[11]||(z[11]=E=>e.unref(o).bringToBack())},null,8,["element","style"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).sortedElements,E=>(e.openBlock(),e.createBlock(Eo,{key:E.id,element:E,selected:e.unref(o).selectedElementIds.includes(E.id),onSelect:C=>h(E.id,C),onDrag:(C,O,$)=>e.unref(c)(E.id,C,O,$),onDragEnd:e.unref(f),onResize:(C,O,$)=>k(E.id,C,O,$),onResizeEnd:z[2]||(z[2]=C=>e.unref(o).endResize()),onRotate:C=>I(E.id,E.rotation),onDelete:z[3]||(z[3]=C=>e.unref(o).deleteSelectedElement()),onCopy:z[4]||(z[4]=C=>e.unref(o).copySelectedElement()),onDuplicate:z[5]||(z[5]=C=>e.unref(o).duplicateSelectedElement())},null,8,["element","selected","onSelect","onDrag","onDragEnd","onResize","onRotate"]))),128))]),_:1},8,["content-width","content-height"]),e.createElementVNode("div",pf,[e.createVNode(df)])]),e.createVNode(Nc,{"is-collapsed":a.value},null,8,["is-collapsed"]),e.createVNode(jc,{"right-sidebar-collapsed":a.value},null,8,["right-sidebar-collapsed"]),e.createVNode(Oc)]))}});U.EditPage=uf,U.ElementWrapper=Eo,U.GridCanvas=so,U.SNAP_THRESHOLD=Yn,U.useDragStore=Xe,U.useElementsStore=W,U.useZoomStore=J,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whiteboard-v2",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "main": "./dist/whiteboard-editor.umd.cjs",
6
6
  "module": "./dist/whiteboard-editor.js",