whiteboard-v2 1.0.2 → 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.
@@ -1,12 +1,12 @@
1
- (function(H,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],e):(H=typeof globalThis<"u"?globalThis:H||self,e(H.WhiteboardEditor={},H.Vue,H.Pinia))})(this,(function(H,e,Ne){"use strict";function es(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const no=es(e),J=Ne.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,s=100){if(t.length===0){this.resetZoom();return}const r=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-r,c=l-a,f=(o-s)/d,u=(n-s)/c,m=Math.min(f,u,3);this.setZoom(Math.max(.1,m))}}}),ts=["width","height"],os=["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,s=o,r=J(),a=e.computed(()=>r.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*r.zoom}px`:"100%",height:l.value?`${l.value*r.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(${r.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"))&&s("canvas-click")},m=p=>{const y=navigator.platform.toUpperCase().indexOf("MAC")>=0?p.metaKey:p.ctrlKey;y&&p.key==="z"&&!p.shiftKey?(p.preventDefault(),s("undo")):y&&p.key==="z"&&p.shiftKey||y&&p.key==="y"?(p.preventDefault(),s("redo")):y&&p.key==="c"?(p.preventDefault(),s("copy-selected")):y&&p.key==="v"?(p.preventDefault(),s("paste")):y&&p.key==="d"&&(p.preventDefault(),s("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,os)],8,ts)]),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 ns(t){if(!t||!t.trim())return[];const o=[],n=t.trim().split(/\s+/);for(const s of n){const r=s.split(","),a=r[0],i=r[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 ss(t){const o=ns(t);if(o.length===0)return"";const n=o.map(u=>u.x),s=o.map(u=>u.y),r=Math.min(...n),a=Math.max(...n),i=Math.min(...s),l=Math.max(...s),d=a-r,c=l-i;return d===0||c===0?t:o.map(u=>({x:Math.round((u.x-r)/d*100),y:Math.round((u.y-i)/c*100)})).map(u=>`${u.x},${u.y}`).join(" ")}const je=30;function rs(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 as(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 is(t,o,n,s){const{x:r,y:a,width:i,height:l,rotation:d}=t,c={x:r+i/2,y:a+l/2},f=rs(n,s,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(je,i+f.x),p=(u-i)/2;else if(o.includes("w")){const g=i-f.x;u=Math.max(je,g),p=-(u-i)/2}if(o.includes("s"))m=Math.max(je,l+f.y),h=(m-l)/2;else if(o.includes("n")){const g=l-f.y;m=Math.max(je,g),h=-(m-l)/2}const y=as(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 Ue(t){const{x:o,y:n,width:s,height:r,rotation:a}=t,i=(a%360+360)%360;if(i===90||i===270){const l={x:o+s/2,y:n+r/2};return{x:l.x-r/2,y:l.y-s/2,width:r,height:s,rotation:i}}return t}function ro(t,o){const n=o.find(r=>r.id===t);if(!n)return[];const s=[n];return n.type==="group"&&n.childIds.forEach(a=>{const i=o.find(l=>l.id===a);i&&!s.some(l=>l.id===i.id)&&s.push(i)}),s}function Oe(t,o){const n=[],s=new Set;return t.forEach(r=>{ro(r,o).forEach(i=>{s.has(i.id)||(s.add(i.id),n.push(i))})}),n}function ao(t,o){t.forEach(n=>{if(n.groupId&&o[n.groupId]&&(n.groupId=o[n.groupId]),n.type==="group"){const s=n;s.childIds=s.childIds.map(r=>o[r]||r)}})}function io(t){let o=1/0,n=1/0,s=-1/0,r=-1/0;return t.forEach(a=>{const i=Ue(a);o=Math.min(o,i.x),n=Math.min(n,i.y),s=Math.max(s,i.x+i.width),r=Math.max(r,i.y+i.height)}),{x:o,y:n,width:s-o,height:r-n}}function ls(t,o,n,s){const r=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=s.find(w=>w.id===l);if(!d)return;const c=Ue(d),f=c.x-o.x,u=c.y-o.y,m=n.x+f*r,p=n.y+u*a,h=Math.max(10,c.width*r),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 ds(t,o){const n=t.x+t.width/2,s=t.y+t.height/2,r=[],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-s),h=u,y=n+p,g=s+h,x=(d.rotation+90)%360,w={x:y-d.width/2,y:g-d.height/2,rotation:x};r.push({id:l,updates:w}),a.push({...d,...w})});const i=io(a);return{childUpdates:r,newGroupBounds:i}}const He="#cfe4ed",ae="#279ac8",Ke="#073446",cs=50,W=Ne.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:ss(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>cs&&(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,s){const r={id:`shape-${this.nextId++}`,type:"shape",shapeType:t,x:o,y:n,width:100,height:100,outline:ae,fill:He,strokeWeight:3,fontSize:16,fontFamily:"Arial",color:Ke,zIndex:this.elements.length,rotation:0,customPoints:t==="custom"?s:void 0};this.addElement(r)},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:Ke,zIndex:this.elements.length,rotation:0};this.addElement(n)},addIcon(t,o=100,n=100){const s={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(s)},updateElement(t,o,n=!0){const s=this.elements.findIndex(r=>r.id===t);s!==-1&&(this.elements[s]={...this.elements[s],...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=Oe(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=io(t),s=`group-${this.nextId++}`,r={id:s,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=s}),this.elements.push(r),this.selectedElementIds=[s],this.saveSnapshot()},ungroupElement(t){const o=this.elements.find(s=>s.id===t&&s.type==="group");if(!o)return;o.childIds.forEach(s=>{const r=this.elements.find(a=>a.id===s);r&&(r.groupId=void 0)});const n=this.elements.findIndex(s=>s.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 r=this.elements.findIndex(a=>a.id===n.id);r!==-1&&this.elements.splice(r,1)}}),this.selectedElementIds=o,this.saveSnapshot()},copySelectedElement(){if(this.selectedElementIds.length===0)return;const t=Oe(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={},s=[...this.clipboard].sort((a,i)=>a.zIndex-i.zIndex);s.forEach(a=>{n[a.id]=`${a.type}-${this.nextId++}`});const r=s.map((a,i)=>({...JSON.parse(JSON.stringify(a)),id:n[a.id],x:a.x+20,y:a.y+20,zIndex:o+i}));ao(r,n),r.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=Oe(this.selectedElementIds,this.elements);if(t.length===0)return;const o=[],n=this.elements.length,s={};t.forEach(i=>{s[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:s[i.id],x:i.x+20,y:i.y+20,zIndex:n+l}));ao(a,s),a.forEach(i=>{this.elements.push(i),i.groupId||o.push(i.id)}),this.selectedElementIds=o,this.saveSnapshot()},updateElementPosition(t,o,n){ro(t,this.elements).forEach(r=>{r.x+=o,r.y+=n})},bringToFront(){if(this.selectedElementIds.length===0)return;const t=Oe(this.selectedElementIds,this.elements);if(t.length===0)return;const o=Math.max(...this.elements.map(s=>s.zIndex));Math.max(...t.map(s=>s.zIndex))!==o&&(t.sort((s,r)=>s.zIndex-r.zIndex),t.forEach((s,r)=>{s.zIndex=o+1+r}),this.saveSnapshot())},bringToBack(){if(this.selectedElementIds.length===0)return;const t=Oe(this.selectedElementIds,this.elements);if(t.length===0)return;const o=new Set(t.map(r=>r.id)),n=Math.min(...this.elements.map(r=>r.zIndex));Math.min(...t.map(r=>r.zIndex))!==n&&(t.sort((r,a)=>r.zIndex-a.zIndex),this.elements.forEach(r=>{o.has(r.id)||(r.zIndex+=t.length)}),t.forEach((r,a)=>{r.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}}}),Ce=100,Ge=Ne.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 s=J();this.ghostPosition={x:o.clientX-Ce*s.zoom/2,y:o.clientY-Ce*s.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-Ce*o.zoom/2,y:t.clientY-Ce*o.zoom/2}},_handleMouseUp(t){if(!this.isDragging||!this.draggedShapeType){this._cleanup();return}if(this.canvasElement){const o=this.canvasElement.getBoundingClientRect(),n=t.clientX,s=t.clientY;if(n>=o.left&&n<=o.right&&s>=o.top&&s<=o.bottom){const a=J(),i=(n-o.left+this.canvasElement.scrollLeft)/a.zoom-Ce/2,l=(s-o.top+this.canvasElement.scrollTop)/a.zoom-Ce/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 lo=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fs=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,n,s)=>s?s.toUpperCase():n.toLowerCase()),ps=t=>{const o=fs(t);return o.charAt(0).toUpperCase()+o.slice(1)},us=(...t)=>t.filter((o,n,s)=>!!o&&o.trim()!==""&&s.indexOf(o)===n).join(" ").trim(),co=t=>t==="";var Ae={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 ms=({name:t,iconNode:o,absoluteStrokeWidth:n,"absolute-stroke-width":s,strokeWidth:r,"stroke-width":a,size:i=Ae.width,color:l=Ae.stroke,...d},{slots:c})=>e.h("svg",{...Ae,...d,width:i,height:i,stroke:l,"stroke-width":co(n)||co(s)||n===!0||s===!0?Number(r||a||Ae["stroke-width"])*24/Number(i):r||a||Ae["stroke-width"],class:us("lucide",d.class,...t?[`lucide-${lo(ps(t))}-icon`,`lucide-${lo(t)}`]:["lucide-icon"])},[...o.map(f=>e.h(...f)),...c.default?[c.default()]:[]]);const P=(t,o)=>(n,{slots:s,attrs:r})=>e.h(ms,{...r,...n,iconNode:o,name:t},s);const hs=P("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 bt=P("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const fo=P("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const po=P("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const wt=P("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const ys=P("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 gs=P("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 xs=P("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 bs=P("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 ws=P("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 ks=P("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const uo=P("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Cs=P("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 Es=P("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 Ss=P("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 zs=P("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const _s=P("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 Bs=P("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 vs=P("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 Vs=P("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 Ps=P("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 Is=P("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 Ns=P("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 Os=P("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 As=P("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 Ms=P("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 mo=P("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 $s=P("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 Ts=P("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 Ds=P("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 Fs=P("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 Rs=P("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 Ls=P("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 ho=P("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const qs=P("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 Ws=P("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 js=P("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 Us=P("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 Hs=P("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Ks=P("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 Gs=P("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const Xs=P("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 kt=P("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Ys=P("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 Zs=P("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 Js=P("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 Qs=P("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 er=P("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 tr=P("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const yo=P("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 or=P("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 nr=P("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 go=P("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 sr=P("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);const rr=P("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 ar=P("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 xo=P("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 ir=P("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 lr=P("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 dr=P("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 cr=P("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 fr=P("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 Ct=P("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pr=["href"],ur=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(Ts),{class:"w-4 h-4 text-blue-600"})],40,pr))}}),mr=e.defineComponent({__name:"ElementTextOverlay",props:{element:{}},setup(t){const o=t,n=e.computed(()=>{const r=o.element,a=r.rotation||0,i=Math.abs(a%180)===90;return{position:"absolute",top:"50%",left:"50%",width:`${i?r.height:r.width}px`,height:`${i?r.width:r.height}px`,transform:`translate(-50%, -50%) rotate(${-a}deg)`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",overflow:"hidden"}}),s=e.computed(()=>{const r=o.element;return{color:r.color||"#000000",fontSize:`${r.fontSize||16}px`,fontFamily:r.fontFamily||"Arial",textAlign:"center",whiteSpace:"pre-wrap",overflowWrap:"break-word",lineHeight:"1.2",userSelect:"none",maxWidth:"100%",maxHeight:"100%"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(n.value)},[e.createElementVNode("span",{style:e.normalizeStyle(s.value)},e.toDisplayString(t.element.content),5)],4))}}),bo=["nw","n","ne","e","se","s","sw","w"],hr=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%"}}},wo=3;function yr(t){const o=J(),n=e.ref(!1);let s=!1,r=0,a=0,i=0,l=0;const d=u=>{if(!n.value)return;if(!s){const h=Math.abs(u.clientX-r),y=Math.abs(u.clientY-a);(h>=wo||y>=wo)&&(s=!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,s&&t("drag-end")),s=!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,s=!1,r=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 gr(t){const o=e.ref(!1);let n="",s=0,r=0;const a=c=>{if(!o.value)return;const f=c.clientX-s,u=c.clientY-r;s=c.clientX,r=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,s=f.clientX,r=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 xr(t){const o=e.computed(()=>{const r=t.value;return r.type!=="shape"?null:{width:r.width,height:r.height,fill:r.fill,outline:r.outline,strokeWeight:r.strokeWeight,rotation:0,shapeType:r.shapeType,customPoints:r.customPoints}}),n=e.computed(()=>{const r=t.value;return r.type!=="text"?null:{content:r.content,color:r.color,fontSize:r.fontSize,fontFamily:r.fontFamily}}),s=e.computed(()=>{const r=t.value;return r.type!=="icon"?null:{iconType:r.iconType,color:r.color,strokeWeight:r.strokeWeight}});return{shapeProps:o,textProps:n,iconProps:s}}const br=["data-testid","width","height"],wr=["data-testid","stroke","fill","stroke-width"],kr=["data-testid","points","stroke","fill","stroke-width"],Xe=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";default:return""}});return(s,r)=>(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,wr)):(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,kr))],8,br))}}),Cr=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))}}),ko={arrowUp:wt,arrowDown:bt,arrowLeft:fo,arrowRight:po,user:dr,users:cr,building:gs,factory:Ns,briefcase:ys,fileText:Os,folder:As,database:Ps,clipboardList:Es,server:Qs,monitor:qs,smartphone:tr,mail:Ds,messageSquare:Rs,phone:Xs,checkCircle:Cs,alertTriangle:rr,info:Ms,settings:er,activity:hs,barChart:bs,pieChart:ws,trendingUp:sr,dollarSign:Is,creditCard:vs,truck:ar,package:js,mapPin:Fs,clock:zs,calendar:xs,target:nr},Er=e.defineComponent({__name:"IconElement",props:{iconType:{},color:{},strokeWeight:{}},setup(t){const o=t,n=e.computed(()=>ko[o.iconType]||null);return(s,r)=>(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))}}),Sr={class:"w-full h-full"},zr={key:0,class:"absolute inset-0 pointer-events-none"},_r=["onMousedown"],Co=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,s=o,{startDrag:r}=yr(s),{startResize:a}=gr(s),{shapeProps:i,textProps:l,iconProps:d}=xr(e.toRef(n,"element")),c=e.computed(()=>n.element.type==="icon"?bo.filter(p=>["nw","ne","sw","se"].includes(p)):bo),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=>{s("select",p),r(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",Sr,[e.unref(i)?(e.openBlock(),e.createBlock(Xe,e.normalizeProps(e.mergeProps({key:0},e.unref(i))),null,16)):e.unref(l)?(e.openBlock(),e.createBlock(Cr,e.normalizeProps(e.mergeProps({key:1},e.unref(l))),null,16)):e.unref(d)?(e.openBlock(),e.createBlock(Er,e.normalizeProps(e.mergeProps({key:2},e.unref(d))),null,16)):e.createCommentVNode("",!0)]),t.selected?(e.openBlock(),e.createElementBlock("div",zr,[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(hr)(y)),onMousedown:e.withModifiers(g=>m(y,g),["stop"])},null,44,_r))),128))])):e.createCommentVNode("",!0),t.element.type==="shape"?(e.openBlock(),e.createBlock(mr,{key:1,element:t.element},null,8,["element"])):e.createCommentVNode("",!0),t.element.link&&!t.selected?(e.openBlock(),e.createBlock(ur,{key:2,link:t.element.link},null,8,["link"])):e.createCommentVNode("",!0)],36))}});function Eo(t){var o,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(o=0;o<r;o++)t[o]&&(n=Eo(t[o]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function So(){for(var t,o,n=0,s="",r=arguments.length;n<r;n++)(t=arguments[n])&&(o=Eo(t))&&(s&&(s+=" "),s+=o);return s}const zo=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,_o=So,Br=(t,o)=>n=>{var s;if(o?.variants==null)return _o(t,n?.class,n?.className);const{variants:r,defaultVariants:a}=o,i=Object.keys(r).map(c=>{const f=n?.[c],u=a?.[c];if(f===null)return null;const m=zo(f)||zo(u);return r[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||(s=o.compoundVariants)===null||s===void 0?void 0:s.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 _o(t,i,d,n?.class,n?.className)};function Me(t,o){const n=typeof t=="string"&&!o?`${t}Context`:o,s=Symbol(n);return[i=>{const l=e.inject(s,i);if(l||l===null)return l;throw new Error(`Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(e.provide(s,i),i)]}function fe(){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 Bo(t,o,n){const s=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});o&&s.addEventListener(t,o,{once:!0}),s.dispatchEvent(r)}function vr(t){return t==null}function Et(t){return t?t.flatMap(o=>o.type===e.Fragment?Et(o.children):[o]):[]}const[vo]=Me("ConfigProvider");function Vr(t,o){var n;const s=e.shallowRef();return e.watchEffect(()=>{s.value=t()},{...o,flush:(n=void 0)!=null?n:"sync"}),e.readonly(s)}function Vo(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Pr(t){let o=!1,n;const s=e.effectScope(!0);return(...r)=>(o||(n=s.run(()=>t(...r)),o=!0),n)}function Ir(t){let o=0,n,s;const r=()=>{o-=1,s&&o<=0&&(s.stop(),n=void 0,s=void 0)};return(...a)=>(o+=1,s||(s=e.effectScope(!0),n=s.run(()=>t(...a))),Vo(r),n)}function Nr(t){if(!e.isRef(t))return e.reactive(t);const o=new Proxy({},{get(n,s,r){return e.unref(Reflect.get(t.value,s,r))},set(n,s,r){return e.isRef(t.value[s])&&!e.isRef(r)?t.value[s].value=r:t.value[s]=r,!0},deleteProperty(n,s){return Reflect.deleteProperty(t.value,s)},has(n,s){return Reflect.has(t.value,s)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return e.reactive(o)}function Or(t){return Nr(e.computed(t))}function Ar(t,...o){const n=o.flat(),s=n[0];return Or(()=>Object.fromEntries(typeof s=="function"?Object.entries(e.toRefs(t)).filter(([r,a])=>!s(e.toValue(a),r)):Object.entries(e.toRefs(t)).filter(r=>!n.includes(r[0]))))}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Mr=t=>typeof t<"u",$r=Object.prototype.toString,Tr=t=>$r.call(t)==="[object Object]",Po=Dr();function Dr(){var t,o;return pe&&((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 Fr(t){return e.getCurrentInstance()}function St(t){return Array.isArray(t)?t:[t]}function Rr(t,o){Fr()&&e.onBeforeUnmount(t,o)}function Lr(t,o,n){return e.watch(t,o,{...n,immediate:!0})}const zt=pe?window:void 0;function $e(t){var o;const n=e.toValue(t);return(o=n?.$el)!=null?o:n}function Io(...t){const o=[],n=()=>{o.forEach(l=>l()),o.length=0},s=(l,d,c,f)=>(l.addEventListener(d,c,f),()=>l.removeEventListener(d,c,f)),r=e.computed(()=>{const l=St(e.toValue(t[0])).filter(d=>d!=null);return l.every(d=>typeof d!="string")?l:void 0}),a=Lr(()=>{var l,d;return[(d=(l=r.value)==null?void 0:l.map(c=>$e(c)))!=null?d:[zt].filter(c=>c!=null),St(e.toValue(r.value?t[1]:t[0])),St(e.unref(r.value?t[2]:t[1])),e.toValue(r.value?t[3]:t[2])]},([l,d,c,f])=>{if(n(),!l?.length||!d?.length||!c?.length)return;const u=Tr(f)?{...f}:f;o.push(...l.flatMap(m=>d.flatMap(p=>c.map(h=>s(m,p,h,u)))))},{flush:"post"}),i=()=>{a(),n()};return Vo(n),i}function qr(){const t=e.shallowRef(!1),o=e.getCurrentInstance();return o&&e.onMounted(()=>{t.value=!0},o),t}function Wr(t){return typeof t=="function"?t:typeof t=="string"?o=>o.key===t:Array.isArray(t)?o=>t.includes(o.key):()=>!0}function jr(...t){let o,n,s={};t.length===3?(o=t[0],n=t[1],s=t[2]):t.length===2?typeof t[1]=="object"?(o=!0,n=t[0],s=t[1]):(o=t[0],n=t[1]):(o=!0,n=t[0]);const{target:r=zt,eventName:a="keydown",passive:i=!1,dedupe:l=!1}=s,d=Wr(o);return Io(r,a,f=>{f.repeat&&e.toValue(l)||d(f)&&n(f)},i)}function Ur(t){return JSON.parse(JSON.stringify(t))}function No(t,o,n,s={}){var r,a,i;const{clone:l=!1,passive:d=!1,eventName:c,deep:f=!1,defaultValue:u,shouldEmit:m}=s,p=e.getCurrentInstance(),h=n||p?.emit||((r=p?.$emit)==null?void 0:r.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):Ur(k):k,x=()=>Mr(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 _t(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 Bt(t,o,n=".",s){if(!_t(o))return Bt(t,{},n,s);const r=Object.assign({},o);for(const a in t){if(a==="__proto__"||a==="constructor")continue;const i=t[a];i!=null&&(s&&s(r,a,i,n)||(Array.isArray(i)&&Array.isArray(r[a])?r[a]=[...i,...r[a]]:_t(i)&&_t(r[a])?r[a]=Bt(i,r[a],(n?`${n}.`:"")+a.toString(),s):r[a]=i))}return r}function Hr(t){return(...o)=>o.reduce((n,s)=>Bt(n,s,"",t),{})}const Kr=Hr(),Gr=Ir(()=>{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}),s=vo({scrollBody:e.ref(!0)});let r=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??"",Po&&r?.(),o.value=void 0};return e.watch(n,(i,l)=>{if(!pe)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=s.scrollBody?.value?typeof s.scrollBody.value=="object"?Kr({padding:s.scrollBody.value.padding===!0?d:s.scrollBody.value.padding,margin:s.scrollBody.value.margin===!0?d:s.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"),Po&&(r=Io(document,"touchmove",u=>Xr(u),{passive:!1})),e.nextTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function Oo(t){const o=Math.random().toString(36).substring(2,7),n=Gr();n.value.set(o,t);const s=e.computed({get:()=>n.value.get(o)??!1,set:r=>n.value.set(o,r)});return Rr(()=>{n.value.delete(o)}),s}function Ao(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:Ao(n)}}function Xr(t){const o=t||window.event,n=o.target;return n instanceof Element&&Ao(n)?!1:o.touches.length>1?!0:(o.preventDefault&&o.cancelable&&o.preventDefault(),!1)}function Ye(t){const o=e.getCurrentInstance(),n=o?.type.emits,s={};return n?.length||console.warn(`No emitted event found. Please check component: ${o?.type.__name}`),n?.forEach(r=>{s[e.toHandlerKey(e.camelize(r))]=(...a)=>t(r,...a)}),s}let vt=0;function Yr(){e.watchEffect(t=>{if(!pe)return;const o=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",o[0]??Mo()),document.body.insertAdjacentElement("beforeend",o[1]??Mo()),vt++,t(()=>{vt===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),vt--})})}function Mo(){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:$e(o)),s=Object.assign({},t.exposed),r={};for(const i in t.props)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>t.props[i]});if(Object.keys(s).length>0)for(const i in s)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>s[i]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=r;function a(i){if(o.value=i,!!i&&(Object.defineProperty(r,"$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({},r);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 Vt(t){const o=e.getCurrentInstance(),n=Object.keys(o?.type.props??{}).reduce((r,a)=>{const i=(o?.type.props[a]).default;return i!==void 0&&(r[a]=i),r},{}),s=e.toRef(t);return e.computed(()=>{const r={},a=o?.vnode.props??{};return Object.keys(a).forEach(i=>{r[e.camelize(i)]=a[i]}),Object.keys({...n,...r}).reduce((i,l)=>(s.value[l]!==void 0&&(i[l]=s.value[l]),i),{})})}function xe(t,o){const n=Vt(t),s=o?Ye(o):{};return e.computed(()=>({...n.value,...s}))}var Zr=function(t){if(typeof document>"u")return null;var o=Array.isArray(t)?t[0]:t;return o.ownerDocument.body},Ee=new WeakMap,Ze=new WeakMap,Je={},Pt=0,$o=function(t){return t&&(t.host||$o(t.parentNode))},Jr=function(t,o){return o.map(function(n){if(t.contains(n))return n;var s=$o(n);return s&&t.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Qr=function(t,o,n,s){var r=Jr(o,Array.isArray(t)?t:[t]);Je[n]||(Je[n]=new WeakMap);var a=Je[n],i=[],l=new Set,d=new Set(r),c=function(u){!u||l.has(u)||(l.add(u),c(u.parentNode))};r.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(s),h=p!==null&&p!=="false",y=(Ee.get(m)||0)+1,g=(a.get(m)||0)+1;Ee.set(m,y),a.set(m,g),i.push(m),y===1&&h&&Ze.set(m,!0),g===1&&m.setAttribute(n,"true"),h||m.setAttribute(s,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(o),l.clear(),Pt++,function(){i.forEach(function(u){var m=Ee.get(u)-1,p=a.get(u)-1;Ee.set(u,m),a.set(u,p),m||(Ze.has(u)||u.removeAttribute(s),Ze.delete(u)),p||u.removeAttribute(n)}),Pt--,Pt||(Ee=new WeakMap,Ee=new WeakMap,Ze=new WeakMap,Je={})}},ea=function(t,o,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),r=Zr(t);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live], script"))),Qr(s,r,n,"aria-hidden")):function(){return null}};function To(t){let o;e.watch(()=>$e(t),n=>{n?o=ea(n):o&&o()}),e.onUnmounted(()=>{o&&o()})}let ta=0;function Qe(t,o="reka"){if("useId"in no)return`${o}-${no.useId?.()}`;const n=vo({useId:void 0});return n.useId?`${o}-${n.useId()}`:`${o}-${++ta}`}function oa(t){const o=e.ref(),n=e.computed(()=>o.value?.width??0),s=e.computed(()=>o.value?.height??0);return e.onMounted(()=>{const r=$e(t);if(r){o.value={width:r.offsetWidth,height:r.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=r.offsetWidth,c=r.offsetHeight;o.value={width:d,height:c}});return a.observe(r,{box:"border-box"}),()=>a.unobserve(r)}else o.value=void 0}),{width:n,height:s}}function na(t,o){const n=e.ref(t);function s(a){return o[n.value][a]??n.value}return{state:n,dispatch:a=>{n.value=s(a)}}}function sa(t,o){const n=e.ref({}),s=e.ref("none"),r=e.ref(t),a=t.value?"mounted":"unmounted";let i;const l=o.value?.ownerDocument.defaultView??zt,{state:d,dispatch:c}=na(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),f=g=>{if(pe){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=s.value,I=et(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=et(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"),!r.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&&(s.value=et(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=et(o.value);s.value=d.value==="mounted"?g:"none"});return e.onUnmounted(()=>{p(),h()}),{isPresent:e.computed(()=>["mounted","unmountSuspended"].includes(d.value))}}function et(t){return t&&getComputedStyle(t).animationName||"none"}var It=e.defineComponent({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:o,expose:n}){const{present:s,forceMount:r}=e.toRefs(t),a=e.ref(),{isPresent:i}=sa(s,a);n({present:i});let l=o.default({present:i.value});l=Et(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
- `))}return()=>r.value||s.value||i.value?e.h(o.default({present:i.value})[0],{ref:c=>{const f=$e(c);return typeof f?.hasAttribute>"u"||(f?.hasAttribute("data-reka-popper-content-wrapper")?a.value=f.firstElementChild:a.value=f),f}}):null}});const ra=e.defineComponent({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:o,slots:n}){return()=>{if(!n.default)return null;const s=Et(n.default()),r=s.findIndex(d=>d.type!==e.Comment);if(r===-1)return s;const a=s[r];delete a.props?.ref;const i=a.props?e.mergeProps(o,a.props):o,l=e.cloneVNode({...a,props:{}},i);return s.length===1?l:(s[r]=l,s)}}}),aa=["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 s=t.asChild?"template":t.as;return typeof s=="string"&&aa.includes(s)?()=>e.h(s,o):s!=="template"?()=>e.h(t.as,o,{default:n.default}):()=>e.h(ra,o,{default:n.default})}}),[ue,ia]=Me("DialogRoot");var la=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,r=No(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=e.ref(),i=e.ref(),{modal:l}=e.toRefs(n);return ia({open:r,modal:l,openModal:()=>{r.value=!0},onOpenChange:d=>{r.value=d},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:a,contentElement:i}),(d,c)=>e.renderSlot(d.$slots,"default",{open:e.unref(r),close:()=>r.value=!1})}}),da=la,ca=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=ue();return(s,r)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{type:s.as==="button"?"button":void 0,onClick:r[0]||(r[0]=a=>e.unref(n).onOpenChange(!1))}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["type"]))}}),fa=ca;const pa="dismissableLayer.pointerDownOutside",ua="dismissableLayer.focusOutside";function Do(t,o){const n=o.closest("[data-dismissable-layer]"),s=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(s===n||r.indexOf(s)<r.indexOf(n)))}function ma(t,o,n=!0){const s=o?.value?.ownerDocument??globalThis?.document,r=e.ref(!1),a=e.ref(()=>{});return e.watchEffect(i=>{if(!pe||!e.toValue(n))return;const l=async c=>{const f=c.target;if(!(!o?.value||!f)){if(Do(o.value,f)){r.value=!1;return}if(c.target&&!r.value){let m=function(){Bo(pa,t,u)};const u={originalEvent:c};c.pointerType==="touch"?(s.removeEventListener("click",a.value),a.value=m,s.addEventListener("click",a.value,{once:!0})):m()}else s.removeEventListener("click",a.value);r.value=!1}},d=window.setTimeout(()=>{s.addEventListener("pointerdown",l)},0);i(()=>{window.clearTimeout(d),s.removeEventListener("pointerdown",l),s.removeEventListener("click",a.value)})}),{onPointerDownCapture:()=>{e.toValue(n)&&(r.value=!0)}}}function ha(t,o,n=!0){const s=o?.value?.ownerDocument??globalThis?.document,r=e.ref(!1);return e.watchEffect(a=>{if(!pe||!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||Do(o.value,d)||l.target&&!r.value&&Bo(ua,t,{originalEvent:l})};s.addEventListener("focusin",i),a(()=>s.removeEventListener("focusin",i))}),{onFocusCapture:()=>{e.toValue(n)&&(r.value=!0)},onBlurCapture:()=>{e.toValue(n)&&(r.value=!1)}}}const Z=e.reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var ya=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,s=o,{forwardRef:r,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=ma(async p=>{const h=[...Z.branches].some(y=>y?.contains(p.target));!f.value||h||(s("pointerDownOutside",p),s("interactOutside",p),await e.nextTick(),p.defaultPrevented||s("dismiss"))},a),m=ha(p=>{[...Z.branches].some(y=>y?.contains(p.target))||(s("focusOutside",p),s("interactOutside",p),p.defaultPrevented||s("dismiss"))},a);return jr("Escape",p=>{d.value===l.value.size-1&&(s("escapeKeyDown",p),p.defaultPrevented||s("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&&!vr(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(r),"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"]))}}),Fo=ya;const ga=Pr(()=>e.ref([]));function xa(){const t=ga();return{add(o){const n=t.value[0];o!==n&&n?.pause(),t.value=Ro(t.value,o),t.value.unshift(o)},remove(o){t.value=Ro(t.value,o),t.value[0]?.resume()}}}function Ro(t,o){const n=[...t],s=n.indexOf(o);return s!==-1&&n.splice(s,1),n}function ba(t){return t.filter(o=>o.tagName!=="A")}const Nt="focusScope.autoFocusOnMount",Ot="focusScope.autoFocusOnUnmount",Lo={bubbles:!1,cancelable:!0};function wa(t,{select:o=!1}={}){const n=fe();for(const s of t)if(me(s,{select:o}),fe()!==n)return!0}function ka(t){const o=qo(t),n=Wo(o,t),s=Wo(o.reverse(),t);return[n,s]}function qo(t){const o=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)o.push(n.currentNode);return o}function Wo(t,o){for(const n of t)if(!Ca(n,{upTo:o}))return n}function Ca(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 Ea(t){return t instanceof HTMLInputElement&&"select"in t}function me(t,{select:o=!1}={}){if(t&&t.focus){const n=fe();t.focus({preventScroll:!0}),t!==n&&Ea(t)&&o&&t.select()}}var Sa=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,s=o,{currentRef:r,currentElement:a}=j(),i=e.ref(null),l=xa(),d=e.reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});e.watchEffect(f=>{if(!pe)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:me(i.value,{select:!0})}function p(g){if(d.paused||!u)return;const x=g.relatedTarget;x!==null&&(u.contains(x)||me(i.value,{select:!0}))}function h(g){u.contains(i.value)||me(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=fe();if(!u.contains(m)){const h=new CustomEvent(Nt,Lo);u.addEventListener(Nt,y=>s("mountAutoFocus",y)),u.dispatchEvent(h),h.defaultPrevented||(wa(ba(qo(u)),{select:!0}),fe()===m&&me(u))}f(()=>{u.removeEventListener(Nt,g=>s("mountAutoFocus",g));const h=new CustomEvent(Ot,Lo),y=g=>{s("unmountAutoFocus",g)};u.addEventListener(Ot,y),u.dispatchEvent(h),setTimeout(()=>{h.defaultPrevented||me(m??document.body,{select:!0}),u.removeEventListener(Ot,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=fe();if(u&&m){const p=f.currentTarget,[h,y]=ka(p);h&&y?!f.shiftKey&&m===y?(f.preventDefault(),n.loop&&me(h,{select:!0})):f.shiftKey&&m===h&&(f.preventDefault(),n.loop&&me(y,{select:!0})):m===p&&f.preventDefault()}}return(f,u)=>(e.openBlock(),e.createBlock(e.unref(Q),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":f.asChild,as:f.as,onKeydown:c},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default")]),_:3},8,["as-child","as"]))}}),jo=Sa;function za(t){return t?"open":"closed"}const _a="DialogTitle",Ba="DialogContent";function va({titleName:t=_a,contentName:o=Ba,componentLink:n="dialog.html#title",titleId:s,descriptionId:r,contentElement:a}){const i=`Warning: \`${o}\` requires a \`${t}\` for the component to be accessible for screen reader users.
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
 
5
5
  If you want to hide the \`${t}\`, you can wrap it with our VisuallyHidden component.
6
6
 
7
- For more information, see https://www.reka-ui.com/docs/components/${n}`,l=`Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${o}.`;e.onMounted(()=>{document.getElementById(s)||console.warn(i);const c=a.value?.getAttribute("aria-describedby");r&&c&&(document.getElementById(r)||console.warn(l))})}var Va=e.defineComponent({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=ue(),{forwardRef:a,currentElement:i}=j();return r.titleId||=Qe(void 0,"reka-dialog-title"),r.descriptionId||=Qe(void 0,"reka-dialog-description"),e.onMounted(()=>{r.contentElement=i,fe()!==document.body&&(r.triggerElement.value=fe())}),process.env.NODE_ENV!=="production"&&va({titleName:"DialogTitle",contentName:"DialogContent",componentLink:"dialog.html#title",titleId:r.titleId,descriptionId:r.descriptionId,contentElement:i}),(l,d)=>(e.openBlock(),e.createBlock(e.unref(jo),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>s("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>s("closeAutoFocus",c))},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo),e.mergeProps({id:e.unref(r).contentId,ref:e.unref(a),as:l.as,"as-child":l.asChild,"disable-outside-pointer-events":l.disableOutsidePointerEvents,role:"dialog","aria-describedby":e.unref(r).descriptionId,"aria-labelledby":e.unref(r).titleId,"data-state":e.unref(za)(e.unref(r).open.value)},l.$attrs,{onDismiss:d[0]||(d[0]=c=>e.unref(r).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>s("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>s("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>s("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>s("pointerDownOutside",c))}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),Uo=Va,Pa=e.defineComponent({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=ue(),a=Ye(s),{forwardRef:i,currentElement:l}=j();return To(l),(d,c)=>(e.openBlock(),e.createBlock(Uo,e.mergeProps({...n,...e.unref(a)},{ref:e.unref(i),"trap-focus":e.unref(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=f=>{f.defaultPrevented||(f.preventDefault(),e.unref(r).triggerElement.value?.focus())}),onPointerDownOutside:c[1]||(c[1]=f=>{const u=f.detail.originalEvent,m=u.button===0&&u.ctrlKey===!0;(u.button===2||m)&&f.preventDefault()}),onFocusOutside:c[2]||(c[2]=f=>{f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Ia=Pa,Na=e.defineComponent({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=Ye(o);j();const a=ue(),i=e.ref(!1),l=e.ref(!1);return(d,c)=>(e.openBlock(),e.createBlock(Uo,e.mergeProps({...n,...e.unref(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=f=>{f.defaultPrevented||(i.value||e.unref(a).triggerElement.value?.focus(),f.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=f=>{f.defaultPrevented||(i.value=!0,f.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=f.target;e.unref(a).triggerElement.value?.contains(u)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&l.value&&f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16))}}),Oa=Na,Aa=e.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=ue(),a=Ye(s),{forwardRef:i}=j();return(l,d)=>(e.openBlock(),e.createBlock(e.unref(It),{present:l.forceMount||e.unref(r).open.value},{default:e.withCtx(()=>[e.unref(r).modal.value?(e.openBlock(),e.createBlock(Ia,e.mergeProps({key:0,ref:e.unref(i)},{...n,...e.unref(a),...l.$attrs}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createBlock(Oa,e.mergeProps({key:1,ref:e.unref(i)},{...n,...e.unref(a),...l.$attrs}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ma=Aa,$a=e.defineComponent({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=ue();return Oo(!0),j(),(n,s)=>(e.openBlock(),e.createBlock(e.unref(Q),{as:n.as,"as-child":n.asChild,"data-state":e.unref(o).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Ta=$a,Da=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=ue(),{forwardRef:n}=j();return(s,r)=>e.unref(o)?.modal.value?(e.openBlock(),e.createBlock(e.unref(It),{key:0,present:s.forceMount||e.unref(o).open.value},{default:e.withCtx(()=>[e.createVNode(Ta,e.mergeProps(s.$attrs,{ref:e.unref(n),as:s.as,"as-child":s.asChild}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):e.createCommentVNode("v-if",!0)}}),Fa=Da,Ra=e.defineComponent({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=qr();return(n,s)=>e.unref(o)||n.forceMount?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[e.renderSlot(n.$slots,"default")],8,["to","disabled","defer"])):e.createCommentVNode("v-if",!0)}}),Ho=Ra,La=e.defineComponent({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createBlock(e.unref(Ho),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),qa=La,Wa=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(t){const o=t,n=ue();return j(),(s,r)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{id:e.unref(n).titleId}),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["id"]))}}),ja=Wa;const[Ko,Ua]=Me("PopperRoot");var Ha=e.defineComponent({inheritAttrs:!1,__name:"PopperRoot",setup(t){const o=e.ref();return Ua({anchor:o,onAnchorChange:n=>o.value=n}),(n,s)=>e.renderSlot(n.$slots,"default")}}),Ka=Ha,Ga=e.defineComponent({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=t,{forwardRef:n,currentElement:s}=j(),r=Ko();return e.watchPostEffect(()=>{r.onAnchorChange(o.reference??s.value)}),(a,i)=>(e.openBlock(),e.createBlock(e.unref(Q),{ref:e.unref(n),as:a.as,"as-child":a.asChild},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["as","as-child"]))}}),Xa=Ga;function Ya(t){return t!==null}function Za(t){return{name:"transformOrigin",options:t,fn(o){const{placement:n,rects:s,middlewareData:r}=o,i=r.arrow?.centerOffset!==0,l=i?0:t.arrowWidth,d=i?0:t.arrowHeight,[c,f]=At(n),u={start:"0%",center:"50%",end:"100%"}[f],m=(r.arrow?.x??0)+l/2,p=(r.arrow?.y??0)+d/2;let h="",y="";return c==="bottom"?(h=i?u:`${m}px`,y=`${-d}px`):c==="top"?(h=i?u:`${m}px`,y=`${s.floating.height+d}px`):c==="right"?(h=`${-d}px`,y=i?u:`${p}px`):c==="left"&&(h=`${s.floating.width+d}px`,y=i?u:`${p}px`),{data:{x:h,y}}}}}function At(t){const[o,n="center"]=t.split("-");return[o,n]}const Ja=["top","right","bottom","left"],he=Math.min,K=Math.max,tt=Math.round,ot=Math.floor,oe=t=>({x:t,y:t}),Qa={left:"right",right:"left",bottom:"top",top:"bottom"},ei={start:"end",end:"start"};function Mt(t,o,n){return K(t,he(o,n))}function ie(t,o){return typeof t=="function"?t(o):t}function le(t){return t.split("-")[0]}function Se(t){return t.split("-")[1]}function $t(t){return t==="x"?"y":"x"}function Tt(t){return t==="y"?"height":"width"}const ti=new Set(["top","bottom"]);function ne(t){return ti.has(le(t))?"y":"x"}function Dt(t){return $t(ne(t))}function oi(t,o,n){n===void 0&&(n=!1);const s=Se(t),r=Dt(t),a=Tt(r);let i=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return o.reference[a]>o.floating[a]&&(i=nt(i)),[i,nt(i)]}function ni(t){const o=nt(t);return[Ft(t),o,Ft(o)]}function Ft(t){return t.replace(/start|end/g,o=>ei[o])}const Go=["left","right"],Xo=["right","left"],si=["top","bottom"],ri=["bottom","top"];function ai(t,o,n){switch(t){case"top":case"bottom":return n?o?Xo:Go:o?Go:Xo;case"left":case"right":return o?si:ri;default:return[]}}function ii(t,o,n,s){const r=Se(t);let a=ai(le(t),n==="start",s);return r&&(a=a.map(i=>i+"-"+r),o&&(a=a.concat(a.map(Ft)))),a}function nt(t){return t.replace(/left|right|bottom|top/g,o=>Qa[o])}function li(t){return{top:0,right:0,bottom:0,left:0,...t}}function Yo(t){return typeof t!="number"?li(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:o,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:o,right:o+s,bottom:n+r,x:o,y:n}}function Zo(t,o,n){let{reference:s,floating:r}=t;const a=ne(o),i=Dt(o),l=Tt(i),d=le(o),c=a==="y",f=s.x+s.width/2-r.width/2,u=s.y+s.height/2-r.height/2,m=s[l]/2-r[l]/2;let p;switch(d){case"top":p={x:f,y:s.y-r.height};break;case"bottom":p={x:f,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:u};break;case"left":p={x:s.x-r.width,y:u};break;default:p={x:s.x,y:s.y}}switch(Se(o)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const di=async(t,o,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,l=a.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(o));let c=await i.getElementRects({reference:t,floating:o,strategy:r}),{x:f,y:u}=Zo(c,s,d),m=s,p={},h=0;for(let y=0;y<l.length;y++){const{name:g,fn:x}=l[y],{x:w,y:k,data:I,reset:S}=await x({x:f,y:u,initialPlacement:s,placement:m,strategy:r,middlewareData:p,rects:c,platform:i,elements:{reference:t,floating:o}});f=w??f,u=k??u,p={...p,[g]:{...p[g],...I}},S&&h<=50&&(h++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:t,floating:o,strategy:r}):S.rects),{x:f,y:u}=Zo(c,m,d)),y=-1)}return{x:f,y:u,placement:m,strategy:r,middlewareData:p}};async function Te(t,o){var n;o===void 0&&(o={});const{x:s,y:r,platform:a,rects:i,elements:l,strategy:d}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=ie(o,t),h=Yo(p),g=l[m?u==="floating"?"reference":"floating":u],x=st(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:d})),w=u==="floating"?{x:s,y:r,width:i.floating.width,height:i.floating.height}:i.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),I=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},S=st(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:k,strategy:d}):w);return{top:(x.top-S.top+h.top)/I.y,bottom:(S.bottom-x.bottom+h.bottom)/I.y,left:(x.left-S.left+h.left)/I.x,right:(S.right-x.right+h.right)/I.x}}const ci=t=>({name:"arrow",options:t,async fn(o){const{x:n,y:s,placement:r,rects:a,platform:i,elements:l,middlewareData:d}=o,{element:c,padding:f=0}=ie(t,o)||{};if(c==null)return{};const u=Yo(f),m={x:n,y:s},p=Dt(r),h=Tt(p),y=await i.getDimensions(c),g=p==="y",x=g?"top":"left",w=g?"bottom":"right",k=g?"clientHeight":"clientWidth",I=a.reference[h]+a.reference[p]-m[p]-a.floating[h],S=m[p]-a.reference[p],z=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=z?z[k]:0;(!E||!await(i.isElement==null?void 0:i.isElement(z)))&&(E=l.floating[k]||a.floating[h]);const C=I/2-S/2,O=E/2-y[h]/2-1,$=he(u[x],O),F=he(u[w],O),T=$,R=E-y[h]-F,_=E/2-y[h]/2+C,b=Mt(T,_,R),N=!d.arrow&&Se(r)!=null&&_!==b&&a.reference[h]/2-(_<T?$:F)-y[h]/2<0,D=N?_<T?_-T:_-R:0;return{[p]:m[p]+D,data:{[p]:b,centerOffset:_-b-D,...N&&{alignmentOffset:D}},reset:N}}}),fi=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var n,s;const{placement:r,middlewareData:a,rects:i,initialPlacement:l,platform:d,elements:c}=o,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=ie(t,o);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=le(r),w=ne(l),k=le(l)===l,I=await(d.isRTL==null?void 0:d.isRTL(c.floating)),S=m||(k||!y?[nt(l)]:ni(l)),z=h!=="none";!m&&z&&S.push(...ii(l,y,h,I));const E=[l,...S],C=await Te(o,g),O=[];let $=((s=a.flip)==null?void 0:s.overflows)||[];if(f&&O.push(C[x]),u){const _=oi(r,i,I);O.push(C[_[0]],C[_[1]])}if($=[...$,{placement:r,overflows:O}],!O.every(_=>_<=0)){var F,T;const _=(((F=a.flip)==null?void 0:F.index)||0)+1,b=E[_];if(b&&(!(u==="alignment"?w!==ne(b):!1)||$.every(B=>ne(B.placement)===w?B.overflows[0]>0:!0)))return{data:{index:_,overflows:$},reset:{placement:b}};let N=(T=$.filter(D=>D.overflows[0]<=0).sort((D,B)=>D.overflows[1]-B.overflows[1])[0])==null?void 0:T.placement;if(!N)switch(p){case"bestFit":{var R;const D=(R=$.filter(B=>{if(z){const X=ne(B.placement);return X===w||X==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(X=>X>0).reduce((X,mt)=>X+mt,0)]).sort((B,X)=>B[1]-X[1])[0])==null?void 0:R[0];D&&(N=D);break}case"initialPlacement":N=l;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function Jo(t,o){return{top:t.top-o.height,right:t.right-o.width,bottom:t.bottom-o.height,left:t.left-o.width}}function Qo(t){return Ja.some(o=>t[o]>=0)}const pi=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(o){const{rects:n}=o,{strategy:s="referenceHidden",...r}=ie(t,o);switch(s){case"referenceHidden":{const a=await Te(o,{...r,elementContext:"reference"}),i=Jo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Qo(i)}}}case"escaped":{const a=await Te(o,{...r,altBoundary:!0}),i=Jo(a,n.floating);return{data:{escapedOffsets:i,escaped:Qo(i)}}}default:return{}}}}},en=new Set(["left","top"]);async function ui(t,o){const{placement:n,platform:s,elements:r}=t,a=await(s.isRTL==null?void 0:s.isRTL(r.floating)),i=le(n),l=Se(n),d=ne(n)==="y",c=en.has(i)?-1:1,f=a&&d?-1:1,u=ie(o,t);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),d?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const mi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var n,s;const{x:r,y:a,placement:i,middlewareData:l}=o,d=await ui(o,t);return i===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+d.x,y:a+d.y,data:{...d,placement:i}}}}},hi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:n,y:s,placement:r}=o,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:g=>{let{x,y:w}=g;return{x,y:w}}},...d}=ie(t,o),c={x:n,y:s},f=await Te(o,d),u=ne(le(r)),m=$t(u);let p=c[m],h=c[u];if(a){const g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=p+f[g],k=p-f[x];p=Mt(w,p,k)}if(i){const g=u==="y"?"top":"left",x=u==="y"?"bottom":"right",w=h+f[g],k=h-f[x];h=Mt(w,h,k)}const y=l.fn({...o,[m]:p,[u]:h});return{...y,data:{x:y.x-n,y:y.y-s,enabled:{[m]:a,[u]:i}}}}}},yi=function(t){return t===void 0&&(t={}),{options:t,fn(o){const{x:n,y:s,placement:r,rects:a,middlewareData:i}=o,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=ie(t,o),f={x:n,y:s},u=ne(r),m=$t(u);let p=f[m],h=f[u];const y=ie(l,o),g=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const k=m==="y"?"height":"width",I=a.reference[m]-a.floating[k]+g.mainAxis,S=a.reference[m]+a.reference[k]-g.mainAxis;p<I?p=I:p>S&&(p=S)}if(c){var x,w;const k=m==="y"?"width":"height",I=en.has(le(r)),S=a.reference[u]-a.floating[k]+(I&&((x=i.offset)==null?void 0:x[u])||0)+(I?0:g.crossAxis),z=a.reference[u]+a.reference[k]+(I?0:((w=i.offset)==null?void 0:w[u])||0)-(I?g.crossAxis:0);h<S?h=S:h>z&&(h=z)}return{[m]:p,[u]:h}}}},gi=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){var n,s;const{placement:r,rects:a,platform:i,elements:l}=o,{apply:d=()=>{},...c}=ie(t,o),f=await Te(o,c),u=le(r),m=Se(r),p=ne(r)==="y",{width:h,height:y}=a.floating;let g,x;u==="top"||u==="bottom"?(g=u,x=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=u,g=m==="end"?"top":"bottom");const w=y-f.top-f.bottom,k=h-f.left-f.right,I=he(y-f[g],w),S=he(h-f[x],k),z=!o.middlewareData.shift;let E=I,C=S;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(C=k),(s=o.middlewareData.shift)!=null&&s.enabled.y&&(E=w),z&&!m){const $=K(f.left,0),F=K(f.right,0),T=K(f.top,0),R=K(f.bottom,0);p?C=h-2*($!==0||F!==0?$+F:K(f.left,f.right)):E=y-2*(T!==0||R!==0?T+R:K(f.top,f.bottom))}await d({...o,availableWidth:C,availableHeight:E});const O=await i.getDimensions(l.floating);return h!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function rt(){return typeof window<"u"}function be(t){return Rt(t)?(t.nodeName||"").toLowerCase():"#document"}function G(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function se(t){var o;return(o=(Rt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Rt(t){return rt()?t instanceof Node||t instanceof G(t).Node:!1}function ee(t){return rt()?t instanceof Element||t instanceof G(t).Element:!1}function re(t){return rt()?t instanceof HTMLElement||t instanceof G(t).HTMLElement:!1}function tn(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof G(t).ShadowRoot}const xi=new Set(["inline","contents"]);function De(t){const{overflow:o,overflowX:n,overflowY:s,display:r}=te(t);return/auto|scroll|overlay|hidden|clip/.test(o+s+n)&&!xi.has(r)}const bi=new Set(["table","td","th"]);function wi(t){return bi.has(be(t))}const ki=[":popover-open",":modal"];function at(t){return ki.some(o=>{try{return t.matches(o)}catch{return!1}})}const Ci=["transform","translate","scale","rotate","perspective"],Ei=["transform","translate","scale","rotate","perspective","filter"],Si=["paint","layout","strict","content"];function Lt(t){const o=qt(),n=ee(t)?te(t):t;return Ci.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||Ei.some(s=>(n.willChange||"").includes(s))||Si.some(s=>(n.contain||"").includes(s))}function zi(t){let o=ye(t);for(;re(o)&&!ze(o);){if(Lt(o))return o;if(at(o))return null;o=ye(o)}return null}function qt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _i=new Set(["html","body","#document"]);function ze(t){return _i.has(be(t))}function te(t){return G(t).getComputedStyle(t)}function it(t){return ee(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ye(t){if(be(t)==="html")return t;const o=t.assignedSlot||t.parentNode||tn(t)&&t.host||se(t);return tn(o)?o.host:o}function on(t){const o=ye(t);return ze(o)?t.ownerDocument?t.ownerDocument.body:t.body:re(o)&&De(o)?o:on(o)}function Fe(t,o,n){var s;o===void 0&&(o=[]),n===void 0&&(n=!0);const r=on(t),a=r===((s=t.ownerDocument)==null?void 0:s.body),i=G(r);if(a){const l=Wt(i);return o.concat(i,i.visualViewport||[],De(r)?r:[],l&&n?Fe(l):[])}return o.concat(r,Fe(r,[],n))}function Wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function nn(t){const o=te(t);let n=parseFloat(o.width)||0,s=parseFloat(o.height)||0;const r=re(t),a=r?t.offsetWidth:n,i=r?t.offsetHeight:s,l=tt(n)!==a||tt(s)!==i;return l&&(n=a,s=i),{width:n,height:s,$:l}}function jt(t){return ee(t)?t:t.contextElement}function _e(t){const o=jt(t);if(!re(o))return oe(1);const n=o.getBoundingClientRect(),{width:s,height:r,$:a}=nn(o);let i=(a?tt(n.width):n.width)/s,l=(a?tt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Bi=oe(0);function sn(t){const o=G(t);return!qt()||!o.visualViewport?Bi:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function vi(t,o,n){return o===void 0&&(o=!1),!n||o&&n!==G(t)?!1:o}function we(t,o,n,s){o===void 0&&(o=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),a=jt(t);let i=oe(1);o&&(s?ee(s)&&(i=_e(s)):i=_e(t));const l=vi(a,n,s)?sn(a):oe(0);let d=(r.left+l.x)/i.x,c=(r.top+l.y)/i.y,f=r.width/i.x,u=r.height/i.y;if(a){const m=G(a),p=s&&ee(s)?G(s):s;let h=m,y=Wt(h);for(;y&&s&&p!==h;){const g=_e(y),x=y.getBoundingClientRect(),w=te(y),k=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*g.x,I=x.top+(y.clientTop+parseFloat(w.paddingTop))*g.y;d*=g.x,c*=g.y,f*=g.x,u*=g.y,d+=k,c+=I,h=G(y),y=Wt(h)}}return st({width:f,height:u,x:d,y:c})}function lt(t,o){const n=it(t).scrollLeft;return o?o.left+n:we(se(t)).left+n}function rn(t,o){const n=t.getBoundingClientRect(),s=n.left+o.scrollLeft-lt(t,n),r=n.top+o.scrollTop;return{x:s,y:r}}function Vi(t){let{elements:o,rect:n,offsetParent:s,strategy:r}=t;const a=r==="fixed",i=se(s),l=o?at(o.floating):!1;if(s===i||l&&a)return n;let d={scrollLeft:0,scrollTop:0},c=oe(1);const f=oe(0),u=re(s);if((u||!u&&!a)&&((be(s)!=="body"||De(i))&&(d=it(s)),re(s))){const p=we(s);c=_e(s),f.x=p.x+s.clientLeft,f.y=p.y+s.clientTop}const m=i&&!u&&!a?rn(i,d):oe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-d.scrollTop*c.y+f.y+m.y}}function Pi(t){return Array.from(t.getClientRects())}function Ii(t){const o=se(t),n=it(t),s=t.ownerDocument.body,r=K(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),a=K(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let i=-n.scrollLeft+lt(t);const l=-n.scrollTop;return te(s).direction==="rtl"&&(i+=K(o.clientWidth,s.clientWidth)-r),{width:r,height:a,x:i,y:l}}const an=25;function Ni(t,o){const n=G(t),s=se(t),r=n.visualViewport;let a=s.clientWidth,i=s.clientHeight,l=0,d=0;if(r){a=r.width,i=r.height;const f=qt();(!f||f&&o==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const c=lt(s);if(c<=0){const f=s.ownerDocument,u=f.body,m=getComputedStyle(u),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(s.clientWidth-u.clientWidth-p);h<=an&&(a-=h)}else c<=an&&(a+=c);return{width:a,height:i,x:l,y:d}}const Oi=new Set(["absolute","fixed"]);function Ai(t,o){const n=we(t,!0,o==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,a=re(t)?_e(t):oe(1),i=t.clientWidth*a.x,l=t.clientHeight*a.y,d=r*a.x,c=s*a.y;return{width:i,height:l,x:d,y:c}}function ln(t,o,n){let s;if(o==="viewport")s=Ni(t,n);else if(o==="document")s=Ii(se(t));else if(ee(o))s=Ai(o,n);else{const r=sn(t);s={x:o.x-r.x,y:o.y-r.y,width:o.width,height:o.height}}return st(s)}function dn(t,o){const n=ye(t);return n===o||!ee(n)||ze(n)?!1:te(n).position==="fixed"||dn(n,o)}function Mi(t,o){const n=o.get(t);if(n)return n;let s=Fe(t,[],!1).filter(l=>ee(l)&&be(l)!=="body"),r=null;const a=te(t).position==="fixed";let i=a?ye(t):t;for(;ee(i)&&!ze(i);){const l=te(i),d=Lt(i);!d&&l.position==="fixed"&&(r=null),(a?!d&&!r:!d&&l.position==="static"&&!!r&&Oi.has(r.position)||De(i)&&!d&&dn(t,i))?s=s.filter(f=>f!==i):r=l,i=ye(i)}return o.set(t,s),s}function $i(t){let{element:o,boundary:n,rootBoundary:s,strategy:r}=t;const i=[...n==="clippingAncestors"?at(o)?[]:Mi(o,this._c):[].concat(n),s],l=i[0],d=i.reduce((c,f)=>{const u=ln(o,f,r);return c.top=K(u.top,c.top),c.right=he(u.right,c.right),c.bottom=he(u.bottom,c.bottom),c.left=K(u.left,c.left),c},ln(o,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ti(t){const{width:o,height:n}=nn(t);return{width:o,height:n}}function Di(t,o,n){const s=re(o),r=se(o),a=n==="fixed",i=we(t,!0,a,o);let l={scrollLeft:0,scrollTop:0};const d=oe(0);function c(){d.x=lt(r)}if(s||!s&&!a)if((be(o)!=="body"||De(r))&&(l=it(o)),s){const p=we(o,!0,a,o);d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}else r&&c();a&&!s&&r&&c();const f=r&&!s&&!a?rn(r,l):oe(0),u=i.left+l.scrollLeft-d.x-f.x,m=i.top+l.scrollTop-d.y-f.y;return{x:u,y:m,width:i.width,height:i.height}}function Ut(t){return te(t).position==="static"}function cn(t,o){if(!re(t)||te(t).position==="fixed")return null;if(o)return o(t);let n=t.offsetParent;return se(t)===n&&(n=n.ownerDocument.body),n}function fn(t,o){const n=G(t);if(at(t))return n;if(!re(t)){let r=ye(t);for(;r&&!ze(r);){if(ee(r)&&!Ut(r))return r;r=ye(r)}return n}let s=cn(t,o);for(;s&&wi(s)&&Ut(s);)s=cn(s,o);return s&&ze(s)&&Ut(s)&&!Lt(s)?n:s||zi(t)||n}const Fi=async function(t){const o=this.getOffsetParent||fn,n=this.getDimensions,s=await n(t.floating);return{reference:Di(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Ri(t){return te(t).direction==="rtl"}const Li={convertOffsetParentRelativeRectToViewportRelativeRect:Vi,getDocumentElement:se,getClippingRect:$i,getOffsetParent:fn,getElementRects:Fi,getClientRects:Pi,getDimensions:Ti,getScale:_e,isElement:ee,isRTL:Ri};function pn(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function qi(t,o){let n=null,s;const r=se(t);function a(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function i(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),a();const c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:p}=c;if(l||o(),!m||!p)return;const h=ot(u),y=ot(r.clientWidth-(f+m)),g=ot(r.clientHeight-(u+p)),x=ot(f),k={rootMargin:-h+"px "+-y+"px "+-g+"px "+-x+"px",threshold:K(0,he(1,d))||1};let I=!0;function S(z){const E=z[0].intersectionRatio;if(E!==d){if(!I)return i();E?i(!1,E):s=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!pn(c,t.getBoundingClientRect())&&i(),I=!1}try{n=new IntersectionObserver(S,{...k,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,k)}n.observe(t)}return i(!0),a}function Wi(t,o,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,c=jt(t),f=r||a?[...c?Fe(c):[],...Fe(o)]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const u=c&&l?qi(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&p&&(p.unobserve(o),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(o)})),n()}),c&&!d&&p.observe(c),p.observe(o));let h,y=d?we(t):null;d&&g();function g(){const x=we(t);y&&!pn(y,x)&&n(),y=x,h=requestAnimationFrame(g)}return n(),()=>{var x;f.forEach(w=>{r&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),u?.(),(x=p)==null||x.disconnect(),p=null,d&&cancelAnimationFrame(h)}}const ji=mi,Ui=hi,un=fi,Hi=gi,Ki=pi,Gi=ci,Xi=yi,Yi=(t,o,n)=>{const s=new Map,r={platform:Li,...n},a={...r.platform,_c:s};return di(t,o,{...r,platform:a})};function Zi(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ht(t){if(Zi(t)){const o=t.$el;return Rt(o)&&be(o)==="#comment"?null:o}return t}function Be(t){return typeof t=="function"?t():e.unref(t)}function Ji(t){return{name:"arrow",options:t,fn(o){const n=Ht(Be(t.element));return n==null?{}:Gi({element:n,padding:t.padding}).fn(o)}}}function mn(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(t,o){const n=mn(t);return Math.round(o*n)/n}function Qi(t,o,n){n===void 0&&(n={});const s=n.whileElementsMounted,r=e.computed(()=>{var E;return(E=Be(n.open))!=null?E:!0}),a=e.computed(()=>Be(n.middleware)),i=e.computed(()=>{var E;return(E=Be(n.placement))!=null?E:"bottom"}),l=e.computed(()=>{var E;return(E=Be(n.strategy))!=null?E:"absolute"}),d=e.computed(()=>{var E;return(E=Be(n.transform))!=null?E:!0}),c=e.computed(()=>Ht(t.value)),f=e.computed(()=>Ht(o.value)),u=e.ref(0),m=e.ref(0),p=e.ref(l.value),h=e.ref(i.value),y=e.shallowRef({}),g=e.ref(!1),x=e.computed(()=>{const E={position:p.value,left:"0",top:"0"};if(!f.value)return E;const C=hn(f.value,u.value),O=hn(f.value,m.value);return d.value?{...E,transform:"translate("+C+"px, "+O+"px)",...mn(f.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:C+"px",top:O+"px"}});let w;function k(){if(c.value==null||f.value==null)return;const E=r.value;Yi(c.value,f.value,{middleware:a.value,placement:i.value,strategy:l.value}).then(C=>{u.value=C.x,m.value=C.y,p.value=C.strategy,h.value=C.placement,y.value=C.middlewareData,g.value=E!==!1})}function I(){typeof w=="function"&&(w(),w=void 0)}function S(){if(I(),s===void 0){k();return}if(c.value!=null&&f.value!=null){w=s(c.value,f.value,k);return}}function z(){r.value||(g.value=!1)}return e.watch([a,i,l,r],k,{flush:"sync"}),e.watch([c,f],S,{flush:"sync"}),e.watch(r,z,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(I),{x:e.shallowReadonly(u),y:e.shallowReadonly(m),strategy:e.shallowReadonly(p),placement:e.shallowReadonly(h),middlewareData:e.shallowReadonly(y),isPositioned:e.shallowReadonly(g),floatingStyles:x,update:k}}const el={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[pf,tl]=Me("PopperContent");var ol=e.defineComponent({inheritAttrs:!1,__name:"PopperContent",props:e.mergeDefaults({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...el}),emits:["placed"],setup(t,{emit:o}){const n=t,s=o,r=Ko(),{forwardRef:a,currentElement:i}=j(),l=e.ref(),d=e.ref(),{width:c,height:f}=oa(d),u=e.computed(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),m=e.computed(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),p=e.computed(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=e.computed(()=>({padding:m.value,boundary:p.value.filter(Ya),altBoundary:p.value.length>0})),y=e.computed(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=Vr(()=>[ji({mainAxis:n.sideOffset+f.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&un({...h.value,...y.value}),n.avoidCollisions&&Ui({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Xi():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&un({...h.value,...y.value}),Hi({...h.value,apply:({elements:T,rects:R,availableWidth:_,availableHeight:b})=>{const{width:N,height:D}=R.reference,B=T.floating.style;B.setProperty("--reka-popper-available-width",`${_}px`),B.setProperty("--reka-popper-available-height",`${b}px`),B.setProperty("--reka-popper-anchor-width",`${N}px`),B.setProperty("--reka-popper-anchor-height",`${D}px`)}}),d.value&&Ji({element:d.value,padding:n.arrowPadding}),Za({arrowWidth:c.value,arrowHeight:f.value}),n.hideWhenDetached&&Ki({strategy:"referenceHidden",...h.value})]),x=e.computed(()=>n.reference??r.anchor.value),{floatingStyles:w,placement:k,isPositioned:I,middlewareData:S}=Qi(x,l,{strategy:n.positionStrategy,placement:u,whileElementsMounted:(...T)=>Wi(...T,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),z=e.computed(()=>At(k.value)[0]),E=e.computed(()=>At(k.value)[1]);e.watchPostEffect(()=>{I.value&&s("placed")});const C=e.computed(()=>S.value.arrow?.centerOffset!==0),O=e.ref("");e.watchEffect(()=>{i.value&&(O.value=window.getComputedStyle(i.value).zIndex)});const $=e.computed(()=>S.value.arrow?.x??0),F=e.computed(()=>S.value.arrow?.y??0);return tl({placedSide:z,onArrowChange:T=>d.value=T,arrowX:$,arrowY:F,shouldHideArrow:C}),(T,R)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"floatingRef",ref:l,"data-reka-popper-content-wrapper":"",style:e.normalizeStyle({...e.unref(w),transform:e.unref(I)?e.unref(w).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:O.value,"--reka-popper-transform-origin":[e.unref(S).transformOrigin?.x,e.unref(S).transformOrigin?.y].join(" "),...e.unref(S).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[e.createVNode(e.unref(Q),e.mergeProps({ref:e.unref(a)},T.$attrs,{"as-child":n.asChild,as:T.as,"data-side":z.value,"data-align":E.value,style:{animation:e.unref(I)?void 0:"none"}}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),nl=ol;const[Re,sl]=Me("PopoverRoot");var rl=e.defineComponent({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:o}){const n=t,s=o,{modal:r}=e.toRefs(n),a=No(n,"open",s,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=e.ref(),l=e.ref(!1);return sl({contentId:"",triggerId:"",modal:r,open:a,onOpenChange:d=>{a.value=d},onOpenToggle:()=>{a.value=!a.value},triggerElement:i,hasCustomAnchor:l}),(d,c)=>(e.openBlock(),e.createBlock(e.unref(Ka),null,{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{open:e.unref(a),close:()=>a.value=!1})]),_:3}))}}),al=rl,il=e.defineComponent({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=Vt(Ar(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:a}=j(),i=Re();return Yr(),(l,d)=>(e.openBlock(),e.createBlock(e.unref(jo),{"as-child":"",loop:"",trapped:l.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>s("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>s("closeAutoFocus",c))},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo),{"as-child":"","disable-outside-pointer-events":l.disableOutsidePointerEvents,onPointerDownOutside:d[0]||(d[0]=c=>s("pointerDownOutside",c)),onInteractOutside:d[1]||(d[1]=c=>s("interactOutside",c)),onEscapeKeyDown:d[2]||(d[2]=c=>s("escapeKeyDown",c)),onFocusOutside:d[3]||(d[3]=c=>s("focusOutside",c)),onDismiss:d[4]||(d[4]=c=>e.unref(i).onOpenChange(!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(nl),e.mergeProps(e.unref(r),{id:e.unref(i).contentId,ref:e.unref(a),"data-state":e.unref(i).open.value?"open":"closed","aria-labelledby":e.unref(i).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),yn=il,ll=e.defineComponent({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=Re(),a=e.ref(!1);Oo(!0);const i=xe(n,s),{forwardRef:l,currentElement:d}=j();return To(d),(c,f)=>(e.openBlock(),e.createBlock(yn,e.mergeProps(e.unref(i),{ref:e.unref(l),"trap-focus":e.unref(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:f[0]||(f[0]=e.withModifiers(u=>{s("closeAutoFocus",u),a.value||e.unref(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:f[1]||(f[1]=u=>{s("pointerDownOutside",u);const m=u.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,h=m.button===2||p;a.value=h}),onFocusOutside:f[2]||(f[2]=e.withModifiers(()=>{},["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),dl=ll,cl=e.defineComponent({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=Re(),a=e.ref(!1),i=e.ref(!1),l=xe(n,s);return(d,c)=>(e.openBlock(),e.createBlock(yn,e.mergeProps(e.unref(l),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=f=>{s("closeAutoFocus",f),f.defaultPrevented||(a.value||e.unref(r).triggerElement.value?.focus(),f.preventDefault()),a.value=!1,i.value=!1}),onInteractOutside:c[1]||(c[1]=async f=>{s("interactOutside",f),f.defaultPrevented||(a.value=!0,f.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const u=f.target;e.unref(r).triggerElement.value?.contains(u)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&i.value&&f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16))}}),fl=cl,pl=e.defineComponent({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=Re(),a=xe(n,s),{forwardRef:i}=j();return r.contentId||=Qe(void 0,"reka-popover-content"),(l,d)=>(e.openBlock(),e.createBlock(e.unref(It),{present:l.forceMount||e.unref(r).open.value},{default:e.withCtx(()=>[e.unref(r).modal.value?(e.openBlock(),e.createBlock(dl,e.mergeProps({key:0},e.unref(a),{ref:e.unref(i)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createBlock(fl,e.mergeProps({key:1},e.unref(a),{ref:e.unref(i)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),ul=pl,ml=e.defineComponent({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createBlock(e.unref(Ho),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),hl=ml,yl=e.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,n=Re(),{forwardRef:s,currentElement:r}=j();return n.triggerId||=Qe(void 0,"reka-popover-trigger"),e.onMounted(()=>{n.triggerElement.value=r.value}),(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n).hasCustomAnchor.value?e.unref(Q):e.unref(Xa)),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Q),{id:e.unref(n).triggerId,ref:e.unref(s),type:a.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":e.unref(n).open.value,"aria-controls":e.unref(n).contentId,"data-state":e.unref(n).open.value?"open":"closed",as:a.as,"as-child":o.asChild,onClick:e.unref(n).onOpenToggle},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),gl=yl,xl=e.defineComponent({__name:"Label",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"label"}},setup(t){const o=t;return j(),(n,s)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{onMousedown:s[0]||(s[0]=r=>{!r.defaultPrevented&&r.detail>1&&r.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),bl=xl;const wl=(t,o)=>{const n=new Array(t.length+o.length);for(let s=0;s<t.length;s++)n[s]=t[s];for(let s=0;s<o.length;s++)n[t.length+s]=o[s];return n},kl=(t,o)=>({classGroupId:t,validator:o}),gn=(t=new Map,o=null,n)=>({nextPart:t,validators:o,classGroupId:n}),dt="-",xn=[],Cl="arbitrary..",El=t=>{const o=zl(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Sl(i);const l=i.split(dt),d=l[0]===""&&l.length>1?1:0;return bn(l,d,o)},getConflictingClassGroupIds:(i,l)=>{if(l){const d=s[i],c=n[i];return d?c?wl(c,d):d:c||xn}return n[i]||xn}}},bn=(t,o,n)=>{if(t.length-o===0)return n.classGroupId;const r=t[o],a=n.nextPart.get(r);if(a){const c=bn(t,o+1,a);if(c)return c}const i=n.validators;if(i===null)return;const l=o===0?t.join(dt):t.slice(o).join(dt),d=i.length;for(let c=0;c<d;c++){const f=i[c];if(f.validator(l))return f.classGroupId}},Sl=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=t.slice(1,-1),n=o.indexOf(":"),s=o.slice(0,n);return s?Cl+s:void 0})(),zl=t=>{const{theme:o,classGroups:n}=t;return _l(n,o)},_l=(t,o)=>{const n=gn();for(const s in t){const r=t[s];Kt(r,n,s,o)}return n},Kt=(t,o,n,s)=>{const r=t.length;for(let a=0;a<r;a++){const i=t[a];Bl(i,o,n,s)}},Bl=(t,o,n,s)=>{if(typeof t=="string"){vl(t,o,n);return}if(typeof t=="function"){Vl(t,o,n,s);return}Pl(t,o,n,s)},vl=(t,o,n)=>{const s=t===""?o:wn(o,t);s.classGroupId=n},Vl=(t,o,n,s)=>{if(Il(t)){Kt(t(s),o,n,s);return}o.validators===null&&(o.validators=[]),o.validators.push(kl(n,t))},Pl=(t,o,n,s)=>{const r=Object.entries(t),a=r.length;for(let i=0;i<a;i++){const[l,d]=r[i];Kt(d,wn(o,l),n,s)}},wn=(t,o)=>{let n=t;const s=o.split(dt),r=s.length;for(let a=0;a<r;a++){const i=s[a];let l=n.nextPart.get(i);l||(l=gn(),n.nextPart.set(i,l)),n=l}return n},Il=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Nl=t=>{if(t<1)return{get:()=>{},set:()=>{}};let o=0,n=Object.create(null),s=Object.create(null);const r=(a,i)=>{n[a]=i,o++,o>t&&(o=0,s=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=s[a])!==void 0)return r(a,i),i},set(a,i){a in n?n[a]=i:r(a,i)}}},Gt="!",kn=":",Ol=[],Cn=(t,o,n,s,r)=>({modifiers:t,hasImportantModifier:o,baseClassName:n,maybePostfixModifierPosition:s,isExternal:r}),Al=t=>{const{prefix:o,experimentalParseClassName:n}=t;let s=r=>{const a=[];let i=0,l=0,d=0,c;const f=r.length;for(let y=0;y<f;y++){const g=r[y];if(i===0&&l===0){if(g===kn){a.push(r.slice(d,y)),d=y+1;continue}if(g==="/"){c=y;continue}}g==="["?i++:g==="]"?i--:g==="("?l++:g===")"&&l--}const u=a.length===0?r:r.slice(d);let m=u,p=!1;u.endsWith(Gt)?(m=u.slice(0,-1),p=!0):u.startsWith(Gt)&&(m=u.slice(1),p=!0);const h=c&&c>d?c-d:void 0;return Cn(a,p,m,h)};if(o){const r=o+kn,a=s;s=i=>i.startsWith(r)?a(i.slice(r.length)):Cn(Ol,!1,i,void 0,!0)}if(n){const r=s;s=a=>n({className:a,parseClassName:r})}return s},Ml=t=>{const o=new Map;return t.orderSensitiveModifiers.forEach((n,s)=>{o.set(n,1e6+s)}),n=>{const s=[];let r=[];for(let a=0;a<n.length;a++){const i=n[a],l=i[0]==="[",d=o.has(i);l||d?(r.length>0&&(r.sort(),s.push(...r),r=[]),s.push(i)):r.push(i)}return r.length>0&&(r.sort(),s.push(...r)),s}},$l=t=>({cache:Nl(t.cacheSize),parseClassName:Al(t),sortModifiers:Ml(t),...El(t)}),Tl=/\s+/,Dl=(t,o)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r,sortModifiers:a}=o,i=[],l=t.trim().split(Tl);let d="";for(let c=l.length-1;c>=0;c-=1){const f=l[c],{isExternal:u,modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:y}=n(f);if(u){d=f+(d.length>0?" "+d:d);continue}let g=!!y,x=s(g?h.substring(0,y):h);if(!x){if(!g){d=f+(d.length>0?" "+d:d);continue}if(x=s(h),!x){d=f+(d.length>0?" "+d:d);continue}g=!1}const w=m.length===0?"":m.length===1?m[0]:a(m).join(":"),k=p?w+Gt:w,I=k+x;if(i.indexOf(I)>-1)continue;i.push(I);const S=r(x,g);for(let z=0;z<S.length;++z){const E=S[z];i.push(k+E)}d=f+(d.length>0?" "+d:d)}return d},Fl=(...t)=>{let o=0,n,s,r="";for(;o<t.length;)(n=t[o++])&&(s=En(n))&&(r&&(r+=" "),r+=s);return r},En=t=>{if(typeof t=="string")return t;let o,n="";for(let s=0;s<t.length;s++)t[s]&&(o=En(t[s]))&&(n&&(n+=" "),n+=o);return n},Rl=(t,...o)=>{let n,s,r,a;const i=d=>{const c=o.reduce((f,u)=>u(f),t());return n=$l(c),s=n.cache.get,r=n.cache.set,a=l,l(d)},l=d=>{const c=s(d);if(c)return c;const f=Dl(d,n);return r(d,f),f};return a=i,(...d)=>a(Fl(...d))},Ll=[],L=t=>{const o=n=>n[t]||Ll;return o.isThemeGetter=!0,o},Sn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ql=/^\d+\/\d+$/,Wl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ul=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Kl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ve=t=>ql.test(t),A=t=>!!t&&!Number.isNaN(Number(t)),ge=t=>!!t&&Number.isInteger(Number(t)),Xt=t=>t.endsWith("%")&&A(t.slice(0,-1)),de=t=>Wl.test(t),Gl=()=>!0,Xl=t=>jl.test(t)&&!Ul.test(t),_n=()=>!1,Yl=t=>Hl.test(t),Zl=t=>Kl.test(t),Jl=t=>!v(t)&&!V(t),Ql=t=>Ve(t,In,_n),v=t=>Sn.test(t),ke=t=>Ve(t,Nn,Xl),Yt=t=>Ve(t,sd,A),Bn=t=>Ve(t,Vn,_n),ed=t=>Ve(t,Pn,Zl),ct=t=>Ve(t,On,Yl),V=t=>zn.test(t),Le=t=>Pe(t,Nn),td=t=>Pe(t,rd),vn=t=>Pe(t,Vn),od=t=>Pe(t,In),nd=t=>Pe(t,Pn),ft=t=>Pe(t,On,!0),Ve=(t,o,n)=>{const s=Sn.exec(t);return s?s[1]?o(s[1]):n(s[2]):!1},Pe=(t,o,n=!1)=>{const s=zn.exec(t);return s?s[1]?o(s[1]):n:!1},Vn=t=>t==="position"||t==="percentage",Pn=t=>t==="image"||t==="url",In=t=>t==="length"||t==="size"||t==="bg-size",Nn=t=>t==="length",sd=t=>t==="number",rd=t=>t==="family-name",On=t=>t==="shadow",ad=Rl(()=>{const t=L("color"),o=L("font"),n=L("text"),s=L("font-weight"),r=L("tracking"),a=L("leading"),i=L("breakpoint"),l=L("container"),d=L("spacing"),c=L("radius"),f=L("shadow"),u=L("inset-shadow"),m=L("text-shadow"),p=L("drop-shadow"),h=L("blur"),y=L("perspective"),g=L("aspect"),x=L("ease"),w=L("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...I(),V,v],z=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],C=()=>[V,v,d],O=()=>[ve,"full","auto",...C()],$=()=>[ge,"none","subgrid",V,v],F=()=>["auto",{span:["full",ge,V,v]},ge,V,v],T=()=>[ge,"auto",V,v],R=()=>["auto","min","max","fr",V,v],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],b=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...C()],D=()=>[ve,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[t,V,v],X=()=>[...I(),vn,Bn,{position:[V,v]}],mt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Zn=()=>["auto","cover","contain",od,Ql,{size:[V,v]}],to=()=>[Xt,Le,ke],U=()=>["","none","full",c,V,v],Y=()=>["",A,Le,ke],ht=()=>["solid","dashed","dotted","double"],Jn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[A,Xt,vn,Bn],Qn=()=>["","none",h,V,v],yt=()=>["none",A,V,v],gt=()=>["none",A,V,v],oo=()=>[A,V,v],xt=()=>[ve,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[de],breakpoint:[de],color:[Gl],container:[de],"drop-shadow":[de],ease:["in","out","in-out"],font:[Jl],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[de],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[de],shadow:[de],spacing:["px",A],text:[de],"text-shadow":[de],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ve,v,V,g]}],container:["container"],columns:[{columns:[A,v,V,l]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[ge,"auto",V,v]}],basis:[{basis:[ve,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[A,ve,"auto","initial","none",v]}],grow:[{grow:["",A,V,v]}],shrink:[{shrink:["",A,V,v]}],order:[{order:[ge,"first","last","none",V,v]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...b(),"normal"]}],"justify-self":[{"justify-self":["auto",...b()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...b(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...b(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...b(),"baseline"]}],"place-self":[{"place-self":["auto",...b()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[l,"screen",...D()]}],"min-w":[{"min-w":[l,"screen","none",...D()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,Le,ke]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,V,Yt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xt,v]}],"font-family":[{font:[td,v,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,V,v]}],"line-clamp":[{"line-clamp":[A,"none",V,Yt]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",V,v]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",V,v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ht(),"wavy"]}],"text-decoration-thickness":[{decoration:[A,"from-font","auto",V,ke]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[A,"auto",V,v]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",V,v]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",V,v]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:mt()}],"bg-size":[{bg:Zn()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ge,V,v],radial:["",V,v],conic:[ge,V,v]},nd,ed]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:to()}],"gradient-via-pos":[{via:to()}],"gradient-to-pos":[{to:to()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ht(),"hidden","none"]}],"divide-style":[{divide:[...ht(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ht(),"none","hidden"]}],"outline-offset":[{"outline-offset":[A,V,v]}],"outline-w":[{outline:["",A,Le,ke]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",f,ft,ct]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",u,ft,ct]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[A,ke]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,ft,ct]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[A,V,v]}],"mix-blend":[{"mix-blend":[...Jn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Jn()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[A]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[V,v]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[A]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:mt()}],"mask-size":[{mask:Zn()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",V,v]}],filter:[{filter:["","none",V,v]}],blur:[{blur:Qn()}],brightness:[{brightness:[A,V,v]}],contrast:[{contrast:[A,V,v]}],"drop-shadow":[{"drop-shadow":["","none",p,ft,ct]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",A,V,v]}],"hue-rotate":[{"hue-rotate":[A,V,v]}],invert:[{invert:["",A,V,v]}],saturate:[{saturate:[A,V,v]}],sepia:[{sepia:["",A,V,v]}],"backdrop-filter":[{"backdrop-filter":["","none",V,v]}],"backdrop-blur":[{"backdrop-blur":Qn()}],"backdrop-brightness":[{"backdrop-brightness":[A,V,v]}],"backdrop-contrast":[{"backdrop-contrast":[A,V,v]}],"backdrop-grayscale":[{"backdrop-grayscale":["",A,V,v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[A,V,v]}],"backdrop-invert":[{"backdrop-invert":["",A,V,v]}],"backdrop-opacity":[{"backdrop-opacity":[A,V,v]}],"backdrop-saturate":[{"backdrop-saturate":[A,V,v]}],"backdrop-sepia":[{"backdrop-sepia":["",A,V,v]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",V,v]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[A,"initial",V,v]}],ease:[{ease:["linear","initial",x,V,v]}],delay:[{delay:[A,V,v]}],animate:[{animate:["none",w,V,v]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,V,v]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:yt()}],"rotate-x":[{"rotate-x":yt()}],"rotate-y":[{"rotate-y":yt()}],"rotate-z":[{"rotate-z":yt()}],scale:[{scale:gt()}],"scale-x":[{"scale-x":gt()}],"scale-y":[{"scale-y":gt()}],"scale-z":[{"scale-z":gt()}],"scale-3d":["scale-3d"],skew:[{skew:oo()}],"skew-x":[{"skew-x":oo()}],"skew-y":[{"skew-y":oo()}],transform:[{transform:[V,v,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xt()}],"translate-x":[{"translate-x":xt()}],"translate-y":[{"translate-y":xt()}],"translate-z":[{"translate-z":xt()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",V,v]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",V,v]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[A,Le,ke,Yt]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ce(...t){return ad(So(t))}const M=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createBlock(e.unref(Q),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(ce)(e.unref(id)({variant:t.variant,size:t.size}),o.class))},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),id=Br("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-ma-primary-500/50",{variants:{variant:{default:"bg-ma-primary-400 text-white hover:bg-ma-primary-600",destructive:"bg-ma-red-400 text-white hover:bg-ma-red-700",outline:"border border-ma-grey-400 bg-ma-grey-100 shadow-xs hover:bg-ma-grey-300 text-ma-text-01",secondary:"bg-ma-grey-300 text-ma-text-01 hover:bg-ma-grey-400",ghost:"hover:bg-ma-grey-300 text-ma-text-01",link:"text-ma-primary-500 underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),An=e.defineComponent({__name:"SidebarToggle",props:{isCollapsed:{type:Boolean},side:{default:"left"}},emits:["toggle"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"sidebar-toggle",class:e.normalizeClass(["absolute top-3 z-10 bg-ma-grey-100 border border-ma-grey-300 shadow-sm",t.side==="left"?"left-3":"right-3"]),title:`Toggle ${t.side} sidebar`,onClick:n[0]||(n[0]=s=>o.$emit("toggle"))},{default:e.withCtx(()=>[t.side==="left"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.isCollapsed?(e.openBlock(),e.createBlock(e.unref(Hs),{key:1,class:"w-5 h-5 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Us),{key:0,class:"w-5 h-5 text-ma-text-01"}))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.isCollapsed?(e.openBlock(),e.createBlock(e.unref(Gs),{key:1,class:"w-5 h-5 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Ks),{key:0,class:"w-5 h-5 text-ma-text-01"}))],64))]),_:1},8,["class","title"]))}}),Mn=()=>({saveToFile:n=>{const s=JSON.stringify(n,null,2),r=new Blob([s],{type:"application/json"}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download="canvas.json",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)},loadFromFile:n=>new Promise((s,r)=>{const a=new FileReader;a.onload=i=>{try{const l=i.target?.result;s(JSON.parse(l))}catch(l){r(l)}},a.onerror=()=>r(a.error),a.readAsText(n)})}),ld=e.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const r=xe(t,o);return(a,i)=>(e.openBlock(),e.createBlock(e.unref(al),e.normalizeProps(e.guardReactiveProps(e.unref(r))),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}}),dd=e.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const o=t;return(n,s)=>(e.openBlock(),e.createBlock(e.unref(gl),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),cd=e.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:"center"},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=o,r=e.computed(()=>{const{class:i,...l}=n;return l}),a=xe(r,s);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(hl),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ul),e.mergeProps({...e.unref(a),...i.$attrs},{class:e.unref(ce)("z-50 w-72 rounded-md border bg-white p-4 text-slate-950 shadow-md outline-none 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-slate-950 dark:text-slate-50",n.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fd={key:0,class:"text-sm text-ma-text-01"},pd={class:"flex items-center justify-between p-3 border-b border-ma-grey-300 bg-transparent"},ud={class:"flex items-center gap-2.5"},md={class:"shadow-sm border border-ma-grey-300 bg-ma-grey-100 p-1 rounded-lg"},hd={class:"p-2 grid grid-cols-5 gap-1 max-h-[60vh] overflow-y-auto custom-scrollbar"},yd=e.defineComponent({__name:"IconPicker",props:{collapsed:{type:Boolean}},setup(t){const o=W(),n=s=>{o.addIcon(s)};return(s,r)=>(e.openBlock(),e.createBlock(e.unref(ld),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dd),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(["gap-2 text-ma-text-01",t.collapsed?"w-10 h-10 p-0 ml-1 justify-center":"w-full h-9 px-2 justify-start"]),title:"Icons"},{default:e.withCtx(()=>[e.createVNode(e.unref(yo),{style:e.normalizeStyle({color:e.unref(ae)}),class:e.normalizeClass(["text-ma-text-01",(t.collapsed,"w-4 h-4")])},null,8,["style","class"]),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",fd,"Icons"))]),_:1},8,["class"])]),_:1}),e.createVNode(e.unref(cd),{class:"p-0 shadow-xl border border-ma-grey-300 bg-ma-grey-100 rounded-xl overflow-hidden flex flex-col",align:"start",side:"right","side-offset":10,style:{width:"270px"}},{default:e.withCtx(()=>[e.createElementVNode("div",pd,[e.createElementVNode("div",ud,[e.createElementVNode("div",md,[e.createVNode(e.unref(yo),{class:"w-4 h-4 text-ma-text-02"})]),r[0]||(r[0]=e.createElementVNode("h3",{class:"text-sm font-semibold tracking-wide text-ma-text-01"}," Icons ",-1))])]),e.createElementVNode("div",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ko),(a,i)=>(e.openBlock(),e.createBlock(e.unref(M),{key:i,variant:"ghost",class:"h-9 w-9 p-0 hover:bg-toolbar-btn-bg-hover transition-colors rounded-lg flex items-center justify-center group",title:i,onClick:l=>n(i)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a),{class:"w-5 h-5 text-ma-text-02 group-hover:text-ma-text-01 transition-colors",style:{color:"inherit"}}))]),_:2},1032,["title","onClick"]))),128))])]),_:1})]),_:1}))}}),Zt=(t,o)=>{const n=t.__vccOpts||t;for(const[s,r]of o)n[s]=r;return n},$n=Zt(yd,[["__scopeId","data-v-23dc5d20"]]),gd={key:0,class:"capitalize"},Jt=e.defineComponent({__name:"ShapeButton",props:{shapeType:{},collapsed:{type:Boolean},customPoints:{},label:{}},setup(t){const o=t,n=Ge(),s=r=>{n.startDrag(o.shapeType,r,o.customPoints)};return(r,a)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"shape-button",variant:"ghost",size:t.collapsed?"icon-sm":"sm",class:e.normalizeClass(["cursor-grab w-full text-ma-text-01",t.collapsed?"justify-center":"justify-start"]),title:t.shapeType,onMousedown:s},{default:e.withCtx(()=>[e.createVNode(Xe,{width:24,height:24,"shape-type":t.shapeType,"custom-points":t.customPoints,"stroke-weight":1,outline:e.unref(ae),fill:e.unref(He),class:"pointer-events-none shrink-0"},null,8,["shape-type","custom-points","outline","fill"]),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(t.label||t.shapeType),1))]),_:1},8,["size","class","title"]))}}),xd={key:0,class:"w-full h-px bg-ma-grey-300 my-1"},bd={key:0},wd={key:0},Tn=e.defineComponent({__name:"SaveLoadButtons",props:{collapsed:{type:Boolean}},setup(t){const o=t,n=W(),{saveToFile:s,loadFromFile:r}=Mn(),a=e.ref(null),i=e.computed(()=>o.collapsed?"p-1 flex flex-col gap-1 items-center":"p-2 border-t border-ma-grey-300 flex gap-2 justify-between"),l=e.computed(()=>o.collapsed?"w-full h-10 gap-0 text-ma-text-01 hover:bg-ma-grey-200":"flex-1 h-9 gap-2 text-sm text-ma-text-01 hover:bg-ma-grey-200"),d=()=>{s(n.exportSnapshot())},c=()=>{a.value?.click()},f=async u=>{const m=u.target;if(m.files&&m.files.length>0){const p=m.files[0];if(p)try{const h=await r(p);n.importSnapshot(h)}catch(h){console.error("Failed to load file:",h),alert("Failed to load file. Please ensure it is a valid JSON file.")}finally{m.value=""}}};return(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(i.value)},[t.collapsed?(e.openBlock(),e.createElementBlock("div",xd)):e.createCommentVNode("",!0),e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(l.value),"data-testid":"save-button",title:"Save to JSON",onClick:d},{default:e.withCtx(()=>[e.createVNode(e.unref(Js),{class:"w-4 h-4 text-ma-text-01"}),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",bd,"Save"))]),_:1},8,["class"]),e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(l.value),"data-testid":"load-button",title:"Upload JSON",onClick:c},{default:e.withCtx(()=>[e.createVNode(e.unref(lr),{class:"w-4 h-4 text-ma-text-01"}),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",wd,"Load"))]),_:1},8,["class"]),e.createElementVNode("input",{ref_key:"fileInputRef",ref:a,type:"file",accept:".json",class:"hidden",onChange:f},null,544)],2))}}),Dn="darkMode";function kd(){const t=localStorage.getItem(Dn),o=e.ref(t==="true");return o.value&&document.documentElement.classList.add("dark-mode"),{isDark:o,toggle:()=>{o.value=!o.value,o.value?document.documentElement.classList.add("dark-mode"):document.documentElement.classList.remove("dark-mode"),localStorage.setItem(Dn,String(o.value))}}}const Fn=e.defineComponent({__name:"SidebarActions",props:{collapsed:{type:Boolean}},emits:["clear-all"],setup(t){const o=t,n=W(),{isDark:s,toggle:r}=kd(),a=e.computed(()=>o.collapsed?"p-2 border-t border-ma-grey-300 flex flex-col gap-1 items-center":"p-2 border-t border-ma-grey-300 flex gap-1 justify-between"),i=e.computed(()=>o.collapsed?"flex flex-col gap-1 items-center":"flex gap-1");return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(i.value)},[e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"undo-button",disabled:!e.unref(n).canUndo,title:"Undo",onClick:d[0]||(d[0]=c=>e.unref(n).undo())},{default:e.withCtx(()=>[e.createVNode(e.unref(ir),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"redo-button",disabled:!e.unref(n).canRedo,title:"Redo",onClick:d[1]||(d[1]=c=>e.unref(n).redo())},{default:e.withCtx(()=>[e.createVNode(e.unref(Ys),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"paste-button",disabled:!e.unref(n).hasCopiedElement,title:"Paste",onClick:d[2]||(d[2]=c=>e.unref(n).pasteElement())},{default:e.withCtx(()=>[e.createVNode(e.unref(Ss),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"clear-all-button",title:"Clear all",onClick:d[3]||(d[3]=c=>l.$emit("clear-all"))},{default:e.withCtx(()=>[e.createVNode(e.unref(go),{class:"w-4 h-4 text-ma-text-01"})]),_:1})],2),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"dark-mode-button",title:"Toggle dark mode",onClick:e.unref(r)},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(e.unref(or),{key:0,class:"w-4 h-4 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Ws),{key:1,class:"w-4 h-4 text-ma-text-01"}))]),_:1},8,["onClick"])],2))}}),Cd={key:0,class:"text-sm text-ma-text-01 truncate"},Rn=e.defineComponent({__name:"TemplateButton",props:{template:{},collapsed:{type:Boolean}},setup(t){const o=t,n=o.template.name,s=W(),r=()=>{window.confirm(`Load template "${o.template.name}"? This will replace the current canvas.`)&&s.importSnapshot(o.template.snapshot)};return(a,i)=>(e.openBlock(),e.createBlock(e.unref(M),{variant:"ghost",class:e.normalizeClass(t.collapsed?"w-full justify-center h-10":"w-full justify-start gap-2 h-9 px-2 text-ma-text-01"),title:e.unref(n),"data-testid":`template-button-${e.unref(n)}`,onClick:r},{default:e.withCtx(()=>[e.createVNode(e.unref($s),{class:"w-4 h-4 text-ma-text-01 shrink-0"}),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Cd,e.toDisplayString(e.unref(n)),1))]),_:1},8,["class","title","data-testid"]))}}),Ln=[{name:"Prozesslandschaft Construction",description:"Process landscape diagram with blue color scheme (German)",snapshot:{version:1,timestamp:1772201027363,elements:[{id:"shape-60",type:"shape",shapeType:"chevron",x:62,y:172,width:97,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:1,rotation:0},{id:"shape-63",type:"shape",shapeType:"custom",x:165,y:172,width:556,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:2,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50"},{id:"shape-64",type:"shape",shapeType:"chevron",x:811,y:172,width:97,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:3,rotation:0},{id:"icon-68",type:"icon",iconType:"arrowRight",x:165,y:263,width:30,height:30,color:"#000",strokeWeight:2,zIndex:4,rotation:0},{id:"icon-69",type:"icon",iconType:"arrowRight",x:135,y:354,width:30,height:30,color:"#000",strokeWeight:2,zIndex:5,rotation:0},{id:"icon-70",type:"icon",iconType:"arrowRight",x:150,y:309.4117647058824,width:30,height:30,color:"#000",strokeWeight:2,zIndex:6,rotation:0},{id:"icon-71",type:"icon",iconType:"arrowRight",x:135,y:172,width:30,height:30,color:"#000",strokeWeight:2,zIndex:7,rotation:0},{id:"icon-72",type:"icon",iconType:"arrowRight",x:150,y:215.9411764705883,width:30,height:30,color:"#000",strokeWeight:2,zIndex:8,rotation:0},{id:"shape-75",type:"shape",shapeType:"custom",x:223.00000000000003,y:299,width:440,height:55,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:9,rotation:180,customPoints:"0,100 97,100 100,50 97,0 0,0 3,50",content:"Kontinuierliche und Fortlaufende Verbesserung",fontSize:14,color:"#ffffff"},{id:"shape-77",type:"shape",shapeType:"custom",x:223.00000000000003,y:201.9411764705883,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:10,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Vertrieb",color:"#ffffff",fontSize:14},{id:"shape-78",type:"shape",shapeType:"custom",x:312.18181818181813,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:11,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Fertigung",fontSize:14,color:"#ffffff"},{id:"shape-79",type:"shape",shapeType:"custom",x:400,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:12,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Abnahme",color:"#ffffff",fontSize:14},{id:"shape-80",type:"shape",shapeType:"custom",x:488.23076923076906,y:201.09090909090918,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:13,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Versand",fontSize:14,color:"#ffffff"},{id:"shape-81",type:"shape",shapeType:"custom",x:577,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:14,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:`Projekt-
7
+ For more information, see https://www.reka-ui.com/docs/components/${n}`,l=`Warning: Missing \`Description\` or \`aria-describedby="undefined"\` for ${o}.`;e.onMounted(()=>{document.getElementById(r)||console.warn(i);const c=a.value?.getAttribute("aria-describedby");s&&c&&(document.getElementById(s)||console.warn(l))})}var Na=e.defineComponent({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=me(),{forwardRef:a,currentElement:i}=j();return s.titleId||=et(void 0,"reka-dialog-title"),s.descriptionId||=et(void 0,"reka-dialog-description"),e.onMounted(()=>{s.contentElement=i,pe()!==document.body&&(s.triggerElement.value=pe())}),process.env.NODE_ENV!=="production"&&Ia({titleName:"DialogTitle",contentName:"DialogContent",componentLink:"dialog.html#title",titleId:s.titleId,descriptionId:s.descriptionId,contentElement:i}),(l,d)=>(e.openBlock(),e.createBlock(e.unref(Uo),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>r("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>r("closeAutoFocus",c))},{default:e.withCtx(()=>[e.createVNode(e.unref(Ro),e.mergeProps({id:e.unref(s).contentId,ref:e.unref(a),as:l.as,"as-child":l.asChild,"disable-outside-pointer-events":l.disableOutsidePointerEvents,role:"dialog","aria-describedby":e.unref(s).descriptionId,"aria-labelledby":e.unref(s).titleId,"data-state":e.unref(Va)(e.unref(s).open.value)},l.$attrs,{onDismiss:d[0]||(d[0]=c=>e.unref(s).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>r("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>r("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>r("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>r("pointerDownOutside",c))}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),Ho=Na,Oa=e.defineComponent({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=me(),a=Ze(r),{forwardRef:i,currentElement:l}=j();return Do(l),(d,c)=>(e.openBlock(),e.createBlock(Ho,e.mergeProps({...n,...e.unref(a)},{ref:e.unref(i),"trap-focus":e.unref(s).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=f=>{f.defaultPrevented||(f.preventDefault(),e.unref(s).triggerElement.value?.focus())}),onPointerDownOutside:c[1]||(c[1]=f=>{const u=f.detail.originalEvent,m=u.button===0&&u.ctrlKey===!0;(u.button===2||m)&&f.preventDefault()}),onFocusOutside:c[2]||(c[2]=f=>{f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Aa=Oa,Ma=e.defineComponent({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,s=Ze(o);j();const a=me(),i=e.ref(!1),l=e.ref(!1);return(d,c)=>(e.openBlock(),e.createBlock(Ho,e.mergeProps({...n,...e.unref(s)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=f=>{f.defaultPrevented||(i.value||e.unref(a).triggerElement.value?.focus(),f.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=f=>{f.defaultPrevented||(i.value=!0,f.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=f.target;e.unref(a).triggerElement.value?.contains(u)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&l.value&&f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16))}}),$a=Ma,Ta=e.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=me(),a=Ze(r),{forwardRef:i}=j();return(l,d)=>(e.openBlock(),e.createBlock(e.unref(Ot),{present:l.forceMount||e.unref(s).open.value},{default:e.withCtx(()=>[e.unref(s).modal.value?(e.openBlock(),e.createBlock(Aa,e.mergeProps({key:0,ref:e.unref(i)},{...n,...e.unref(a),...l.$attrs}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createBlock($a,e.mergeProps({key:1,ref:e.unref(i)},{...n,...e.unref(a),...l.$attrs}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Da=Ta,Fa=e.defineComponent({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=me();return Ao(!0),j(),(n,r)=>(e.openBlock(),e.createBlock(e.unref(Q),{as:n.as,"as-child":n.asChild,"data-state":e.unref(o).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Ra=Fa,La=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=me(),{forwardRef:n}=j();return(r,s)=>e.unref(o)?.modal.value?(e.openBlock(),e.createBlock(e.unref(Ot),{key:0,present:r.forceMount||e.unref(o).open.value},{default:e.withCtx(()=>[e.createVNode(Ra,e.mergeProps(r.$attrs,{ref:e.unref(n),as:r.as,"as-child":r.asChild}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):e.createCommentVNode("v-if",!0)}}),qa=La,Wa=e.defineComponent({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=Us();return(n,r)=>e.unref(o)||n.forceMount?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[e.renderSlot(n.$slots,"default")],8,["to","disabled","defer"])):e.createCommentVNode("v-if",!0)}}),Ko=Wa,ja=e.defineComponent({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createBlock(e.unref(Ko),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),Ua=ja,Ha=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(t){const o=t,n=me();return j(),(r,s)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{id:e.unref(n).titleId}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["id"]))}}),Ka=Ha;const[Go,Ga]=Te("PopperRoot");var Xa=e.defineComponent({inheritAttrs:!1,__name:"PopperRoot",setup(t){const o=e.ref();return Ga({anchor:o,onAnchorChange:n=>o.value=n}),(n,r)=>e.renderSlot(n.$slots,"default")}}),Ya=Xa,Za=e.defineComponent({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const o=t,{forwardRef:n,currentElement:r}=j(),s=Go();return e.watchPostEffect(()=>{s.onAnchorChange(o.reference??r.value)}),(a,i)=>(e.openBlock(),e.createBlock(e.unref(Q),{ref:e.unref(n),as:a.as,"as-child":a.asChild},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["as","as-child"]))}}),Ja=Za;function Qa(t){return t!==null}function ei(t){return{name:"transformOrigin",options:t,fn(o){const{placement:n,rects:r,middlewareData:s}=o,i=s.arrow?.centerOffset!==0,l=i?0:t.arrowWidth,d=i?0:t.arrowHeight,[c,f]=$t(n),u={start:"0%",center:"50%",end:"100%"}[f],m=(s.arrow?.x??0)+l/2,p=(s.arrow?.y??0)+d/2;let h="",y="";return c==="bottom"?(h=i?u:`${m}px`,y=`${-d}px`):c==="top"?(h=i?u:`${m}px`,y=`${r.floating.height+d}px`):c==="right"?(h=`${-d}px`,y=i?u:`${p}px`):c==="left"&&(h=`${r.floating.width+d}px`,y=i?u:`${p}px`),{data:{x:h,y}}}}}function $t(t){const[o,n="center"]=t.split("-");return[o,n]}const ti=["top","right","bottom","left"],ye=Math.min,K=Math.max,ot=Math.round,nt=Math.floor,oe=t=>({x:t,y:t}),oi={left:"right",right:"left",bottom:"top",top:"bottom"},ni={start:"end",end:"start"};function Tt(t,o,n){return K(t,ye(o,n))}function ie(t,o){return typeof t=="function"?t(o):t}function le(t){return t.split("-")[0]}function ze(t){return t.split("-")[1]}function Dt(t){return t==="x"?"y":"x"}function Ft(t){return t==="y"?"height":"width"}const ri=new Set(["top","bottom"]);function ne(t){return ri.has(le(t))?"y":"x"}function Rt(t){return Dt(ne(t))}function si(t,o,n){n===void 0&&(n=!1);const r=ze(t),s=Rt(t),a=Ft(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return o.reference[a]>o.floating[a]&&(i=rt(i)),[i,rt(i)]}function ai(t){const o=rt(t);return[Lt(t),o,Lt(o)]}function Lt(t){return t.replace(/start|end/g,o=>ni[o])}const Xo=["left","right"],Yo=["right","left"],ii=["top","bottom"],li=["bottom","top"];function di(t,o,n){switch(t){case"top":case"bottom":return n?o?Yo:Xo:o?Xo:Yo;case"left":case"right":return o?ii:li;default:return[]}}function ci(t,o,n,r){const s=ze(t);let a=di(le(t),n==="start",r);return s&&(a=a.map(i=>i+"-"+s),o&&(a=a.concat(a.map(Lt)))),a}function rt(t){return t.replace(/left|right|bottom|top/g,o=>oi[o])}function fi(t){return{top:0,right:0,bottom:0,left:0,...t}}function Zo(t){return typeof t!="number"?fi(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:o,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:o,right:o+r,bottom:n+s,x:o,y:n}}function Jo(t,o,n){let{reference:r,floating:s}=t;const a=ne(o),i=Rt(o),l=Ft(i),d=le(o),c=a==="y",f=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let p;switch(d){case"top":p={x:f,y:r.y-s.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-s.width,y:u};break;default:p={x:r.x,y:r.y}}switch(ze(o)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}const pi=async(t,o,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:i}=n,l=a.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(o));let c=await i.getElementRects({reference:t,floating:o,strategy:s}),{x:f,y:u}=Jo(c,r,d),m=r,p={},h=0;for(let y=0;y<l.length;y++){const{name:g,fn:x}=l[y],{x:w,y:k,data:I,reset:S}=await x({x:f,y:u,initialPlacement:r,placement:m,strategy:s,middlewareData:p,rects:c,platform:i,elements:{reference:t,floating:o}});f=w??f,u=k??u,p={...p,[g]:{...p[g],...I}},S&&h<=50&&(h++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(c=S.rects===!0?await i.getElementRects({reference:t,floating:o,strategy:s}):S.rects),{x:f,y:u}=Jo(c,m,d)),y=-1)}return{x:f,y:u,placement:m,strategy:s,middlewareData:p}};async function Fe(t,o){var n;o===void 0&&(o={});const{x:r,y:s,platform:a,rects:i,elements:l,strategy:d}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=ie(o,t),h=Zo(p),g=l[m?u==="floating"?"reference":"floating":u],x=st(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:d})),w=u==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),I=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},S=st(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:k,strategy:d}):w);return{top:(x.top-S.top+h.top)/I.y,bottom:(S.bottom-x.bottom+h.bottom)/I.y,left:(x.left-S.left+h.left)/I.x,right:(S.right-x.right+h.right)/I.x}}const ui=t=>({name:"arrow",options:t,async fn(o){const{x:n,y:r,placement:s,rects:a,platform:i,elements:l,middlewareData:d}=o,{element:c,padding:f=0}=ie(t,o)||{};if(c==null)return{};const u=Zo(f),m={x:n,y:r},p=Rt(s),h=Ft(p),y=await i.getDimensions(c),g=p==="y",x=g?"top":"left",w=g?"bottom":"right",k=g?"clientHeight":"clientWidth",I=a.reference[h]+a.reference[p]-m[p]-a.floating[h],S=m[p]-a.reference[p],z=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=z?z[k]:0;(!E||!await(i.isElement==null?void 0:i.isElement(z)))&&(E=l.floating[k]||a.floating[h]);const C=I/2-S/2,O=E/2-y[h]/2-1,$=ye(u[x],O),F=ye(u[w],O),T=$,R=E-y[h]-F,_=E/2-y[h]/2+C,b=Tt(T,_,R),N=!d.arrow&&ze(s)!=null&&_!==b&&a.reference[h]/2-(_<T?$:F)-y[h]/2<0,D=N?_<T?_-T:_-R:0;return{[p]:m[p]+D,data:{[p]:b,centerOffset:_-b-D,...N&&{alignmentOffset:D}},reset:N}}}),mi=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var n,r;const{placement:s,middlewareData:a,rects:i,initialPlacement:l,platform:d,elements:c}=o,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=ie(t,o);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=le(s),w=ne(l),k=le(l)===l,I=await(d.isRTL==null?void 0:d.isRTL(c.floating)),S=m||(k||!y?[rt(l)]:ai(l)),z=h!=="none";!m&&z&&S.push(...ci(l,y,h,I));const E=[l,...S],C=await Fe(o,g),O=[];let $=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&O.push(C[x]),u){const _=si(s,i,I);O.push(C[_[0]],C[_[1]])}if($=[...$,{placement:s,overflows:O}],!O.every(_=>_<=0)){var F,T;const _=(((F=a.flip)==null?void 0:F.index)||0)+1,b=E[_];if(b&&(!(u==="alignment"?w!==ne(b):!1)||$.every(B=>ne(B.placement)===w?B.overflows[0]>0:!0)))return{data:{index:_,overflows:$},reset:{placement:b}};let N=(T=$.filter(D=>D.overflows[0]<=0).sort((D,B)=>D.overflows[1]-B.overflows[1])[0])==null?void 0:T.placement;if(!N)switch(p){case"bestFit":{var R;const D=(R=$.filter(B=>{if(z){const X=ne(B.placement);return X===w||X==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(X=>X>0).reduce((X,yt)=>X+yt,0)]).sort((B,X)=>B[1]-X[1])[0])==null?void 0:R[0];D&&(N=D);break}case"initialPlacement":N=l;break}if(s!==N)return{reset:{placement:N}}}return{}}}};function Qo(t,o){return{top:t.top-o.height,right:t.right-o.width,bottom:t.bottom-o.height,left:t.left-o.width}}function en(t){return ti.some(o=>t[o]>=0)}const hi=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(o){const{rects:n}=o,{strategy:r="referenceHidden",...s}=ie(t,o);switch(r){case"referenceHidden":{const a=await Fe(o,{...s,elementContext:"reference"}),i=Qo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:en(i)}}}case"escaped":{const a=await Fe(o,{...s,altBoundary:!0}),i=Qo(a,n.floating);return{data:{escapedOffsets:i,escaped:en(i)}}}default:return{}}}}},tn=new Set(["left","top"]);async function yi(t,o){const{placement:n,platform:r,elements:s}=t,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=le(n),l=ze(n),d=ne(n)==="y",c=tn.has(i)?-1:1,f=a&&d?-1:1,u=ie(o,t);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),d?{x:p*f,y:m*c}:{x:m*c,y:p*f}}const gi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var n,r;const{x:s,y:a,placement:i,middlewareData:l}=o,d=await yi(o,t);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:i}}}}},xi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:n,y:r,placement:s}=o,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:g=>{let{x,y:w}=g;return{x,y:w}}},...d}=ie(t,o),c={x:n,y:r},f=await Fe(o,d),u=ne(le(s)),m=Dt(u);let p=c[m],h=c[u];if(a){const g=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=p+f[g],k=p-f[x];p=Tt(w,p,k)}if(i){const g=u==="y"?"top":"left",x=u==="y"?"bottom":"right",w=h+f[g],k=h-f[x];h=Tt(w,h,k)}const y=l.fn({...o,[m]:p,[u]:h});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[m]:a,[u]:i}}}}}},bi=function(t){return t===void 0&&(t={}),{options:t,fn(o){const{x:n,y:r,placement:s,rects:a,middlewareData:i}=o,{offset:l=0,mainAxis:d=!0,crossAxis:c=!0}=ie(t,o),f={x:n,y:r},u=ne(s),m=Dt(u);let p=f[m],h=f[u];const y=ie(l,o),g=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const k=m==="y"?"height":"width",I=a.reference[m]-a.floating[k]+g.mainAxis,S=a.reference[m]+a.reference[k]-g.mainAxis;p<I?p=I:p>S&&(p=S)}if(c){var x,w;const k=m==="y"?"width":"height",I=tn.has(le(s)),S=a.reference[u]-a.floating[k]+(I&&((x=i.offset)==null?void 0:x[u])||0)+(I?0:g.crossAxis),z=a.reference[u]+a.reference[k]+(I?0:((w=i.offset)==null?void 0:w[u])||0)-(I?g.crossAxis:0);h<S?h=S:h>z&&(h=z)}return{[m]:p,[u]:h}}}},wi=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){var n,r;const{placement:s,rects:a,platform:i,elements:l}=o,{apply:d=()=>{},...c}=ie(t,o),f=await Fe(o,c),u=le(s),m=ze(s),p=ne(s)==="y",{width:h,height:y}=a.floating;let g,x;u==="top"||u==="bottom"?(g=u,x=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=u,g=m==="end"?"top":"bottom");const w=y-f.top-f.bottom,k=h-f.left-f.right,I=ye(y-f[g],w),S=ye(h-f[x],k),z=!o.middlewareData.shift;let E=I,C=S;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(C=k),(r=o.middlewareData.shift)!=null&&r.enabled.y&&(E=w),z&&!m){const $=K(f.left,0),F=K(f.right,0),T=K(f.top,0),R=K(f.bottom,0);p?C=h-2*($!==0||F!==0?$+F:K(f.left,f.right)):E=y-2*(T!==0||R!==0?T+R:K(f.top,f.bottom))}await d({...o,availableWidth:C,availableHeight:E});const O=await i.getDimensions(l.floating);return h!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function at(){return typeof window<"u"}function we(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function G(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function re(t){var o;return(o=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function qt(t){return at()?t instanceof Node||t instanceof G(t).Node:!1}function ee(t){return at()?t instanceof Element||t instanceof G(t).Element:!1}function se(t){return at()?t instanceof HTMLElement||t instanceof G(t).HTMLElement:!1}function on(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof G(t).ShadowRoot}const ki=new Set(["inline","contents"]);function Re(t){const{overflow:o,overflowX:n,overflowY:r,display:s}=te(t);return/auto|scroll|overlay|hidden|clip/.test(o+r+n)&&!ki.has(s)}const Ci=new Set(["table","td","th"]);function Ei(t){return Ci.has(we(t))}const Si=[":popover-open",":modal"];function it(t){return Si.some(o=>{try{return t.matches(o)}catch{return!1}})}const zi=["transform","translate","scale","rotate","perspective"],_i=["transform","translate","scale","rotate","perspective","filter"],Bi=["paint","layout","strict","content"];function Wt(t){const o=jt(),n=ee(t)?te(t):t;return zi.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||_i.some(r=>(n.willChange||"").includes(r))||Bi.some(r=>(n.contain||"").includes(r))}function Vi(t){let o=ge(t);for(;se(o)&&!_e(o);){if(Wt(o))return o;if(it(o))return null;o=ge(o)}return null}function jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vi=new Set(["html","body","#document"]);function _e(t){return vi.has(we(t))}function te(t){return G(t).getComputedStyle(t)}function lt(t){return ee(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ge(t){if(we(t)==="html")return t;const o=t.assignedSlot||t.parentNode||on(t)&&t.host||re(t);return on(o)?o.host:o}function nn(t){const o=ge(t);return _e(o)?t.ownerDocument?t.ownerDocument.body:t.body:se(o)&&Re(o)?o:nn(o)}function Le(t,o,n){var r;o===void 0&&(o=[]),n===void 0&&(n=!0);const s=nn(t),a=s===((r=t.ownerDocument)==null?void 0:r.body),i=G(s);if(a){const l=Ut(i);return o.concat(i,i.visualViewport||[],Re(s)?s:[],l&&n?Le(l):[])}return o.concat(s,Le(s,[],n))}function Ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function rn(t){const o=te(t);let n=parseFloat(o.width)||0,r=parseFloat(o.height)||0;const s=se(t),a=s?t.offsetWidth:n,i=s?t.offsetHeight:r,l=ot(n)!==a||ot(r)!==i;return l&&(n=a,r=i),{width:n,height:r,$:l}}function Ht(t){return ee(t)?t:t.contextElement}function Be(t){const o=Ht(t);if(!se(o))return oe(1);const n=o.getBoundingClientRect(),{width:r,height:s,$:a}=rn(o);let i=(a?ot(n.width):n.width)/r,l=(a?ot(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Pi=oe(0);function sn(t){const o=G(t);return!jt()||!o.visualViewport?Pi:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Ii(t,o,n){return o===void 0&&(o=!1),!n||o&&n!==G(t)?!1:o}function ke(t,o,n,r){o===void 0&&(o=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),a=Ht(t);let i=oe(1);o&&(r?ee(r)&&(i=Be(r)):i=Be(t));const l=Ii(a,n,r)?sn(a):oe(0);let d=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,f=s.width/i.x,u=s.height/i.y;if(a){const m=G(a),p=r&&ee(r)?G(r):r;let h=m,y=Ut(h);for(;y&&r&&p!==h;){const g=Be(y),x=y.getBoundingClientRect(),w=te(y),k=x.left+(y.clientLeft+parseFloat(w.paddingLeft))*g.x,I=x.top+(y.clientTop+parseFloat(w.paddingTop))*g.y;d*=g.x,c*=g.y,f*=g.x,u*=g.y,d+=k,c+=I,h=G(y),y=Ut(h)}}return st({width:f,height:u,x:d,y:c})}function dt(t,o){const n=lt(t).scrollLeft;return o?o.left+n:ke(re(t)).left+n}function an(t,o){const n=t.getBoundingClientRect(),r=n.left+o.scrollLeft-dt(t,n),s=n.top+o.scrollTop;return{x:r,y:s}}function Ni(t){let{elements:o,rect:n,offsetParent:r,strategy:s}=t;const a=s==="fixed",i=re(r),l=o?it(o.floating):!1;if(r===i||l&&a)return n;let d={scrollLeft:0,scrollTop:0},c=oe(1);const f=oe(0),u=se(r);if((u||!u&&!a)&&((we(r)!=="body"||Re(i))&&(d=lt(r)),se(r))){const p=ke(r);c=Be(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=i&&!u&&!a?an(i,d):oe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-d.scrollTop*c.y+f.y+m.y}}function Oi(t){return Array.from(t.getClientRects())}function Ai(t){const o=re(t),n=lt(t),r=t.ownerDocument.body,s=K(o.scrollWidth,o.clientWidth,r.scrollWidth,r.clientWidth),a=K(o.scrollHeight,o.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+dt(t);const l=-n.scrollTop;return te(r).direction==="rtl"&&(i+=K(o.clientWidth,r.clientWidth)-s),{width:s,height:a,x:i,y:l}}const ln=25;function Mi(t,o){const n=G(t),r=re(t),s=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,l=0,d=0;if(s){a=s.width,i=s.height;const f=jt();(!f||f&&o==="fixed")&&(l=s.offsetLeft,d=s.offsetTop)}const c=dt(r);if(c<=0){const f=r.ownerDocument,u=f.body,m=getComputedStyle(u),p=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(r.clientWidth-u.clientWidth-p);h<=ln&&(a-=h)}else c<=ln&&(a+=c);return{width:a,height:i,x:l,y:d}}const $i=new Set(["absolute","fixed"]);function Ti(t,o){const n=ke(t,!0,o==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,a=se(t)?Be(t):oe(1),i=t.clientWidth*a.x,l=t.clientHeight*a.y,d=s*a.x,c=r*a.y;return{width:i,height:l,x:d,y:c}}function dn(t,o,n){let r;if(o==="viewport")r=Mi(t,n);else if(o==="document")r=Ai(re(t));else if(ee(o))r=Ti(o,n);else{const s=sn(t);r={x:o.x-s.x,y:o.y-s.y,width:o.width,height:o.height}}return st(r)}function cn(t,o){const n=ge(t);return n===o||!ee(n)||_e(n)?!1:te(n).position==="fixed"||cn(n,o)}function Di(t,o){const n=o.get(t);if(n)return n;let r=Le(t,[],!1).filter(l=>ee(l)&&we(l)!=="body"),s=null;const a=te(t).position==="fixed";let i=a?ge(t):t;for(;ee(i)&&!_e(i);){const l=te(i),d=Wt(i);!d&&l.position==="fixed"&&(s=null),(a?!d&&!s:!d&&l.position==="static"&&!!s&&$i.has(s.position)||Re(i)&&!d&&cn(t,i))?r=r.filter(f=>f!==i):s=l,i=ge(i)}return o.set(t,r),r}function Fi(t){let{element:o,boundary:n,rootBoundary:r,strategy:s}=t;const i=[...n==="clippingAncestors"?it(o)?[]:Di(o,this._c):[].concat(n),r],l=i[0],d=i.reduce((c,f)=>{const u=dn(o,f,s);return c.top=K(u.top,c.top),c.right=ye(u.right,c.right),c.bottom=ye(u.bottom,c.bottom),c.left=K(u.left,c.left),c},dn(o,l,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ri(t){const{width:o,height:n}=rn(t);return{width:o,height:n}}function Li(t,o,n){const r=se(o),s=re(o),a=n==="fixed",i=ke(t,!0,a,o);let l={scrollLeft:0,scrollTop:0};const d=oe(0);function c(){d.x=dt(s)}if(r||!r&&!a)if((we(o)!=="body"||Re(s))&&(l=lt(o)),r){const p=ke(o,!0,a,o);d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}else s&&c();a&&!r&&s&&c();const f=s&&!r&&!a?an(s,l):oe(0),u=i.left+l.scrollLeft-d.x-f.x,m=i.top+l.scrollTop-d.y-f.y;return{x:u,y:m,width:i.width,height:i.height}}function Kt(t){return te(t).position==="static"}function fn(t,o){if(!se(t)||te(t).position==="fixed")return null;if(o)return o(t);let n=t.offsetParent;return re(t)===n&&(n=n.ownerDocument.body),n}function pn(t,o){const n=G(t);if(it(t))return n;if(!se(t)){let s=ge(t);for(;s&&!_e(s);){if(ee(s)&&!Kt(s))return s;s=ge(s)}return n}let r=fn(t,o);for(;r&&Ei(r)&&Kt(r);)r=fn(r,o);return r&&_e(r)&&Kt(r)&&!Wt(r)?n:r||Vi(t)||n}const qi=async function(t){const o=this.getOffsetParent||pn,n=this.getDimensions,r=await n(t.floating);return{reference:Li(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wi(t){return te(t).direction==="rtl"}const ji={convertOffsetParentRelativeRectToViewportRelativeRect:Ni,getDocumentElement:re,getClippingRect:Fi,getOffsetParent:pn,getElementRects:qi,getClientRects:Oi,getDimensions:Ri,getScale:Be,isElement:ee,isRTL:Wi};function un(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function Ui(t,o){let n=null,r;const s=re(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),a();const c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:p}=c;if(l||o(),!m||!p)return;const h=nt(u),y=nt(s.clientWidth-(f+m)),g=nt(s.clientHeight-(u+p)),x=nt(f),k={rootMargin:-h+"px "+-y+"px "+-g+"px "+-x+"px",threshold:K(0,ye(1,d))||1};let I=!0;function S(z){const E=z[0].intersectionRatio;if(E!==d){if(!I)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!un(c,t.getBoundingClientRect())&&i(),I=!1}try{n=new IntersectionObserver(S,{...k,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,k)}n.observe(t)}return i(!0),a}function Hi(t,o,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,c=Ht(t),f=s||a?[...c?Le(c):[],...Le(o)]:[];f.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const u=c&&l?Ui(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&p&&(p.unobserve(o),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(o)})),n()}),c&&!d&&p.observe(c),p.observe(o));let h,y=d?ke(t):null;d&&g();function g(){const x=ke(t);y&&!un(y,x)&&n(),y=x,h=requestAnimationFrame(g)}return n(),()=>{var x;f.forEach(w=>{s&&w.removeEventListener("scroll",n),a&&w.removeEventListener("resize",n)}),u?.(),(x=p)==null||x.disconnect(),p=null,d&&cancelAnimationFrame(h)}}const Ki=gi,Gi=xi,mn=mi,Xi=wi,Yi=hi,Zi=ui,Ji=bi,Qi=(t,o,n)=>{const r=new Map,s={platform:ji,...n},a={...s.platform,_c:r};return pi(t,o,{...s,platform:a})};function el(t){return t!=null&&typeof t=="object"&&"$el"in t}function Gt(t){if(el(t)){const o=t.$el;return qt(o)&&we(o)==="#comment"?null:o}return t}function Ve(t){return typeof t=="function"?t():e.unref(t)}function tl(t){return{name:"arrow",options:t,fn(o){const n=Gt(Ve(t.element));return n==null?{}:Zi({element:n,padding:t.padding}).fn(o)}}}function hn(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function yn(t,o){const n=hn(t);return Math.round(o*n)/n}function ol(t,o,n){n===void 0&&(n={});const r=n.whileElementsMounted,s=e.computed(()=>{var E;return(E=Ve(n.open))!=null?E:!0}),a=e.computed(()=>Ve(n.middleware)),i=e.computed(()=>{var E;return(E=Ve(n.placement))!=null?E:"bottom"}),l=e.computed(()=>{var E;return(E=Ve(n.strategy))!=null?E:"absolute"}),d=e.computed(()=>{var E;return(E=Ve(n.transform))!=null?E:!0}),c=e.computed(()=>Gt(t.value)),f=e.computed(()=>Gt(o.value)),u=e.ref(0),m=e.ref(0),p=e.ref(l.value),h=e.ref(i.value),y=e.shallowRef({}),g=e.ref(!1),x=e.computed(()=>{const E={position:p.value,left:"0",top:"0"};if(!f.value)return E;const C=yn(f.value,u.value),O=yn(f.value,m.value);return d.value?{...E,transform:"translate("+C+"px, "+O+"px)",...hn(f.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:C+"px",top:O+"px"}});let w;function k(){if(c.value==null||f.value==null)return;const E=s.value;Qi(c.value,f.value,{middleware:a.value,placement:i.value,strategy:l.value}).then(C=>{u.value=C.x,m.value=C.y,p.value=C.strategy,h.value=C.placement,y.value=C.middlewareData,g.value=E!==!1})}function I(){typeof w=="function"&&(w(),w=void 0)}function S(){if(I(),r===void 0){k();return}if(c.value!=null&&f.value!=null){w=r(c.value,f.value,k);return}}function z(){s.value||(g.value=!1)}return e.watch([a,i,l,s],k,{flush:"sync"}),e.watch([c,f],S,{flush:"sync"}),e.watch(s,z,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(I),{x:e.shallowReadonly(u),y:e.shallowReadonly(m),strategy:e.shallowReadonly(p),placement:e.shallowReadonly(h),middlewareData:e.shallowReadonly(y),isPositioned:e.shallowReadonly(g),floatingStyles:x,update:k}}const nl={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[mf,rl]=Te("PopperContent");var sl=e.defineComponent({inheritAttrs:!1,__name:"PopperContent",props:e.mergeDefaults({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...nl}),emits:["placed"],setup(t,{emit:o}){const n=t,r=o,s=Go(),{forwardRef:a,currentElement:i}=j(),l=e.ref(),d=e.ref(),{width:c,height:f}=sa(d),u=e.computed(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),m=e.computed(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),p=e.computed(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=e.computed(()=>({padding:m.value,boundary:p.value.filter(Qa),altBoundary:p.value.length>0})),y=e.computed(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=Ns(()=>[Ki({mainAxis:n.sideOffset+f.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&mn({...h.value,...y.value}),n.avoidCollisions&&Gi({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Ji():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&mn({...h.value,...y.value}),Xi({...h.value,apply:({elements:T,rects:R,availableWidth:_,availableHeight:b})=>{const{width:N,height:D}=R.reference,B=T.floating.style;B.setProperty("--reka-popper-available-width",`${_}px`),B.setProperty("--reka-popper-available-height",`${b}px`),B.setProperty("--reka-popper-anchor-width",`${N}px`),B.setProperty("--reka-popper-anchor-height",`${D}px`)}}),d.value&&tl({element:d.value,padding:n.arrowPadding}),ei({arrowWidth:c.value,arrowHeight:f.value}),n.hideWhenDetached&&Yi({strategy:"referenceHidden",...h.value})]),x=e.computed(()=>n.reference??s.anchor.value),{floatingStyles:w,placement:k,isPositioned:I,middlewareData:S}=ol(x,l,{strategy:n.positionStrategy,placement:u,whileElementsMounted:(...T)=>Hi(...T,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),z=e.computed(()=>$t(k.value)[0]),E=e.computed(()=>$t(k.value)[1]);e.watchPostEffect(()=>{I.value&&r("placed")});const C=e.computed(()=>S.value.arrow?.centerOffset!==0),O=e.ref("");e.watchEffect(()=>{i.value&&(O.value=window.getComputedStyle(i.value).zIndex)});const $=e.computed(()=>S.value.arrow?.x??0),F=e.computed(()=>S.value.arrow?.y??0);return rl({placedSide:z,onArrowChange:T=>d.value=T,arrowX:$,arrowY:F,shouldHideArrow:C}),(T,R)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"floatingRef",ref:l,"data-reka-popper-content-wrapper":"",style:e.normalizeStyle({...e.unref(w),transform:e.unref(I)?e.unref(w).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:O.value,"--reka-popper-transform-origin":[e.unref(S).transformOrigin?.x,e.unref(S).transformOrigin?.y].join(" "),...e.unref(S).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[e.createVNode(e.unref(Q),e.mergeProps({ref:e.unref(a)},T.$attrs,{"as-child":n.asChild,as:T.as,"data-side":z.value,"data-align":E.value,style:{animation:e.unref(I)?void 0:"none"}}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),al=sl;const[qe,il]=Te("PopoverRoot");var ll=e.defineComponent({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:o}){const n=t,r=o,{modal:s}=e.toRefs(n),a=Oo(n,"open",r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=e.ref(),l=e.ref(!1);return il({contentId:"",triggerId:"",modal:s,open:a,onOpenChange:d=>{a.value=d},onOpenToggle:()=>{a.value=!a.value},triggerElement:i,hasCustomAnchor:l}),(d,c)=>(e.openBlock(),e.createBlock(e.unref(Ya),null,{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default",{open:e.unref(a),close:()=>a.value=!1})]),_:3}))}}),dl=ll,cl=e.defineComponent({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=It(Ts(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:a}=j(),i=qe();return Qs(),(l,d)=>(e.openBlock(),e.createBlock(e.unref(Uo),{"as-child":"",loop:"",trapped:l.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>r("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>r("closeAutoFocus",c))},{default:e.withCtx(()=>[e.createVNode(e.unref(Ro),{"as-child":"","disable-outside-pointer-events":l.disableOutsidePointerEvents,onPointerDownOutside:d[0]||(d[0]=c=>r("pointerDownOutside",c)),onInteractOutside:d[1]||(d[1]=c=>r("interactOutside",c)),onEscapeKeyDown:d[2]||(d[2]=c=>r("escapeKeyDown",c)),onFocusOutside:d[3]||(d[3]=c=>r("focusOutside",c)),onDismiss:d[4]||(d[4]=c=>e.unref(i).onOpenChange(!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(al),e.mergeProps(e.unref(s),{id:e.unref(i).contentId,ref:e.unref(a),"data-state":e.unref(i).open.value?"open":"closed","aria-labelledby":e.unref(i).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),gn=cl,fl=e.defineComponent({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=qe(),a=e.ref(!1);Ao(!0);const i=be(n,r),{forwardRef:l,currentElement:d}=j();return Do(d),(c,f)=>(e.openBlock(),e.createBlock(gn,e.mergeProps(e.unref(i),{ref:e.unref(l),"trap-focus":e.unref(s).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:f[0]||(f[0]=e.withModifiers(u=>{r("closeAutoFocus",u),a.value||e.unref(s).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:f[1]||(f[1]=u=>{r("pointerDownOutside",u);const m=u.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,h=m.button===2||p;a.value=h}),onFocusOutside:f[2]||(f[2]=e.withModifiers(()=>{},["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),pl=fl,ul=e.defineComponent({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=qe(),a=e.ref(!1),i=e.ref(!1),l=be(n,r);return(d,c)=>(e.openBlock(),e.createBlock(gn,e.mergeProps(e.unref(l),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=f=>{r("closeAutoFocus",f),f.defaultPrevented||(a.value||e.unref(s).triggerElement.value?.focus(),f.preventDefault()),a.value=!1,i.value=!1}),onInteractOutside:c[1]||(c[1]=async f=>{r("interactOutside",f),f.defaultPrevented||(a.value=!0,f.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const u=f.target;e.unref(s).triggerElement.value?.contains(u)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&i.value&&f.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16))}}),ml=ul,hl=e.defineComponent({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=qe(),a=be(n,r),{forwardRef:i}=j();return s.contentId||=et(void 0,"reka-popover-content"),(l,d)=>(e.openBlock(),e.createBlock(e.unref(Ot),{present:l.forceMount||e.unref(s).open.value},{default:e.withCtx(()=>[e.unref(s).modal.value?(e.openBlock(),e.createBlock(pl,e.mergeProps({key:0},e.unref(a),{ref:e.unref(i)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createBlock(ml,e.mergeProps({key:1},e.unref(a),{ref:e.unref(i)}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),yl=hl,gl=e.defineComponent({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createBlock(e.unref(Ko),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),xl=gl,bl=e.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const o=t,n=qe(),{forwardRef:r,currentElement:s}=j();return n.triggerId||=et(void 0,"reka-popover-trigger"),e.onMounted(()=>{n.triggerElement.value=s.value}),(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n).hasCustomAnchor.value?e.unref(Q):e.unref(Ja)),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Q),{id:e.unref(n).triggerId,ref:e.unref(r),type:a.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":e.unref(n).open.value,"aria-controls":e.unref(n).contentId,"data-state":e.unref(n).open.value?"open":"closed",as:a.as,"as-child":o.asChild,onClick:e.unref(n).onOpenToggle},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),wl=bl,kl=e.defineComponent({__name:"Label",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"label"}},setup(t){const o=t;return j(),(n,r)=>(e.openBlock(),e.createBlock(e.unref(Q),e.mergeProps(o,{onMousedown:r[0]||(r[0]=s=>{!s.defaultPrevented&&s.detail>1&&s.preventDefault()})}),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),Cl=kl;const El=(t,o)=>{const n=new Array(t.length+o.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<o.length;r++)n[t.length+r]=o[r];return n},Sl=(t,o)=>({classGroupId:t,validator:o}),xn=(t=new Map,o=null,n)=>({nextPart:t,validators:o,classGroupId:n}),ct="-",bn=[],zl="arbitrary..",_l=t=>{const o=Vl(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Bl(i);const l=i.split(ct),d=l[0]===""&&l.length>1?1:0;return wn(l,d,o)},getConflictingClassGroupIds:(i,l)=>{if(l){const d=r[i],c=n[i];return d?c?El(c,d):d:c||bn}return n[i]||bn}}},wn=(t,o,n)=>{if(t.length-o===0)return n.classGroupId;const s=t[o],a=n.nextPart.get(s);if(a){const c=wn(t,o+1,a);if(c)return c}const i=n.validators;if(i===null)return;const l=o===0?t.join(ct):t.slice(o).join(ct),d=i.length;for(let c=0;c<d;c++){const f=i[c];if(f.validator(l))return f.classGroupId}},Bl=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=t.slice(1,-1),n=o.indexOf(":"),r=o.slice(0,n);return r?zl+r:void 0})(),Vl=t=>{const{theme:o,classGroups:n}=t;return vl(n,o)},vl=(t,o)=>{const n=xn();for(const r in t){const s=t[r];Xt(s,n,r,o)}return n},Xt=(t,o,n,r)=>{const s=t.length;for(let a=0;a<s;a++){const i=t[a];Pl(i,o,n,r)}},Pl=(t,o,n,r)=>{if(typeof t=="string"){Il(t,o,n);return}if(typeof t=="function"){Nl(t,o,n,r);return}Ol(t,o,n,r)},Il=(t,o,n)=>{const r=t===""?o:kn(o,t);r.classGroupId=n},Nl=(t,o,n,r)=>{if(Al(t)){Xt(t(r),o,n,r);return}o.validators===null&&(o.validators=[]),o.validators.push(Sl(n,t))},Ol=(t,o,n,r)=>{const s=Object.entries(t),a=s.length;for(let i=0;i<a;i++){const[l,d]=s[i];Xt(d,kn(o,l),n,r)}},kn=(t,o)=>{let n=t;const r=o.split(ct),s=r.length;for(let a=0;a<s;a++){const i=r[a];let l=n.nextPart.get(i);l||(l=xn(),n.nextPart.set(i,l)),n=l}return n},Al=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Ml=t=>{if(t<1)return{get:()=>{},set:()=>{}};let o=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,o++,o>t&&(o=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},Yt="!",Cn=":",$l=[],En=(t,o,n,r,s)=>({modifiers:t,hasImportantModifier:o,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Tl=t=>{const{prefix:o,experimentalParseClassName:n}=t;let r=s=>{const a=[];let i=0,l=0,d=0,c;const f=s.length;for(let y=0;y<f;y++){const g=s[y];if(i===0&&l===0){if(g===Cn){a.push(s.slice(d,y)),d=y+1;continue}if(g==="/"){c=y;continue}}g==="["?i++:g==="]"?i--:g==="("?l++:g===")"&&l--}const u=a.length===0?s:s.slice(d);let m=u,p=!1;u.endsWith(Yt)?(m=u.slice(0,-1),p=!0):u.startsWith(Yt)&&(m=u.slice(1),p=!0);const h=c&&c>d?c-d:void 0;return En(a,p,m,h)};if(o){const s=o+Cn,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):En($l,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},Dl=t=>{const o=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{o.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],l=i[0]==="[",d=o.has(i);l||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},Fl=t=>({cache:Ml(t.cacheSize),parseClassName:Tl(t),sortModifiers:Dl(t),..._l(t)}),Rl=/\s+/,Ll=(t,o)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=o,i=[],l=t.trim().split(Rl);let d="";for(let c=l.length-1;c>=0;c-=1){const f=l[c],{isExternal:u,modifiers:m,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:y}=n(f);if(u){d=f+(d.length>0?" "+d:d);continue}let g=!!y,x=r(g?h.substring(0,y):h);if(!x){if(!g){d=f+(d.length>0?" "+d:d);continue}if(x=r(h),!x){d=f+(d.length>0?" "+d:d);continue}g=!1}const w=m.length===0?"":m.length===1?m[0]:a(m).join(":"),k=p?w+Yt:w,I=k+x;if(i.indexOf(I)>-1)continue;i.push(I);const S=s(x,g);for(let z=0;z<S.length;++z){const E=S[z];i.push(k+E)}d=f+(d.length>0?" "+d:d)}return d},ql=(...t)=>{let o=0,n,r,s="";for(;o<t.length;)(n=t[o++])&&(r=Sn(n))&&(s&&(s+=" "),s+=r);return s},Sn=t=>{if(typeof t=="string")return t;let o,n="";for(let r=0;r<t.length;r++)t[r]&&(o=Sn(t[r]))&&(n&&(n+=" "),n+=o);return n},Wl=(t,...o)=>{let n,r,s,a;const i=d=>{const c=o.reduce((f,u)=>u(f),t());return n=Fl(c),r=n.cache.get,s=n.cache.set,a=l,l(d)},l=d=>{const c=r(d);if(c)return c;const f=Ll(d,n);return s(d,f),f};return a=i,(...d)=>a(ql(...d))},jl=[],L=t=>{const o=n=>n[t]||jl;return o.isThemeGetter=!0,o},zn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_n=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ul=/^\d+\/\d+$/,Hl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Gl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ve=t=>Ul.test(t),A=t=>!!t&&!Number.isNaN(Number(t)),xe=t=>!!t&&Number.isInteger(Number(t)),Zt=t=>t.endsWith("%")&&A(t.slice(0,-1)),de=t=>Hl.test(t),Zl=()=>!0,Jl=t=>Kl.test(t)&&!Gl.test(t),Bn=()=>!1,Ql=t=>Xl.test(t),ed=t=>Yl.test(t),td=t=>!v(t)&&!P(t),od=t=>Pe(t,Nn,Bn),v=t=>zn.test(t),Ce=t=>Pe(t,On,Jl),Jt=t=>Pe(t,id,A),Vn=t=>Pe(t,Pn,Bn),nd=t=>Pe(t,In,ed),ft=t=>Pe(t,An,Ql),P=t=>_n.test(t),We=t=>Ie(t,On),rd=t=>Ie(t,ld),vn=t=>Ie(t,Pn),sd=t=>Ie(t,Nn),ad=t=>Ie(t,In),pt=t=>Ie(t,An,!0),Pe=(t,o,n)=>{const r=zn.exec(t);return r?r[1]?o(r[1]):n(r[2]):!1},Ie=(t,o,n=!1)=>{const r=_n.exec(t);return r?r[1]?o(r[1]):n:!1},Pn=t=>t==="position"||t==="percentage",In=t=>t==="image"||t==="url",Nn=t=>t==="length"||t==="size"||t==="bg-size",On=t=>t==="length",id=t=>t==="number",ld=t=>t==="family-name",An=t=>t==="shadow",dd=Wl(()=>{const t=L("color"),o=L("font"),n=L("text"),r=L("font-weight"),s=L("tracking"),a=L("leading"),i=L("breakpoint"),l=L("container"),d=L("spacing"),c=L("radius"),f=L("shadow"),u=L("inset-shadow"),m=L("text-shadow"),p=L("drop-shadow"),h=L("blur"),y=L("perspective"),g=L("aspect"),x=L("ease"),w=L("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...I(),P,v],z=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],C=()=>[P,v,d],O=()=>[ve,"full","auto",...C()],$=()=>[xe,"none","subgrid",P,v],F=()=>["auto",{span:["full",xe,P,v]},xe,P,v],T=()=>[xe,"auto",P,v],R=()=>["auto","min","max","fr",P,v],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],b=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...C()],D=()=>[ve,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],B=()=>[t,P,v],X=()=>[...I(),vn,Vn,{position:[P,v]}],yt=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Jn=()=>["auto","cover","contain",sd,od,{size:[P,v]}],oo=()=>[Zt,We,Ce],H=()=>["","none","full",c,P,v],Y=()=>["",A,We,Ce],gt=()=>["solid","dashed","dotted","double"],Qn=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[A,Zt,vn,Vn],er=()=>["","none",h,P,v],xt=()=>["none",A,P,v],bt=()=>["none",A,P,v],no=()=>[A,P,v],wt=()=>[ve,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[de],breakpoint:[de],color:[Zl],container:[de],"drop-shadow":[de],ease:["in","out","in-out"],font:[td],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[de],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[de],shadow:[de],spacing:["px",A],text:[de],"text-shadow":[de],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ve,v,P,g]}],container:["container"],columns:[{columns:[A,v,P,l]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[xe,"auto",P,v]}],basis:[{basis:[ve,"full","auto",l,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[A,ve,"auto","initial","none",v]}],grow:[{grow:["",A,P,v]}],shrink:[{shrink:["",A,P,v]}],order:[{order:[xe,"first","last","none",P,v]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...b(),"normal"]}],"justify-self":[{"justify-self":["auto",...b()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...b(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...b(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...b(),"baseline"]}],"place-self":[{"place-self":["auto",...b()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[l,"screen",...D()]}],"min-w":[{"min-w":[l,"screen","none",...D()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,We,Ce]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,P,Jt]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zt,v]}],"font-family":[{font:[rd,v,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,P,v]}],"line-clamp":[{"line-clamp":[A,"none",P,Jt]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",P,v]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",P,v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...gt(),"wavy"]}],"text-decoration-thickness":[{decoration:[A,"from-font","auto",P,Ce]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[A,"auto",P,v]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",P,v]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",P,v]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:yt()}],"bg-size":[{bg:Jn()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xe,P,v],radial:["",P,v],conic:[xe,P,v]},ad,nd]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:oo()}],"gradient-via-pos":[{via:oo()}],"gradient-to-pos":[{to:oo()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...gt(),"hidden","none"]}],"divide-style":[{divide:[...gt(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...gt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[A,P,v]}],"outline-w":[{outline:["",A,We,Ce]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",f,pt,ft]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",u,pt,ft]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[A,Ce]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,pt,ft]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[A,P,v]}],"mix-blend":[{"mix-blend":[...Qn(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qn()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[A]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[P,v]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[A]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:yt()}],"mask-size":[{mask:Jn()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",P,v]}],filter:[{filter:["","none",P,v]}],blur:[{blur:er()}],brightness:[{brightness:[A,P,v]}],contrast:[{contrast:[A,P,v]}],"drop-shadow":[{"drop-shadow":["","none",p,pt,ft]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",A,P,v]}],"hue-rotate":[{"hue-rotate":[A,P,v]}],invert:[{invert:["",A,P,v]}],saturate:[{saturate:[A,P,v]}],sepia:[{sepia:["",A,P,v]}],"backdrop-filter":[{"backdrop-filter":["","none",P,v]}],"backdrop-blur":[{"backdrop-blur":er()}],"backdrop-brightness":[{"backdrop-brightness":[A,P,v]}],"backdrop-contrast":[{"backdrop-contrast":[A,P,v]}],"backdrop-grayscale":[{"backdrop-grayscale":["",A,P,v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[A,P,v]}],"backdrop-invert":[{"backdrop-invert":["",A,P,v]}],"backdrop-opacity":[{"backdrop-opacity":[A,P,v]}],"backdrop-saturate":[{"backdrop-saturate":[A,P,v]}],"backdrop-sepia":[{"backdrop-sepia":["",A,P,v]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",P,v]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[A,"initial",P,v]}],ease:[{ease:["linear","initial",x,P,v]}],delay:[{delay:[A,P,v]}],animate:[{animate:["none",w,P,v]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,P,v]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:xt()}],"rotate-x":[{"rotate-x":xt()}],"rotate-y":[{"rotate-y":xt()}],"rotate-z":[{"rotate-z":xt()}],scale:[{scale:bt()}],"scale-x":[{"scale-x":bt()}],"scale-y":[{"scale-y":bt()}],"scale-z":[{"scale-z":bt()}],"scale-3d":["scale-3d"],skew:[{skew:no()}],"skew-x":[{"skew-x":no()}],"skew-y":[{"skew-y":no()}],transform:[{transform:[P,v,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:wt()}],"translate-x":[{"translate-x":wt()}],"translate-y":[{"translate-y":wt()}],"translate-z":[{"translate-z":wt()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",P,v]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",P,v]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[A,We,Ce,Jt]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ce(...t){return dd(zo(t))}const M=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createBlock(e.unref(Q),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(ce)(e.unref(cd)({variant:t.variant,size:t.size}),o.class))},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),cd=Ps("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-ma-primary-500/50",{variants:{variant:{default:"bg-ma-primary-400 text-white hover:bg-ma-primary-600",destructive:"bg-ma-red-400 text-white hover:bg-ma-red-700",outline:"border border-ma-grey-400 bg-ma-grey-100 shadow-xs hover:bg-ma-grey-300 text-ma-text-01",secondary:"bg-ma-grey-300 text-ma-text-01 hover:bg-ma-grey-400",ghost:"hover:bg-ma-grey-300 text-ma-text-01",link:"text-ma-primary-500 underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Mn=e.defineComponent({__name:"SidebarToggle",props:{isCollapsed:{type:Boolean},side:{default:"left"}},emits:["toggle"],setup(t){return(o,n)=>(e.openBlock(),e.createBlock(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"sidebar-toggle",class:e.normalizeClass(["absolute top-3 z-10 bg-ma-grey-100 border border-ma-grey-300 shadow-sm",t.side==="left"?"left-3":"right-3"]),title:`Toggle ${t.side} sidebar`,onClick:n[0]||(n[0]=r=>o.$emit("toggle"))},{default:e.withCtx(()=>[t.side==="left"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.isCollapsed?(e.openBlock(),e.createBlock(e.unref(Xr),{key:1,class:"w-5 h-5 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Gr),{key:0,class:"w-5 h-5 text-ma-text-01"}))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.isCollapsed?(e.openBlock(),e.createBlock(e.unref(Zr),{key:1,class:"w-5 h-5 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Yr),{key:0,class:"w-5 h-5 text-ma-text-01"}))],64))]),_:1},8,["class","title"]))}}),$n=()=>({saveToFile:n=>{const r=JSON.stringify(n,null,2),s=new Blob([r],{type:"application/json"}),a=URL.createObjectURL(s),i=document.createElement("a");i.href=a,i.download="canvas.json",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)},loadFromFile:n=>new Promise((r,s)=>{const a=new FileReader;a.onload=i=>{try{const l=i.target?.result;r(JSON.parse(l))}catch(l){s(l)}},a.onerror=()=>s(a.error),a.readAsText(n)})}),fd=e.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{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(dl),e.normalizeProps(e.guardReactiveProps(e.unref(s))),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}}),pd=e.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const o=t;return(n,r)=>(e.openBlock(),e.createBlock(e.unref(wl),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16))}}),ud=e.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:"center"},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:o}){const n=t,r=o,s=e.computed(()=>{const{class:i,...l}=n;return l}),a=be(s,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(xl),null,{default:e.withCtx(()=>[e.createVNode(e.unref(yl),e.mergeProps({...e.unref(a),...i.$attrs},{class:e.unref(ce)("z-50 w-72 rounded-md border bg-white p-4 text-slate-950 shadow-md outline-none 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:bg-slate-950 dark:text-slate-50",n.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),md={key:0,class:"text-sm text-ma-text-01"},hd={class:"flex items-center justify-between p-3 border-b border-ma-grey-300 bg-transparent"},yd={class:"flex items-center gap-2.5"},gd={class:"shadow-sm border border-ma-grey-300 bg-ma-grey-100 p-1 rounded-lg"},xd={class:"p-2 grid grid-cols-5 gap-1 max-h-[60vh] overflow-y-auto custom-scrollbar"},bd=e.defineComponent({__name:"IconPicker",props:{collapsed:{type:Boolean}},setup(t){const o=W(),n=r=>{o.addIcon(r)};return(r,s)=>(e.openBlock(),e.createBlock(e.unref(fd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pd),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(["gap-2 text-ma-text-01",t.collapsed?"w-10 h-10 p-0 ml-1 justify-center":"w-full h-9 px-2 justify-start"]),title:"Icons"},{default:e.withCtx(()=>[e.createVNode(e.unref(go),{style:e.normalizeStyle({color:e.unref(ae)}),class:e.normalizeClass(["text-ma-text-01",(t.collapsed,"w-4 h-4")])},null,8,["style","class"]),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",md,"Icons"))]),_:1},8,["class"])]),_:1}),e.createVNode(e.unref(ud),{class:"p-0 shadow-xl border border-ma-grey-300 bg-ma-grey-100 rounded-xl overflow-hidden flex flex-col",align:"start",side:"right","side-offset":10,style:{width:"270px"}},{default:e.withCtx(()=>[e.createElementVNode("div",hd,[e.createElementVNode("div",yd,[e.createElementVNode("div",gd,[e.createVNode(e.unref(go),{class:"w-4 h-4 text-ma-text-02"})]),s[0]||(s[0]=e.createElementVNode("h3",{class:"text-sm font-semibold tracking-wide text-ma-text-01"}," Icons ",-1))])]),e.createElementVNode("div",xd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Co),(a,i)=>(e.openBlock(),e.createBlock(e.unref(M),{key:i,variant:"ghost",class:"h-9 w-9 p-0 hover:bg-toolbar-btn-bg-hover transition-colors rounded-lg flex items-center justify-center group",title:i,onClick:l=>n(i)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a),{class:"w-5 h-5 text-ma-text-02 group-hover:text-ma-text-01 transition-colors",style:{color:"inherit"}}))]),_:2},1032,["title","onClick"]))),128))])]),_:1})]),_:1}))}}),Qt=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},Tn=Qt(bd,[["__scopeId","data-v-23dc5d20"]]),wd={key:0,class:"capitalize"},ut=e.defineComponent({__name:"ShapeButton",props:{shapeType:{},collapsed:{type:Boolean},customPoints:{},label:{}},setup(t){const o=t,n=Xe(),r=s=>{n.startDrag(o.shapeType,s,o.customPoints)};return(s,a)=>(e.openBlock(),e.createBlock(e.unref(M),{"data-testid":"shape-button",variant:"ghost",size:t.collapsed?"icon-sm":"sm",class:e.normalizeClass(["cursor-grab w-full text-ma-text-01",t.collapsed?"justify-center":"justify-start"]),title:t.shapeType,onMousedown:r},{default:e.withCtx(()=>[e.createVNode(Ye,{width:24,height:24,"shape-type":t.shapeType,"custom-points":t.customPoints,"stroke-weight":1,outline:e.unref(ae),fill:e.unref(Ke),class:"pointer-events-none shrink-0"},null,8,["shape-type","custom-points","outline","fill"]),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",wd,e.toDisplayString(t.label||t.shapeType),1))]),_:1},8,["size","class","title"]))}}),kd={key:0,class:"w-full h-px bg-ma-grey-300 my-1"},Dn=e.defineComponent({__name:"SaveLoadButtons",props:{collapsed:{type:Boolean}},setup(t){const o=t,n=tr.useRouter(),r=W(),{saveToFile:s,loadFromFile:a}=$n(),i=()=>{n.push("/view")},l=e.ref(null),d=e.computed(()=>o.collapsed?"p-1 flex flex-col gap-1 items-center":"p-2 border-t border-ma-grey-300 flex gap-2 justify-between"),c=e.computed(()=>o.collapsed?"w-full h-10 gap-0 text-ma-text-01 hover:bg-ma-grey-200 justify-center":"flex-1 h-9 justify-center text-ma-text-01 hover:bg-ma-grey-200"),f=()=>{s(r.exportSnapshot())},u=()=>{l.value?.click()},m=async p=>{const h=p.target;if(h.files&&h.files.length>0){const y=h.files[0];if(y)try{const g=await a(y);r.importSnapshot(g)}catch(g){console.error("Failed to load file:",g),alert("Failed to load file. Please ensure it is a valid JSON file.")}finally{h.value=""}}};return(p,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(d.value)},[t.collapsed?(e.openBlock(),e.createElementBlock("div",kd)):e.createCommentVNode("",!0),e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(c.value),"data-testid":"save-button",title:"Save to JSON",onClick:f},{default:e.withCtx(()=>[e.createVNode(e.unref(ts),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["class"]),e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(c.value),"data-testid":"load-button",title:"Upload JSON",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(fs),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["class"]),e.createVNode(e.unref(M),{variant:"ghost",class:e.normalizeClass(c.value),"data-testid":"view-button",title:"View Mode",onClick:i},{default:e.withCtx(()=>[e.createVNode(e.unref(Ar),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["class"]),e.createElementVNode("input",{ref_key:"fileInputRef",ref:l,type:"file",accept:".json",class:"hidden",onChange:m},null,544)],2))}}),Fn="darkMode",Cd=localStorage.getItem(Fn),Ne=e.ref(Cd==="true");Ne.value&&document.documentElement.classList.add("dark-mode");function Ed(){return{isDark:Ne,toggle:()=>{Ne.value=!Ne.value,Ne.value?document.documentElement.classList.add("dark-mode"):document.documentElement.classList.remove("dark-mode"),localStorage.setItem(Fn,String(Ne.value))}}}const Rn=e.defineComponent({__name:"SidebarActions",props:{collapsed:{type:Boolean}},emits:["clear-all"],setup(t){const o=t,n=W(),{isDark:r,toggle:s}=Ed(),a=e.computed(()=>o.collapsed?"p-2 border-t border-ma-grey-300 flex flex-col gap-1 items-center":"p-2 border-t border-ma-grey-300 flex gap-1 justify-between"),i=e.computed(()=>o.collapsed?"flex flex-col gap-1 items-center":"flex gap-1");return(l,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(i.value)},[e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"undo-button",disabled:!e.unref(n).canUndo,title:"Undo",onClick:d[0]||(d[0]=c=>e.unref(n).undo())},{default:e.withCtx(()=>[e.createVNode(e.unref(cs),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"redo-button",disabled:!e.unref(n).canRedo,title:"Redo",onClick:d[1]||(d[1]=c=>e.unref(n).redo())},{default:e.withCtx(()=>[e.createVNode(e.unref(Qr),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"paste-button",disabled:!e.unref(n).hasCopiedElement,title:"Paste",onClick:d[2]||(d[2]=c=>e.unref(n).pasteElement())},{default:e.withCtx(()=>[e.createVNode(e.unref(_r),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"]),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"clear-all-button",title:"Clear all",onClick:d[3]||(d[3]=c=>l.$emit("clear-all"))},{default:e.withCtx(()=>[e.createVNode(e.unref(xo),{class:"w-4 h-4 text-ma-text-01"})]),_:1})],2),e.createVNode(e.unref(M),{variant:"ghost",size:"icon-sm","data-testid":"dark-mode-button",title:"Toggle dark mode",onClick:e.unref(s)},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createBlock(e.unref(ss),{key:0,class:"w-4 h-4 text-ma-text-01"})):(e.openBlock(),e.createBlock(e.unref(Hr),{key:1,class:"w-4 h-4 text-ma-text-01"}))]),_:1},8,["onClick"])],2))}}),Sd={key:0,class:"text-sm text-ma-text-01 truncate"},Ln=e.defineComponent({__name:"TemplateButton",props:{template:{},collapsed:{type:Boolean}},setup(t){const o=t,n=o.template.name,r=W(),s=()=>{window.confirm(`Load template "${o.template.name}"? This will replace the current canvas.`)&&r.importSnapshot(o.template.snapshot)};return(a,i)=>(e.openBlock(),e.createBlock(e.unref(M),{variant:"ghost",class:e.normalizeClass(t.collapsed?"w-full justify-center h-10":"w-full justify-start gap-2 h-9 px-2 text-ma-text-01"),title:e.unref(n),"data-testid":`template-button-${e.unref(n)}`,onClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(Fr),{class:"w-4 h-4 text-ma-text-01 shrink-0"}),t.collapsed?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Sd,e.toDisplayString(e.unref(n)),1))]),_:1},8,["class","title","data-testid"]))}}),qn=[{name:"Prozesslandschaft Construction",description:"Process landscape diagram with blue color scheme (German)",snapshot:{version:1,timestamp:1772201027363,elements:[{id:"shape-60",type:"shape",shapeType:"chevron",x:62,y:172,width:97,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:1,rotation:0},{id:"shape-63",type:"shape",shapeType:"custom",x:165,y:172,width:556,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:2,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50"},{id:"shape-64",type:"shape",shapeType:"chevron",x:811,y:172,width:97,height:212,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:3,rotation:0},{id:"icon-68",type:"icon",iconType:"arrowRight",x:165,y:263,width:30,height:30,color:"#000",strokeWeight:2,zIndex:4,rotation:0},{id:"icon-69",type:"icon",iconType:"arrowRight",x:135,y:354,width:30,height:30,color:"#000",strokeWeight:2,zIndex:5,rotation:0},{id:"icon-70",type:"icon",iconType:"arrowRight",x:150,y:309.4117647058824,width:30,height:30,color:"#000",strokeWeight:2,zIndex:6,rotation:0},{id:"icon-71",type:"icon",iconType:"arrowRight",x:135,y:172,width:30,height:30,color:"#000",strokeWeight:2,zIndex:7,rotation:0},{id:"icon-72",type:"icon",iconType:"arrowRight",x:150,y:215.9411764705883,width:30,height:30,color:"#000",strokeWeight:2,zIndex:8,rotation:0},{id:"shape-75",type:"shape",shapeType:"custom",x:223.00000000000003,y:299,width:440,height:55,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:9,rotation:180,customPoints:"0,100 97,100 100,50 97,0 0,0 3,50",content:"Kontinuierliche und Fortlaufende Verbesserung",fontSize:14,color:"#ffffff"},{id:"shape-77",type:"shape",shapeType:"custom",x:223.00000000000003,y:201.9411764705883,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:10,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Vertrieb",color:"#ffffff",fontSize:14},{id:"shape-78",type:"shape",shapeType:"custom",x:312.18181818181813,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:11,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Fertigung",fontSize:14,color:"#ffffff"},{id:"shape-79",type:"shape",shapeType:"custom",x:400,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:12,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Abnahme",color:"#ffffff",fontSize:14},{id:"shape-80",type:"shape",shapeType:"custom",x:488.23076923076906,y:201.09090909090918,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:13,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:"Versand",fontSize:14,color:"#ffffff"},{id:"shape-81",type:"shape",shapeType:"custom",x:577,y:201.09090909090912,width:86,height:44,outline:"#74A7FE",fill:"#74A7FE",strokeWeight:3,zIndex:14,rotation:0,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:`Projekt-
8
8
  abschluss`,fontSize:14,color:"#ffffff"},{id:"shape-83",type:"shape",shapeType:"custom",x:721,y:302.4117647058824,width:90,height:44,outline:"#d6d6d6",fill:"#d6d6d6",strokeWeight:3,zIndex:16,rotation:180,customPoints:"0,100 93,100 100,50 93,0 0,0 7,50",content:`Feedback
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}}],Ed={"data-testid":"collapsed-sidebar",class:"flex flex-col h-full w-14 border-r border-ma-grey-300 bg-ma-grey-100"},Sd={class:"p-3 border-b border-ma-grey-300 flex items-center justify-center"},zd={class:"flex-1 overflow-y-auto p-1"},_d={class:"flex flex-col gap-1"},Bd=e.defineComponent({__name:"CollapsedSidebar",emits:["clear-all"],setup(t){const o=["rectangle","triangle","trapezoid","chevron","hexagon","ellipse","diamond","parallelogram","pentagon"],n=W();return(s,r)=>(e.openBlock(),e.createElementBlock("aside",Ed,[e.createElementVNode("div",Sd,[e.createVNode(e.unref(fr),{class:"w-5 h-5 text-ma-text-01"})]),e.createElementVNode("div",zd,[e.createElementVNode("div",_d,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,a=>e.createVNode(Jt,{key:a,"shape-type":a,collapsed:""},null,8,["shape-type"])),64)),r[2]||(r[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:r[0]||(r[0]=a=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(xo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"])]),_:1}),r[3]||(r[3]=e.createElementVNode("div",{class:"w-full h-px bg-ma-grey-300 my-1"},null,-1)),e.createVNode($n,{collapsed:""}),r[4]||(r[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(Ln),a=>(e.openBlock(),e.createBlock(Rn,{key:a.name,template:a,collapsed:""},null,8,["template"]))),128))])]),e.createVNode(Tn,{collapsed:""}),e.createVNode(Fn,{collapsed:"",onClearAll:r[1]||(r[1]=a=>s.$emit("clear-all"))})]))}}),vd={class:"mb-2","data-testid":"sidebar-group"},Vd={class:"flex flex-col gap-1"},qe=e.defineComponent({__name:"SidebarGroup",props:{title:{},sidebarCollapsed:{type:Boolean}},setup(t){const o=e.ref(!0);return(n,s)=>(e.openBlock(),e.createElementBlock("div",vd,[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 px-1 py-1 text-xs text-ma-text-02 hover:text-ma-text-01 transition-colors",onClick:s[0]||(s[0]=r=>o.value=!o.value)},[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createVNode(e.unref(uo),{class:e.normalizeClass(["w-3 h-3 transition-transform",{"rotate-180":!o.value}])},null,8,["class"])])),e.withDirectives(e.createElementVNode("div",Vd,[e.renderSlot(n.$slots,"default")],512),[[e.vShow,o.value||t.sidebarCollapsed]])]))}}),Pd=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const r=xe(t,o);return(a,i)=>(e.openBlock(),e.createBlock(e.unref(da),e.mergeProps({"data-slot":"dialog"},e.unref(r)),{default:e.withCtx(l=>[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(l)))]),_:3},16))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Id=t=>typeof t<"u";function Nd(t){return e.isRef(t)?e.reactive(new Proxy({},{get(o,n,s){return e.unref(Reflect.get(t.value,n,s))},set(o,n,s){return e.isRef(t.value[n])&&!e.isRef(s)?t.value[n].value=s:t.value[n]=s,!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 Od(t){return Nd(e.computed(t))}function Qt(t,...o){const n=o.flat(),s=n[0];return Od(()=>Object.fromEntries(typeof s=="function"?Object.entries(e.toRefs(t)).filter(([r,a])=>!s(e.toValue(a),r)):Object.entries(e.toRefs(t)).filter(r=>!n.includes(r[0]))))}function Ad(t){return JSON.parse(JSON.stringify(t))}function Md(t,o,n,s={}){var r,a;const{clone:i=!1,passive:l=!1,eventName:d,deep:c=!1,defaultValue:f,shouldEmit:u}=s,m=e.getCurrentInstance(),p=n||m?.emit||(m==null||(r=m.$emit)===null||r===void 0?void 0:r.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):Ad(w):w,g=()=>Id(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 $d=e.defineComponent({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=e.computed(()=>{const{class:s,...r}=o;return r});return(s,r)=>(e.openBlock(),e.createBlock(e.unref(Fa),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"]))}}),Td=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,s=o,r=Qt(n,"class"),a=xe(r,s);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(qa),null,{default:e.withCtx(()=>[e.createVNode($d),e.createVNode(e.unref(Ma),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(fa),{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(Ct)),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})):e.createCommentVNode("",!0)]),_:3},16,["class"])]),_:3}))}}),Dd=e.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const o=t;return(n,s)=>(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))}}),Fd=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=Qt(o,"class"),s=Vt(n);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(ja),e.mergeProps({"data-slot":"dialog-title"},e.unref(s),{class:e.unref(ce)("text-lg leading-none font-semibold",o.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Rd=e.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const o=t;return(n,s)=>(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))}}),eo=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,r=Md(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(r)?r.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(r)]])}}),Ie=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{}},setup(t){const o=t,n=Qt(o,"class");return(s,r)=>(e.openBlock(),e.createBlock(e.unref(bl),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(s.$slots,"default")]),_:3},16,["class"]))}}),Ld={class:"grid gap-4 py-4"},qd={class:"grid grid-cols-4 items-center gap-4"},Wd={class:"space-y-4"},jd={class:"col-span-2 space-y-1"},Ud={key:0,class:"text-[10px] text-red-500"},Hd={class:"col-span-2 space-y-1"},Kd={key:0,class:"text-[10px] text-red-500"},Gd={class:"flex justify-end gap-2 mb-4"},Xd={class:"flex w-full justify-center border border-ma-grey-600 rounded-md p-4 bg-ma-grey-400"},Yd={class:"border border-ma-grey-200 rounded-md p-4 bg-ma-grey-100 w-[150px] h-[150px] flex items-center justify-center"},Zd=e.defineComponent({__name:"CustomShapeDialog",props:{open:{type:Boolean}},emits:["update:open"],setup(t,{emit:o}){const n=o,s=W(),r=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=r.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&&(s.saveCustomShape(r.value,c.value),r.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(Pd),{open:t.open,"onUpdate:open":h[1]||(h[1]=y=>p.$emit("update:open",y))},{default:e.withCtx(()=>[e.createVNode(e.unref(Td),{class:"lg:max-w-[450px] bg-ma-white text-ma-text-01 border-ma-grey-200"},{default:e.withCtx(()=>[e.createVNode(e.unref(Dd),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Fd),{class:"text-ma-text-01"},{default:e.withCtx(()=>[...h[2]||(h[2]=[e.createTextVNode("Add Custom Shape",-1)])]),_:1})]),_:1}),e.createElementVNode("div",Ld,[e.createElementVNode("div",qd,[e.createVNode(e.unref(Ie),{"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(eo),{id:"name",modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=y=>r.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",Wd,[(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",jd,[e.createVNode(e.unref(eo),{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",Ud," Must be 0-100 ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hd,[e.createVNode(e.unref(eo),{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",Kd," Must be 0-100 ")):e.createCommentVNode("",!0)])]))),128))]),e.createElementVNode("div",Gd,[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(kt),{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(ho),{class:"w-4 h-4 text-ma-text-01"})]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Xd,[e.createElementVNode("div",Yd,[e.createVNode(Xe,{width:100,height:100,"shape-type":"custom","custom-points":d.value,outline:e.unref(ae),fill:e.unref(He),class:"text-ma-text-01"},null,8,["custom-points","outline","fill"])])])]),e.createVNode(e.unref(Rd),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"]))}}),Jd={"data-testid":"expanded-sidebar",class:"flex flex-col h-full w-56 border-r border-ma-grey-300 bg-ma-grey-100"},Qd={class:"flex-1 overflow-y-auto p-2"},ec=e.defineComponent({__name:"ExpandedSidebar",emits:["clear-all"],setup(t){const o=e.ref(!1),n=W(),s=["rectangle","triangle","trapezoid","chevron","hexagon","ellipse","diamond","parallelogram","pentagon"];return(r,a)=>(e.openBlock(),e.createElementBlock("aside",Jd,[a[6]||(a[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",Qd,[e.createVNode(qe,{title:"Shapes","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,i=>e.createVNode(Jt,{key:i,"shape-type":i,collapsed:!1},null,8,["shape-type"])),64))]),_:1}),e.createVNode(qe,{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:a[0]||(a[0]=i=>e.unref(n).addText())},{default:e.withCtx(()=>[e.createVNode(e.unref(xo),{style:e.normalizeStyle({color:e.unref(ae)}),class:"w-4 h-4 text-ma-text-01"},null,8,["style"]),a[4]||(a[4]=e.createElementVNode("span",{class:"text-sm text-ma-text-01"},"Text",-1))]),_:1})]),_:1}),e.createVNode(qe,{title:"Icons","sidebar-collapsed":!1},{default:e.withCtx(()=>[e.createVNode($n,{collapsed:!1,class:"w-full"})]),_:1}),e.createVNode(qe,{title:"Custom Shapes","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n).customShapes,i=>(e.openBlock(),e.createBlock(Jt,{key:i.name,"shape-type":"custom","custom-points":i.points,label:i.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:a[1]||(a[1]=i=>o.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(kt),{class:"w-6 h-6"}),a[5]||(a[5]=e.createElementVNode("span",{class:"text-xs"},"Add",-1))]),_:1})]),_:1}),e.createVNode(qe,{title:"Templates","sidebar-collapsed":!1},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ln),i=>(e.openBlock(),e.createBlock(Rn,{key:i.name,template:i,collapsed:!1},null,8,["template"]))),128))]),_:1}),e.createVNode(Zd,{open:o.value,"onUpdate:open":a[2]||(a[2]=i=>o.value=i)},null,8,["open"])]),e.createVNode(Tn),e.createVNode(Fn,{onClearAll:a[3]||(a[3]=i=>r.$emit("clear-all"))})]))}}),tc=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(s,r)=>t.isCollapsed?(e.openBlock(),e.createBlock(Bd,{key:0,"data-testid":"app-sidebar",onClearAll:n})):(e.openBlock(),e.createBlock(ec,{key:1,"data-testid":"app-sidebar",onClearAll:n}))}}),oc={class:"flex flex-col gap-2"},nc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden"},sc={class:"flex flex-1 items-center h-8 border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},rc=["value"],ac=["id","value"],We=e.defineComponent({__name:"PropertyColorInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",oc,[e.createVNode(e.unref(Ie),{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",nc,[e.createElementVNode("div",sc,[e.createElementVNode("input",{type:"color",class:"w-8 h-full border-none p-0 cursor-pointer",value:t.modelValue,onInput:n[0]||(n[0]=s=>o.$emit("update:modelValue",s.target.value)),onChange:n[1]||(n[1]=s=>o.$emit("change",s.target.value))},null,40,rc),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]=s=>o.$emit("update:modelValue",s.target.value)),onChange:n[3]||(n[3]=s=>o.$emit("change",s.target.value))},null,40,ac)])])]))}}),ic={class:"flex flex-col gap-2"},lc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},dc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},cc=["id","value"],pt=e.defineComponent({__name:"PropertyNumericInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","change"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",ic,[e.createVNode(e.unref(Ie),{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",lc,[e.createElementVNode("div",dc,[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]=s=>o.$emit("update:modelValue",Number(s.target.value))),onChange:n[1]||(n[1]=s=>o.$emit("change",Number(s.target.value)))},null,40,cc)])])]))}}),fc={class:"flex flex-col gap-2"},pc={class:"flex gap-2 items-center border border-ma-grey-500 rounded-md bg-ma-grey-200 overflow-hidden h-8"},uc={class:"flex flex-1 items-center border border-ma-grey-300 rounded-md bg-[--ma-grey-200] overflow-hidden h-8"},mc=["id","value"],hc={class:"flex flex-row gap-1 mt-2"},yc={key:0,class:"text-[10px] text-green-600 font-medium"},gc={key:1,class:"text-[10px] text-red-600 font-medium"},xc={key:2,class:"text-[10px] text-ma-text-02"},bc=e.defineComponent({__name:"PropertyLinkInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue","save","remove"],setup(t,{emit:o}){const n=t,s=o,r=e.ref(""),a=e.ref("");e.watch(()=>n.modelValue,c=>{c?r.value=c.replace(/^https?:\/\//,""):r.value="",a.value=""},{immediate:!0});const i=c=>{r.value=c},l=()=>{let c=r.value.trim();c=c.replace(/^https?:\/\//,"");let f;c.length>0&&(f=`https://${c}`),s("save",f),a.value="Link saved!",setTimeout(()=>{a.value=""},2e3)},d=()=>{s("remove"),a.value="Link removed!",setTimeout(()=>{a.value=""},2e3)};return(c,f)=>(e.openBlock(),e.createElementBlock("div",fc,[e.createVNode(e.unref(Ie),{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",pc,[e.createElementVNode("div",uc,[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:r.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,mc)])]),e.createElementVNode("div",hc,[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(ks),{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(Ct),{class:"w-4 h-4 text-ma-white-01"})]),_:1})]),a.value==="Link saved!"?(e.openBlock(),e.createElementBlock("p",yc,e.toDisplayString(a.value),1)):a.value==="Link removed!"?(e.openBlock(),e.createElementBlock("p",gc,e.toDisplayString(a.value),1)):(e.openBlock(),e.createElementBlock("p",xc," Enter a URL and click the check to save. Click the X to remove the link from element. "))]))}}),wc={class:"flex flex-col gap-2"},kc={class:"flex flex-col border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden"},Cc=["id","value"],qn=e.defineComponent({__name:"PropertyTextInput",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",wc,[e.createVNode(e.unref(Ie),{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",kc,[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]=s=>o.$emit("update:modelValue",s.target.value))},null,40,Cc)])]))}}),Ec={class:"flex flex-col gap-2"},Sc={class:"flex items-center border border-ma-grey-300 rounded-md bg-ma-grey-200 overflow-hidden h-8"},zc=["id","value"],_c=["value"],Bc={class:"px-2 pointer-events-none text-ma-text-02"},Wn=e.defineComponent({__name:"PropertySelectInput",props:{modelValue:{},label:{},id:{},options:{}},emits:["update:modelValue"],setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ec,[e.createVNode(e.unref(Ie),{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("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]=s=>o.$emit("update:modelValue",s.target.value))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,s=>(e.openBlock(),e.createElementBlock("option",{key:s.value,value:s.value},e.toDisplayString(s.label),9,_c))),128))],40,zc),e.createElementVNode("div",Bc,[e.createVNode(e.unref(uo),{class:"w-4 h-4"})])])]))}}),vc={class:"p-4 flex flex-col gap-4"},Vc={key:1,class:"border-t border-ma-grey-300 my-2 pt-2 flex flex-col gap-4"},Pc=e.defineComponent({__name:"RightSidebar",props:{isCollapsed:{type:Boolean}},setup(t){const o=W(),n=e.computed(()=>o.selectedElement),s=e.computed(()=>n.value?.type==="group"),r=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(()=>r.value.some(_=>_.type==="shape")),i=e.computed(()=>r.value.some(_=>_.type==="text")),l=e.computed(()=>r.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||He,f.value=b.strokeWeight||0,p.value=b.content||"",h.value=b.fontFamily||"Arial",y.value=b.color||Ke,g.value=b.fontSize||16}else if(_&&_.type==="text")p.value=_.content,h.value=_.fontFamily,y.value=_.color||Ke,g.value=_.fontSize;else if(_&&_.type==="icon"){const b=_;x.value=b.color||ae,w.value=b.strokeWeight}},{immediate:!0,deep:!0});const I=_=>{r.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{outline:_}))},S=_=>{r.value.filter(b=>b.type==="shape").forEach(b=>o.updateElement(b.id,{fill:_}))},z=_=>{r.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,_=>{r.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:_})},$=_=>{r.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{color:_}))},F=_=>{r.value.filter(b=>b.type==="text"||b.type==="shape").forEach(b=>o.updateElement(b.id,{fontSize:_})),g.value=_},T=_=>{r.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",vc,[a.value||n.value?.type==="shape"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(bc,{key:0,id:"shape-link",label:"Link","model-value":n.value.link,onSave:E,onRemove:C},null,8,["model-value"])),e.createVNode(We,{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(We,{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(pt,{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"]),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vc,[b[13]||(b[13]=e.createElementVNode("h3",{class:"text-sm font-semibold mb-2 text-ma-text-02"}," Text Overlay ",-1)),e.createVNode(qn,{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(Wn,{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(pt,{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(We,{id:"shape-text-color",modelValue:y.value,"onUpdate:modelValue":b[6]||(b[6]=N=>y.value=N),label:"Text Color",onChange:$},null,8,["modelValue"])]))],64)):e.createCommentVNode("",!0),!s.value&&(i.value||n.value?.type==="text")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(qn,{id:"text-content",modelValue:p.value,"onUpdate:modelValue":[b[7]||(b[7]=N=>p.value=N),O],label:"Content"},null,8,["modelValue"]),e.createVNode(Wn,{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(pt,{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(We,{id:"text-color",modelValue:y.value,"onUpdate:modelValue":b[10]||(b[10]=N=>y.value=N),label:"Color",onChange:$},null,8,["modelValue"])],64)):e.createCommentVNode("",!0),l.value||n.value?.type==="icon"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(We,{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(pt,{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)}}),ut=100,Ic=e.defineComponent({__name:"DragGhost",setup(t){const o=J(),n=Ge(),{zoom:s}=Ne.storeToRefs(o),{isDragging:r,draggedShapeType:a,ghostPosition:i,draggedCustomPoints:l}=Ne.storeToRefs(n),d=e.computed(()=>({left:`${i.value.x}px`,top:`${i.value.y}px`,width:`${ut}px`,height:`${ut}px`}));return(c,f)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(r)&&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(Xe,{width:ut*e.unref(s),height:ut*e.unref(s),"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)]))}}),Nc=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]=s=>o.$emit("copy"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Bs),{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]=s=>o.$emit("duplicate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(_s),{class:"w-4 h-4"})]),_:1})],64))}}),Oc=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]=s=>o.$emit("rotate"))},{default:e.withCtx(()=>[e.createVNode(e.unref(Zs),{class:"w-4 h-4"})]),_:1}))}}),Ac=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]=s=>o.$emit("up"))},{default:e.withCtx(()=>[e.createVNode(e.unref(wt),{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]=s=>o.$emit("down"))},{default:e.withCtx(()=>[e.createVNode(e.unref(bt),{class:"w-4 h-4"})]),_:1})],64))}}),Mc=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]=s=>o.$emit("delete"))},{default:e.withCtx(()=>[e.createVNode(e.unref(go),{class:"w-4 h-4"})]),_:1}))}}),$c=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(Nc,{onCopy:n[0]||(n[0]=s=>o.$emit("copy")),onDuplicate:n[1]||(n[1]=s=>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(Oc,{onRotate:n[2]||(n[2]=s=>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(Ac,{onUp:n[3]||(n[3]=s=>o.$emit("up")),onDown:n[4]||(n[4]=s=>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(Mc,{onDelete:n[5]||(n[5]=s=>o.$emit("delete"))})],32))}}),Tc={key:0,class:"absolute top-0 left-0 w-full h-full pointer-events-none snap-lines","data-testid":"snap-lines-svg"},Dc=["data-testid","x1","y1","x2","y2"],Fc=["data-testid","x1","y1","x2","y2"],Rc=Zt(e.defineComponent({__name:"SnapLines",props:{snapLines:{},zoom:{}},setup(t){return(o,n)=>t.snapLines.length>0?(e.openBlock(),e.createElementBlock("svg",Tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.snapLines,(s,r)=>(e.openBlock(),e.createElementBlock("g",{key:r},[s.axis==="horizontal"?(e.openBlock(),e.createElementBlock("line",{key:0,"data-testid":`snap-line-horizontal-${r}`,x1:`${s.start*t.zoom}px`,y1:`${s.position*t.zoom}px`,x2:`${s.end*t.zoom}px`,y2:`${s.position*t.zoom}px`},null,8,Dc)):(e.openBlock(),e.createElementBlock("line",{key:1,"data-testid":`snap-line-vertical-${r}`,x1:`${s.position*t.zoom}px`,y1:`${s.start*t.zoom}px`,x2:`${s.position*t.zoom}px`,y2:`${s.end*t.zoom}px`},null,8,Fc))]))),128))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-c7baf393"]]),Lc={class:"flex items-center gap-1"},qc=e.defineComponent({__name:"FloatingZoomControls",props:{rightSidebarCollapsed:{type:Boolean}},setup(t){const o=t,n=J(),s=e.computed(()=>o.rightSidebarCollapsed?"right-4":"right-[272px]"),r=()=>{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",s.value])},[e.createElementVNode("div",Lc,[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(ho),{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(kt),{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(Ls),{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:r},{default:e.withCtx(()=>[e.createVNode(e.unref(Vs),{class:"w-4 h-4 text-ma-text-01"})]),_:1})])],2))}});function Wc(){const t=W(),o=J();return{contextBarStyle:e.computed(()=>{const s=t.selectedElement,r=o.zoom;if(!s)return{};const a=Ue(s),l=(a.x+a.width/2)*r;let d=a.y*r-64;return d<10&&(d=(a.y+a.height)*r+20),{left:`${l}px`,top:`${d}px`,transform:"translateX(-50%)"}})}}function jc(t){const o=W(),n=r=>{const a=r.ctrlKey||r.metaKey;if(a&&r.key==="s"){r.preventDefault(),t.saveToFile(o.exportSnapshot());return}if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key)&&o.selectedElementIds.length>0){r.preventDefault();const i=r.shiftKey?20:5;let l=0,d=0;switch(r.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&&r.key==="g"&&!r.shiftKey&&(r.preventDefault(),o.groupSelectedElements()),a&&r.shiftKey&&r.key==="G"&&(r.preventDefault(),o.ungroupSelectedElements())};return window.addEventListener("keydown",n),{cleanup:()=>{window.removeEventListener("keydown",n)}}}function jn(t){const o=Ue(t),{x:n,y:s,width:r,height:a}=o,{id:i}=t;return[{value:n,type:"left",elementId:i},{value:n+r,type:"right",elementId:i},{value:s,type:"top",elementId:i},{value:s+a,type:"bottom",elementId:i},{value:n+r/2,type:"center-x",elementId:i},{value:s+a/2,type:"center-y",elementId:i}]}function Un(t){return t.filter(o=>o.type==="left"||o.type==="right"||o.type==="center-x")}function Hn(t){return t.filter(o=>o.type==="top"||o.type==="bottom"||o.type==="center-y")}function Kn(t,o,n){let s=null,r=1/0;for(const a of o){const i=Math.abs(t-a.value);i<=n&&i<r&&(r=i,s=a)}return s===null?null:{snappedValue:s.value,snapPoint:s}}function Gn(t){const o=t.type==="top"||t.type==="bottom"||t.type==="center-y",n=J(),s=document.querySelector('[data-testid="canvas-container"]');let r=1e4,a=1e4;return s&&(r=s?.scrollWidth,a=s?.scrollHeight),o?{axis:"horizontal",position:t.value,start:0,end:r/n.zoom}:{axis:"vertical",position:t.value,start:0,end:a/n.zoom}}function Uc(t,o,n){const s=o.filter(x=>x.id!==t.id);if(s.length===0)return{x:t.x,y:t.y,snapLines:[]};const r=jn(t),a=Un(r),i=Hn(r),l=s.flatMap(jn),d=Un(l),c=Hn(l);let f=t.x,u=null,m=1/0;for(const x of a){const w=Kn(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=Kn(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(Gn(u)),h&&g.push(Gn(h)),{x:f,y:p,snapLines:g}}const Xn=5;function Hc(){const t=W(),o=e.ref([]);return{handleDrag:(r,a,i,l)=>{const d=t.elements.find(p=>p.id===r);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=Uc(u,t.topLevelElements,Xn);o.value=p.snapLines;const h=p.x-d.x,y=p.y-d.y;t.updateElementPosition(r,h,y)}else o.value=[],t.selectedElementIds.includes(r)?t.selectedElementIds.forEach(p=>{t.updateElementPosition(p,a,i)}):t.updateElementPosition(r,a,i)},handleDragEnd:()=>{o.value=[],t.endDrag()},activeSnapLines:o}}const Yn=50;function Kc(){const t=W();return{canvasContentSize:e.computed(()=>{if(t.elements.length===0)return{width:0,height:0};const n=Math.max(...t.elements.map(r=>r.x+r.width)),s=Math.max(...t.elements.map(r=>r.y+r.height));return{width:Math.max(0,n+Yn),height:Math.max(0,s+Yn)}})}}const Gc={class:"relative"},Xc={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"},Yc={class:"legend-header flex items-center justify-between p-4 border-b"},Zc={class:"flex items-center gap-2.5"},Jc={class:"legend-header-icon shadow-sm border p-1.5 rounded-lg"},Qc={class:"p-2 space-y-0.5 max-h-[60vh] overflow-y-auto custom-scrollbar"},ef={class:"row"},tf={class:"keys gap-1.5 font-bold"},of={class:"key leading-none pb-0.5 pt-0.5"},nf={class:"key leading-none pb-0.5 pt-0.5"},sf={class:"key leading-none pb-0.5 pt-0.5"},rf={class:"key leading-none pb-0.5 pt-0.5"},af=Zt(e.defineComponent({__name:"KeyboardLegend",setup(t){const o=e.ref(!1);return(n,s)=>(e.openBlock(),e.createElementBlock("div",Gc,[o.value?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[e.createElementVNode("div",Zc,[e.createElementVNode("div",Jc,[e.createVNode(e.unref(mo),{class:"w-4 h-4"})]),s[2]||(s[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:s[1]||(s[1]=r=>o.value=!1)},[e.createVNode(e.unref(Ct),{class:"w-4 h-4"})])]),e.createElementVNode("div",Qc,[s[4]||(s[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",ef,[s[3]||(s[3]=e.createElementVNode("span",{class:"label"},"Move",-1)),e.createElementVNode("div",tf,[e.createElementVNode("kbd",of,[e.createVNode(e.unref(wt),{class:"w-4 h-4"})]),e.createElementVNode("kbd",nf,[e.createVNode(e.unref(bt),{class:"w-4 h-4"})]),e.createElementVNode("kbd",sf,[e.createVNode(e.unref(fo),{class:"w-4 h-4"})]),e.createElementVNode("kbd",rf,[e.createVNode(e.unref(po),{class:"w-4 h-4"})])])]),s[5]||(s[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:s[0]||(s[0]=r=>o.value=!0)},[e.createVNode(e.unref(mo),{class:"w-7 h-7 transition-colors"})]))]))}}),[["__scopeId","data-v-dd253f3b"]]),lf={"data-testid":"edit-page-container",class:"flex h-screen w-screen overflow-hidden bg-bg-maincontent"},df={class:"flex flex-col flex-1 relative"},cf={class:"absolute bottom-[50px] left-4 z-20"},ff=e.defineComponent({__name:"EditPage",setup(t){const o=W(),n=Ge(),s=J(),r=e.ref(!1),a=e.ref(!0),{saveToFile:i}=Mn(),{contextBarStyle:l}=Wc(),{cleanup:d}=jc({saveToFile:i}),{handleDrag:c,handleDragEnd:f,activeSnapLines:u}=Hc(),{canvasContentSize:m}=Kc(),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 $=is(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};ls(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}=ds(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",lf,[e.createVNode(tc,{"is-collapsed":r.value},null,8,["is-collapsed"]),e.createElementVNode("div",df,[e.createVNode(An,{side:"left","is-collapsed":r.value,onToggle:z[0]||(z[0]=E=>r.value=!r.value)},null,8,["is-collapsed"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock(An,{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(Rc,{"snap-lines":e.unref(u),zoom:e.unref(s).zoom},null,8,["snap-lines","zoom"]),e.unref(o).selectedElement?(e.openBlock(),e.createBlock($c,{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(Co,{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",cf,[e.createVNode(af)])]),e.createVNode(Pc,{"is-collapsed":a.value},null,8,["is-collapsed"]),e.createVNode(qc,{"right-sidebar-collapsed":a.value},null,8,["right-sidebar-collapsed"]),e.createVNode(Ic)]))}});H.EditPage=ff,H.ElementWrapper=Co,H.GridCanvas=so,H.SNAP_THRESHOLD=Xn,H.useDragStore=Ge,H.useElementsStore=W,H.useZoomStore=J,Object.defineProperty(H,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"})}));