@craftile/editor 0.1.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.
@@ -0,0 +1,7 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){.__craftile *,.__craftile :before,.__craftile :after,.__craftile ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{.__craftile,.__craftile :host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-slate-400:oklch(70.4% .04 256.788);--color-gray-50:var(--color-gray-50,oklch(98.5% 0 0));--color-gray-100:var(--color-gray-100,oklch(96.7% .001 286.375));--color-gray-200:var(--color-gray-200,oklch(92% .004 286.32));--color-gray-300:var(--color-gray-300,oklch(87.1% .006 286.286));--color-gray-400:var(--color-gray-400,oklch(70.5% .015 286.067));--color-gray-500:var(--color-gray-500,oklch(55.2% .016 285.938));--color-gray-600:var(--color-gray-600,oklch(44.2% .017 285.786));--color-gray-700:var(--color-gray-700,oklch(37% .013 285.805));--color-gray-800:var(--color-gray-800,oklch(37% .013 285.805));--color-gray-900:var(--color-gray-900,oklch(37% .013 285.805));--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-xs:.125rem;--radius-md:.375rem;--radius-lg:.5rem;--ease-out:cubic-bezier(0,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-accent:var(--color-accent,oklch(54.6% .245 262.881));--color-accent-foreground:var(--color-accent-foreground,oklch(93.2% .032 255.585))}}@layer base{.__craftile *,.__craftile :after,.__craftile :before,.__craftile ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}.__craftile ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}.__craftile,.__craftile :host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}.__craftile hr{height:0;color:inherit;border-top-width:1px}.__craftile abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.__craftile h1,.__craftile h2,.__craftile h3,.__craftile h4,.__craftile h5,.__craftile h6{font-size:inherit;font-weight:inherit}.__craftile a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}.__craftile b,.__craftile strong{font-weight:bolder}.__craftile code,.__craftile kbd,.__craftile samp,.__craftile pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}.__craftile small{font-size:80%}.__craftile sub,.__craftile sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.__craftile sub{bottom:-.25em}.__craftile sup{top:-.5em}.__craftile table{text-indent:0;border-color:inherit;border-collapse:collapse}.__craftile :-moz-focusring{outline:auto}.__craftile progress{vertical-align:baseline}.__craftile summary{display:list-item}.__craftile ol,.__craftile ul,.__craftile menu{list-style:none}.__craftile img,.__craftile svg,.__craftile video,.__craftile canvas,.__craftile audio,.__craftile iframe,.__craftile embed,.__craftile object{vertical-align:middle;display:block}.__craftile img,.__craftile video{max-width:100%;height:auto}.__craftile button,.__craftile input,.__craftile select,.__craftile optgroup,.__craftile textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.__craftile ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.__craftile :where(select:is([multiple],[size])) optgroup{font-weight:bolder}.__craftile :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}.__craftile ::file-selector-button{margin-inline-end:4px}.__craftile ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){.__craftile ::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){.__craftile ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}.__craftile textarea{resize:vertical}.__craftile ::-webkit-search-decoration{-webkit-appearance:none}.__craftile ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}.__craftile ::-webkit-datetime-edit{display:inline-flex}.__craftile ::-webkit-datetime-edit-fields-wrapper{padding:0}.__craftile ::-webkit-datetime-edit{padding-block:0}.__craftile ::-webkit-datetime-edit-year-field{padding-block:0}.__craftile ::-webkit-datetime-edit-month-field{padding-block:0}.__craftile ::-webkit-datetime-edit-day-field{padding-block:0}.__craftile ::-webkit-datetime-edit-hour-field{padding-block:0}.__craftile ::-webkit-datetime-edit-minute-field{padding-block:0}.__craftile ::-webkit-datetime-edit-second-field{padding-block:0}.__craftile ::-webkit-datetime-edit-millisecond-field{padding-block:0}.__craftile ::-webkit-datetime-edit-meridiem-field{padding-block:0}.__craftile ::-webkit-calendar-picker-indicator{line-height:1}.__craftile :-moz-ui-invalid{box-shadow:none}.__craftile button,.__craftile input:where([type=button],[type=reset],[type=submit]){appearance:button}.__craftile ::file-selector-button{appearance:button}.__craftile ::-webkit-inner-spin-button{height:auto}.__craftile ::-webkit-outer-spin-button{height:auto}.__craftile [hidden]:where(:not([hidden=until-found])){display:none!important}.__craftile *,.__craftile :after,.__craftile :before,.__craftile ::backdrop{border-color:var(--color-gray-200,oklch(92% .004 286.32))}.__craftile ::file-selector-button{border-color:var(--color-gray-200,oklch(92% .004 286.32))}}@layer components{.__craftile .ghost-block{border-radius:var(--radius-md);border-style:var(--tw-border-style);--tw-border-style:dashed;border-style:dashed;border-width:2px;border-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .ghost-block{border-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))80%,transparent)}}.__craftile .ghost-block{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .ghost-block{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))20%,transparent)}}.__craftile .ghost-block{opacity:.3}}@layer utilities{.__craftile .pointer-events-auto{pointer-events:auto}.__craftile .pointer-events-none{pointer-events:none}.__craftile .visible{visibility:visible}.__craftile .sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.__craftile .absolute{position:absolute}.__craftile .fixed{position:fixed}.__craftile .relative{position:relative}.__craftile .static{position:static}.__craftile .inset-0{inset:calc(var(--spacing)*0)}.__craftile .-top-2{top:calc(var(--spacing)*-2)}.__craftile .-top-\\[18\\.5px\\]{top:-18.5px}.__craftile .-top-\\[19px\\]{top:-19px}.__craftile .top-0{top:calc(var(--spacing)*0)}.__craftile .top-1\\/2{top:50%}.__craftile .top-4{top:calc(var(--spacing)*4)}.__craftile .-right-2{right:calc(var(--spacing)*-2)}.__craftile .right-4{right:calc(var(--spacing)*4)}.__craftile .-bottom-2{bottom:calc(var(--spacing)*-2)}.__craftile .-left-2{left:calc(var(--spacing)*-2)}.__craftile .-left-\\[1px\\]{left:-1px}.__craftile .left-0{left:calc(var(--spacing)*0)}.__craftile .left-1\\/2{left:50%}.__craftile .left-14{left:calc(var(--spacing)*14)}.__craftile .\\!z-\\[1100\\]{z-index:1100!important}.__craftile .z-10{z-index:10}.__craftile .z-50{z-index:50}.__craftile .z-\\[1000\\]{z-index:1000}.__craftile .container{width:100%}@media (min-width:40rem){.__craftile .container{max-width:40rem}}@media (min-width:48rem){.__craftile .container{max-width:48rem}}@media (min-width:64rem){.__craftile .container{max-width:64rem}}@media (min-width:80rem){.__craftile .container{max-width:80rem}}@media (min-width:96rem){.__craftile .container{max-width:96rem}}.__craftile .m-0{margin:calc(var(--spacing)*0)}.__craftile .mx-0{margin-inline:calc(var(--spacing)*0)}.__craftile .mx-auto{margin-inline:auto}.__craftile .my-2{margin-block:calc(var(--spacing)*2)}.__craftile .mt-0{margin-top:calc(var(--spacing)*0)}.__craftile .mt-1{margin-top:calc(var(--spacing)*1)}.__craftile .mt-2{margin-top:calc(var(--spacing)*2)}.__craftile .mt-3{margin-top:calc(var(--spacing)*3)}.__craftile .mt-4{margin-top:calc(var(--spacing)*4)}.__craftile .mr-0\\.5{margin-right:calc(var(--spacing)*.5)}.__craftile .mr-1{margin-right:calc(var(--spacing)*1)}.__craftile .mb-1{margin-bottom:calc(var(--spacing)*1)}.__craftile .mb-2{margin-bottom:calc(var(--spacing)*2)}.__craftile .mb-3{margin-bottom:calc(var(--spacing)*3)}.__craftile .mb-4{margin-bottom:calc(var(--spacing)*4)}.__craftile .ml-3{margin-left:calc(var(--spacing)*3)}.__craftile .ml-auto{margin-left:auto}.__craftile .box-border{box-sizing:border-box}.__craftile .block{display:block}.__craftile .flex{display:flex}.__craftile .grid{display:grid}.__craftile .hidden{display:none}.__craftile .inline-flex{display:inline-flex}.__craftile .aspect-square{aspect-ratio:1}.__craftile .h-1\\.5{height:calc(var(--spacing)*1.5)}.__craftile .h-3{height:calc(var(--spacing)*3)}.__craftile .h-3\\.5{height:calc(var(--spacing)*3.5)}.__craftile .h-4{height:calc(var(--spacing)*4)}.__craftile .h-5{height:calc(var(--spacing)*5)}.__craftile .h-6{height:calc(var(--spacing)*6)}.__craftile .h-8{height:calc(var(--spacing)*8)}.__craftile .h-10{height:calc(var(--spacing)*10)}.__craftile .h-12{height:calc(var(--spacing)*12)}.__craftile .h-14{height:calc(var(--spacing)*14)}.__craftile .h-16{height:calc(var(--spacing)*16)}.__craftile .h-\\[2px\\]{height:2px}.__craftile .h-\\[480px\\]{height:480px}.__craftile .h-full{height:100%}.__craftile .max-h-\\[90vh\\]{max-height:90vh}.__craftile .max-h-\\[calc\\(100vh-2rem\\)\\]{max-height:calc(100vh - 2rem)}.__craftile .w-0{width:calc(var(--spacing)*0)}.__craftile .w-3{width:calc(var(--spacing)*3)}.__craftile .w-3\\.5{width:calc(var(--spacing)*3.5)}.__craftile .w-4{width:calc(var(--spacing)*4)}.__craftile .w-5{width:calc(var(--spacing)*5)}.__craftile .w-6{width:calc(var(--spacing)*6)}.__craftile .w-8{width:calc(var(--spacing)*8)}.__craftile .w-10{width:calc(var(--spacing)*10)}.__craftile .w-14{width:calc(var(--spacing)*14)}.__craftile .w-16{width:calc(var(--spacing)*16)}.__craftile .w-72{width:calc(var(--spacing)*72)}.__craftile .w-75{width:calc(var(--spacing)*75)}.__craftile .w-full{width:100%}.__craftile .w-md{width:var(--container-md)}.__craftile .max-w-2xl{max-width:var(--container-2xl)}.__craftile .max-w-\\[120px\\]{max-width:120px}.__craftile .max-w-\\[calc\\(100vw-2rem\\)\\]{max-width:calc(100vw - 2rem)}.__craftile .max-w-lg{max-width:var(--container-lg)}.__craftile .max-w-md{max-width:var(--container-md)}.__craftile .max-w-sm{max-width:var(--container-sm)}.__craftile .max-w-xl{max-width:var(--container-xl)}.__craftile .max-w-xs{max-width:var(--container-xs)}.__craftile .min-w-0{min-width:calc(var(--spacing)*0)}.__craftile .min-w-96{min-width:calc(var(--spacing)*96)}.__craftile .min-w-\\[160px\\]{min-width:160px}.__craftile .flex-1{flex:1}.__craftile .flex-none{flex:none}.__craftile .shrink-0{flex-shrink:0}.__craftile .-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.__craftile .-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.__craftile .rotate-90{rotate:90deg}.__craftile .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.__craftile .cursor-grab{cursor:grab}.__craftile .cursor-pointer{cursor:pointer}.__craftile .resize{resize:both}.__craftile .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.__craftile .flex-col{flex-direction:column}.__craftile .flex-wrap{flex-wrap:wrap}.__craftile .items-center{align-items:center}.__craftile .items-start{align-items:flex-start}.__craftile .justify-between{justify-content:space-between}.__craftile .justify-center{justify-content:center}.__craftile .gap-0\\.5{gap:calc(var(--spacing)*.5)}.__craftile .gap-1{gap:calc(var(--spacing)*1)}.__craftile .gap-1\\.5{gap:calc(var(--spacing)*1.5)}.__craftile .gap-2{gap:calc(var(--spacing)*2)}.__craftile .gap-3{gap:calc(var(--spacing)*3)}.__craftile .gap-4{gap:calc(var(--spacing)*4)}.__craftile :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.__craftile :where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.__craftile .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.__craftile .overflow-auto{overflow:auto}.__craftile .overflow-hidden{overflow:hidden}.__craftile .overflow-y-auto{overflow-y:auto}.__craftile .overflow-y-hidden{overflow-y:hidden}.__craftile .rounded{border-radius:.25rem}.__craftile .rounded-full{border-radius:3.40282e38px}.__craftile .rounded-lg{border-radius:var(--radius-lg)}.__craftile .rounded-md{border-radius:var(--radius-md)}.__craftile .rounded-xs{border-radius:var(--radius-xs)}.__craftile .rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.__craftile .border{border-style:var(--tw-border-style);border-width:1px}.__craftile .border-0{border-style:var(--tw-border-style);border-width:0}.__craftile .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.__craftile .border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.__craftile .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.__craftile .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.__craftile .border-dashed{--tw-border-style:dashed;border-style:dashed}.__craftile .border-solid{--tw-border-style:solid;border-style:solid}.__craftile .border-\\[none\\]{border-color:none}.__craftile .border-amber-200{border-color:var(--color-amber-200)}.__craftile .border-amber-300{border-color:var(--color-amber-300)}.__craftile .border-blue-200{border-color:var(--color-blue-200)}.__craftile .border-blue-300{border-color:var(--color-blue-300)}.__craftile .border-blue-500{border-color:var(--color-blue-500)}.__craftile .border-gray-100{border-color:var(--color-gray-100,oklch(96.7% .001 286.375))}.__craftile .border-gray-200{border-color:var(--color-gray-200,oklch(92% .004 286.32))}.__craftile .border-gray-300{border-color:var(--color-gray-300,oklch(87.1% .006 286.286))}.__craftile .border-red-200{border-color:var(--color-red-200)}.__craftile .border-red-300{border-color:var(--color-red-300)}.__craftile .border-slate-400{border-color:var(--color-slate-400)}.__craftile .border-white\\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.__craftile .border-white\\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.__craftile .bg-accent{background-color:var(--color-accent,oklch(54.6% .245 262.881))}.__craftile .bg-accent-foreground{background-color:var(--color-accent-foreground,oklch(93.2% .032 255.585))}.__craftile .bg-accent\\/8{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-accent\\/8{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))8%,transparent)}}.__craftile .bg-accent\\/70{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-accent\\/70{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))70%,transparent)}}.__craftile .bg-amber-50{background-color:var(--color-amber-50)}.__craftile .bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.__craftile .bg-blue-50{background-color:var(--color-blue-50)}.__craftile .bg-blue-500{background-color:var(--color-blue-500)}.__craftile .bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.__craftile .bg-blue-500\\/90{background-color:#3080ffe6}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-blue-500\\/90{background-color:color-mix(in oklab,var(--color-blue-500)90%,transparent)}}.__craftile .bg-blue-500\\/95{background-color:#3080fff2}@supports (color:color-mix(in lab,red,red)){.__craftile .bg-blue-500\\/95{background-color:color-mix(in oklab,var(--color-blue-500)95%,transparent)}}.__craftile .bg-gray-50{background-color:var(--color-gray-50,oklch(98.5% 0 0))}.__craftile .bg-gray-100{background-color:var(--color-gray-100,oklch(96.7% .001 286.375))}.__craftile .bg-gray-800{background-color:var(--color-gray-800,oklch(37% .013 285.805))}.__craftile .bg-red-50{background-color:var(--color-red-50)}.__craftile .bg-red-600{background-color:var(--color-red-600)}.__craftile .bg-transparent{background-color:#0000}.__craftile .bg-white{background-color:var(--color-white)}.__craftile .fill-current{fill:currentColor}.__craftile .p-0{padding:calc(var(--spacing)*0)}.__craftile .p-0\\.5{padding:calc(var(--spacing)*.5)}.__craftile .p-1{padding:calc(var(--spacing)*1)}.__craftile .p-1\\.5{padding:calc(var(--spacing)*1.5)}.__craftile .p-2{padding:calc(var(--spacing)*2)}.__craftile .p-3{padding:calc(var(--spacing)*3)}.__craftile .p-4{padding:calc(var(--spacing)*4)}.__craftile .p-6{padding:calc(var(--spacing)*6)}.__craftile .px-1{padding-inline:calc(var(--spacing)*1)}.__craftile .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.__craftile .px-2{padding-inline:calc(var(--spacing)*2)}.__craftile .px-3{padding-inline:calc(var(--spacing)*3)}.__craftile .px-4{padding-inline:calc(var(--spacing)*4)}.__craftile .px-6{padding-inline:calc(var(--spacing)*6)}.__craftile .py-0\\.5{padding-block:calc(var(--spacing)*.5)}.__craftile .py-1{padding-block:calc(var(--spacing)*1)}.__craftile .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.__craftile .py-2{padding-block:calc(var(--spacing)*2)}.__craftile .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.__craftile .py-3{padding-block:calc(var(--spacing)*3)}.__craftile .py-4{padding-block:calc(var(--spacing)*4)}.__craftile .py-8{padding-block:calc(var(--spacing)*8)}.__craftile .pb-2{padding-bottom:calc(var(--spacing)*2)}.__craftile .text-center{text-align:center}.__craftile .text-left{text-align:left}.__craftile .font-mono{font-family:var(--font-mono)}.__craftile .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.__craftile .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.__craftile .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.__craftile .text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.__craftile .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.__craftile .text-\\[0\\.6rem\\],.__craftile .text-\\[0\\.60rem\\]{font-size:.6rem}.__craftile .text-\\[13px\\]{font-size:13px}.__craftile .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.__craftile .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.__craftile .text-ellipsis{text-overflow:ellipsis}.__craftile .whitespace-nowrap{white-space:nowrap}.__craftile .text-accent{color:var(--color-accent,oklch(54.6% .245 262.881))}.__craftile .text-accent\\!{color:var(--color-accent,oklch(54.6% .245 262.881))!important}.__craftile .text-accent-foreground{color:var(--color-accent-foreground,oklch(93.2% .032 255.585))}.__craftile .text-amber-700{color:var(--color-amber-700)}.__craftile .text-amber-800{color:var(--color-amber-800)}.__craftile .text-blue-700{color:var(--color-blue-700)}.__craftile .text-blue-800{color:var(--color-blue-800)}.__craftile .text-gray-400{color:var(--color-gray-400,oklch(70.5% .015 286.067))}.__craftile .text-gray-500{color:var(--color-gray-500,oklch(55.2% .016 285.938))}.__craftile .text-gray-600{color:var(--color-gray-600,oklch(44.2% .017 285.786))}.__craftile .text-gray-700{color:var(--color-gray-700,oklch(37% .013 285.805))}.__craftile .text-gray-800{color:var(--color-gray-800,oklch(37% .013 285.805))}.__craftile .text-gray-900{color:var(--color-gray-900,oklch(37% .013 285.805))}.__craftile .text-red-600{color:var(--color-red-600)}.__craftile .text-red-700{color:var(--color-red-700)}.__craftile .text-red-800{color:var(--color-red-800)}.__craftile .text-white{color:var(--color-white)}.__craftile .capitalize{text-transform:capitalize}.__craftile .opacity-0{opacity:0}.__craftile .opacity-70{opacity:.7}.__craftile .opacity-80{opacity:.8}.__craftile .opacity-90{opacity:.9}.__craftile .opacity-100{opacity:1}.__craftile .shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .shadow-black\\/25{--tw-shadow-color:#00000040}@supports (color:color-mix(in lab,red,red)){.__craftile .shadow-black\\/25{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)25%,transparent)var(--tw-shadow-alpha),transparent)}}.__craftile .ring-white\\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.__craftile .ring-white\\/10{--tw-ring-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.__craftile .filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.__craftile .transition-\\[background\\]{transition-property:background;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.__craftile .duration-100{--tw-duration:.1s;transition-duration:.1s}.__craftile .duration-200{--tw-duration:.2s;transition-duration:.2s}.__craftile .duration-300{--tw-duration:.3s;transition-duration:.3s}.__craftile .duration-\\[0\\.2s\\]{--tw-duration:.2s;transition-duration:.2s}.__craftile .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.__craftile .not-last\\:border-b:not(:last-child){border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media (hover:hover){.__craftile .group-hover\\:flex:is(:where(.group):hover *){display:flex}.__craftile .group-hover\\:w-full:is(:where(.group):hover *){width:100%}.__craftile .group-hover\\:opacity-0:is(:where(.group):hover *){opacity:0}.__craftile .group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.__craftile .last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.__craftile .hover\\:border-gray-300:hover{border-color:var(--color-gray-300,oklch(87.1% .006 286.286))}.__craftile .hover\\:bg-accent\\/90:hover{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .hover\\:bg-accent\\/90:hover{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))90%,transparent)}}.__craftile .hover\\:bg-amber-100:hover{background-color:var(--color-amber-100)}.__craftile .hover\\:bg-blue-100:hover{background-color:var(--color-blue-100)}.__craftile .hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.__craftile .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50,oklch(98.5% 0 0))}.__craftile .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100,oklch(96.7% .001 286.375))}.__craftile .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200,oklch(92% .004 286.32))}.__craftile .hover\\:bg-red-50:hover{background-color:var(--color-red-50)}.__craftile .hover\\:bg-red-100:hover{background-color:var(--color-red-100)}.__craftile .hover\\:bg-red-700:hover{background-color:var(--color-red-700)}.__craftile .hover\\:text-gray-600:hover{color:var(--color-gray-600,oklch(44.2% .017 285.786))}.__craftile .hover\\:text-gray-700:hover{color:var(--color-gray-700,oklch(37% .013 285.805))}.__craftile .hover\\:text-red-600:hover{color:var(--color-red-600)}.__craftile .hover\\:opacity-100:hover{opacity:1}.__craftile .hover\\:ring-2:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .hover\\:ring-accent\\/40:hover{--tw-ring-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .hover\\:ring-accent\\/40:hover{--tw-ring-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))40%,transparent)}}}.__craftile .focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .focus\\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.__craftile .focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.__craftile .focus-visible\\:border-transparent:focus-visible{border-color:#0000}.__craftile .focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.__craftile .focus-visible\\:ring-accent:focus-visible{--tw-ring-color:var(--color-accent,oklch(54.6% .245 262.881))}.__craftile .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.__craftile .focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.__craftile .active\\:cursor-grabbing:active{cursor:grabbing}@media (hover:hover){.__craftile .hover\\:enabled\\:bg-gray-500:hover:enabled{background-color:var(--color-gray-500,oklch(55.2% .016 285.938))}.__craftile .hover\\:enabled\\:bg-red-800:hover:enabled{background-color:var(--color-red-800)}.__craftile .hover\\:enabled\\:text-gray-100:hover:enabled{color:var(--color-gray-100,oklch(96.7% .001 286.375))}.__craftile .hover\\:enabled\\:text-red-200:hover:enabled{color:var(--color-red-200)}}.__craftile .active\\:enabled\\:bg-gray-600:active:enabled{background-color:var(--color-gray-600,oklch(44.2% .017 285.786))}.__craftile .disabled\\:pointer-events-none:disabled{pointer-events:none}.__craftile .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.__craftile .disabled\\:text-gray-600:disabled{color:var(--color-gray-600,oklch(44.2% .017 285.786))}.__craftile .disabled\\:opacity-50:disabled{opacity:.5}.__craftile .data-selected\\:border[data-selected]{border-style:var(--tw-border-style);border-width:1px}.__craftile .data-selected\\:border-b-2[data-selected]{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.__craftile .data-selected\\:border-accent[data-selected],.__craftile .data-selected\\:border-accent\\/20[data-selected]{border-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .data-selected\\:border-accent\\/20[data-selected]{border-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))20%,transparent)}}.__craftile .data-selected\\:bg-accent\\/10[data-selected]{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .data-selected\\:bg-accent\\/10[data-selected]{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))10%,transparent)}}.__craftile .data-selected\\:bg-white[data-selected]{background-color:var(--color-white)}.__craftile .data-selected\\:text-accent[data-selected]{color:var(--color-accent,oklch(54.6% .245 262.881))}.__craftile .data-selected\\:shadow[data-selected]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media (hover:hover){.__craftile .data-selected\\:hover\\:bg-accent\\/10[data-selected]:hover{background-color:var(--color-accent,oklch(54.6% .245 262.881))}@supports (color:color-mix(in lab,red,red)){.__craftile .data-selected\\:hover\\:bg-accent\\/10[data-selected]:hover{background-color:color-mix(in oklab,var(--color-accent,oklch(54.6% .245 262.881))10%,transparent)}}}.__craftile .data-\\[disabled\\]\\:cursor-not-allowed[data-disabled]{cursor:not-allowed}.__craftile .data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.__craftile .data-\\[state\\=open\\]\\:rotate-180[data-state=open]{rotate:180deg}.__craftile .\\[\\&_svg\\]\\:h-full svg{height:100%}.__craftile .\\[\\&_svg\\]\\:w-full svg{width:100%}.__craftile .\\[\\&_svg\\]\\:fill-current svg{fill:currentColor}.__craftile .\\[\\&\\>svg\\]\\:w-3\\.5>svg{width:calc(var(--spacing)*3.5)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}')),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
+ (function(gt,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(gt=typeof globalThis<"u"?globalThis:gt||self,n(gt.CraftileEditor={},gt.Vue))})(this,(function(gt,n){"use strict";class si{listeners=new Map;on(t,o){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(o),()=>{this.off(t,o)}}off(t,o){const r=this.listeners.get(t);r&&(r.delete(o),r.size===0&&this.listeners.delete(t))}once(t,o){const r=i=>{o(i),this.off(t,r)};this.on(t,r)}emit(t,...o){const r=this.listeners.get(t);if(r){const i=o[0];r.forEach(s=>{try{s(i)}catch(a){console.error(`Error in event listener for '${String(t)}':`,a)}})}}removeAllListeners(t){t?this.listeners.delete(t):this.listeners.clear()}}class Ja{schemas=new Map;patternCache=new Map;register(t,o){if(this.schemas.has(t))throw new Error(`Block type '${t}' is already registered`);this.schemas.set(t,o)}registerMany(t){for(const[o,r]of Object.entries(t))this.register(o,r)}unregister(t){return this.schemas.delete(t)}get(t){return this.schemas.get(t)}has(t){return this.schemas.has(t)}getAll(){const t={};for(const[o,r]of this.schemas.entries())t[o]=r;return t}find(t){const o=[];for(const[r,i]of this.schemas.entries())t(r,i)&&o.push(r);return o}canBeChild(t,o){const r=this.get(o);return!r||!r.accepts?!1:r.accepts.some(i=>this.matchesPattern(t,i))}getTypes(){return Array.from(this.schemas.keys())}matchesPattern(t,o){if(o==="*")return!0;if(!this.patternCache.has(o)){const s="^"+o.replace(/\*/g,"__WILDCARD__").replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/__WILDCARD__/g,".*")+"$";this.patternCache.set(o,new RegExp(s))}return this.patternCache.get(o).test(t)}}class Za{history=[];currentIndex=-1;maxHistorySize;constructor(t=100){this.maxHistorySize=t}addCommand(t){this.currentIndex<this.history.length-1&&this.history.splice(this.currentIndex+1),this.history.length>=this.maxHistorySize&&(this.history.shift(),this.currentIndex--),this.history.push(t),this.currentIndex++}undo(){if(!this.canUndo())return null;const t=this.history[this.currentIndex];return t.revert(),this.currentIndex--,t}redo(){if(!this.canRedo())return null;this.currentIndex++;const t=this.history[this.currentIndex];return t.apply(),t}canUndo(){return this.currentIndex>=0}canRedo(){return this.currentIndex<this.history.length-1}clear(){this.history=[],this.currentIndex=-1}getCurrentIndex(){return this.currentIndex}getHistorySize(){return this.history.length}}const Vo=()=>crypto.randomUUID?crypto.randomUUID():Date.now().toString(36)+Math.random().toString(36).substr(2);class Qa{page;blockType;parentId;regionName;index;blockId;properties;insertedBlock;actualIndex;emit;constructor(t,o){this.page=t,this.blockType=o.blockType,this.parentId=o.parentId,this.regionName=o.regionName,this.index=o.index,this.blockId=Vo(),this.emit=o.emit,this.properties=this.buildProperties(o.blockSchema)}apply(){if(this.insertedBlock={type:this.blockType,id:this.blockId,properties:this.properties,children:[],parentId:void 0},this.page.blocks[this.blockId]=this.insertedBlock,this.parentId){const t=this.page.blocks[this.parentId];if(!t)throw new Error(`Parent block not found: ${this.parentId}`);this.insertedBlock.parentId=t.id,this.index!==void 0&&this.index>=0&&this.index<=t.children.length?(t.children.splice(this.index,0,this.blockId),this.actualIndex=this.index):(t.children.push(this.blockId),this.actualIndex=t.children.length-1)}else{const t=this.regionName||this.page.regions[0].name;let o=this.page.regions.find(r=>r.name===t);o||(o={name:t,blocks:[]},this.page.regions.push(o)),this.index!==void 0&&this.index>=0&&this.index<=o.blocks.length?(o.blocks.splice(this.index,0,this.blockId),this.actualIndex=this.index):(o.blocks.push(this.blockId),this.actualIndex=o.blocks.length-1)}this.emit("block:insert",{blockId:this.blockId,block:this.insertedBlock,parentId:this.parentId,index:this.actualIndex,regionName:this.regionName||this.page.regions[0].name})}revert(){if(this.insertedBlock){if(delete this.page.blocks[this.blockId],this.parentId){const t=this.page.blocks[this.parentId];t&&this.actualIndex!==void 0&&t.children.splice(this.actualIndex,1)}else{const t=this.regionName||this.page.regions[0].name,o=this.page.regions.find(r=>r.name===t);o&&this.actualIndex!==void 0&&o.blocks.splice(this.actualIndex,1)}this.emit("block:remove",{blockId:this.blockId,block:this.insertedBlock,parentId:this.parentId})}}getBlockId(){return this.blockId}getInsertedBlock(){return this.insertedBlock}buildProperties(t){const o={};if(t?.properties)for(const r of t.properties)r.default!==void 0&&(o[r.id]=r.default);return o}}class el{page;blockId;removedBlock;originalIndex;originalParentId;regionName;emit;constructor(t,o){this.page=t,this.blockId=o.blockId,this.emit=o.emit}apply(){if(this.removedBlock=this.page.blocks[this.blockId],!this.removedBlock)throw new Error(`Block not found: ${this.blockId}`);if(this.originalParentId=this.removedBlock.parentId,this.originalParentId){const t=this.page.blocks[this.originalParentId];t&&(this.originalIndex=t.children.indexOf(this.blockId),this.originalIndex!==-1&&t.children.splice(this.originalIndex,1))}else{const t=this.page.regions.find(o=>o.blocks.includes(this.blockId));t&&(this.originalIndex=t.blocks.indexOf(this.blockId),this.regionName=t.name,t.blocks.splice(this.originalIndex,1))}delete this.page.blocks[this.blockId],this.emit("block:remove",{blockId:this.blockId,block:this.removedBlock,parentId:this.originalParentId})}revert(){if(!(!this.removedBlock||this.originalIndex===void 0)){if(this.page.blocks[this.blockId]=this.removedBlock,this.originalParentId){const t=this.page.blocks[this.originalParentId];t&&t.children.splice(this.originalIndex,0,this.blockId)}else if(this.regionName){const t=this.page.regions.find(o=>o.name===this.regionName);t&&t.blocks.splice(this.originalIndex,0,this.blockId)}this.emit("block:insert",{blockId:this.blockId,block:this.removedBlock,parentId:this.originalParentId,index:this.originalIndex,regionName:this.regionName})}}getBlockId(){return this.blockId}getRemovedBlock(){return this.removedBlock}}class tl{page;blockId;targetParentId;targetIndex;targetRegionName;blockToMove;originalParentId;originalIndex;originalRegionName;emit;constructor(t,o){this.page=t,this.blockId=o.blockId,this.targetParentId=o.targetParentId,this.targetIndex=o.targetIndex,this.targetRegionName=o.targetRegionName,this.emit=o.emit}apply(){if(this.blockToMove=this.page.blocks[this.blockId],!this.blockToMove)throw new Error(`Block not found: ${this.blockId}`);if(this.targetParentId&&!this.page.blocks[this.targetParentId])throw new Error(`Target parent not found: ${this.targetParentId}`);if(this.originalParentId=this.blockToMove.parentId,this.originalParentId){const t=this.page.blocks[this.originalParentId];t&&(this.originalIndex=t.children.indexOf(this.blockId),this.originalIndex!==-1&&t.children.splice(this.originalIndex,1))}else{const t=this.page.regions.find(o=>o.blocks.includes(this.blockId));t&&(this.originalIndex=t.blocks.indexOf(this.blockId),this.originalRegionName=t.name,t.blocks.splice(this.originalIndex,1))}if(this.targetParentId){const t=this.page.blocks[this.targetParentId];this.blockToMove.parentId=this.targetParentId,this.targetIndex!==void 0&&this.targetIndex>=0&&this.targetIndex<=t.children.length?t.children.splice(this.targetIndex,0,this.blockId):t.children.push(this.blockId)}else{this.blockToMove.parentId=void 0;const t=this.targetRegionName||this.page.regions[0].name||"main";let o=this.page.regions.find(r=>r.name===t);o||(o={name:t,blocks:[]},this.page.regions.push(o)),this.targetIndex!==void 0&&this.targetIndex>=0&&this.targetIndex<=o.blocks.length?o.blocks.splice(this.targetIndex,0,this.blockId):o.blocks.push(this.blockId)}this.emit("block:move",{blockId:this.blockId,targetParentId:this.targetParentId,targetIndex:this.targetIndex,targetRegionName:this.targetRegionName,sourceParentId:this.originalParentId||null,sourceRegionName:this.originalRegionName||null,sourceIndex:this.originalIndex})}revert(){if(!(!this.blockToMove||this.originalIndex===void 0)){if(this.blockToMove.parentId){const t=this.page.blocks[this.blockToMove.parentId];if(t){const o=t.children.indexOf(this.blockId);o!==-1&&t.children.splice(o,1)}}else{const t=this.page.regions.find(o=>o.blocks.includes(this.blockId));if(t){const o=t.blocks.indexOf(this.blockId);o!==-1&&t.blocks.splice(o,1)}}if(this.blockToMove.parentId=this.originalParentId,this.originalParentId){const t=this.page.blocks[this.originalParentId];t&&t.children.splice(this.originalIndex,0,this.blockId)}else if(this.originalRegionName){const t=this.page.regions.find(o=>o.name===this.originalRegionName);t&&t.blocks.splice(this.originalIndex,0,this.blockId)}this.emit("block:move",{blockId:this.blockId,targetParentId:this.originalParentId,targetIndex:this.originalIndex,targetRegionName:this.originalRegionName,sourceParentId:this.targetParentId||null,sourceRegionName:this.targetRegionName||null,sourceIndex:this.targetIndex||0})}}getBlockId(){return this.blockId}getTargetParentId(){return this.targetParentId}getTargetIndex(){return this.targetIndex}getTargetRegionName(){return this.targetRegionName}getSourceParentId(){return this.originalParentId||null}getSourceRegionName(){return this.originalRegionName||null}getSourceIndex(){return this.originalIndex}}class nl{page;blockId;targetDisabled;originalDisabled;block;emit;constructor(t,o){this.page=t,this.blockId=o.blockId,this.targetDisabled=o.disabled,this.emit=o.emit}apply(){if(this.block=this.page.blocks[this.blockId],!this.block)throw new Error(`Block not found: ${this.blockId}`);this.originalDisabled=this.block.disabled,this.targetDisabled!==void 0?this.block.disabled=this.targetDisabled:this.block.disabled=!this.block.disabled,this.emit("block:toggle",{blockId:this.blockId,disabled:this.block.disabled??!1,oldValue:this.originalDisabled})}revert(){this.block&&(this.originalDisabled!==void 0?this.block.disabled=this.originalDisabled:this.block.disabled=!this.block.disabled,this.emit("block:toggle",{blockId:this.blockId,disabled:this.block.disabled??!1,oldValue:this.targetDisabled!==void 0?this.targetDisabled:!this.originalDisabled}))}getBlockId(){return this.blockId}getOriginalDisabled(){return this.originalDisabled}getNewDisabled(){return this.block?.disabled}}class ol{page;blockId;propertyKey;propertyValue;originalValue;block;emit;constructor(t,o){this.page=t,this.blockId=o.blockId,this.propertyKey=o.propertyKey,this.propertyValue=o.propertyValue,this.emit=o.emit}apply(){if(this.block=this.page.blocks[this.blockId],!this.block)throw new Error(`Block not found: ${this.blockId}`);this.block.properties||(this.block.properties={}),this.originalValue=this.block.properties[this.propertyKey],this.block.properties[this.propertyKey]=this.propertyValue,this.emit("block:property:set",{blockId:this.blockId,key:this.propertyKey,value:this.propertyValue,oldValue:this.originalValue})}revert(){!this.block||!this.block.properties||(this.originalValue!==void 0?this.block.properties[this.propertyKey]=this.originalValue:delete this.block.properties[this.propertyKey],this.emit("block:property:set",{blockId:this.blockId,key:this.propertyKey,value:this.originalValue,oldValue:this.propertyValue}))}getBlockId(){return this.blockId}getPropertyKey(){return this.propertyKey}getPropertyValue(){return this.propertyValue}getOriginalValue(){return this.originalValue}}class rl{page;blockId;duplicatedBlockId;duplicatedBlock;parentId;insertIndex;regionName;emit;constructor(t,o){this.page=t,this.blockId=o.blockId,this.emit=o.emit}apply(){const t=this.page.blocks[this.blockId];if(!t)throw new Error(`Block not found: ${this.blockId}`);this.duplicatedBlockId=Vo(),this.duplicatedBlock=this.cloneBlockWithNewIds(t,this.duplicatedBlockId,t.parentId),this.determineInsertLocation(),this.insertDuplicatedBlock(),this.emit("block:duplicate",{originalBlockId:this.blockId,newBlockId:this.duplicatedBlockId,newBlock:this.duplicatedBlock,parentId:this.parentId||void 0,index:this.insertIndex,regionName:this.regionName||void 0})}revert(){!this.duplicatedBlock||!this.duplicatedBlockId||this.removeDuplicatedBlock()}getBlockId(){return this.blockId}getDuplicatedBlockId(){return this.duplicatedBlockId}getDuplicatedBlock(){return this.duplicatedBlock}getParentId(){return this.parentId}getInsertIndex(){return this.insertIndex}getRegionName(){return this.regionName}cloneBlockWithNewIds(t,o,r){const i={...structuredClone(t),id:o,parentId:r,children:[]};if(t.children&&t.children.length>0)for(const s of t.children){const a=this.page.blocks[s];if(a){const c=Vo();this.cloneBlockWithNewIds(a,c,o),i.children.push(c)}}return this.page.blocks[o]=i,i}determineInsertLocation(){const t=this.page.blocks[this.blockId];if(!t)throw new Error(`Block not found: ${this.blockId}`);if(this.parentId=t.parentId||null,this.parentId){const o=this.page.blocks[this.parentId];if(o){const r=o.children.indexOf(this.blockId);this.insertIndex=r!==-1?r+1:o.children.length}else this.insertIndex=0}else{const o=this.page.regions.find(r=>r.blocks.includes(this.blockId));if(o){const r=o.blocks.indexOf(this.blockId);this.regionName=o.name,this.insertIndex=r+1}else this.regionName=this.page.regions[0].name||"main",this.insertIndex=this.page.regions[0].blocks.length||0}}insertDuplicatedBlock(){if(this.duplicatedBlock)if(this.parentId){const t=this.page.blocks[this.parentId];if(!t)throw new Error(`Parent block not found: ${this.parentId}`);t.children.splice(this.insertIndex,0,this.duplicatedBlockId)}else{let t=this.page.regions.find(o=>o.name===this.regionName);t||(t={name:this.regionName||"main",blocks:[]},this.page.regions.push(t)),t.blocks.splice(this.insertIndex,0,this.duplicatedBlockId)}}removeDuplicatedBlock(){if(this.duplicatedBlockId){if(this.removeBlockAndChildren(this.duplicatedBlockId),this.parentId){const t=this.page.blocks[this.parentId];if(t){const o=t.children.indexOf(this.duplicatedBlockId);o!==-1&&t.children.splice(o,1)}}else if(this.page.regions){const t=this.page.regions.find(o=>o.name===this.regionName);if(t){const o=t.blocks.indexOf(this.duplicatedBlockId);o!==-1&&t.blocks.splice(o,1)}}}}removeBlockAndChildren(t){const o=this.page.blocks[t];if(o){for(const r of o.children)this.removeBlockAndChildren(r);delete this.page.blocks[t]}}}class Mo extends si{page;blocksManager;historyManager;constructor(t={}){super(),this.blocksManager=t.blocksManager||new Ja,this.historyManager=new Za,this.setPage(t.page?t.page:{blocks:{},regions:[{name:"main",blocks:[]}]}),t.blockSchemas&&t.blockSchemas.length>0&&t.blockSchemas.forEach(o=>{this.blocksManager.register(o.type,o)})}insertBlock(t,o){const r=this.blocksManager.get(t);if(!r)throw new Error(`Block type '${t}' is not registered`);if(o?.parentId){const s=this.page.blocks[o.parentId];if(!s)throw new Error(`Parent block not found: ${o.parentId}`);if(!this.blocksManager.canBeChild(t,s.type))throw new Error(`Block type '${t}' cannot be a child of '${s.type}'`)}const i=new Qa(this.page,{blockType:t,parentId:o?.parentId,regionName:o?.regionName,index:o?.index,blockSchema:r,emit:this.emit.bind(this)});return i.apply(),this.historyManager.addCommand(i),i.getBlockId()}removeBlock(t){const o=new el(this.page,{blockId:t,emit:this.emit.bind(this)});o.apply(),this.historyManager.addCommand(o)}moveBlock(t,o){const r=this.page.blocks[t];if(o?.targetParentId){const s=this.page.blocks[o.targetParentId];if(!s)throw new Error(`Target parent block not found: ${o.targetParentId}`);if(!this.blocksManager.canBeChild(r.type,s.type))throw new Error(`Block type '${r.type}' cannot be a child of '${s.type}'`)}const i=new tl(this.page,{blockId:t,targetParentId:o?.targetParentId,targetIndex:o?.targetIndex,targetRegionName:o?.targetRegionName,emit:this.emit.bind(this)});i.apply(),this.historyManager.addCommand(i)}toggleBlock(t,o){const r=new nl(this.page,{blockId:t,disabled:o,emit:this.emit.bind(this)});r.apply(),this.historyManager.addCommand(r)}setBlockProperty(t,o,r){const i=new ol(this.page,{blockId:t,propertyKey:o,propertyValue:r,emit:this.emit.bind(this)});i.apply(),this.historyManager.addCommand(i)}duplicateBlock(t){const o=new rl(this.page,{blockId:t,emit:this.emit.bind(this)});return o.apply(),this.historyManager.addCommand(o),o.getDuplicatedBlockId()}getBlockById(t){return this.page.blocks[t]}getPage(){return structuredClone(this.page)}setPage(t){const o=structuredClone(this.page);this.page=structuredClone(t),this.page.regions.length===0&&(this.page.regions=[{name:"main",blocks:Object.keys(this.page.blocks)}]),this.page.regions.length===0&&(this.page.regions=[{name:"main",blocks:Object.values(this.page.blocks).filter(r=>!r.parentId).map(r=>r.id)}]),this.initializeParentChildRelationships(),this.historyManager.clear(),this.emit("page:set",{previousPage:o,newPage:structuredClone(this.page)})}getBlocksManager(){return this.blocksManager}getBlockSchemas(){return this.blocksManager.getAll()}getBlockSchema(t){return this.blocksManager.get(t)}undo(){const t=this.historyManager.undo();return t!==null&&this.emit("undo",{command:t}),t!==null}redo(){const t=this.historyManager.redo();return t!==null&&this.emit("redo",{command:t}),t!==null}canUndo(){return this.historyManager.canUndo()}canRedo(){return this.historyManager.canRedo()}initializeParentChildRelationships(){const t=o=>{o.children&&o.children.length>0&&o.children.forEach(r=>{const i=this.page.blocks[r];i&&(i.parentId||(i.parentId=o.id),t(i))})};Object.values(this.page.blocks).forEach(t)}}const Q=Symbol("craftile-editor"),en=n.defineComponent({__name:"RenderFunctionWrapper",props:{renderFn:{type:Function}},setup(e){const t=n.inject(Q),o=e,r=n.ref(),i=()=>{if(!r.value||!o.renderFn)return;r.value.innerHTML="";const s=o.renderFn({editor:t});r.value.appendChild(s)};return n.onMounted(()=>{i()}),(s,a)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:r},null,512))}}),il={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sl(e,t){return n.openBlock(),n.createElementBlock("svg",il,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M6 18L18 6M6 6l12 12"},null,-1)])])}const Fo=n.markRaw({name:"heroicons-x-mark",render:sl}),ee=e=>{const t=Symbol(e);return[i=>n.provide(t,i),i=>n.inject(t,i),t]},[ai,tn]=ee("AccordionContext"),al=n.defineComponent({__name:"accordion-context",setup(e){const t=tn();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}});function ll(e){return e==null?[]:Array.isArray(e)?e:[e]}var Lo=e=>e[0],Ho=e=>e[e.length-1],cl=(e,...t)=>e.concat(t),dl=(e,...t)=>e.filter(o=>!t.includes(o));function li(e,t,o={}){const{step:r=1,loop:i=!0}=o,s=t+r,a=e.length,c=a-1;return t===-1?r>0?0:c:s<0?i?c:0:s>=a?i?0:t>a?a:t:s}function ul(e,t,o={}){return e[li(e,t,o)]}function pl(e,t,o={}){const{step:r=1,loop:i=!0}=o;return li(e,t,{step:-r,loop:i})}function fl(e,t,o={}){return e[pl(e,t,o)]}var ci=e=>e?.constructor.name==="Array",hl=(e,t)=>{if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!An(e[o],t[o]))return!1;return!0},An=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(ci(e)&&ci(t))return hl(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const o=Object.keys(t??Object.create(null)),r=o.length;for(let i=0;i<r;i++)if(!Reflect.has(e,o[i]))return!1;for(let i=0;i<r;i++){const s=o[i];if(!An(e[s],t[s]))return!1}return!0},gl=e=>e!=null&&typeof e=="object",Vn=e=>typeof e=="string",mt=e=>typeof e=="function",ml=e=>e==null,Mn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),bl=e=>Object.prototype.toString.call(e),di=Function.prototype.toString,yl=di.call(Object),kl=e=>{if(!gl(e)||bl(e)!="[object Object]"||xl(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const o=Mn(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&di.call(o)==yl},_l=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,wl=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,xl=e=>_l(e)||wl(e),Fn=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,ui=e=>e,Cl=()=>{},Uo=(...e)=>(...t)=>{e.forEach(function(o){o?.(...t)})},pi=(()=>{let e=0;return()=>(e++,e.toString(36))})();function Ln(e){if(!kl(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),o={};for(const r of t){const i=e[r];i!==void 0&&(o[r]=Ln(i))}return o}function jo(e,t){const o=performance.now();let r;function i(s){if(s-o>=t){e();return}r=requestAnimationFrame(i)}return r=requestAnimationFrame(i),()=>cancelAnimationFrame(r)}function vt(...e){const t=e.length===1?e[0]:e[1];(e.length===2?e[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(t)}function El(e,t){if(e==null)throw new Error(t())}function Bl(e,t,o){let r=[];for(const i of t)e[i]==null&&r.push(i);if(r.length>0)throw new Error(`[zag-js${` > ${o}`}] missing required props: ${r.join(", ")}`)}var Il=(e,t)=>e.map((o,r)=>e[(Math.max(t,0)+r)%e.length]),fi=()=>{},Hn=e=>typeof e=="object"&&e!==null,Pl=2147483647,F=e=>e?"":void 0,hi=e=>e?"true":void 0,Ol=1,vl=9,Tl=11,ne=e=>Hn(e)&&e.nodeType===Ol&&typeof e.nodeName=="string",zo=e=>Hn(e)&&e.nodeType===vl,Sl=e=>Hn(e)&&e===e.window,gi=e=>ne(e)?e.localName||"":"#document";function Nl(e){return["html","body","#document"].includes(gi(e))}var Rl=e=>Hn(e)&&e.nodeType!==void 0,nn=e=>Rl(e)&&e.nodeType===Tl&&"host"in e,Dl=e=>ne(e)&&e.localName==="input",mi=e=>!!e?.matches("a[href]"),$l=e=>ne(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function bt(e){if(!e)return!1;const t=e.getRootNode();return Tt(t)===e}var Al=/(textarea|select)/;function Wo(e){if(e==null||!ne(e))return!1;try{return Dl(e)&&e.selectionStart!=null||Al.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function Oe(e,t){if(!e||!t||!ne(e)||!ne(t))return!1;const o=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(o&&nn(o)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ve(e){return zo(e)?e:Sl(e)?e.document:e?.ownerDocument??document}function Vl(e){return ve(e).documentElement}function Te(e){return nn(e)?Te(e.host):zo(e)?e.defaultView??window:ne(e)?e.ownerDocument?.defaultView??window:window}function Tt(e){let t=e.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(!o||o===t)break;t=o}return t}function Ml(e){if(gi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nn(e)&&e.host||Vl(e);return nn(t)?t.host:t}var Go=new WeakMap;function St(e){return Go.has(e)||Go.set(e,Te(e).getComputedStyle(e)),Go.get(e)}var Un=()=>typeof document<"u";function Fl(){return navigator.userAgentData?.platform??navigator.platform}function Ll(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:o})=>`${t}/${o}`).join(" "):navigator.userAgent}var Ko=e=>Un()&&e.test(Fl()),Hl=e=>Un()&&e.test(Ll()),Ul=e=>Un()&&e.test(navigator.vendor),bi=()=>Un()&&!!navigator.maxTouchPoints,jl=()=>Ko(/^iPhone/i),zl=()=>Ko(/^iPad/i)||jn()&&navigator.maxTouchPoints>1,yi=()=>jl()||zl(),Wl=()=>jn()||yi(),jn=()=>Ko(/^Mac/i),qo=()=>Wl()&&Ul(/apple/i),Gl=()=>Hl(/Firefox/i);function Kl(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function re(e){return Kl(e)?.[0]??e.target}function Xo(e){const t=e.currentTarget;if(!t||!t.matches("a[href], button[type='submit'], input[type='submit']"))return!1;const r=e.button===1,i=Xl(e);return r||i}function ki(e){const t=e.currentTarget;if(!t)return!1;const o=t.localName;return e.altKey?o==="a"||o==="button"&&t.type==="submit"||o==="input"&&t.type==="submit":!1}function ql(e){return tc(e).isComposing||e.keyCode===229}function Xl(e){return jn()?e.metaKey:e.ctrlKey}function Yl(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var Jl=e=>e.button===0,_i=e=>e.button===2||jn()&&e.ctrlKey&&e.button===0,Zl=e=>e.ctrlKey||e.altKey||e.metaKey,Ql=e=>"touches"in e&&e.touches.length>0,ec={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},wi={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function zn(e,t={}){const{dir:o="ltr",orientation:r="horizontal"}=t;let i=e.key;return i=ec[i]??i,o==="rtl"&&r==="horizontal"&&i in wi&&(i=wi[i]),i}function tc(e){return e.nativeEvent??e}function Wn(e,t="client"){const o=Ql(e)?e.touches[0]||e.changedTouches[0]:e;return{x:o[`${t}X`],y:o[`${t}Y`]}}var de=(e,t,o,r)=>{const i=typeof e=="function"?e():e;return i?.addEventListener(t,o,r),()=>{i?.removeEventListener(t,o,r)}},xi=e=>ne(e)&&e.tagName==="IFRAME",nc=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),oc=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Yo="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Jo=(e,t=!1)=>{if(!e)return[];const o=Array.from(e.querySelectorAll(Yo));(t==!0||t=="if-empty"&&o.length===0)&&ne(e)&&Qe(e)&&o.unshift(e);const i=o.filter(Qe);return i.forEach((s,a)=>{if(xi(s)&&s.contentDocument){const c=s.contentDocument.body;i.splice(a,1,...Jo(c))}}),i};function Qe(e){return!e||e.closest("[inert]")?!1:e.matches(Yo)&&$l(e)}function on(e,t){if(!e)return[];const o=Array.from(e.querySelectorAll(Yo)),r=o.filter(et);return t&&et(e)&&r.unshift(e),r.forEach((i,s)=>{if(xi(i)&&i.contentDocument){const a=i.contentDocument.body,c=on(a);r.splice(s,1,...c)}}),!r.length&&t?o:r}function et(e){return e!=null&&e.tabIndex>0?!0:Qe(e)&&!oc(e)}function Ci(e,t){const o=on(e,t),r=o[0]||null,i=o[o.length-1]||null;return[r,i]}function rc(e,t){const o=on(e),r=e?.ownerDocument||document,i=t??Tt(r);if(!i)return null;const s=o.indexOf(i);return o[s+1]||null}function rn(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||Wo(e))&&!nc(e)?0:e.tabIndex}function Zo(e){const{root:t,getInitialEl:o,filter:r,enabled:i=!0}=e;if(!i)return;let s=null;if(s||(s=typeof o=="function"?o():o),s||(s=t?.querySelector("[data-autofocus],[autofocus]")),!s){const a=on(t);s=r?a.filter(r)[0]:a[0]}return s||t||void 0}function ic(e){const t=e.currentTarget;if(!t)return!1;const[o,r]=Ci(t);return!(bt(o)&&e.shiftKey||bt(r)&&!e.shiftKey||!o&&!r)}function Qo(e){const t=new Set;function o(r){const i=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(i))}return o(()=>o(e)),function(){t.forEach(i=>i())}}function U(e){let t;const o=globalThis.requestAnimationFrame(()=>{t=e()});return()=>{globalThis.cancelAnimationFrame(o),t?.()}}function sc(e,t,o){const r=U(()=>{e.removeEventListener(t,i,!0),o()}),i=()=>{r(),o()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function ac(e,t){if(!e)return;const{attributes:o,callback:r}=t,i=e.ownerDocument.defaultView||window,s=new i.MutationObserver(a=>{for(const c of a)c.type==="attributes"&&c.attributeName&&o.includes(c.attributeName)&&r(c)});return s.observe(e,{attributes:!0,attributeFilter:o}),()=>s.disconnect()}function lc(e,t){const o=U,r=[];return r.push(o(()=>{const i=typeof e=="function"?e():e;r.push(ac(i,t))})),()=>{r.forEach(i=>i?.())}}function Ei(e){const t=()=>{const o=Te(e);e.dispatchEvent(new o.MouseEvent("click"))};Gl()?sc(e,"keyup",t):queueMicrotask(t)}function er(e){const t=Ml(e);return Nl(t)?ve(t).body:ne(t)&&Bi(t)?t:er(t)}var cc=/auto|scroll|overlay|hidden|clip/,dc=new Set(["inline","contents"]);function Bi(e){const t=Te(e),{overflow:o,overflowX:r,overflowY:i,display:s}=t.getComputedStyle(e);return cc.test(o+i+r)&&!dc.has(s)}function uc(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function pc(e,t){const{rootEl:o,...r}=t||{};!e||!o||!Bi(o)||!uc(o)||e.scrollIntoView(r)}function fc(e,t={}){const{triggerElement:o,onFocus:r,onFocusEnter:i}=t,s=e?.ownerDocument||document,a=s.body;function c(l){if(l.key!=="Tab")return;let d=null;const[u,g]=Ci(e,!0),h=rc(a,o),p=!u&&!g;l.shiftKey&&bt(h)?(i?.(),d=g):l.shiftKey&&(bt(u)||p)?d=o:!l.shiftKey&&bt(o)?(i?.(),d=u):!l.shiftKey&&(bt(g)||p)&&(d=h),d&&(l.preventDefault(),typeof r=="function"?r(d):d.focus())}return de(s,"keydown",c,!0)}function hc(e,t){const{defer:o,triggerElement:r,...i}=t,s=o?U:c=>c(),a=[];return a.push(s(()=>{const c=typeof e=="function"?e():e,l=typeof r=="function"?r():r;a.push(fc(c,{triggerElement:l,...i}))})),()=>{a.forEach(c=>c?.())}}function tr(e,t){return Array.from(e?.querySelectorAll(t)??[])}var nr=e=>e.id;function Ii(e,t,o=nr){return e.find(r=>o(r)===t)}function or(e,t,o=nr){const r=Ii(e,t,o);return r?e.indexOf(r):-1}function Pi(e,t,o=!0){let r=or(e,t);return r=o?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function Oi(e,t,o=!0){let r=or(e,t);return r===-1?o?e[e.length-1]:null:(r=o?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function gc(e,t){const{onEntry:o,measure:r,box:i="border-box"}=t,s=(Array.isArray(e)?e:[e]).filter(ne),a=Te(s[0]),c=d=>{const u=s.map(g=>r(g));o({rects:u,entries:d})};c([]);const l=new a.ResizeObserver(c);return s.forEach(d=>l.observe(d,{box:i})),()=>l.disconnect()}var mc=e=>e.split("").map(t=>{const o=t.charCodeAt(0);return o>0&&o<128?t:o>=128&&o<=255?`/x${o.toString(16)}`.replace("/","\\"):""}).join("").trim(),bc=e=>mc(e.dataset?.valuetext??e.textContent??""),yc=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function kc(e,t,o,r=nr){const i=o?or(e,o,r):-1;let s=o?Il(e,i):e;return t.length===1&&(s=s.filter(c=>r(c)!==o)),s.find(c=>yc(bc(c),t))}function sn(e,t){if(!e)return fi;const o=Object.keys(t).reduce((r,i)=>(r[i]=e.style.getPropertyValue(i),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,o),e.style.length===0&&e.removeAttribute("style")}}function _c(e,t,o){if(!e)return fi;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute("style")}}function wc(e,t){const{state:o,activeId:r,key:i,timeout:s=350,itemToId:a}=t,c=o.keysSoFar+i,d=c.length>1&&Array.from(c).every(m=>m===c[0])?c[0]:c;let u=e.slice();const g=kc(u,d,r,a);function h(){clearTimeout(o.timer),o.timer=-1}function p(m){o.keysSoFar=m,h(),m!==""&&(o.timer=+setTimeout(()=>{p(""),h()},s))}return p(c),g}var vi=Object.assign(wc,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:xc});function xc(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function Cc(e,t,o){const{signal:r}=t;return[new Promise((a,c)=>{const l=setTimeout(()=>{c(new Error(`Timeout of ${o}ms exceeded`))},o);r.addEventListener("abort",()=>{clearTimeout(l),c(new Error("Promise aborted"))}),e.then(d=>{r.aborted||(clearTimeout(l),a(d))}).catch(d=>{r.aborted||(clearTimeout(l),c(d))})}),()=>t.abort()]}function Ec(e,t){const{timeout:o,rootNode:r}=t,i=Te(r),s=ve(r),a=new i.AbortController;return Cc(new Promise(c=>{const l=e();if(l){c(l);return}const d=new i.MutationObserver(()=>{const u=e();u&&u.isConnected&&(d.disconnect(),c(u))});d.observe(s.body,{childList:!0,subtree:!0})}),a,o)}var Bc=(...e)=>e.map(t=>t?.trim?.()).filter(Boolean).join(" "),Ic=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Ti=e=>{const t={};let o;for(;o=Ic.exec(e);)t[o[1]]=o[2];return t},Pc=(e,t)=>{if(Vn(e)){if(Vn(t))return`${e};${t}`;e=Ti(e)}else Vn(t)&&(t=Ti(t));return Object.assign({},e??{},t??{})};function an(...e){let t={};for(let o of e){if(!o)continue;for(let i in t){if(i.startsWith("on")&&typeof t[i]=="function"&&typeof o[i]=="function"){t[i]=Uo(o[i],t[i]);continue}if(i==="className"||i==="class"){t[i]=Bc(t[i],o[i]);continue}if(i==="style"){t[i]=Pc(t[i],o[i]);continue}t[i]=o[i]!==void 0?o[i]:t[i]}for(let i in o)t[i]===void 0&&(t[i]=o[i]);const r=Object.getOwnPropertySymbols(o);for(let i of r)t[i]=o[i]}return t}function Gn(){return{and:(...e)=>function(o){return e.every(r=>o.guard(r))},or:(...e)=>function(o){return e.some(r=>o.guard(r))},not:e=>function(o){return!o.guard(e)}}}function zk(e){return e}function Oc(){return{guards:Gn(),createMachine:e=>e,choose:e=>function({choose:o}){return o(e)?.actions}}}var Nt=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(Nt||{}),rr="__init__";function vc(e){const t=()=>e.getRootNode?.()??document,o=()=>ve(t());return{...e,getRootNode:t,getDoc:o,getWin:()=>o().defaultView??window,getActiveElement:()=>Tt(t()),isActiveElement:bt,getById:a=>t().getElementById(a)}}function Tc(e){return new Proxy({},{get(t,o){return o==="style"?r=>e({style:r}).style:e}})}var ue=()=>e=>Array.from(new Set(e));function Sc(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}var Si={htmlFor:"for",className:"class",onDoubleClick:"onDblclick",onChange:"onInput",onFocus:"onFocusin",onBlur:"onFocusout",defaultValue:"value",defaultChecked:"checked"},Nc="viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(",");function Rc(e){return e in Si?Si[e]:e.startsWith("on")?`on${Sc(e.substr(2))}`:Nc.includes(e)?e:e.toLowerCase()}var tt=Tc(e=>{const t={};for(const o in e){const r=e[o];o==="children"?typeof r=="string"?t.innerHTML=r:process.env.NODE_ENV!=="production"&&r!=null&&console.warn("[Vue Normalize Prop] : avoid passing non-primitive value as `children`"):t[Rc(o)]=e[o]}return t});function Kn(e){const t=e().defaultValue??e().value,o=e().isEqual??Object.is,r=n.shallowRef(t),i=n.computed(()=>e().value!==void 0),s=n.shallowRef(i.value?e().value:r.value);return{initial:t,ref:s,get(){return i.value?e().value:r.value},set(a){const c=i.value?e().value:r.value,l=mt(a)?a(c):a;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:l,prev:c}),i.value||(r.value=l),o(l,c)||e().onChange?.(l,c)},invoke(a,c){e().onChange?.(a,c)},hash(a){return e().hash?.(a)??String(a)}}}Kn.cleanup=e=>{n.onUnmounted(()=>e())},Kn.ref=e=>{let t=e;return{get:()=>t,set:o=>{t=o}}};function Dc(e){const t={current:e};return{get(o){return t.current[o]},set(o,r){t.current[o]=r}}}var $c=(e,t)=>{n.watch(()=>[...e.map(o=>o())],(o,r)=>{let i=!1;for(let s=0;s<o.length;s++)if(!An(r[s],n.toValue(o[s]))){i=!0;break}i&&t()})};function Le(e,t={}){const o=n.computed(()=>{const{id:_,ids:P,getRootNode:x}=n.toValue(t);return vc({id:_,ids:P,getRootNode:x})}),r=(..._)=>{e.debug&&console.log(..._)},i=n.computed(()=>e.props?.({props:Ln(n.toValue(t)),get scope(){return o.value}})??n.toValue(t)),s=Ac(i),a=e.context?.({prop:s,bindable:Kn,get scope(){return o.value},flush:Ni,getContext(){return c},getComputed(){return f},getRefs(){return m},getEvent(){return h()}}),c={get(_){return a[_]?.get()},set(_,P){a[_]?.set(P)},initial(_){return a[_]?.initial},hash(_){const P=a[_]?.get();return a[_]?.hash(P)}};let l=new Map,d=null,u={current:null},g={current:{type:""}};const h=()=>({...g.current,current(){return g.current},previous(){return u.current}}),p=()=>({...y,matches(..._){const P=y.get();return _.includes(P)},hasTag(_){const P=y.get();return!!e.states[P]?.tags?.includes(_)}}),m=Dc(e.refs?.({prop:s,context:c})??{}),b=()=>({state:p(),context:c,event:h(),prop:s,send:v,action:k,guard:w,track:$c,refs:m,computed:f,flush:Ni,get scope(){return o.value},choose:B}),k=_=>{const P=mt(_)?_(b()):_;if(!P)return;const x=P.map(T=>{const C=e.implementations?.actions?.[T];return C||vt(`[zag-js] No implementation found for action "${JSON.stringify(T)}"`),C});for(const T of x)T?.(b())},w=_=>mt(_)?_(b()):e.implementations?.guards?.[_](b()),E=_=>{const P=mt(_)?_(b()):_;if(!P)return;const x=P.map(C=>{const I=e.implementations?.effects?.[C];return I||vt(`[zag-js] No implementation found for effect "${JSON.stringify(C)}"`),I}),T=[];for(const C of x){const I=C?.(b());I&&T.push(I)}return()=>T.forEach(C=>C?.())},B=_=>ll(_).find(P=>{let x=!P.guard;return Vn(P.guard)?x=!!w(P.guard):mt(P.guard)&&(x=P.guard(b())),x}),f=_=>{El(e.computed,()=>"[zag-js] No computed object found on machine");const P=e.computed[_];return P({context:c,event:h(),prop:s,refs:m,get scope(){return o.value},computed:f})},y=Kn(()=>({defaultValue:e.initialState({prop:s}),onChange(_,P){P&&(l.get(P)?.(),l.delete(P)),P&&k(e.states[P]?.exit),k(d?.actions);const x=E(e.states[_]?.effects);if(x&&l.set(_,x),P===rr){k(e.entry);const T=E(e.effects);T&&l.set(rr,T)}k(e.states[_]?.entry)}}));let O=Nt.NotStarted;n.onMounted(()=>{const _=O===Nt.Started;O=Nt.Started,r(_?"rehydrating...":"initializing..."),y.invoke(y.initial,rr)}),n.onBeforeUnmount(()=>{O=Nt.Stopped,r("unmounting...");const _=l.values();for(const P of _)P?.();l=new Map,k(e.exit)});const v=_=>{if(O!==Nt.Started)return;u.current=g.current,g.current=_;let P=y.get();const x=e.states[P].on?.[_.type]??e.on?.[_.type],T=B(x);if(!T)return;d=T;const C=T.target??P;r("transition",_.type,T.target||P,`(${T.actions})`);const I=C!==P;I?y.set(C):T.reenter&&!I?y.invoke(P,P):k(T.actions)};return e.watch?.(b()),{state:p(),send:v,context:c,prop:s,get scope(){return o.value},refs:m,computed:f,event:h(),getStatus:()=>O}}function Ac(e){return function(o){return e.value[o]}}var Ni=e=>{n.nextTick().then(()=>{e()})};const Vc=n.defineComponent({name:"Dynamic",inheritAttrs:!1,setup(e,{attrs:t,slots:o}){return()=>{if(!o.default)return null;const r=Ri(o.default()),[i,...s]=r;if(Object.keys(t).length>0){delete i.props?.ref;const a=an(t,i.props??{}),c=n.cloneVNode(i,a);for(const l in a)l.startsWith("on")&&(c.props||={},c.props[l]=a[l]);return r.length===1?c:[c,...s]}return r}}});function Ri(e){return e?e.flatMap(t=>t.type===n.Fragment?Ri(t.children):[t]):[]}const Mc="br, hr, img, input, area, textarea".split(", "),Fc=e=>typeof e=="string"&&Mc.includes(e),ir=e=>n.defineComponent({name:"Polymorphic",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1}},setup(t,{attrs:o,slots:r}){return t.asChild?()=>n.h(Vc,o,r):()=>n.h(e,o,Fc(e)?void 0:r.default?.())}});function Lc(){const e=new Map;return new Proxy(ir,{apply(o,r,i){return ir(i[0])},get(o,r){return e.has(r)||e.set(r,ir(r)),e.get(r)}})}const D=Lc(),[Di,ln]=ee("CollapsibleContext");function sr(e){const t=n.toValue(e);return t?.$el??t}const Hc=e=>Object.prototype.hasOwnProperty.call(e,"nodeName")&&typeof e.nodeName=="string";function N(){const e=n.getCurrentInstance(),t=n.ref(),o=n.computed(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:sr(t)),r=Object.assign({},e.exposed),i={};for(const a in e.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>e.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function s(a){t.value=a,!(Hc(a)||!a)&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a.$el}),e.exposed=i)}return{forwardRef:s,currentRef:t,currentElement:o}}const Uc=n.defineComponent({__name:"collapsible-content",props:{asChild:{type:Boolean}},setup(e){const t=ln();return N(),(o,r)=>n.unref(t).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},n.unref(t).getContentProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),jc=n.defineComponent({__name:"collapsible-context",setup(e){const t=ln();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),zc=n.defineComponent({__name:"collapsible-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return Di(o),N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(o.value.getRootProps(),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}});var ke=(e,t=[])=>({parts:(...o)=>{if(Wc(t))return ke(e,o);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...o)=>ke(e,[...t,...o]),omit:(...o)=>ke(e,t.filter(r=>!o.includes(r))),rename:o=>ke(o,t),keys:()=>t,build:()=>[...new Set(t)].reduce((o,r)=>Object.assign(o,{[r]:{selector:[`&[data-scope="${Rt(e)}"][data-part="${Rt(r)}"]`,`& [data-scope="${Rt(e)}"][data-part="${Rt(r)}"]`].join(", "),attrs:{"data-scope":Rt(e),"data-part":Rt(r)}}}),{})}),Rt=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Wc=e=>e.length===0,Gc=ke("collapsible").parts("root","trigger","content","indicator"),qn=Gc.build(),Kc=e=>e.ids?.root??`collapsible:${e.id}`,ar=e=>e.ids?.content??`collapsible:${e.id}:content`,qc=e=>e.ids?.trigger??`collapsible:${e.id}:trigger`,Xn=e=>e.getById(ar(e));function Xc(e,t){const{state:o,send:r,context:i,scope:s,prop:a}=e,c=o.matches("open")||o.matches("closing"),l=o.matches("open"),{width:d,height:u}=i.get("size"),g=!!a("disabled"),h=!i.get("initial")&&l,p="ltr";return{disabled:g,visible:c,open:l,measureSize(){r({type:"size.measure"})},setOpen(m){o.matches("open")!==m&&r({type:m?"open":"close"})},getRootProps(){return t.element({...qn.root.attrs,"data-state":l?"open":"closed",dir:p,id:Kc(s)})},getContentProps(){return t.element({...qn.content.attrs,"data-collapsible":"","data-state":h?void 0:l?"open":"closed",id:ar(s),"data-disabled":F(g),hidden:!c,style:{"--height":u!=null?`${u}px`:void 0,"--width":d!=null?`${d}px`:void 0}})},getTriggerProps(){return t.element({...qn.trigger.attrs,id:qc(s),dir:p,type:"button","data-state":l?"open":"closed","data-disabled":F(g),"aria-controls":ar(s),"aria-expanded":c||!1,onClick(m){m.defaultPrevented||g||r({type:l?"close":"open"})}})},getIndicatorProps(){return t.element({...qn.indicator.attrs,dir:p,"data-state":l?"open":"closed","data-disabled":F(g)})}}}var Yc={initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{size:e(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:e(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:e,prop:t,action:o}){e([()=>t("open")],()=>{o(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackEnterAnimation:({send:e,scope:t})=>{let o;const r=U(()=>{const i=Xn(t);if(!i)return;const s=St(i).animationName;if(!s||s==="none"){e({type:"animation.end"});return}const c=l=>{re(l)===i&&e({type:"animation.end"})};i.addEventListener("animationend",c),o=()=>{i.removeEventListener("animationend",c)}});return()=>{r(),o?.()}},trackExitAnimation:({send:e,scope:t})=>{let o;const r=U(()=>{const i=Xn(t);if(!i)return;const s=St(i).animationName;if(!s||s==="none"){e({type:"animation.end"});return}const c=d=>{re(d)===i&&e({type:"animation.end"})};i.addEventListener("animationend",c);const l=sn(i,{animationFillMode:"forwards"});o=()=>{i.removeEventListener("animationend",c),Qo(()=>l())}});return()=>{r(),o?.()}}},actions:{setInitial:({context:e,flush:t})=>{t(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},cleanupNode:({refs:e})=>{e.set("stylesRef",null)},measureSize:({context:e,scope:t})=>{const o=Xn(t);if(!o)return;const{height:r,width:i}=o.getBoundingClientRect();e.set("size",{height:r,width:i})},computeSize:({refs:e,scope:t,context:o})=>{e.get("cleanup")?.();const r=U(()=>{const i=Xn(t);if(!i)return;const s=i.hidden;i.style.animationName="none",i.style.animationDuration="0s",i.hidden=!1;const a=i.getBoundingClientRect();o.set("size",{height:a.height,width:a.width}),o.get("initial")&&(i.style.animationName="",i.style.animationDuration=""),i.hidden=s});e.set("cleanup",r)},invokeOnOpen:({prop:e})=>{e("onOpenChange")?.({open:!0})},invokeOnClose:({prop:e})=>{e("onOpenChange")?.({open:!1})},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},toggleVisibility:({prop:e,send:t})=>{t({type:e("open")?"controlled.open":"controlled.close"})}}}};ue()(["dir","disabled","getRootNode","id","ids","onExitComplete","onOpenChange","defaultOpen","open"]);const[Wk,He]=ee("EnvironmentContext"),Ue=n.computed(()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})),yt=n.computed(()=>({dir:"ltr",locale:"en-US"})),[Gk,kt]=ee("LocaleContext"),Dt=e=>{const t={};for(const[o,r]of Object.entries(e))r!==void 0&&(t[o]=r);return t},Jc=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const d=n.toValue(e);return{id:o,dir:i.value.dir,getRootNode:r?.value.getRootNode,...Dt(d),onExitComplete:()=>{t?.("exitComplete"),d.onExitComplete?.()},onOpenChange:u=>{t?.("openChange",u),t?.("update:open",u.open),d.onOpenChange?.(u)}}}),a=Le(Yc,s),c=n.computed(()=>Xc(a,tt)),l=n.ref(!1);return n.watch(()=>c.value.visible,()=>{c.value.visible&&(l.value=!0)}),n.computed(()=>{const d=n.toValue(e);return{...c.value,unmounted:!c.value.visible&&!l.value&&d.lazyMount||d.unmountOnExit&&!c.value.visible&&l.value}})},Zc=n.defineComponent({__name:"collapsible-root",props:n.mergeDefaults({defaultOpen:{type:Boolean},disabled:{type:Boolean},id:{},ids:{},lazyMount:{type:Boolean},open:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{defaultOpen:void 0,disabled:void 0,lazyMount:void 0,open:void 0,unmountOnExit:void 0}),emits:["exitComplete","openChange","update:open"],setup(e,{emit:t}){const i=Jc(e,t);return Di(i),N(),(s,a)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getRootProps(),{"as-child":s.asChild}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),Qc=n.defineComponent({__name:"collapsible-trigger",props:{asChild:{type:Boolean}},setup(e){const t=ln();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),$i=Object.freeze(Object.defineProperty({__proto__:null,Content:Uc,Context:jc,Indicator:n.defineComponent({__name:"collapsible-indicator",props:{asChild:{type:Boolean}},setup(e){const t=ln();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getIndicatorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Root:Zc,RootProvider:zc,Trigger:Qc},Symbol.toStringTag,{value:"Module"})),ed=["top","right","bottom","left"],nt=Math.min,he=Math.max,Yn=Math.round,Jn=Math.floor,Se=e=>({x:e,y:e}),td={left:"right",right:"left",bottom:"top",top:"bottom"},nd={start:"end",end:"start"};function lr(e,t,o){return he(e,nt(t,o))}function je(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function $t(e){return e.split("-")[1]}function cr(e){return e==="x"?"y":"x"}function dr(e){return e==="y"?"height":"width"}const od=new Set(["top","bottom"]);function Ne(e){return od.has(ze(e))?"y":"x"}function ur(e){return cr(Ne(e))}function rd(e,t,o){o===void 0&&(o=!1);const r=$t(e),i=ur(e),s=dr(i);let a=i==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Zn(a)),[a,Zn(a)]}function id(e){const t=Zn(e);return[pr(e),t,pr(t)]}function pr(e){return e.replace(/start|end/g,t=>nd[t])}const Ai=["left","right"],Vi=["right","left"],sd=["top","bottom"],ad=["bottom","top"];function ld(e,t,o){switch(e){case"top":case"bottom":return o?t?Vi:Ai:t?Ai:Vi;case"left":case"right":return t?sd:ad;default:return[]}}function cd(e,t,o,r){const i=$t(e);let s=ld(ze(e),o==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(pr)))),s}function Zn(e){return e.replace(/left|right|bottom|top/g,t=>td[t])}function dd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mi(e){return typeof e!="number"?dd(e):{top:e,right:e,bottom:e,left:e}}function Qn(e){const{x:t,y:o,width:r,height:i}=e;return{width:r,height:i,top:o,left:t,right:t+r,bottom:o+i,x:t,y:o}}function Fi(e,t,o){let{reference:r,floating:i}=e;const s=Ne(t),a=ur(t),c=dr(a),l=ze(t),d=s==="y",u=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,h=r[c]/2-i[c]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:g};break;case"left":p={x:r.x-i.width,y:g};break;default:p={x:r.x,y:r.y}}switch($t(t)){case"start":p[a]-=h*(o&&d?-1:1);break;case"end":p[a]+=h*(o&&d?-1:1);break}return p}const ud=async(e,t,o)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=o,c=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:g}=Fi(d,r,l),h=r,p={},m=0;for(let b=0;b<c.length;b++){const{name:k,fn:w}=c[b],{x:E,y:B,data:f,reset:y}=await w({x:u,y:g,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});u=E??u,g=B??g,p={...p,[k]:{...p[k],...f}},y&&m<=50&&(m++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(d=y.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:g}=Fi(d,h,l)),b=-1)}return{x:u,y:g,placement:h,strategy:i,middlewareData:p}};async function cn(e,t){var o;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:c,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:g="floating",altBoundary:h=!1,padding:p=0}=je(t,e),m=Mi(p),k=c[h?g==="floating"?"reference":"floating":g],w=Qn(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(k)))==null||o?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:d,rootBoundary:u,strategy:l})),E=g==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,B=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),f=await(s.isElement==null?void 0:s.isElement(B))?await(s.getScale==null?void 0:s.getScale(B))||{x:1,y:1}:{x:1,y:1},y=Qn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:B,strategy:l}):E);return{top:(w.top-y.top+m.top)/f.y,bottom:(y.bottom-w.bottom+m.bottom)/f.y,left:(w.left-y.left+m.left)/f.x,right:(y.right-w.right+m.right)/f.x}}const pd=e=>({name:"arrow",options:e,async fn(t){const{x:o,y:r,placement:i,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:d,padding:u=0}=je(e,t)||{};if(d==null)return{};const g=Mi(u),h={x:o,y:r},p=ur(i),m=dr(p),b=await a.getDimensions(d),k=p==="y",w=k?"top":"left",E=k?"bottom":"right",B=k?"clientHeight":"clientWidth",f=s.reference[m]+s.reference[p]-h[p]-s.floating[m],y=h[p]-s.reference[p],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let v=O?O[B]:0;(!v||!await(a.isElement==null?void 0:a.isElement(O)))&&(v=c.floating[B]||s.floating[m]);const _=f/2-y/2,P=v/2-b[m]/2-1,x=nt(g[w],P),T=nt(g[E],P),C=x,I=v-b[m]-T,R=v/2-b[m]/2+_,V=lr(C,R,I),H=!l.arrow&&$t(i)!=null&&R!==V&&s.reference[m]/2-(R<C?x:T)-b[m]/2<0,j=H?R<C?R-C:R-I:0;return{[p]:h[p]+j,data:{[p]:V,centerOffset:R-V-j,...H&&{alignmentOffset:j}},reset:H}}}),fd=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...k}=je(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const w=ze(i),E=Ne(c),B=ze(c)===c,f=await(l.isRTL==null?void 0:l.isRTL(d.floating)),y=h||(B||!b?[Zn(c)]:id(c)),O=m!=="none";!h&&O&&y.push(...cd(c,b,m,f));const v=[c,...y],_=await cn(t,k),P=[];let x=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&P.push(_[w]),g){const R=rd(i,a,f);P.push(_[R[0]],_[R[1]])}if(x=[...x,{placement:i,overflows:P}],!P.every(R=>R<=0)){var T,C;const R=(((T=s.flip)==null?void 0:T.index)||0)+1,V=v[R];if(V&&(!(g==="alignment"?E!==Ne(V):!1)||x.every(Y=>Ne(Y.placement)===E?Y.overflows[0]>0:!0)))return{data:{index:R,overflows:x},reset:{placement:V}};let H=(C=x.filter(j=>j.overflows[0]<=0).sort((j,Y)=>j.overflows[1]-Y.overflows[1])[0])==null?void 0:C.placement;if(!H)switch(p){case"bestFit":{var I;const j=(I=x.filter(Y=>{if(O){const se=Ne(Y.placement);return se===E||se==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(se=>se>0).reduce((se,W)=>se+W,0)]).sort((Y,se)=>Y[1]-se[1])[0])==null?void 0:I[0];j&&(H=j);break}case"initialPlacement":H=c;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function Li(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hi(e){return ed.some(t=>e[t]>=0)}const hd=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:o}=t,{strategy:r="referenceHidden",...i}=je(e,t);switch(r){case"referenceHidden":{const s=await cn(t,{...i,elementContext:"reference"}),a=Li(s,o.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Hi(a)}}}case"escaped":{const s=await cn(t,{...i,altBoundary:!0}),a=Li(s,o.floating);return{data:{escapedOffsets:a,escaped:Hi(a)}}}default:return{}}}}},Ui=new Set(["left","top"]);async function gd(e,t){const{placement:o,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ze(o),c=$t(o),l=Ne(o)==="y",d=Ui.has(a)?-1:1,u=s&&l?-1:1,g=je(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const md=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,r;const{x:i,y:s,placement:a,middlewareData:c}=t,l=await gd(t,e);return a===((o=c.offset)==null?void 0:o.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},bd=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:c={fn:k=>{let{x:w,y:E}=k;return{x:w,y:E}}},...l}=je(e,t),d={x:o,y:r},u=await cn(t,l),g=Ne(ze(i)),h=cr(g);let p=d[h],m=d[g];if(s){const k=h==="y"?"top":"left",w=h==="y"?"bottom":"right",E=p+u[k],B=p-u[w];p=lr(E,p,B)}if(a){const k=g==="y"?"top":"left",w=g==="y"?"bottom":"right",E=m+u[k],B=m-u[w];m=lr(E,m,B)}const b=c.fn({...t,[h]:p,[g]:m});return{...b,data:{x:b.x-o,y:b.y-r,enabled:{[h]:s,[g]:a}}}}}},yd=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:o,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=je(e,t),u={x:o,y:r},g=Ne(i),h=cr(g);let p=u[h],m=u[g];const b=je(c,t),k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const B=h==="y"?"height":"width",f=s.reference[h]-s.floating[B]+k.mainAxis,y=s.reference[h]+s.reference[B]-k.mainAxis;p<f?p=f:p>y&&(p=y)}if(d){var w,E;const B=h==="y"?"width":"height",f=Ui.has(ze(i)),y=s.reference[g]-s.floating[B]+(f&&((w=a.offset)==null?void 0:w[g])||0)+(f?0:k.crossAxis),O=s.reference[g]+s.reference[B]+(f?0:((E=a.offset)==null?void 0:E[g])||0)-(f?k.crossAxis:0);m<y?m=y:m>O&&(m=O)}return{[h]:p,[g]:m}}}},kd=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,r;const{placement:i,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...d}=je(e,t),u=await cn(t,d),g=ze(i),h=$t(i),p=Ne(i)==="y",{width:m,height:b}=s.floating;let k,w;g==="top"||g==="bottom"?(k=g,w=h===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(w=g,k=h==="end"?"top":"bottom");const E=b-u.top-u.bottom,B=m-u.left-u.right,f=nt(b-u[k],E),y=nt(m-u[w],B),O=!t.middlewareData.shift;let v=f,_=y;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(_=B),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(v=E),O&&!h){const x=he(u.left,0),T=he(u.right,0),C=he(u.top,0),I=he(u.bottom,0);p?_=m-2*(x!==0||T!==0?x+T:he(u.left,u.right)):v=b-2*(C!==0||I!==0?C+I:he(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:v});const P=await a.getDimensions(c.floating);return m!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}};function eo(){return typeof window<"u"}function At(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return eo()?e instanceof Node||e instanceof ge(e).Node:!1}function xe(e){return eo()?e instanceof Element||e instanceof ge(e).Element:!1}function De(e){return eo()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function zi(e){return!eo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}const _d=new Set(["inline","contents"]);function dn(e){const{overflow:t,overflowX:o,overflowY:r,display:i}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&!_d.has(i)}const wd=new Set(["table","td","th"]);function xd(e){return wd.has(At(e))}const Cd=[":popover-open",":modal"];function to(e){return Cd.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ed=["transform","translate","scale","rotate","perspective"],Bd=["transform","translate","scale","rotate","perspective","filter"],Id=["paint","layout","strict","content"];function fr(e){const t=hr(),o=xe(e)?Ce(e):e;return Ed.some(r=>o[r]?o[r]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||Bd.some(r=>(o.willChange||"").includes(r))||Id.some(r=>(o.contain||"").includes(r))}function Pd(e){let t=ot(e);for(;De(t)&&!Vt(t);){if(fr(t))return t;if(to(t))return null;t=ot(t)}return null}function hr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Od=new Set(["html","body","#document"]);function Vt(e){return Od.has(At(e))}function Ce(e){return ge(e).getComputedStyle(e)}function no(e){return xe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ot(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zi(e)&&e.host||Re(e);return zi(t)?t.host:t}function Wi(e){const t=ot(e);return Vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:De(t)&&dn(t)?t:Wi(t)}function un(e,t,o){var r;t===void 0&&(t=[]),o===void 0&&(o=!0);const i=Wi(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=ge(i);if(s){const c=gr(a);return t.concat(a,a.visualViewport||[],dn(i)?i:[],c&&o?un(c):[])}return t.concat(i,un(i,[],o))}function gr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gi(e){const t=Ce(e);let o=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=De(e),s=i?e.offsetWidth:o,a=i?e.offsetHeight:r,c=Yn(o)!==s||Yn(r)!==a;return c&&(o=s,r=a),{width:o,height:r,$:c}}function mr(e){return xe(e)?e:e.contextElement}function Mt(e){const t=mr(e);if(!De(t))return Se(1);const o=t.getBoundingClientRect(),{width:r,height:i,$:s}=Gi(t);let a=(s?Yn(o.width):o.width)/r,c=(s?Yn(o.height):o.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const vd=Se(0);function Ki(e){const t=ge(e);return!hr()||!t.visualViewport?vd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Td(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==ge(e)?!1:t}function _t(e,t,o,r){t===void 0&&(t=!1),o===void 0&&(o=!1);const i=e.getBoundingClientRect(),s=mr(e);let a=Se(1);t&&(r?xe(r)&&(a=Mt(r)):a=Mt(e));const c=Td(s,o,r)?Ki(s):Se(0);let l=(i.left+c.x)/a.x,d=(i.top+c.y)/a.y,u=i.width/a.x,g=i.height/a.y;if(s){const h=ge(s),p=r&&xe(r)?ge(r):r;let m=h,b=gr(m);for(;b&&r&&p!==m;){const k=Mt(b),w=b.getBoundingClientRect(),E=Ce(b),B=w.left+(b.clientLeft+parseFloat(E.paddingLeft))*k.x,f=w.top+(b.clientTop+parseFloat(E.paddingTop))*k.y;l*=k.x,d*=k.y,u*=k.x,g*=k.y,l+=B,d+=f,m=ge(b),b=gr(m)}}return Qn({width:u,height:g,x:l,y:d})}function oo(e,t){const o=no(e).scrollLeft;return t?t.left+o:_t(Re(e)).left+o}function qi(e,t){const o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-oo(e,o),i=o.top+t.scrollTop;return{x:r,y:i}}function Sd(e){let{elements:t,rect:o,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=Re(r),c=t?to(t.floating):!1;if(r===a||c&&s)return o;let l={scrollLeft:0,scrollTop:0},d=Se(1);const u=Se(0),g=De(r);if((g||!g&&!s)&&((At(r)!=="body"||dn(a))&&(l=no(r)),De(r))){const p=_t(r);d=Mt(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=a&&!g&&!s?qi(a,l):Se(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-l.scrollTop*d.y+u.y+h.y}}function Nd(e){return Array.from(e.getClientRects())}function Rd(e){const t=Re(e),o=no(e),r=e.ownerDocument.body,i=he(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=he(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-o.scrollLeft+oo(e);const c=-o.scrollTop;return Ce(r).direction==="rtl"&&(a+=he(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:c}}const Xi=25;function Dd(e,t){const o=ge(e),r=Re(e),i=o.visualViewport;let s=r.clientWidth,a=r.clientHeight,c=0,l=0;if(i){s=i.width,a=i.height;const u=hr();(!u||u&&t==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}const d=oo(r);if(d<=0){const u=r.ownerDocument,g=u.body,h=getComputedStyle(g),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-g.clientWidth-p);m<=Xi&&(s-=m)}else d<=Xi&&(s+=d);return{width:s,height:a,x:c,y:l}}const $d=new Set(["absolute","fixed"]);function Ad(e,t){const o=_t(e,!0,t==="fixed"),r=o.top+e.clientTop,i=o.left+e.clientLeft,s=De(e)?Mt(e):Se(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=i*s.x,d=r*s.y;return{width:a,height:c,x:l,y:d}}function Yi(e,t,o){let r;if(t==="viewport")r=Dd(e,o);else if(t==="document")r=Rd(Re(e));else if(xe(t))r=Ad(t,o);else{const i=Ki(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qn(r)}function Ji(e,t){const o=ot(e);return o===t||!xe(o)||Vt(o)?!1:Ce(o).position==="fixed"||Ji(o,t)}function Vd(e,t){const o=t.get(e);if(o)return o;let r=un(e,[],!1).filter(c=>xe(c)&&At(c)!=="body"),i=null;const s=Ce(e).position==="fixed";let a=s?ot(e):e;for(;xe(a)&&!Vt(a);){const c=Ce(a),l=fr(a);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&$d.has(i.position)||dn(a)&&!l&&Ji(e,a))?r=r.filter(u=>u!==a):i=c,a=ot(a)}return t.set(e,r),r}function Md(e){let{element:t,boundary:o,rootBoundary:r,strategy:i}=e;const a=[...o==="clippingAncestors"?to(t)?[]:Vd(t,this._c):[].concat(o),r],c=a[0],l=a.reduce((d,u)=>{const g=Yi(t,u,i);return d.top=he(g.top,d.top),d.right=nt(g.right,d.right),d.bottom=nt(g.bottom,d.bottom),d.left=he(g.left,d.left),d},Yi(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Fd(e){const{width:t,height:o}=Gi(e);return{width:t,height:o}}function Ld(e,t,o){const r=De(t),i=Re(t),s=o==="fixed",a=_t(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=Se(0);function d(){l.x=oo(i)}if(r||!r&&!s)if((At(t)!=="body"||dn(i))&&(c=no(t)),r){const p=_t(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&d();s&&!r&&i&&d();const u=i&&!r&&!s?qi(i,c):Se(0),g=a.left+c.scrollLeft-l.x-u.x,h=a.top+c.scrollTop-l.y-u.y;return{x:g,y:h,width:a.width,height:a.height}}function br(e){return Ce(e).position==="static"}function Zi(e,t){if(!De(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return Re(e)===o&&(o=o.ownerDocument.body),o}function Qi(e,t){const o=ge(e);if(to(e))return o;if(!De(e)){let i=ot(e);for(;i&&!Vt(i);){if(xe(i)&&!br(i))return i;i=ot(i)}return o}let r=Zi(e,t);for(;r&&xd(r)&&br(r);)r=Zi(r,t);return r&&Vt(r)&&br(r)&&!fr(r)?o:r||Pd(e)||o}const Hd=async function(e){const t=this.getOffsetParent||Qi,o=this.getDimensions,r=await o(e.floating);return{reference:Ld(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ud(e){return Ce(e).direction==="rtl"}const jd={convertOffsetParentRelativeRectToViewportRelativeRect:Sd,getDocumentElement:Re,getClippingRect:Md,getOffsetParent:Qi,getElementRects:Hd,getClientRects:Nd,getDimensions:Fd,getScale:Mt,isElement:xe,isRTL:Ud};function es(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zd(e,t){let o=null,r;const i=Re(e);function s(){var c;clearTimeout(r),(c=o)==null||c.disconnect(),o=null}function a(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const d=e.getBoundingClientRect(),{left:u,top:g,width:h,height:p}=d;if(c||t(),!h||!p)return;const m=Jn(g),b=Jn(i.clientWidth-(u+h)),k=Jn(i.clientHeight-(g+p)),w=Jn(u),B={rootMargin:-m+"px "+-b+"px "+-k+"px "+-w+"px",threshold:he(0,nt(1,l))||1};let f=!0;function y(O){const v=O[0].intersectionRatio;if(v!==l){if(!f)return a();v?a(!1,v):r=setTimeout(()=>{a(!1,1e-7)},1e3)}v===1&&!es(d,e.getBoundingClientRect())&&a(),f=!1}try{o=new IntersectionObserver(y,{...B,root:i.ownerDocument})}catch{o=new IntersectionObserver(y,B)}o.observe(e)}return a(!0),s}function Wd(e,t,o,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=mr(e),u=i||s?[...d?un(d):[],...un(t)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",o,{passive:!0}),s&&w.addEventListener("resize",o)});const g=d&&c?zd(d,o):null;let h=-1,p=null;a&&(p=new ResizeObserver(w=>{let[E]=w;E&&E.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var B;(B=p)==null||B.observe(t)})),o()}),d&&!l&&p.observe(d),p.observe(t));let m,b=l?_t(e):null;l&&k();function k(){const w=_t(e);b&&!es(b,w)&&o(),b=w,m=requestAnimationFrame(k)}return o(),()=>{var w;u.forEach(E=>{i&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),g?.(),(w=p)==null||w.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Gd=md,Kd=bd,qd=fd,Xd=kd,Yd=hd,Jd=pd,Zd=yd,Qd=(e,t,o)=>{const r=new Map,i={platform:jd,...o},s={...i.platform,_c:r};return ud(e,t,{...i,platform:s})};function ts(e=0,t=0,o=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,o,r);const i={x:e,y:t,width:o,height:r,top:t,right:e+o,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function eu(e){if(!e)return ts();const{x:t,y:o,width:r,height:i}=e;return ts(t,o,r,i)}function tu(e,t){return{contextElement:ne(e)?e:void 0,getBoundingClientRect:()=>{const o=e,r=t?.(o);return r||!o?eu(r):o.getBoundingClientRect()}}}var pn=e=>({variable:e,reference:`var(${e})`}),We={arrowSize:pn("--arrow-size"),arrowSizeHalf:pn("--arrow-size-half"),arrowBg:pn("--arrow-background"),transformOrigin:pn("--transform-origin"),arrowOffset:pn("--arrow-offset")},nu=e=>e==="top"||e==="bottom"?"y":"x";function ou(e,t){return{name:"transformOrigin",fn(o){const{elements:r,middlewareData:i,placement:s,rects:a,y:c}=o,l=s.split("-")[0],d=nu(l),u=i.arrow?.x||0,g=i.arrow?.y||0,h=t?.clientWidth||0,p=t?.clientHeight||0,m=u+h/2,b=g+p/2,k=Math.abs(i.shift?.y||0),w=a.reference.height/2,E=p/2,B=e.offset?.mainAxis??e.gutter,f=typeof B=="number"?B+E:B??E,y=k>f,O={top:`${m}px calc(100% + ${f}px)`,bottom:`${m}px ${-f}px`,left:`calc(100% + ${f}px) ${b}px`,right:`${-f}px ${b}px`}[l],v=`${m}px ${a.reference.y+w-c}px`,_=!!e.overlap&&d==="y"&&y;return r.floating.style.setProperty(We.transformOrigin.variable,_?v:O),{data:{transformOrigin:_?v:O}}}}}var ru={name:"rects",fn({rects:e}){return{data:e}}},iu=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:o}){if(!o.arrow)return{};const{x:r,y:i}=o.arrow,s=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:i!=null?`${i}px`:"",[s]:`calc(100% + ${We.arrowOffset.reference})`}),{}}}};function su(e){const[t,o]=e.split("-");return{side:t,align:o,hasAlign:o!=null}}function au(e){return e.split("-")[0]}var lu={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function ns(e,t){const o=e.devicePixelRatio||1;return Math.round(t*o)/o}function yr(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function cu(e,t,o){const r=e||t.createElement("div");return Jd({element:r,padding:o.arrowPadding})}function du(e,t){if(!ml(t.offset??t.gutter))return Gd(({placement:o})=>{const r=(e?.clientHeight||0)/2,i=t.offset?.mainAxis??t.gutter,s=typeof i=="number"?i+r:i??r,{hasAlign:a}=su(o),c=a?void 0:t.shift,l=t.offset?.crossAxis??c;return Ln({crossAxis:l,mainAxis:s,alignmentAxis:t.shift})})}function uu(e){if(!e.flip)return;const t=yr(e.boundary);return qd({...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function pu(e){if(!e.slide&&!e.overlap)return;const t=yr(e.boundary);return Kd({...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Zd()})}function fu(e){return Xd({padding:e.overflowPadding,apply({elements:t,rects:o,availableHeight:r,availableWidth:i}){const s=t.floating,a=Math.round(o.reference.width),c=Math.round(o.reference.height);i=Math.floor(i),r=Math.floor(r),s.style.setProperty("--reference-width",`${a}px`),s.style.setProperty("--reference-height",`${c}px`),s.style.setProperty("--available-width",`${i}px`),s.style.setProperty("--available-height",`${r}px`)}})}function hu(e){if(e.hideWhenDetached)return Yd({strategy:"referenceHidden",boundary:yr(e.boundary)??"clippingAncestors"})}function gu(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function mu(e,t,o={}){const r=tu(e,o.getAnchorRect);if(!t||!r)return;const i=Object.assign({},lu,o),s=t.querySelector("[data-part=arrow]"),a=[du(s,i),uu(i),pu(i),cu(s,t.ownerDocument,i),iu(s),ou({gutter:i.gutter,offset:i.offset,overlap:i.overlap},s),fu(i),hu(i),ru],{placement:c,strategy:l,onComplete:d,onPositioned:u}=i,g=async()=>{if(!r||!t)return;const b=await Qd(r,t,{placement:c,middleware:a,strategy:l});d?.(b),u?.({placed:!0});const k=Te(t),w=ns(k,b.x),E=ns(k,b.y);t.style.setProperty("--x",`${w}px`),t.style.setProperty("--y",`${E}px`),i.hideWhenDetached&&(b.middlewareData.hide?.referenceHidden?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const B=t.firstElementChild;if(B){const f=St(B);t.style.setProperty("--z-index",f.zIndex)}},h=async()=>{o.updatePosition?(await o.updatePosition({updatePosition:g,floatingElement:t}),u?.({placed:!0})):await g()},p=gu(i.listeners),m=i.listeners?Wd(r,t,h,p):Cl;return h(),()=>{m?.(),u?.({placed:!1})}}function ro(e,t,o={}){const{defer:r,...i}=o,s=r?U:c=>c(),a=[];return a.push(s(()=>{const c=typeof e=="function"?e():e,l=typeof t=="function"?t():t;a.push(mu(c,l,i))})),()=>{a.forEach(c=>c?.())}}var bu={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function os(e={}){const{placement:t,sameWidth:o,fitViewport:r,strategy:i="absolute"}=e;return{arrow:{position:"absolute",width:We.arrowSize.reference,height:We.arrowSize.reference,[We.arrowSizeHalf.variable]:`calc(${We.arrowSize.reference} / 2)`,[We.arrowOffset.variable]:`calc(${We.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?bu[t.split("-")[0]]:void 0,background:We.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:o?void 0:"max-content",width:o?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function yu(e){const t={each(o){for(let r=0;r<e.frames?.length;r+=1){const i=e.frames[r];i&&o(i)}},addEventListener(o,r,i){return t.each(s=>{try{s.document.addEventListener(o,r,i)}catch{}}),()=>{try{t.removeEventListener(o,r,i)}catch{}}},removeEventListener(o,r,i){t.each(s=>{try{s.document.removeEventListener(o,r,i)}catch{}})}};return t}function ku(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(o,r,i)=>{try{t?.addEventListener(o,r,i)}catch{}return()=>{try{t?.removeEventListener(o,r,i)}catch{}}},removeEventListener:(o,r,i)=>{try{t?.removeEventListener(o,r,i)}catch{}}}}var rs="pointerdown.outside",is="focus.outside";function _u(e){for(const t of e)if(ne(t)&&Qe(t))return!0;return!1}var ss=e=>"clientY"in e;function wu(e,t){if(!ss(t)||!e)return!1;const o=e.getBoundingClientRect();return o.width===0||o.height===0?!1:o.top<=t.clientY&&t.clientY<=o.top+o.height&&o.left<=t.clientX&&t.clientX<=o.left+o.width}function xu(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function as(e,t){if(!t||!ss(e))return!1;const o=t.scrollHeight>t.clientHeight,r=o&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,s=i&&e.clientY>t.offsetTop+t.clientHeight,a={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(o?16:0),height:t.clientHeight+(i?16:0)},c={x:e.clientX,y:e.clientY};return xu(a,c)?r||s:!1}function Cu(e,t){const{exclude:o,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:s,defer:a}=t;if(!e)return;const c=ve(e),l=Te(e),d=yu(l),u=ku(l);function g(E,B){if(!ne(B)||!B.isConnected||Oe(e,B)||wu(e,E))return!1;const f=c.querySelector(`[aria-controls="${e.id}"]`);if(f){const O=er(f);if(as(E,O))return!1}const y=er(e);return as(E,y)?!1:!o?.(B)}const h=new Set,p=nn(e?.getRootNode());function m(E){function B(f){const y=a&&!bi()?U:_=>_(),O=f??E,v=O?.composedPath?.()??[O?.target];y(()=>{const _=p?v[0]:re(E);if(!(!e||!g(E,_))){if(i||s){const P=Uo(i,s);e.addEventListener(rs,P,{once:!0})}ls(e,rs,{bubbles:!1,cancelable:!0,detail:{originalEvent:O,contextmenu:_i(O),focusable:_u(v),target:_}})}})}E.pointerType==="touch"?(h.forEach(f=>f()),h.add(de(c,"click",B,{once:!0})),h.add(u.addEventListener("click",B,{once:!0})),h.add(d.addEventListener("click",B,{once:!0}))):B()}const b=new Set,k=setTimeout(()=>{b.add(de(c,"pointerdown",m,!0)),b.add(u.addEventListener("pointerdown",m,!0)),b.add(d.addEventListener("pointerdown",m,!0))},0);function w(E){(a?U:f=>f())(()=>{const f=re(E);if(!(!e||!g(E,f))){if(r||s){const y=Uo(r,s);e.addEventListener(is,y,{once:!0})}ls(e,is,{bubbles:!1,cancelable:!0,detail:{originalEvent:E,contextmenu:!1,focusable:Qe(f),target:f}})}})}return bi()||(b.add(de(c,"focusin",w,!0)),b.add(u.addEventListener("focusin",w,!0)),b.add(d.addEventListener("focusin",w,!0))),()=>{clearTimeout(k),h.forEach(E=>E()),b.forEach(E=>E())}}function Eu(e,t){const{defer:o}=t,r=o?U:s=>s(),i=[];return i.push(r(()=>{const s=typeof e=="function"?e():e;i.push(Cu(s,t))})),()=>{i.forEach(s=>s?.())}}function ls(e,t,o){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,o);return e.dispatchEvent(i)}function Bu(e,t){const o=r=>{r.key==="Escape"&&(r.isComposing||t?.(r))};return de(ve(e),"keydown",o,{capture:!0})}var cs="layer:request-dismiss",pe={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),o=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<o},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const o=this.indexOf(e);return o===-1?[]:this.layers.slice(o+1).filter(r=>r.type===t)},getParentLayerOfType(e,t){const o=this.indexOf(e);if(!(o<=0))return this.layers.slice(0,o).reverse().find(r=>r.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return this.getNestedLayers(e).some(o=>Oe(o.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>Oe(t,e))},add(e){this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(t<this.count()-1&&this.getNestedLayers(e).forEach(r=>pe.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{e.node.style.setProperty("--layer-index",`${t}`),e.node.removeAttribute("data-nested"),e.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(e.node,e.type)&&e.node.setAttribute("data-nested",e.type);const r=this.countNestedLayersOfType(e.node,e.type);r>0&&e.node.setAttribute("data-has-nested",e.type),e.node.style.setProperty("--nested-layer-count",`${r}`)})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const o=this.indexOf(e);if(o===-1)return;const r=this.layers[o];Pu(e,cs,i=>{r.requestDismiss?.(i),i.defaultPrevented||r?.dismiss()}),Iu(e,cs,{originalLayer:e,targetLayer:t,originalIndex:o,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Iu(e,t,o){const r=e.ownerDocument.defaultView||window,i=new r.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:o});return e.dispatchEvent(i)}function Pu(e,t,o){e.addEventListener(t,o,{once:!0})}var ds;function us(){pe.layers.forEach(({node:e})=>{e.style.pointerEvents=pe.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Ou(e){e.style.pointerEvents=""}function vu(e,t){const o=ve(e),r=[];return pe.hasPointerBlockingLayer()&&!o.body.hasAttribute("data-inert")&&(ds=document.body.style.pointerEvents,queueMicrotask(()=>{o.body.style.pointerEvents="none",o.body.setAttribute("data-inert","")})),t?.forEach(i=>{const[s,a]=Ec(()=>{const c=i();return ne(c)?c:null},{timeout:1e3});s.then(c=>r.push(sn(c,{pointerEvents:"auto"}))),r.push(a)}),()=>{pe.hasPointerBlockingLayer()||(queueMicrotask(()=>{o.body.style.pointerEvents=ds,o.body.removeAttribute("data-inert"),o.body.style.length===0&&o.body.removeAttribute("style")}),r.forEach(i=>i()))}}function Tu(e,t){const{warnOnMissingNode:o=!0}=t;if(o&&!e){vt("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;const{onDismiss:r,onRequestDismiss:i,pointerBlocking:s,exclude:a,debug:c,type:l="dialog"}=t,d={dismiss:r,node:e,type:l,pointerBlocking:s,requestDismiss:i};pe.add(d),us();function u(b){const k=re(b.detail.originalEvent);pe.isBelowPointerBlockingLayer(e)||pe.isInBranch(k)||(t.onPointerDownOutside?.(b),t.onInteractOutside?.(b),!b.defaultPrevented&&(c&&console.log("onPointerDownOutside:",b.detail.originalEvent),r?.()))}function g(b){const k=re(b.detail.originalEvent);pe.isInBranch(k)||(t.onFocusOutside?.(b),t.onInteractOutside?.(b),!b.defaultPrevented&&(c&&console.log("onFocusOutside:",b.detail.originalEvent),r?.()))}function h(b){pe.isTopMost(e)&&(t.onEscapeKeyDown?.(b),!b.defaultPrevented&&r&&(b.preventDefault(),r()))}function p(b){if(!e)return!1;const k=typeof a=="function"?a():a,w=Array.isArray(k)?k:[k],E=t.persistentElements?.map(B=>B()).filter(ne);return E&&w.push(...E),w.some(B=>Oe(B,b))||pe.isInNestedLayer(e,b)}const m=[s?vu(e,t.persistentElements):void 0,Bu(e,h),Eu(e,{exclude:p,onFocusOutside:g,onPointerDownOutside:u,defer:t.defer})];return()=>{pe.remove(e),us(),Ou(e),m.forEach(b=>b?.())}}function kr(e,t){const{defer:o}=t,r=o?U:s=>s(),i=[];return i.push(r(()=>{const s=mt(e)?e():e;i.push(Tu(s,t))})),()=>{i.forEach(s=>s?.())}}function Su(e,t={}){const{defer:o}=t,r=o?U:s=>s(),i=[];return i.push(r(()=>{const s=mt(e)?e():e;if(!s){vt("[@zag-js/dismissable] branch node is `null` or `undefined`");return}pe.addBranch(s),i.push(()=>{pe.removeBranch(s)})})),()=>{i.forEach(s=>s?.())}}const Nu=()=>(e,t)=>t.reduce((o,r)=>{const[i,s]=o,a=r;return s[a]!==void 0&&(i[a]=s[a]),delete s[a],[i,s]},[{},{...e}]),[Ru,_r]=ee("AccordionItemPropsContext"),Du=n.defineComponent({__name:"accordion-item-content",props:{asChild:{type:Boolean}},setup(e){const t=Nu(),o=tn(),r=_r(),i=n.computed(()=>{const s=o.value.getItemContentProps(r),[,a]=t(s,["hidden","data-state"]);return a});return N(),(s,a)=>(n.openBlock(),n.createBlock(n.unref($i).Content,n.mergeProps(i.value,{"as-child":s.asChild}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),[$u,Au]=ee("AccordionItemContext"),Vu=n.defineComponent({__name:"accordion-item-context",setup(e){const t=Au();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),Mu=n.defineComponent({__name:"accordion-item-indicator",props:{asChild:{type:Boolean}},setup(e){const t=tn(),o=_r();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getItemIndicatorProps(n.unref(o)),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),Fu=n.defineComponent({__name:"accordion-item-trigger",props:{asChild:{type:Boolean}},setup(e){const t=tn(),o=_r(),r=ln(),i=n.computed(()=>{const{"aria-controls":s,...a}=t.value.getItemTriggerProps(o);return{...a,...r.value.unmounted?{}:{"aria-controls":s}}});return N(),(s,a)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(i.value,{"as-child":s.asChild}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),[$e,Ft]=ee("RenderStrategyProps"),Lu=n.defineComponent({__name:"accordion-item",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=tn(),o=e,r=n.computed(()=>t.value.getItemState(o)),i=Ft(),s=n.computed(()=>t.value.getItemContentProps(o));return $u(r),Ru(o),N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref($i).Root,n.mergeProps(n.unref(t).getItemProps(o),{open:r.value.expanded,"lazy-mount":n.unref(i).lazyMount,"unmount-on-exit":n.unref(i).unmountOnExit,ids:{content:s.value.id}}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["open","lazy-mount","unmount-on-exit","ids"]))}}),Hu=n.defineComponent({__name:"accordion-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return ai(o),$e(n.computed(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(o.value.getRootProps(),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}});var Uu=ke("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator"),fn=Uu.build(),io=e=>e.ids?.root??`accordion:${e.id}`,ju=(e,t)=>e.ids?.item?.(t)??`accordion:${e.id}:item:${t}`,ps=(e,t)=>e.ids?.itemContent?.(t)??`accordion:${e.id}:content:${t}`,so=(e,t)=>e.ids?.itemTrigger?.(t)??`accordion:${e.id}:trigger:${t}`,zu=e=>e.getById(io(e)),ao=e=>{const o=`[aria-controls][data-ownedby='${CSS.escape(io(e))}']:not([disabled])`;return tr(zu(e),o)},Wu=e=>Lo(ao(e)),Gu=e=>Ho(ao(e)),Ku=(e,t)=>Pi(ao(e),so(e,t)),qu=(e,t)=>Oi(ao(e),so(e,t));function Xu(e,t){const{send:o,context:r,prop:i,scope:s,computed:a}=e,c=r.get("focusedValue"),l=r.get("value"),d=i("multiple");function u(h){let p=h;!d&&p.length>1&&(p=[p[0]]),o({type:"VALUE.SET",value:p})}function g(h){return{expanded:l.includes(h.value),focused:c===h.value,disabled:!!(h.disabled??i("disabled"))}}return{focusedValue:c,value:l,setValue:u,getItemState:g,getRootProps(){return t.element({...fn.root.attrs,dir:i("dir"),id:io(s),"data-orientation":i("orientation")})},getItemProps(h){const p=g(h);return t.element({...fn.item.attrs,dir:i("dir"),id:ju(s,h.value),"data-state":p.expanded?"open":"closed","data-focus":F(p.focused),"data-disabled":F(p.disabled),"data-orientation":i("orientation")})},getItemContentProps(h){const p=g(h);return t.element({...fn.itemContent.attrs,dir:i("dir"),role:"region",id:ps(s,h.value),"aria-labelledby":so(s,h.value),hidden:!p.expanded,"data-state":p.expanded?"open":"closed","data-disabled":F(p.disabled),"data-focus":F(p.focused),"data-orientation":i("orientation")})},getItemIndicatorProps(h){const p=g(h);return t.element({...fn.itemIndicator.attrs,dir:i("dir"),"aria-hidden":!0,"data-state":p.expanded?"open":"closed","data-disabled":F(p.disabled),"data-focus":F(p.focused),"data-orientation":i("orientation")})},getItemTriggerProps(h){const{value:p}=h,m=g(h);return t.button({...fn.itemTrigger.attrs,type:"button",dir:i("dir"),id:so(s,p),"aria-controls":ps(s,p),"aria-expanded":m.expanded,disabled:m.disabled,"data-orientation":i("orientation"),"aria-disabled":m.disabled,"data-state":m.expanded?"open":"closed","data-ownedby":io(s),onFocus(){m.disabled||o({type:"TRIGGER.FOCUS",value:p})},onBlur(){m.disabled||o({type:"TRIGGER.BLUR"})},onClick(b){m.disabled||(qo()&&b.currentTarget.focus(),o({type:"TRIGGER.CLICK",value:p}))},onKeyDown(b){if(b.defaultPrevented||m.disabled)return;const k={ArrowDown(){a("isHorizontal")||o({type:"GOTO.NEXT",value:p})},ArrowUp(){a("isHorizontal")||o({type:"GOTO.PREV",value:p})},ArrowRight(){a("isHorizontal")&&o({type:"GOTO.NEXT",value:p})},ArrowLeft(){a("isHorizontal")&&o({type:"GOTO.PREV",value:p})},Home(){o({type:"GOTO.FIRST",value:p})},End(){o({type:"GOTO.LAST",value:p})}},w=zn(b,{dir:i("dir"),orientation:i("orientation")}),E=k[w];E&&(E(b),b.preventDefault())}})}}}var{and:Yu,not:Ju}=Gn(),Zu={props({props:e}){return{collapsible:!1,multiple:!1,orientation:"vertical",defaultValue:[],...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{focusedValue:t(()=>({defaultValue:null,sync:!0,onChange(o){e("onFocusChange")?.({value:o})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(o){e("onValueChange")?.({value:o})}}))}},computed:{isHorizontal:({prop:e})=>e("orientation")==="horizontal"},on:{"VALUE.SET":{actions:["setValue"]}},states:{idle:{on:{"TRIGGER.FOCUS":{target:"focused",actions:["setFocusedValue"]}}},focused:{on:{"GOTO.NEXT":{actions:["focusNextTrigger"]},"GOTO.PREV":{actions:["focusPrevTrigger"]},"TRIGGER.CLICK":[{guard:Yu("isExpanded","canToggle"),actions:["collapse"]},{guard:Ju("isExpanded"),actions:["expand"]}],"GOTO.FIRST":{actions:["focusFirstTrigger"]},"GOTO.LAST":{actions:["focusLastTrigger"]},"TRIGGER.BLUR":{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{canToggle:({prop:e})=>!!e("collapsible")||!!e("multiple"),isExpanded:({context:e,event:t})=>e.get("value").includes(t.value)},actions:{collapse({context:e,prop:t,event:o}){const r=t("multiple")?dl(e.get("value"),o.value):[];e.set("value",r)},expand({context:e,prop:t,event:o}){const r=t("multiple")?cl(e.get("value"),o.value):[o.value];e.set("value",r)},focusFirstTrigger({scope:e}){Wu(e)?.focus()},focusLastTrigger({scope:e}){Gu(e)?.focus()},focusNextTrigger({context:e,scope:t}){const o=e.get("focusedValue");if(!o)return;Ku(t,o)?.focus()},focusPrevTrigger({context:e,scope:t}){const o=e.get("focusedValue");if(!o)return;qu(t,o)?.focus()},setFocusedValue({context:e,event:t}){e.set("focusedValue",t.value)},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t}){e.set("value",t.value)},coarseValue({context:e,prop:t}){!t("multiple")&&e.get("value").length>1&&(vt("The value of accordion should be a single value when multiple is false."),e.set("value",[e.get("value")[0]]))}}}};ue()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]),ue()(["value","disabled"]);const Qu=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const c=n.toValue(e);return{id:o,dir:i.value.dir,getRootNode:r?.value.getRootNode,onFocusChange:l=>t?.("focusChange",l),value:c.modelValue,...Dt(c),onValueChange:l=>{t?.("valueChange",l),t?.("update:modelValue",l.value),c?.onValueChange?.(l)}}}),a=Le(Zu,s);return n.computed(()=>Xu(a,tt))},Ae=Object.freeze(Object.defineProperty({__proto__:null,Context:al,Item:Lu,ItemContent:Du,ItemContext:Vu,ItemIndicator:Mu,ItemTrigger:Fu,Root:n.defineComponent({__name:"accordion-root",props:n.mergeDefaults({collapsible:{type:Boolean},defaultValue:{},disabled:{type:Boolean},id:{},ids:{},modelValue:{},multiple:{type:Boolean},orientation:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{collapsible:void 0,disabled:void 0,multiple:void 0}),emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const o=e,i=Qu(o,t);return ai(i),$e(n.computed(()=>({lazyMount:o.lazyMount,unmountOnExit:o.unmountOnExit}))),N(),(s,a)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getRootProps(),{"as-child":s.asChild}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),RootProvider:Hu},Symbol.toStringTag,{value:"Module"}));var hn=(e,t)=>({x:e,y:t});function ep(e){const{x:t,y:o,width:r,height:i}=e,s=t+r/2,a=o+i/2;return{x:t,y:o,width:r,height:i,minX:t,minY:o,maxX:t+r,maxY:o+i,midX:s,midY:a,center:hn(s,a)}}function tp(e){const t=hn(e.minX,e.minY),o=hn(e.maxX,e.minY),r=hn(e.maxX,e.maxY),i=hn(e.minX,e.maxY);return{top:t,right:o,bottom:r,left:i}}function np(e,t){const o=ep(e),{top:r,right:i,left:s,bottom:a}=tp(o),[c]=t.split("-");return{top:[s,r,i,a],right:[r,i,a,s],bottom:[r,s,a,i],left:[i,r,s,a]}[c]}function op(e,t){const{x:o,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const c=e[s].x,l=e[s].y,d=e[a].x,u=e[a].y;l>r!=u>r&&o<(d-c)*(r-l)/(u-l)+c&&(i=!i)}return i}const[fs,rt]=ee("FieldContext"),[lo,wr]=ee("PresenceContext");function rp(e,t){const{state:o,send:r,context:i}=e,s=o.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:s,setNode(a){a&&r({type:"NODE.SET",node:a})},unmount(){r({type:"UNMOUNT"})}}}var ip={props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:e,prop:t,send:o}){e([()=>t("present")],()=>{o({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get("initial")||queueMicrotask(()=>{e.set("initial",!0)})},clearInitial:({context:e})=>{e.set("initial",!1)},invokeOnExitComplete:({prop:e})=>{e("onExitComplete")?.()},setupNode:({refs:e,event:t})=>{e.get("node")!==t.node&&(e.set("node",t.node),e.set("styles",St(t.node)))},cleanupNode:({refs:e})=>{e.set("node",null),e.set("styles",null)},syncPresence:({context:e,refs:t,send:o,prop:r})=>{const i=r("present");if(i)return o({type:"MOUNT",src:"presence.changed"});const s=t.get("node");if(!i&&s?.ownerDocument.visibilityState==="hidden")return o({type:"UNMOUNT",src:"visibilitychange"});U(()=>{const a=co(t.get("styles"));e.set("unmountAnimationName",a),a==="none"||a===e.get("prevAnimationName")||t.get("styles")?.display==="none"||t.get("styles")?.animationDuration==="0s"?o({type:"UNMOUNT",src:"presence.changed"}):o({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:e,refs:t})=>{U(()=>{e.set("prevAnimationName",co(t.get("styles")))})},clearPrevAnimationName:({context:e})=>{e.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:o})=>{const r=t.get("node");if(!r)return;const i=c=>{(c.composedPath?.()?.[0]??c.target)===r&&e.set("prevAnimationName",co(t.get("styles")))},s=c=>{const l=co(t.get("styles"));re(c)===r&&l===e.get("unmountAnimationName")&&o({type:"UNMOUNT",src:"animationend"})};r.addEventListener("animationstart",i),r.addEventListener("animationcancel",s),r.addEventListener("animationend",s);const a=sn(r,{animationFillMode:"forwards"});return()=>{r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",s),r.removeEventListener("animationend",s),Qo(()=>a())}}}}};function co(e){return e?.animationName||"none"}ue()(["onExitComplete","present","immediate"]);const uo=(e,t)=>{const o=n.ref(!1),r=n.ref(null),i=n.computed(()=>({present:n.toValue(e).present,onExitComplete:()=>t?.("exitComplete")})),s=Le(ip,i),a=n.computed(()=>rp(s));return n.watch(()=>a.value.present,()=>{a.value.present&&(o.value=!0)}),n.watch(r,()=>{if(r.value){const c=r.value.$el?r.value.$el:r.value;c&&a.value.setNode(c)}}),n.computed(()=>{const c=n.toValue(e);return{present:a.value.present,unmounted:!a.value.present&&!o.value&&c.lazyMount||c?.unmountOnExit&&!a.value?.present&&o.value,presenceProps:{ref:r,hidden:!a.value.present,"data-state":a.value.skip&&c.skipAnimationOnMount?void 0:c?.present?"open":"closed"}}})};var Lt=new WeakMap,po=new WeakMap,fo={},xr=0,hs=e=>e&&(e.host||hs(e.parentNode)),sp=(e,t)=>t.map(o=>{if(e.contains(o))return o;const r=hs(o);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",o,"in not contained inside",e,". Doing nothing"),null)}).filter(o=>!!o),ap=new Set(["script","output","status","next-route-announcer"]),lp=e=>ap.has(e.localName)||e.role==="status"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),cp=(e,t)=>{const{parentNode:o,markerName:r,controlAttribute:i}=t,s=sp(o,Array.isArray(e)?e:[e]);fo[r]||(fo[r]=new WeakMap);const a=fo[r],c=[],l=new Set,d=new Set(s),u=h=>{!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);const g=h=>{!h||d.has(h)||Array.prototype.forEach.call(h.children,p=>{if(l.has(p))g(p);else try{if(lp(p))return;const b=p.getAttribute(i)==="true",k=(Lt.get(p)||0)+1,w=(a.get(p)||0)+1;Lt.set(p,k),a.set(p,w),c.push(p),k===1&&b&&po.set(p,!0),w===1&&p.setAttribute(r,""),b||p.setAttribute(i,"true")}catch(m){console.error("[zag-js > ariaHidden] cannot operate on ",p,m)}})};return g(o),l.clear(),xr++,()=>{c.forEach(h=>{const p=Lt.get(h)-1,m=a.get(h)-1;Lt.set(h,p),a.set(h,m),p||(po.has(h)||h.removeAttribute(i),po.delete(h)),m||h.removeAttribute(r)}),xr--,xr||(Lt=new WeakMap,Lt=new WeakMap,po=new WeakMap,fo={})}},dp=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,up=(e,t=dp(e),o="data-aria-hidden")=>{if(t)return cp(e,{parentNode:t,markerName:o,controlAttribute:"aria-hidden"})},pp=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function gs(e,t={}){const{defer:o=!0}=t,r=o?pp:s=>s(),i=[];return i.push(r(()=>{const a=(typeof e=="function"?e():e).filter(Boolean);a.length!==0&&i.push(up(a))})),()=>{i.forEach(s=>s?.())}}const ms=n.defineComponent({__name:"presence",props:n.mergeDefaults({immediate:{type:Boolean},lazyMount:{type:Boolean},present:{type:Boolean},skipAnimationOnMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{immediate:void 0,lazyMount:void 0,present:void 0,skipAnimationOnMount:void 0,unmountOnExit:void 0}),emits:["exitComplete"],setup(e,{emit:t}){const i=uo(e,t);return lo(i),N(),(s,a)=>n.unref(i).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},n.unref(i).presenceProps,{"as-child":s.asChild,"data-scope":"presence","data-part":"root"}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),[bs,it]=ee("DialogContext"),fp=n.defineComponent({__name:"dialog-backdrop",props:{asChild:{type:Boolean}},setup(e){const t=it(),o=Ft();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(ms),n.mergeProps(n.unref(t).getBackdropProps(),{present:n.unref(t).open,"lazy-mount":n.unref(o).lazyMount,"unmount-on-exit":n.unref(o).unmountOnExit}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["present","lazy-mount","unmount-on-exit"]))}}),hp=n.defineComponent({__name:"dialog-close-trigger",props:{asChild:{type:Boolean}},setup(e){const t=it();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getCloseTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),gp=n.defineComponent({__name:"dialog-content",props:{asChild:{type:Boolean}},setup(e){const t=it(),o=wr(),r=n.computed(()=>an(t.value.getContentProps(),o.value.presenceProps));return N(),(i,s)=>n.unref(o).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},r.value,{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),mp=n.defineComponent({__name:"dialog-context",setup(e){const t=it();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),bp=n.defineComponent({__name:"dialog-description",props:{asChild:{type:Boolean}},setup(e){const t=it();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getDescriptionProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),yp=n.defineComponent({__name:"dialog-positioner",props:{asChild:{type:Boolean}},setup(e){const t=it(),o=Ft(),r=uo(n.computed(()=>({...o.value,present:t.value.open})));return lo(r),N(),(i,s)=>n.unref(r).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},n.unref(t).getPositionerProps(),{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),kp=n.defineComponent({__name:"dialog-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return bs(o),$e(n.computed(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),N(),(r,i)=>n.renderSlot(r.$slots,"default")}});var _p=Object.defineProperty,wp=(e,t,o)=>t in e?_p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,K=(e,t,o)=>wp(e,typeof t!="symbol"?t+"":t,o),ys={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const o=e.indexOf(t);o===-1||e.splice(o,1),e.push(t)},deactivateTrap(e,t){const o=e.indexOf(t);o!==-1&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()}},xp=[],Cp=class{constructor(e,t){K(this,"trapStack"),K(this,"config"),K(this,"doc"),K(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),K(this,"listenerCleanups",[]),K(this,"handleFocus",r=>{const i=re(r),s=this.findContainerIndex(i,r)>=0;if(s||zo(i))s&&(this.state.mostRecentlyFocusedNode=i);else{r.stopImmediatePropagation();let a,c=!0;if(this.state.mostRecentlyFocusedNode)if(rn(this.state.mostRecentlyFocusedNode)>0){const l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:d}=this.state.containerGroups[l];if(d.length>0){const u=d.findIndex(g=>g===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<d.length&&(a=d[u+1],c=!1):u-1>=0&&(a=d[u-1],c=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(d=>rn(d)>0))||(c=!1);else c=!1;c&&(a=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),a?this.tryFocus(a):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),K(this,"handlePointerDown",r=>{const i=re(r);if(!(this.findContainerIndex(i,r)>=0)){if(mn(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}mn(this.config.allowOutsideClick,r)||r.preventDefault()}}),K(this,"handleClick",r=>{const i=re(r);this.findContainerIndex(i,r)>=0||mn(this.config.clickOutsideDeactivates,r)||mn(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),K(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const i=this.config.isKeyBackward(r),s=this.findNextNavNode({event:r,isBackward:i});if(!s)return;gn(r)&&r.preventDefault(),this.tryFocus(s)}}),K(this,"handleEscapeKey",r=>{Ep(r)&&mn(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),K(this,"_mutationObserver"),K(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(i=>{i.some(a=>Array.from(a.removedNodes).some(l=>l===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),K(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(r=>{this._mutationObserver?.observe(r,{subtree:!0,childList:!0})})}),K(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!Qe(r)){const i=Tt(this.doc);if(i&&this.findContainerIndex(i)>=0)r=i;else{const s=this.state.tabbableGroups[0];r=s&&s.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),K(this,"tryFocus",r=>{if(r!==!1&&r!==Tt(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,Bp(r)&&r.select()}}),K(this,"deactivate",r=>{if(!this.state.active)return this;const i={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),ys.deactivateTrap(this.trapStack,this);const s=this.getOption(i,"onDeactivate"),a=this.getOption(i,"onPostDeactivate"),c=this.getOption(i,"checkCanReturnFocus"),l=this.getOption(i,"returnFocus","returnFocusOnDeactivate");s?.();const d=()=>{ks(()=>{if(l){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}a?.()})};if(l&&c){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return c(u).then(d,d),this}return d(),this}),K(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onPause"),s=this.getOption(r,"onPostPause");return this.state.paused=!0,i?.(),this.removeListeners(),this.updateObservedNodes(),s?.(),this}),K(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(r,"onUnpause"),s=this.getOption(r,"onPostUnpause");return this.state.paused=!1,i?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),s?.(),this}),K(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),K(this,"getReturnFocusNode",r=>{const i=this.getNodeForOption("setReturnFocus",{params:[r]});return i||(i===!1?!1:r)}),K(this,"getOption",(r,i,s)=>r&&r[i]!==void 0?r[i]:this.config[s||i]),K(this,"getNodeForOption",(r,{hasFallback:i=!1,params:s=[]}={})=>{let a=this.config[r];if(typeof a=="function"&&(a=a(...s)),a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let c=a;if(typeof a=="string"){try{c=this.doc.querySelector(a)}catch(l){throw new Error(`\`${r}\` appears to be an invalid selector; error="${l.message}"`)}if(!c&&!i)throw new Error(`\`${r}\` as selector refers to no known node`)}return c}),K(this,"findNextNavNode",r=>{const{event:i,isBackward:s=!1}=r,a=r.target||re(i);this.updateTabbableNodes();let c=null;if(this.state.tabbableGroups.length>0){const l=this.findContainerIndex(a,i),d=l>=0?this.state.containerGroups[l]:void 0;if(l<0)s?c=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:c=this.state.tabbableGroups[0].firstTabbableNode;else if(s){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:g})=>a===g);if(u<0&&(d?.container===a||Qe(a)&&!et(a)&&!d?.nextTabbableNode(a,!1))&&(u=l),u>=0){const g=u===0?this.state.tabbableGroups.length-1:u-1,h=this.state.tabbableGroups[g];c=rn(a)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else gn(i)||(c=d?.nextTabbableNode(a,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:g})=>a===g);if(u<0&&(d?.container===a||Qe(a)&&!et(a)&&!d?.nextTabbableNode(a))&&(u=l),u>=0){const g=u===this.state.tabbableGroups.length-1?0:u+1,h=this.state.tabbableGroups[g];c=rn(a)>=0?h.firstTabbableNode:h.firstDomTabbableNode}else gn(i)||(c=d?.nextTabbableNode(a))}}else c=this.getNodeForOption("fallbackFocus");return c}),this.trapStack=t.trapStack||xp;const o={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(r){return gn(r)&&!r.shiftKey},isKeyBackward(r){return gn(r)&&r.shiftKey},...t};this.doc=o.document||ve(Array.isArray(e)?e[0]:e),this.config=o,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const o=typeof t?.composedPath=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||o?.includes(r)||i.find(s=>s===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=on(e),o=Jo(e),r=t.length>0?t[0]:void 0,i=t.length>0?t[t.length-1]:void 0,s=o.find(d=>et(d)),a=o.slice().reverse().find(d=>et(d)),c=!!t.find(d=>rn(d)>0);function l(d,u=!0){const g=t.indexOf(d);return g<0?u?o.slice(o.indexOf(d)+1).find(h=>et(h)):o.slice(0,o.indexOf(d)).reverse().find(h=>et(h)):t[g+(u?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:o,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:s,lastDomTabbableNode:a,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return ys.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?ks(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(de(this.doc,"focusin",this.handleFocus,!0),de(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),de(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),de(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),de(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),de(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),o=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Tt(this.doc),t?.();const i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},gn=e=>e.key==="Tab",mn=(e,...t)=>typeof e=="function"?e(...t):e,Ep=e=>!e.isComposing&&e.key==="Escape",ks=e=>setTimeout(e,0),Bp=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function _s(e,t={}){let o;const r=U(()=>{const i=typeof e=="function"?e():e;if(i){o=new Cp(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:ve(i)});try{o.activate()}catch{}}});return function(){o?.deactivate(),r()}}var Cr="data-scroll-lock";function Ip(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function ws(e){const t=e??document,o=t.defaultView??window,{documentElement:r,body:i}=t;if(i.hasAttribute(Cr))return;const a=o.innerWidth-r.clientWidth;i.setAttribute(Cr,"");const c=()=>_c(r,"--scrollbar-width",`${a}px`),l=Ip(r),d=()=>sn(i,{overflow:"hidden",[l]:`${a}px`}),u=()=>{const{scrollX:h,scrollY:p,visualViewport:m}=o,b=m?.offsetLeft??0,k=m?.offsetTop??0,w=sn(i,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(k))}px`,left:`${-(h-Math.floor(b))}px`,right:"0",[l]:`${a}px`});return()=>{w?.(),o.scrollTo({left:h,top:p,behavior:"instant"})}},g=[c(),yi()?u():d()];return()=>{g.forEach(h=>h?.()),i.removeAttribute(Cr)}}var Pp=ke("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),wt=Pp.build(),xs=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Cs=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Er=e=>e.ids?.content??`dialog:${e.id}:content`,Es=e=>e.ids?.trigger??`dialog:${e.id}:trigger`,Br=e=>e.ids?.title??`dialog:${e.id}:title`,Ir=e=>e.ids?.description??`dialog:${e.id}:description`,Bs=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,ho=e=>e.getById(Er(e)),Op=e=>e.getById(xs(e)),vp=e=>e.getById(Cs(e)),Tp=e=>e.getById(Es(e)),Sp=e=>e.getById(Br(e)),Np=e=>e.getById(Ir(e)),Rp=e=>e.getById(Bs(e));function Dp(e,t){const{state:o,send:r,context:i,prop:s,scope:a}=e,c=s("aria-label"),l=o.matches("open");return{open:l,setOpen(d){o.matches("open")!==d&&r({type:d?"OPEN":"CLOSE"})},getTriggerProps(){return t.button({...wt.trigger.attrs,dir:s("dir"),id:Es(a),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":Er(a),onClick(d){d.defaultPrevented||r({type:"TOGGLE"})}})},getBackdropProps(){return t.element({...wt.backdrop.attrs,dir:s("dir"),hidden:!l,id:Cs(a),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...wt.positioner.attrs,dir:s("dir"),id:xs(a),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){const d=i.get("rendered");return t.element({...wt.content.attrs,dir:s("dir"),role:s("role"),hidden:!l,id:Er(a),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":c||void 0,"aria-labelledby":c||!d.title?void 0:Br(a),"aria-describedby":d.description?Ir(a):void 0})},getTitleProps(){return t.element({...wt.title.attrs,dir:s("dir"),id:Br(a)})},getDescriptionProps(){return t.element({...wt.description.attrs,dir:s("dir"),id:Ir(a)})},getCloseTriggerProps(){return t.button({...wt.closeTrigger.attrs,dir:s("dir"),id:Bs(a),type:"button",onClick(d){d.defaultPrevented||(d.stopPropagation(),r({type:"CLOSE"}))}})}}}var $p={props({props:e,scope:t}){const o=e.role==="alertdialog",r=o?()=>Rp(t):void 0,i=typeof e.modal=="boolean"?e.modal:!0;return{role:"dialog",modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:!o,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r,...e}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:e,action:t,prop:o}){e([()=>o("open")],()=>{t(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackDismissableElement({scope:e,send:t,prop:o}){return kr(()=>ho(e),{type:"dialog",defer:!0,pointerBlocking:o("modal"),exclude:[Tp(e)],onInteractOutside(i){o("onInteractOutside")?.(i),o("closeOnInteractOutside")||i.preventDefault()},persistentElements:o("persistentElements"),onFocusOutside:o("onFocusOutside"),onPointerDownOutside:o("onPointerDownOutside"),onRequestDismiss:o("onRequestDismiss"),onEscapeKeyDown(i){o("onEscapeKeyDown")?.(i),o("closeOnEscape")||i.preventDefault()},onDismiss(){t({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:e,prop:t}){if(t("preventScroll"))return ws(e.getDoc())},trapFocus({scope:e,prop:t}){return t("trapFocus")?_s(()=>ho(e),{preventScroll:!0,returnFocusOnDeactivate:!!t("restoreFocus"),initialFocus:t("initialFocusEl"),setReturnFocus:r=>t("finalFocusEl")?.()??r}):void 0},hideContentBelow({scope:e,prop:t}){return t("modal")?gs(()=>[ho(e)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:e,scope:t}){U(()=>{e.set("rendered",{title:!!Sp(t),description:!!Np(t)})})},syncZIndex({scope:e}){U(()=>{const t=ho(e);if(!t)return;const o=St(t);[Op(e),vp(e)].forEach(i=>{i?.style.setProperty("--z-index",o.zIndex),i?.style.setProperty("--layer-index",o.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},toggleVisibility({prop:e,send:t,event:o}){t({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:o})}}}};ue()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const Ap=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const c=n.toValue(e);return{id:o,dir:i.value.dir,getRootNode:r?.value.getRootNode,...Dt(e),onOpenChange:l=>{t?.("openChange",l),t?.("update:open",l.open),c.onOpenChange?.(l)},onEscapeKeyDown:l=>{t?.("escapeKeyDown",l),c.onEscapeKeyDown?.(l)},onFocusOutside:l=>{t?.("focusOutside",l),c.onFocusOutside?.(l)},onInteractOutside:l=>{t?.("interactOutside",l),c.onInteractOutside?.(l)},onPointerDownOutside:l=>{t?.("pointerDownOutside",l),c.onPointerDownOutside?.(l)},onRequestDismiss:l=>{t?.("requestDismiss",l),c.onRequestDismiss?.(l)}}}),a=Le($p,s);return n.computed(()=>Dp(a,tt))},xt=Object.freeze(Object.defineProperty({__proto__:null,Backdrop:fp,CloseTrigger:hp,Content:gp,Context:mp,Description:bp,Positioner:yp,Root:n.defineComponent({__name:"dialog-root",props:n.mergeDefaults({"aria-label":{},closeOnEscape:{type:Boolean},closeOnInteractOutside:{type:Boolean},defaultOpen:{type:Boolean},finalFocusEl:{type:Function},id:{},ids:{},initialFocusEl:{type:Function},modal:{type:Boolean},open:{type:Boolean},persistentElements:{},preventScroll:{type:Boolean},restoreFocus:{type:Boolean},role:{},trapFocus:{type:Boolean},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean}},{closeOnEscape:void 0,closeOnInteractOutside:void 0,defaultOpen:void 0,modal:void 0,open:void 0,preventScroll:void 0,restoreFocus:void 0,trapFocus:void 0}),emits:["escapeKeyDown","focusOutside","interactOutside","openChange","pointerDownOutside","requestDismiss","update:open"],setup(e,{emit:t}){const o=e,i=Ap(o,t);return bs(i),$e(n.computed(()=>({lazyMount:o.lazyMount,unmountOnExit:o.unmountOnExit}))),N(),(s,a)=>n.renderSlot(s.$slots,"default")}}),RootProvider:kp,Title:n.defineComponent({__name:"dialog-title",props:{asChild:{type:Boolean}},setup(e){const t=it();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).h2,n.mergeProps(n.unref(t).getTitleProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Trigger:n.defineComponent({__name:"dialog-trigger",props:{asChild:{type:Boolean}},setup(e){const t=it();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}})},Symbol.toStringTag,{value:"Module"})),Vp=n.defineComponent({__name:"field-context",setup(e){const t=rt();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),Mp=n.defineComponent({__name:"field-error-text",props:{asChild:{type:Boolean}},setup(e){const t=rt();return N(),(o,r)=>n.unref(t).invalid?(n.openBlock(),n.createBlock(n.unref(D).span,n.mergeProps({key:0},n.unref(t).getErrorTextProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"])):n.createCommentVNode("",!0)}}),Fp=n.defineComponent({__name:"field-helper-text",props:{asChild:{type:Boolean}},setup(e){const t=rt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).span,n.mergeProps(n.unref(t).getHelperTextProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Lp=n.defineComponent({__name:"field-input",props:{modelValue:{},asChild:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const o=rt(),r=t;return N(),(i,s)=>(n.openBlock(),n.createBlock(n.unref(D).input,n.mergeProps(n.unref(o).getInputProps(),{"as-child":i.asChild,value:i.modelValue,onInput:s[0]||(s[0]=a=>r("update:modelValue",a.target.value))}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child","value"]))}}),Hp=n.defineComponent({__name:"field-label",props:{asChild:{type:Boolean}},setup(e){const t=rt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).label,n.mergeProps(n.unref(t).getLabelProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Up=n.defineComponent({__name:"field-required-indicator",props:{asChild:{type:Boolean}},setup(e){const t=rt();return N(),(o,r)=>n.unref(t).required?(n.openBlock(),n.createBlock(n.unref(D).span,n.mergeProps({key:0},n.unref(t).getRequiredIndicatorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default",{},()=>[r[0]||(r[0]=n.createTextVNode("*",-1))])]),_:3},16,["as-child"])):n.renderSlot(o.$slots,"fallback",{key:1})}}),jp=n.defineComponent({__name:"field-root-provider",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return fs(o),N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(o.value.getRootProps(),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),st=ke("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator").build(),zp=(e={})=>{const t=He(Ue),o=n.reactive({hasErrorText:!1,hasHelperText:!1}),r=n.useId(),i=n.computed(()=>n.toValue(e).id??r),s=n.ref(null),a=n.computed(()=>n.toValue(e).ids?.control??`field::${i.value}`),c=n.computed(()=>n.toValue(e).ids?.errorText??`field::${i.value}::error-text`),l=n.computed(()=>n.toValue(e).ids?.helperText??`field::${i.value}::helper-text`),d=n.computed(()=>n.toValue(e).ids?.label??`field::${i.value}::label`);n.onMounted(()=>{const f=sr(s);if(!f)return;const y=()=>{const _=t.value.getRootNode();o.hasErrorText=!!_.getElementById(c.value),o.hasHelperText=!!_.getElementById(l.value)};y();const O=t.value.getWindow(),v=new O.MutationObserver(y);v.observe(f,{childList:!0,subtree:!0}),n.onBeforeUnmount(()=>{v.disconnect()})});const u=()=>{const f=n.toValue(e);return{...st.root.attrs,id:a.value,role:"group","data-disabled":F(f.disabled),"data-invalid":F(f.invalid),"data-readonly":F(f.readOnly)}},g=()=>{const f=n.toValue(e);return{...st.label.attrs,id:d.value,"data-disabled":F(f.disabled),"data-invalid":F(f.invalid),"data-readonly":F(f.readOnly),"data-required":F(f.required),htmlFor:i.value}},h=n.computed(()=>{const f=n.toValue(e),y=[];return o.hasErrorText&&f.invalid&&y.push(c.value),o.hasHelperText&&y.push(l.value),y}),p=()=>{const f=n.toValue(e);return{"aria-describedby":h.value.join(" ")||void 0,"aria-invalid":hi(f.invalid),"data-invalid":F(f.invalid),"data-required":F(f.required),"data-readonly":F(f.readOnly),id:i.value,required:f.required,disabled:f.disabled,readOnly:f.readOnly}},m=()=>({...p(),...st.input.attrs}),b=()=>({...p(),...st.textarea.attrs}),k=()=>({...p(),...st.select.attrs}),w=()=>{const f=n.toValue(e);return{id:l.value,...st.helperText.attrs,"data-disabled":F(f.disabled)}},E=()=>({id:c.value,...st.errorText.attrs,"aria-live":"polite"}),B=()=>({"aria-hidden":!0,...st.requiredIndicator.attrs});return n.computed(()=>{const f=n.toValue(e);return{ariaDescribedby:h.value.join(" ")||void 0,ids:{control:i.value,label:d.value,errorText:c.value,helperText:l.value},refs:{rootRef:s},disabled:f.disabled,invalid:f.invalid,readOnly:f.readOnly,required:f.required,getLabelProps:g,getRootProps:u,getInputProps:m,getTextareaProps:b,getSelectProps:k,getHelperTextProps:w,getErrorTextProps:E,getRequiredIndicatorProps:B}})},Wp=n.defineComponent({__name:"field-root",props:n.mergeDefaults({disabled:{type:Boolean},id:{},ids:{},invalid:{type:Boolean},readOnly:{type:Boolean},required:{type:Boolean},asChild:{type:Boolean}},{disabled:void 0,invalid:void 0,readOnly:void 0,required:void 0}),setup(e){const o=zp(e);return fs(o),N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(o).getRootProps(),{ref:n.unref(o).refs.rootRef,"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),Gp=n.defineComponent({__name:"field-select",props:{modelValue:{},asChild:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const o=rt(),r=t;return N(),(i,s)=>(n.openBlock(),n.createBlock(n.unref(D).select,n.mergeProps(n.unref(o).getSelectProps(),{value:i.modelValue,onChange:s[0]||(s[0]=a=>r("update:modelValue",a.target.value)),"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["value","as-child"]))}});var Kp=e=>{if(!e)return;const t=St(e),o=Te(e),r=ve(e),i=()=>{requestAnimationFrame(()=>{e.style.height="auto";let d;t.boxSizing==="content-box"?d=e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):d=e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!=="none"&&d>parseFloat(t.maxHeight)?(t.overflowY==="hidden"&&(e.style.overflowY="scroll"),d=parseFloat(t.maxHeight)):t.overflowY!=="hidden"&&(e.style.overflowY="hidden"),e.style.height=`${d}px`})};e.addEventListener("input",i),e.form?.addEventListener("reset",i);const s=Object.getPrototypeOf(e),a=Object.getOwnPropertyDescriptor(s,"value");Object.defineProperty(e,"value",{...a,set(){a?.set?.apply(this,arguments),i()}});const c=new o.ResizeObserver(()=>{requestAnimationFrame(()=>i())});c.observe(e);const l=new o.MutationObserver(()=>i());return l.observe(e,{attributes:!0,attributeFilter:["rows","placeholder"]}),r.fonts?.addEventListener("loadingdone",i),()=>{e.removeEventListener("input",i),e.form?.removeEventListener("reset",i),r.fonts?.removeEventListener("loadingdone",i),c.disconnect(),l.disconnect()}};const Is=Object.freeze(Object.defineProperty({__proto__:null,Context:Vp,ErrorText:Mp,HelperText:Fp,Input:Lp,Label:Hp,RequiredIndicator:Up,Root:Wp,RootProvider:jp,Select:Gp,Textarea:n.defineComponent({__name:"field-textarea",props:{modelValue:{},autoresize:{type:Boolean},asChild:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,r=rt(),i=t,s=n.ref();return n.onMounted(()=>{const a=sr(s);if(!a||!o.autoresize)return;const c=Kp(a);n.onBeforeUnmount(()=>c?.())}),N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref(D).textarea,n.mergeProps({ref_key:"textareaRef",ref:s},n.unref(r).getTextareaProps(),{value:a.modelValue,onInput:c[0]||(c[0]=l=>i("update:modelValue",l.target.value)),style:o.autoresize?{resize:"none",overflow:"hidden"}:void 0,"as-child":a.asChild}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["value","style","as-child"]))}})},Symbol.toStringTag,{value:"Module"})),[Ps,te]=ee("MenuContext"),qp=n.defineComponent({__name:"menu-arrow-tip",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getArrowTipProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Xp=n.defineComponent({__name:"menu-arrow",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getArrowProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),[Pr,Yp]=ee("MenuItemContext"),[go,Os]=ee("MenuItemPropsContext"),Jp=n.defineComponent({__name:"menu-checkbox-item",props:n.mergeDefaults({checked:{type:Boolean},value:{},disabled:{type:Boolean},valueText:{},closeOnSelect:{type:Boolean},asChild:{type:Boolean}},{checked:void 0,disabled:void 0,closeOnSelect:void 0}),emits:["update:checked"],setup(e,{emit:t}){const o=e,r=t,i=te(),s=n.computed(()=>({...o,type:"checkbox",onCheckedChange:c=>r("update:checked",c)})),a=n.computed(()=>i.value.getOptionItemState(s.value));return Pr(a),go(s),N(),(c,l)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getOptionItemProps(s.value),{"as-child":c.asChild}),{default:n.withCtx(()=>[n.renderSlot(c.$slots,"default")]),_:3},16,["as-child"]))}}),Zp=n.defineComponent({__name:"menu-content",props:{asChild:{type:Boolean}},setup(e){const t=te(),o=wr(),r=n.computed(()=>an(t.value.getContentProps(),o.value.presenceProps));return N(),(i,s)=>n.unref(o).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},r.value,{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),Qp=n.defineComponent({__name:"menu-context-trigger",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getContextTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),ef=n.defineComponent({__name:"menu-context",setup(e){const t=te();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),tf=n.defineComponent({__name:"menu-indicator",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getIndicatorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),nf=n.defineComponent({__name:"menu-item-context",setup(e){const t=Yp();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),[vs,Ts]=ee("MenuItemGroupContext"),of=n.defineComponent({__name:"menu-item-group-label",props:{asChild:{type:Boolean}},setup(e){const t=te(),o=Ts();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getItemGroupLabelProps({htmlFor:n.unref(o).id}),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),rf=n.defineComponent({__name:"menu-item-group",props:{id:{},asChild:{type:Boolean}},setup(e){const t=e,o=te(),r=n.useId(),i=t.id??r,s=n.computed(()=>({id:i}));return vs(s),N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(o).getItemGroupProps(s.value),{"as-child":a.asChild}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["as-child"]))}}),sf=n.defineComponent({__name:"menu-item-indicator",props:{asChild:{type:Boolean}},setup(e){const t=te(),o=Os();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getItemIndicatorProps(n.unref(o)),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),af=n.defineComponent({__name:"menu-item-text",props:{asChild:{type:Boolean}},setup(e){const t=te(),o=Os();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getItemTextProps(n.unref(o)),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),lf=n.defineComponent({__name:"menu-item",props:n.mergeDefaults({value:{},disabled:{type:Boolean},valueText:{},closeOnSelect:{type:Boolean},asChild:{type:Boolean}},{disabled:void 0,closeOnSelect:void 0}),emits:["select"],setup(e,{emit:t}){const o=e,r=t,i=te(),s=n.computed(()=>i.value.getItemState(o));return go(n.computed(()=>o)),Pr(s),n.onMounted(()=>{const a=i.value.addItemListener({id:s.value.id,onSelect:()=>r("select")});n.onBeforeUnmount(()=>a?.())}),N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getItemProps(o),{"as-child":a.asChild}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["as-child"]))}}),cf=n.defineComponent({__name:"menu-positioner",props:{asChild:{type:Boolean}},setup(e){const t=te(),o=Ft(),r=uo(n.computed(()=>({...o.value,present:t.value.open})));return lo(r),N(),(i,s)=>n.unref(r).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},n.unref(t).getPositionerProps(),{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),df=n.defineComponent({__name:"menu-radio-item-group",props:{id:{},modelValue:{},asChild:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,r=t,i=te(),s=n.useId(),a=o.id??s,c=n.computed(()=>({id:a,value:o.modelValue,onValueChange:l=>r("update:modelValue",l.value)}));return vs(c),N(),(l,d)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getItemGroupProps(c.value),{"as-child":l.asChild}),{default:n.withCtx(()=>[n.renderSlot(l.$slots,"default")]),_:3},16,["as-child"]))}}),uf=n.defineComponent({__name:"menu-radio-item",props:n.mergeDefaults({value:{},disabled:{type:Boolean},valueText:{},closeOnSelect:{type:Boolean},asChild:{type:Boolean}},{disabled:void 0,closeOnSelect:void 0}),setup(e){const t=e,o=te(),r=Ts(),i=n.computed(()=>({...t,checked:r.value.value===t.value,type:"radio",onCheckedChange:()=>r.value.onValueChange?.({value:t.value})})),s=n.computed(()=>o.value.getOptionItemState(i.value));return Pr(s),go(i),N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(o).getOptionItemProps(i.value),{"as-child":a.asChild}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["as-child"]))}}),[Ss,Ns]=ee("MenuMachineContext"),[Rs,pf]=ee("MenuTriggerItemContext"),ff=n.defineComponent({__name:"menu-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,{value:{machine:o,api:r}}=t,i=te(),s=Ns();return n.onMounted(()=>{s&&(i.value.setChild(o),r.value.setParent(s))}),Rs(n.computed(()=>i.value.getTriggerItemProps(r.value))),Ss(o),Ps(r),$e(n.computed(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),N(),(a,c)=>n.renderSlot(a.$slots,"default")}});var hf=ke("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),ae=hf.build(),mo=e=>e.ids?.trigger??`menu:${e.id}:trigger`,Ds=e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,bn=e=>e.ids?.content??`menu:${e.id}:content`,gf=e=>e.ids?.arrow??`menu:${e.id}:arrow`,$s=e=>e.ids?.positioner??`menu:${e.id}:popper`,mf=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,yn=(e,t)=>`${e.id}/${t}`,Ct=e=>e?.dataset.value??null,As=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,at=e=>e.getById(bn(e)),Vs=e=>e.getById($s(e)),bo=e=>e.getById(mo(e)),bf=(e,t)=>t?e.getById(yn(e,t)):null,Or=e=>e.getById(Ds(e)),kn=e=>{const o=`[role^="menuitem"][data-ownedby=${CSS.escape(bn(e))}]:not([data-disabled])`;return tr(at(e),o)},yf=e=>Lo(kn(e)),kf=e=>Ho(kn(e)),vr=(e,t)=>t?e.id===t||e.dataset.value===t:!1,_f=(e,t)=>{const o=kn(e),r=o.findIndex(i=>vr(i,t.value));return ul(o,r,{loop:t.loop??t.loopFocus})},wf=(e,t)=>{const o=kn(e),r=o.findIndex(i=>vr(i,t.value));return fl(o,r,{loop:t.loop??t.loopFocus})},xf=(e,t)=>{const o=kn(e),r=o.find(i=>vr(i,t.value));return vi(o,{state:t.typeaheadState,key:t.key,activeId:r?.id??null})},yo=e=>ne(e)&&(e.dataset.disabled===""||e.hasAttribute("disabled")),Cf=e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),Tr="menu:select";function Ef(e,t){if(!e)return;const o=Te(e),r=new o.CustomEvent(Tr,{detail:{value:t}});e.dispatchEvent(r)}function Bf(e,t){const{context:o,send:r,state:i,computed:s,prop:a,scope:c}=e,l=i.hasTag("open"),d=o.get("isSubmenu"),u=s("isTypingAhead"),g=a("composite"),h=o.get("currentPlacement"),p=o.get("anchorPoint"),m=o.get("highlightedValue"),b=os({...a("positioning"),placement:p?"bottom":h});function k(f){return{id:yn(c,f.value),disabled:!!f.disabled,highlighted:m===f.value}}function w(f){const y=f.valueText??f.value;return{...f,id:f.value,valueText:y}}function E(f){return{...k(w(f)),checked:!!f.checked}}function B(f){const{closeOnSelect:y,valueText:O,value:v}=f,_=k(f),P=yn(c,v);return t.element({...ae.item.attrs,id:P,role:"menuitem","aria-disabled":hi(_.disabled),"data-disabled":F(_.disabled),"data-ownedby":bn(c),"data-highlighted":F(_.highlighted),"data-value":v,"data-valuetext":O,onDragStart(x){x.currentTarget.matches("a[href]")&&x.preventDefault()},onPointerMove(x){if(_.disabled||x.pointerType!=="mouse")return;const T=x.currentTarget;_.highlighted||r({type:"ITEM_POINTERMOVE",id:P,target:T,closeOnSelect:y})},onPointerLeave(x){if(_.disabled||x.pointerType!=="mouse"||!e.event.previous()?.type.includes("POINTER"))return;const C=x.currentTarget;r({type:"ITEM_POINTERLEAVE",id:P,target:C,closeOnSelect:y})},onPointerDown(x){if(_.disabled)return;const T=x.currentTarget;r({type:"ITEM_POINTERDOWN",target:T,id:P,closeOnSelect:y})},onClick(x){if(ki(x)||Xo(x)||_.disabled)return;const T=x.currentTarget;r({type:"ITEM_CLICK",target:T,id:P,closeOnSelect:y})}})}return{highlightedValue:m,open:l,setOpen(f){i.hasTag("open")!==f&&r({type:f?"OPEN":"CLOSE"})},setHighlightedValue(f){r({type:"HIGHLIGHTED.SET",value:f})},setParent(f){r({type:"PARENT.SET",value:f,id:f.prop("id")})},setChild(f){r({type:"CHILD.SET",value:f,id:f.prop("id")})},reposition(f={}){r({type:"POSITIONING.SET",options:f})},addItemListener(f){const y=c.getById(f.id);if(!y)return;const O=()=>f.onSelect?.();return y.addEventListener(Tr,O),()=>y.removeEventListener(Tr,O)},getContextTriggerProps(){return t.element({...ae.contextTrigger.attrs,dir:a("dir"),id:Ds(c),"data-state":l?"open":"closed",onPointerDown(f){if(f.pointerType==="mouse")return;const y=Wn(f);r({type:"CONTEXT_MENU_START",point:y})},onPointerCancel(f){f.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(f){f.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(f){f.pointerType!=="mouse"&&r({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(f){const y=Wn(f);r({type:"CONTEXT_MENU",point:y}),f.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(f){const y=f.getTriggerProps();return an(B({value:y.id}),y)},getTriggerProps(){return t.button({...d?ae.triggerItem.attrs:ae.trigger.attrs,"data-placement":o.get("currentPlacement"),type:"button",dir:a("dir"),id:mo(c),"data-uid":a("id"),"aria-haspopup":g?"menu":"dialog","aria-controls":bn(c),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(f){if(f.pointerType!=="mouse"||yo(f.currentTarget)||!d)return;const O=Wn(f);r({type:"TRIGGER_POINTERMOVE",target:f.currentTarget,point:O})},onPointerLeave(f){if(yo(f.currentTarget)||f.pointerType!=="mouse"||!d)return;const y=Wn(f);r({type:"TRIGGER_POINTERLEAVE",target:f.currentTarget,point:y})},onPointerDown(f){yo(f.currentTarget)||_i(f)||f.preventDefault()},onClick(f){f.defaultPrevented||yo(f.currentTarget)||r({type:"TRIGGER_CLICK",target:f.currentTarget})},onBlur(){r({type:"TRIGGER_BLUR"})},onFocus(){r({type:"TRIGGER_FOCUS"})},onKeyDown(f){if(f.defaultPrevented)return;const y={ArrowDown(){r({type:"ARROW_DOWN"})},ArrowUp(){r({type:"ARROW_UP"})},Enter(){r({type:"ARROW_DOWN",src:"enter"})},Space(){r({type:"ARROW_DOWN",src:"space"})}},O=zn(f,{orientation:"vertical",dir:a("dir")}),v=y[O];v&&(f.preventDefault(),v(f))}})},getIndicatorProps(){return t.element({...ae.indicator.attrs,dir:a("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({...ae.positioner.attrs,dir:a("dir"),id:$s(c),style:b.floating})},getArrowProps(){return t.element({id:gf(c),...ae.arrow.attrs,dir:a("dir"),style:b.arrow})},getArrowTipProps(){return t.element({...ae.arrowTip.attrs,dir:a("dir"),style:b.arrowTip})},getContentProps(){return t.element({...ae.content.attrs,id:bn(c),"aria-label":a("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:g?"menu":"dialog",tabIndex:0,dir:a("dir"),"aria-activedescendant":s("highlightedId")||void 0,"aria-labelledby":mo(c),"data-placement":h,onPointerEnter(f){f.pointerType==="mouse"&&r({type:"MENU_POINTERENTER"})},onKeyDown(f){if(f.defaultPrevented||!Oe(f.currentTarget,re(f)))return;const y=re(f);if(!(y?.closest("[role=menu]")===f.currentTarget||y===f.currentTarget))return;if(f.key==="Tab"&&!ic(f)){f.preventDefault();return}const v={ArrowDown(){r({type:"ARROW_DOWN"})},ArrowUp(){r({type:"ARROW_UP"})},ArrowLeft(){r({type:"ARROW_LEFT"})},ArrowRight(){r({type:"ARROW_RIGHT"})},Enter(){r({type:"ENTER"})},Space(x){u?r({type:"TYPEAHEAD",key:x.key}):v.Enter?.(x)},Home(){r({type:"HOME"})},End(){r({type:"END"})}},_=zn(f,{dir:a("dir")}),P=v[_];if(P){P(f),f.stopPropagation(),f.preventDefault();return}a("typeahead")&&Yl(f)&&(Zl(f)||Wo(y)||(r({type:"TYPEAHEAD",key:f.key}),f.preventDefault()))}})},getSeparatorProps(){return t.element({...ae.separator.attrs,role:"separator",dir:a("dir"),"aria-orientation":"horizontal"})},getItemState:k,getItemProps:B,getOptionItemState:E,getOptionItemProps(f){const{type:y,disabled:O,closeOnSelect:v}=f,_=w(f),P=E(f);return{...B(_),...t.element({"data-type":y,...ae.item.attrs,dir:a("dir"),"data-value":_.value,role:`menuitem${y}`,"aria-checked":!!P.checked,"data-state":P.checked?"checked":"unchecked",onClick(x){if(O||ki(x)||Xo(x))return;const T=x.currentTarget;r({type:"ITEM_CLICK",target:T,option:_,closeOnSelect:v})}})}},getItemIndicatorProps(f){const y=E(ui(f)),O=y.checked?"checked":"unchecked";return t.element({...ae.itemIndicator.attrs,dir:a("dir"),"data-disabled":F(y.disabled),"data-highlighted":F(y.highlighted),"data-state":Mn(f,"checked")?O:void 0,hidden:Mn(f,"checked")?!y.checked:void 0})},getItemTextProps(f){const y=E(ui(f)),O=y.checked?"checked":"unchecked";return t.element({...ae.itemText.attrs,dir:a("dir"),"data-disabled":F(y.disabled),"data-highlighted":F(y.highlighted),"data-state":Mn(f,"checked")?O:void 0})},getItemGroupLabelProps(f){return t.element({...ae.itemGroupLabel.attrs,id:As(c,f.htmlFor),dir:a("dir")})},getItemGroupProps(f){return t.element({id:mf(c,f.id),...ae.itemGroup.attrs,dir:a("dir"),"aria-labelledby":As(c,f.id),role:"group"})}}}var{not:_e,and:Ht,or:If}=Gn(),Pf={props({props:e}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(t){Ei(t.node)},...e,positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},context({bindable:e,prop:t}){return{suspendPointer:e(()=>({defaultValue:!1})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(o){t("onHighlightChange")?.({highlightedValue:o})}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(o){return`x: ${o?.x}, y: ${o?.y}`}})),isSubmenu:e(()=>({defaultValue:!1}))}},refs(){return{parent:null,children:{},typeaheadState:{...vi.defaultOptions},positioningOverride:{}}},computed:{isRtl:({prop:e})=>e("dir")==="rtl",isTypingAhead:({refs:e})=>e.get("typeaheadState").keysSoFar!=="",highlightedId:({context:e,scope:t,refs:o})=>vf(o.get("children"),e.get("highlightedValue"),t)},watch({track:e,action:t,context:o,prop:r}){e([()=>o.get("isSubmenu")],()=>{t(["setSubmenuPlacement"])}),e([()=>o.hash("anchorPoint")],()=>{o.get("anchorPoint")&&t(["reposition"])}),e([()=>r("open")],()=>{t(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:_e("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer","clearAnchorPoint"],on:{"CONTROLLED.OPEN":[{guard:If("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Ht(_e("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:_e("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Ht("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:_e("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:Ht(_e("isPointerSuspended"),_e("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:Ht(_e("isTriggerItemHighlighted"),_e("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Ht(_e("isTriggerItemHighlighted"),_e("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Ht(_e("isTriggerItemHighlighted"),_e("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e("closeOnSelect")),isTriggerItem:({event:e})=>Cf(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:o})=>!!(e.target??t.getById(o("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({context:e})=>e.get("isSubmenu"),isPointerSuspended:({context:e})=>e.get("suspendPointer"),isHighlightedItemEditable:({scope:e,computed:t})=>Wo(e.getById(t("highlightedId"))),isOpenControlled:({prop:e})=>e("open")!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:e})=>e.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:e})=>e.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:e}){const t=setTimeout(()=>{e({type:"DELAY.OPEN"})},100);return()=>clearTimeout(t)},waitForCloseDelay({send:e}){const t=setTimeout(()=>{e({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(t)},waitForLongPress({send:e}){const t=setTimeout(()=>{e({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(t)},trackPositioning({context:e,prop:t,scope:o,refs:r}){if(Or(o))return;const i={...t("positioning"),...r.get("positioningOverride")};e.set("currentPlacement",i.placement);const s=()=>Vs(o);return ro(bo(o),s,{...i,defer:!0,onComplete(a){e.set("currentPlacement",a.placement)}})},trackInteractOutside({refs:e,scope:t,prop:o,context:r,send:i}){const s=()=>at(t);let a=!0;return kr(s,{type:"menu",defer:!0,exclude:[bo(t)],onInteractOutside:o("onInteractOutside"),onRequestDismiss:o("onRequestDismiss"),onFocusOutside(c){o("onFocusOutside")?.(c);const l=re(c.detail.originalEvent);if(Oe(Or(t),l)){c.preventDefault();return}},onEscapeKeyDown(c){o("onEscapeKeyDown")?.(c),r.get("isSubmenu")&&c.preventDefault(),Ms({parent:e.get("parent")})},onPointerDownOutside(c){o("onPointerDownOutside")?.(c);const l=re(c.detail.originalEvent);if(Oe(Or(t),l)&&c.detail.contextmenu){c.preventDefault();return}a=!c.detail.focusable},onDismiss(){i({type:"CLOSE",src:"interact-outside",restoreFocus:a})}})},trackPointerMove({context:e,scope:t,send:o,refs:r,flush:i}){const s=r.get("parent");i(()=>{s.context.set("suspendPointer",!0)});const a=t.getDoc();return de(a,"pointermove",c=>{Of(e.get("intentPolygon"),{x:c.clientX,y:c.clientY})||(o({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),s.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:e,scope:t,computed:o}){const r=()=>{if(e.current().type.startsWith("ITEM_POINTER"))return;const s=t.getById(o("highlightedId")),a=at(t);pc(s,{rootEl:a,block:"nearest"})};return U(()=>r()),lc(()=>at(t),{attributes:["aria-activedescendant"],callback:r})}},actions:{setAnchorPoint({context:e,event:t}){e.set("anchorPoint",o=>An(o,t.point)?o:t.point)},setSubmenuPlacement({context:e,computed:t,refs:o}){if(!e.get("isSubmenu"))return;const r=t("isRtl")?"left-start":"right-start";o.set("positioningOverride",{placement:r,gutter:0})},reposition({context:e,scope:t,prop:o,event:r,refs:i}){const s=()=>Vs(t),a=e.get("anchorPoint"),c=a?()=>({width:0,height:0,...a}):void 0,l={...o("positioning"),...i.get("positioningOverride")};ro(bo(t),s,{...l,defer:!0,getAnchorRect:c,...r.options??{},listeners:!1,onComplete(d){e.set("currentPlacement",d.placement)}})},setOptionState({event:e}){if(!e.option)return;const{checked:t,onCheckedChange:o,type:r}=e.option;r==="radio"?o?.(!0):r==="checkbox"&&o?.(!t)},clickHighlightedItem({scope:e,computed:t,prop:o,context:r}){const i=e.getById(t("highlightedId"));if(!i||i.dataset.disabled)return;const s=r.get("highlightedValue");mi(i)?o("navigate")?.({value:s,node:i,href:i.href}):queueMicrotask(()=>i.click())},setIntentPolygon({context:e,scope:t,event:o}){const r=at(t),i=e.get("currentPlacement");if(!r||!i)return;const s=r.getBoundingClientRect(),a=np(s,i);if(!a)return;const l=au(i)==="right"?-5:5;e.set("intentPolygon",[{...o.point,x:o.point.x+l},...a])},clearIntentPolygon({context:e}){e.set("intentPolygon",null)},clearAnchorPoint({context:e}){e.set("anchorPoint",null)},resumePointer({refs:e,flush:t}){const o=e.get("parent");o&&t(()=>{o.context.set("suspendPointer",!1)})},setHighlightedItem({context:e,event:t}){const o=t.value||Ct(t.target);e.set("highlightedValue",o)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},focusMenu({scope:e}){U(()=>{const t=at(e);Zo({root:t,enabled:!Oe(t,e.getActiveElement()),filter(r){return!r.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:e,scope:t}){(at(t)?queueMicrotask:U)(()=>{const r=yf(t);r&&e.set("highlightedValue",Ct(r))})},highlightLastItem({context:e,scope:t}){(at(t)?queueMicrotask:U)(()=>{const r=kf(t);r&&e.set("highlightedValue",Ct(r))})},highlightNextItem({context:e,scope:t,event:o,prop:r}){const i=_f(t,{loop:o.loop,value:e.get("highlightedValue"),loopFocus:r("loopFocus")});e.set("highlightedValue",Ct(i))},highlightPrevItem({context:e,scope:t,event:o,prop:r}){const i=wf(t,{loop:o.loop,value:e.get("highlightedValue"),loopFocus:r("loopFocus")});e.set("highlightedValue",Ct(i))},invokeOnSelect({context:e,prop:t,scope:o}){const r=e.get("highlightedValue");if(r==null)return;const i=bf(o,r);Ef(i,r),t("onSelect")?.({value:r})},focusTrigger({scope:e,context:t,event:o}){t.get("isSubmenu")||t.get("anchorPoint")||o.restoreFocus===!1||queueMicrotask(()=>bo(e)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:e,context:t,event:o,refs:r}){const i=xf(e,{key:o.key,value:t.get("highlightedValue"),typeaheadState:r.get("typeaheadState")});i&&t.set("highlightedValue",Ct(i))},setParentMenu({refs:e,event:t,context:o}){e.set("parent",t.value),o.set("isSubmenu",!0)},setChildMenu({refs:e,event:t}){const o=e.get("children");o[t.id]=t.value,e.set("children",o)},closeRootMenu({refs:e}){Ms({parent:e.get("parent")})},openSubmenu({refs:e,scope:t,computed:o}){const i=t.getById(o("highlightedId"))?.getAttribute("data-uid"),s=e.get("children");(i?s[i]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:e}){e.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:e,event:t}){e.set("lastHighlightedValue",Ct(t.target))},restoreHighlightedItem({context:e}){e.get("lastHighlightedValue")&&(e.set("highlightedValue",e.get("lastHighlightedValue")),e.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:e}){e.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:e}){e("onOpenChange")?.({open:!0})},invokeOnClose({prop:e}){e("onOpenChange")?.({open:!1})},toggleVisibility({prop:e,event:t,send:o}){o({type:e("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}};function Ms(e){let t=e.parent;for(;t&&t.context.get("isSubmenu");)t=t.refs.get("parent");t?.send({type:"CLOSE"})}function Of(e,t){return e?op(e,t):!1}function vf(e,t,o){const r=Object.keys(e).length>0;if(!t)return null;if(!r)return yn(o,t);for(const i in e){const s=e[i],a=mo(s.scope);if(a===t)return a}return yn(o,t)}ue()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]),ue()(["closeOnSelect","disabled","value","valueText"]),ue()(["htmlFor"]),ue()(["id"]),ue()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);const Tf=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const l=n.toValue(e);return{id:o,dir:i.value.dir,getRootNode:r?.value.getRootNode,...Dt(l),onOpenChange:d=>{t?.("openChange",d),t?.("update:open",d.open),l.onOpenChange?.(d)},onEscapeKeyDown:d=>{t?.("escapeKeyDown",d),l.onEscapeKeyDown?.(d)},onFocusOutside:d=>{t?.("focusOutside",d),l.onFocusOutside?.(d)},onHighlightChange:d=>{t?.("highlightChange",d),t?.("update:highlightedValue",d.highlightedValue),l.onHighlightChange?.(d)},onInteractOutside:d=>{t?.("interactOutside",d),l.onInteractOutside?.(d)},onPointerDownOutside:d=>{t?.("pointerDownOutside",d),l.onPointerDownOutside?.(d)},onSelect:d=>{t?.("select",d),l.onSelect?.(d)}}}),a=Le(Pf,s);return{api:n.computed(()=>Bf(a,tt)),machine:a}},Sf=n.defineComponent({__name:"menu-root",props:n.mergeDefaults({anchorPoint:{},"aria-label":{},closeOnSelect:{type:Boolean},composite:{type:Boolean},defaultHighlightedValue:{},defaultOpen:{type:Boolean},highlightedValue:{},id:{},ids:{},loopFocus:{type:Boolean},navigate:{type:Function},open:{type:Boolean},positioning:{},typeahead:{type:Boolean},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{closeOnSelect:void 0,composite:void 0,defaultOpen:void 0,loopFocus:void 0,open:void 0,typeahead:void 0}),emits:["escapeKeyDown","focusOutside","highlightChange","interactOutside","openChange","pointerDownOutside","requestDismiss","select","update:open","update:highlightedValue"],setup(e,{emit:t}){const o=e,r=t,{api:i,machine:s}=Tf(o,r),a=te(),c=Ns();return n.onMounted(()=>{c&&(a.value.setChild(s),i.value.setParent(c))}),Rs(n.computed(()=>a.value.getTriggerItemProps(i.value))),Ss(s),Ps(i),$e(n.computed(()=>({lazyMount:o.lazyMount,unmountOnExit:o.unmountOnExit}))),N(),(l,d)=>n.renderSlot(l.$slots,"default")}}),Nf=n.defineComponent({__name:"menu-separator",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).hr,n.mergeProps(n.unref(t).getSeparatorProps(),{"as-child":o.asChild}),null,16,["as-child"]))}}),Rf=n.defineComponent({__name:"menu-trigger-item",props:{asChild:{type:Boolean}},setup(e){const t=pf();return go(n.computed(()=>({value:t.value?.["data-value"]}))),N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Ge=Object.freeze(Object.defineProperty({__proto__:null,Arrow:Xp,ArrowTip:qp,CheckboxItem:Jp,Content:Zp,Context:ef,ContextTrigger:Qp,Indicator:tf,Item:lf,ItemContext:nf,ItemGroup:rf,ItemGroupLabel:of,ItemIndicator:sf,ItemText:af,Positioner:cf,RadioItem:uf,RadioItemGroup:df,Root:Sf,RootProvider:ff,Separator:Nf,Trigger:n.defineComponent({__name:"menu-trigger",props:{asChild:{type:Boolean}},setup(e){const t=te();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),TriggerItem:Rf},Symbol.toStringTag,{value:"Module"})),[Fs,Ee]=ee("PopoverContext"),Df=n.defineComponent({__name:"popover-anchor",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getAnchorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),$f=n.defineComponent({__name:"popover-arrow-tip",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getArrowTipProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Af=n.defineComponent({__name:"popover-arrow",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getArrowProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Vf=n.defineComponent({__name:"popover-close-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getCloseTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Mf=n.defineComponent({__name:"popover-content",props:{asChild:{type:Boolean}},setup(e){const t=Ee(),o=wr(),r=n.computed(()=>an(t.value.getContentProps(),o.value.presenceProps));return N(),(i,s)=>n.unref(o).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},r.value,{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),Ff=n.defineComponent({__name:"popover-context",setup(e){const t=Ee();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),Lf=n.defineComponent({__name:"popover-description",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getDescriptionProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Hf=n.defineComponent({__name:"popover-indicator",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getIndicatorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Uf=n.defineComponent({__name:"popover-positioner",props:{asChild:{type:Boolean}},setup(e){const t=Ee(),o=Ft(),r=uo(n.computed(()=>({...o.value,present:t.value.open})));return lo(r),N(),(i,s)=>n.unref(r).unmounted?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps({key:0},n.unref(t).getPositionerProps(),{"as-child":i.asChild}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["as-child"]))}}),jf=n.defineComponent({__name:"popover-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return Fs(o),$e(n.computed(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),N(),(r,i)=>n.renderSlot(r.$slots,"default")}});var zf=ke("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger"),Ve=zf.build(),Ls=e=>e.ids?.anchor??`popover:${e.id}:anchor`,Hs=e=>e.ids?.trigger??`popover:${e.id}:trigger`,Sr=e=>e.ids?.content??`popover:${e.id}:content`,Us=e=>e.ids?.positioner??`popover:${e.id}:popper`,Wf=e=>e.ids?.arrow??`popover:${e.id}:arrow`,Nr=e=>e.ids?.title??`popover:${e.id}:title`,Rr=e=>e.ids?.description??`popover:${e.id}:desc`,Gf=e=>e.ids?.closeTrigger??`popover:${e.id}:close`,js=e=>e.getById(Ls(e)),Ut=e=>e.getById(Hs(e)),jt=e=>e.getById(Sr(e)),zs=e=>e.getById(Us(e)),Kf=e=>e.getById(Nr(e)),qf=e=>e.getById(Rr(e));function Xf(e,t){const{state:o,context:r,send:i,computed:s,prop:a,scope:c}=e,l=o.matches("open"),d=r.get("currentPlacement"),u=s("currentPortalled"),g=r.get("renderedElements"),h=os({...a("positioning"),placement:d});return{portalled:u,open:l,setOpen(p){o.matches("open")!==p&&i({type:p?"OPEN":"CLOSE"})},reposition(p={}){i({type:"POSITIONING.SET",options:p})},getArrowProps(){return t.element({id:Wf(c),...Ve.arrow.attrs,dir:a("dir"),style:h.arrow})},getArrowTipProps(){return t.element({...Ve.arrowTip.attrs,dir:a("dir"),style:h.arrowTip})},getAnchorProps(){return t.element({...Ve.anchor.attrs,dir:a("dir"),id:Ls(c)})},getTriggerProps(){return t.button({...Ve.trigger.attrs,dir:a("dir"),type:"button","data-placement":d,id:Hs(c),"aria-haspopup":"dialog","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":Sr(c),onPointerDown(p){Jl(p)&&qo()&&p.currentTarget.focus()},onClick(p){p.defaultPrevented||i({type:"TOGGLE"})},onBlur(p){i({type:"TRIGGER_BLUR",target:p.relatedTarget})}})},getIndicatorProps(){return t.element({...Ve.indicator.attrs,dir:a("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return t.element({id:Us(c),...Ve.positioner.attrs,dir:a("dir"),style:h.floating})},getContentProps(){return t.element({...Ve.content.attrs,dir:a("dir"),id:Sr(c),tabIndex:-1,role:"dialog",hidden:!l,"data-state":l?"open":"closed","data-expanded":F(l),"aria-labelledby":g.title?Nr(c):void 0,"aria-describedby":g.description?Rr(c):void 0,"data-placement":d})},getTitleProps(){return t.element({...Ve.title.attrs,id:Nr(c),dir:a("dir")})},getDescriptionProps(){return t.element({...Ve.description.attrs,id:Rr(c),dir:a("dir")})},getCloseTriggerProps(){return t.button({...Ve.closeTrigger.attrs,dir:a("dir"),id:Gf(c),type:"button","aria-label":"close",onClick(p){p.defaultPrevented||(p.stopPropagation(),i({type:"CLOSE"}))}})}}}var Yf={props({props:e}){return{closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0,...e,positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"closed"},context({bindable:e}){return{currentPlacement:e(()=>({defaultValue:void 0})),renderedElements:e(()=>({defaultValue:{title:!0,description:!0}}))}},computed:{currentPortalled:({prop:e})=>!!e("modal")||!!e("portalled")},watch({track:e,prop:t,action:o}){e([()=>t("open")],()=>{o(["toggleVisibility"])})},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{effects:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e("open")!=null},effects:{trackPositioning({context:e,prop:t,scope:o}){e.set("currentPlacement",t("positioning").placement);const r=js(o)??Ut(o);return ro(r,()=>zs(o),{...t("positioning"),defer:!0,onComplete(s){e.set("currentPlacement",s.placement)}})},trackDismissableElement({send:e,prop:t,scope:o}){const r=()=>jt(o);let i=!0;return kr(r,{type:"popover",pointerBlocking:t("modal"),exclude:Ut(o),defer:!0,onEscapeKeyDown(s){t("onEscapeKeyDown")?.(s),!t("closeOnEscape")&&s.preventDefault()},onInteractOutside(s){t("onInteractOutside")?.(s),!s.defaultPrevented&&(i=!(s.detail.focusable||s.detail.contextmenu),t("closeOnInteractOutside")||s.preventDefault())},onPointerDownOutside:t("onPointerDownOutside"),onFocusOutside:t("onFocusOutside"),persistentElements:t("persistentElements"),onRequestDismiss:t("onRequestDismiss"),onDismiss(){e({type:"CLOSE",src:"interact-outside",restoreFocus:i})}})},proxyTabFocus({prop:e,scope:t}){return e("modal")||!e("portalled")?void 0:hc(()=>jt(t),{triggerElement:Ut(t),defer:!0,onFocus(r){r.focus({preventScroll:!0})}})},hideContentBelow({prop:e,scope:t}){return e("modal")?gs(()=>[jt(t),Ut(t)],{defer:!0}):void 0},preventScroll({prop:e,scope:t}){if(e("modal"))return ws(t.getDoc())},trapFocus({prop:e,scope:t}){return e("modal")?_s(()=>jt(t),{initialFocus:()=>Zo({root:jt(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")})}):void 0}},actions:{reposition({event:e,prop:t,scope:o,context:r}){const i=js(o)??Ut(o);ro(i,()=>zs(o),{...t("positioning"),...e.options,defer:!0,listeners:!1,onComplete(a){r.set("currentPlacement",a.placement)}})},checkRenderedElements({context:e,scope:t}){U(()=>{Object.assign(e.get("renderedElements"),{title:!!Kf(t),description:!!qf(t)})})},setInitialFocus({prop:e,scope:t}){e("modal")||U(()=>{Zo({root:jt(t),getInitialEl:e("initialFocusEl"),enabled:e("autoFocus")})?.focus({preventScroll:!0})})},setFinalFocus({event:e,scope:t}){const o=e.restoreFocus??e.previousEvent?.restoreFocus;o!=null&&!o||U(()=>{Ut(t)?.focus({preventScroll:!0})})},invokeOnOpen({prop:e,flush:t}){t(()=>{e("onOpenChange")?.({open:!0})})},invokeOnClose({prop:e,flush:t}){t(()=>{e("onOpenChange")?.({open:!1})})},toggleVisibility({event:e,send:t,prop:o}){t({type:o("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};ue()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","portalled","positioning"]);const Ws=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const c=n.toValue(e);return{id:o,dir:i.value.dir,getRootNode:r?.value.getRootNode,...Dt(c),onOpenChange:l=>{t?.("openChange",l),t?.("update:open",l.open),c.onOpenChange?.(l)},onEscapeKeyDown:l=>{t?.("escapeKeyDown",l),c.onEscapeKeyDown?.(l)},onFocusOutside:l=>{t?.("focusOutside",l),c.onFocusOutside?.(l)},onInteractOutside:l=>{t?.("interactOutside",l),c.onInteractOutside?.(l)},onPointerDownOutside:l=>{t?.("pointerDownOutside",l),c.onPointerDownOutside?.(l)}}}),a=Le(Yf,s);return n.computed(()=>Xf(a,tt))},Ke=Object.freeze(Object.defineProperty({__proto__:null,Anchor:Df,Arrow:Af,ArrowTip:$f,CloseTrigger:Vf,Content:Mf,Context:Ff,Description:Lf,Indicator:Hf,Positioner:Uf,Root:n.defineComponent({__name:"popover-root",props:n.mergeDefaults({autoFocus:{type:Boolean},closeOnEscape:{type:Boolean},closeOnInteractOutside:{type:Boolean},defaultOpen:{type:Boolean},id:{},ids:{},initialFocusEl:{type:Function},modal:{type:Boolean},open:{type:Boolean},persistentElements:{},portalled:{type:Boolean},positioning:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean}},{autoFocus:void 0,closeOnEscape:void 0,closeOnInteractOutside:void 0,defaultOpen:void 0,modal:void 0,open:void 0,portalled:void 0}),emits:["escapeKeyDown","focusOutside","interactOutside","openChange","pointerDownOutside","requestDismiss","update:open"],setup(e,{emit:t}){const o=e,i=Ws(o,t);return Fs(i),$e(n.computed(()=>({lazyMount:o.lazyMount,unmountOnExit:o.unmountOnExit}))),N(),(s,a)=>n.renderSlot(s.$slots,"default")}}),RootProvider:jf,Title:n.defineComponent({__name:"popover-title",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getTitleProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Trigger:n.defineComponent({__name:"popover-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Ee();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}})},Symbol.toStringTag,{value:"Module"})),[Gs,_n]=ee("TabsContext"),Jf=n.defineComponent({__name:"tab-content",props:{value:{},asChild:{type:Boolean}},setup(e){const t=e,o=_n(),r=Ft();return N(),(i,s)=>(n.openBlock(),n.createBlock(n.unref(ms),n.mergeProps(n.unref(o).getContentProps(t),{present:n.unref(o).value===t.value,"lazy-mount":n.unref(r).lazyMount,"unmount-on-exit":n.unref(r).unmountOnExit,immediate:!0}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["present","lazy-mount","unmount-on-exit"]))}}),Zf=n.defineComponent({__name:"tab-indicator",props:{asChild:{type:Boolean}},setup(e){const t=_n();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getIndicatorProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Qf=n.defineComponent({__name:"tab-list",props:{asChild:{type:Boolean}},setup(e){const t=_n();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getListProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),eh=n.defineComponent({__name:"tab-trigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,o=_n();return N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(o).getTriggerProps(t),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}}),th=n.defineComponent({__name:"tabs-context",setup(e){const t=_n();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),nh=n.defineComponent({__name:"tabs-root-provider",props:{value:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},setup(e){const t=e,o=n.computed(()=>t.value);return Gs(o),$e(n.computed(()=>({lazyMount:t.lazyMount,unmountOnExit:t.unmountOnExit}))),N(),(r,i)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(o.value.getRootProps(),{"as-child":r.asChild}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["as-child"]))}});var oh=ke("tabs").parts("root","list","trigger","content","indicator"),wn=oh.build(),rh=e=>e.ids?.root??`tabs:${e.id}`,xn=e=>e.ids?.list??`tabs:${e.id}:list`,Dr=(e,t)=>e.ids?.content?.(t)??`tabs:${e.id}:content-${t}`,Et=(e,t)=>e.ids?.trigger?.(t)??`tabs:${e.id}:trigger-${t}`,Ks=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,ih=e=>e.getById(xn(e)),sh=(e,t)=>e.getById(Dr(e,t)),ko=(e,t)=>e.getById(Et(e,t)),qs=e=>e.getById(Ks(e)),Cn=e=>{const o=`[role=tab][data-ownedby='${CSS.escape(xn(e))}']:not([disabled])`;return tr(ih(e),o)},ah=e=>Lo(Cn(e)),lh=e=>Ho(Cn(e)),ch=(e,t)=>Pi(Cn(e),Et(e,t.value),t.loopFocus),dh=(e,t)=>Oi(Cn(e),Et(e,t.value),t.loopFocus),Xs=e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),uh=(e,t)=>{const o=Ii(Cn(e),Et(e,t));return Ys(Xs(o))},Ys=e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`});function ph(e,t){const{state:o,send:r,context:i,prop:s,scope:a}=e,c=s("translations"),l=o.matches("focused"),d=s("orientation")==="vertical",u=s("orientation")==="horizontal",g=s("composite");function h(p){return{selected:i.get("value")===p.value,focused:i.get("focusedValue")===p.value,disabled:!!p.disabled}}return{value:i.get("value"),focusedValue:i.get("focusedValue"),setValue(p){r({type:"SET_VALUE",value:p})},clearValue(){r({type:"CLEAR_VALUE"})},setIndicatorRect(p){const m=Et(a,p);r({type:"SET_INDICATOR_RECT",id:m})},syncTabIndex(){r({type:"SYNC_TAB_INDEX"})},selectNext(p){r({type:"TAB_FOCUS",value:p,src:"selectNext"}),r({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(p){r({type:"TAB_FOCUS",value:p,src:"selectPrev"}),r({type:"ARROW_PREV",src:"selectPrev"})},focus(){const p=i.get("value");p&&ko(a,p)?.focus()},getRootProps(){return t.element({...wn.root.attrs,id:rh(a),"data-orientation":s("orientation"),"data-focus":F(l),dir:s("dir")})},getListProps(){return t.element({...wn.list.attrs,id:xn(a),role:"tablist",dir:s("dir"),"data-focus":F(l),"aria-orientation":s("orientation"),"data-orientation":s("orientation"),"aria-label":c?.listLabel,onKeyDown(p){if(p.defaultPrevented||ql(p)||!Oe(p.currentTarget,re(p)))return;const m={ArrowDown(){u||r({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){u||r({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){d||r({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){d||r({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){r({type:"HOME"})},End(){r({type:"END"})}};let b=zn(p,{dir:s("dir"),orientation:s("orientation")});const k=m[b];if(k){p.preventDefault(),k(p);return}}})},getTriggerState:h,getTriggerProps(p){const{value:m,disabled:b}=p,k=h(p);return t.button({...wn.trigger.attrs,role:"tab",type:"button",disabled:b,dir:s("dir"),"data-orientation":s("orientation"),"data-disabled":F(b),"aria-disabled":b,"data-value":m,"aria-selected":k.selected,"data-selected":F(k.selected),"data-focus":F(k.focused),"aria-controls":k.selected?Dr(a,m):void 0,"data-ownedby":xn(a),"data-ssr":F(i.get("ssr")),id:Et(a,m),tabIndex:k.selected&&g?0:-1,onFocus(){r({type:"TAB_FOCUS",value:m})},onBlur(w){w.relatedTarget?.getAttribute("role")!=="tab"&&r({type:"TAB_BLUR"})},onClick(w){w.defaultPrevented||Xo(w)||b||(qo()&&w.currentTarget.focus(),r({type:"TAB_CLICK",value:m}))}})},getContentProps(p){const{value:m}=p,b=i.get("value")===m;return t.element({...wn.content.attrs,dir:s("dir"),id:Dr(a,m),tabIndex:g?0:-1,"aria-labelledby":Et(a,m),role:"tabpanel","data-ownedby":xn(a),"data-selected":F(b),"data-orientation":s("orientation"),hidden:!b})},getIndicatorProps(){const p=i.get("indicatorRect"),m=i.get("indicatorTransition");return t.element({id:Ks(a),...wn.indicator.attrs,dir:s("dir"),"data-orientation":s("orientation"),style:{"--transition-property":"left, right, top, bottom, width, height","--left":p.left,"--top":p.top,"--width":p.width,"--height":p.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:m?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[u?"left":"top"]:u?"var(--left)":"var(--top)"}})}}}var{createMachine:fh}=Oc(),hh=fh({props({props:e}){return{dir:"ltr",orientation:"horizontal",activationMode:"automatic",loopFocus:!0,composite:!0,navigate(t){Ei(t.node)},defaultValue:null,...e}},initialState(){return"idle"},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),onChange(o){e("onValueChange")?.({value:o})}})),focusedValue:t(()=>({defaultValue:e("value")||e("defaultValue"),sync:!0,onChange(o){e("onFocusChange")?.({focusedValue:o})}})),ssr:t(()=>({defaultValue:!0})),indicatorTransition:t(()=>({defaultValue:!1})),indicatorRect:t(()=>({defaultValue:{left:"0px",top:"0px",width:"0px",height:"0px"}}))}},watch({context:e,prop:t,track:o,action:r}){o([()=>e.get("value")],()=>{r(["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"])}),o([()=>t("dir"),()=>t("orientation")],()=>{r(["syncIndicatorRect"])})},on:{SET_VALUE:{actions:["setValue"]},CLEAR_VALUE:{actions:["clearValue"]},SET_INDICATOR_RECT:{actions:["setIndicatorRect"]},SYNC_TAB_INDEX:{actions:["syncTabIndex"]}},entry:["syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:["setFocusedValue"]},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:["focusPrevTab"]}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:["focusNextTab"]}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:["focusFirstTab"]}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:["focusLastTab"]}],TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e("activationMode")==="automatic"},actions:{selectFocusedTab({context:e,prop:t}){U(()=>{const o=e.get("focusedValue");if(!o)return;const i=t("deselectable")&&e.get("value")===o?null:o;e.set("value",i)})},setFocusedValue({context:e,event:t,flush:o}){t.value!=null&&o(()=>{e.set("focusedValue",t.value)})},clearFocusedValue({context:e}){e.set("focusedValue",null)},setValue({context:e,event:t,prop:o}){const r=o("deselectable")&&e.get("value")===e.get("focusedValue");e.set("value",r?null:t.value)},clearValue({context:e}){e.set("value",null)},focusFirstTab({scope:e}){U(()=>{ah(e)?.focus()})},focusLastTab({scope:e}){U(()=>{lh(e)?.focus()})},focusNextTab({context:e,prop:t,scope:o,event:r}){const i=r.value??e.get("focusedValue");if(!i)return;const s=ch(o,{value:i,loopFocus:t("loopFocus")});U(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},focusPrevTab({context:e,prop:t,scope:o,event:r}){const i=r.value??e.get("focusedValue");if(!i)return;const s=dh(o,{value:i,loopFocus:t("loopFocus")});U(()=>{t("composite")?s?.focus():s?.dataset.value!=null&&e.set("focusedValue",s.dataset.value)})},syncTabIndex({context:e,scope:t}){U(()=>{const o=e.get("value");if(!o)return;const r=sh(t,o);if(!r)return;Jo(r).length>0?r.removeAttribute("tabindex"):r.setAttribute("tabindex","0")})},cleanupObserver({refs:e}){const t=e.get("indicatorCleanup");t&&t()},allowIndicatorTransition({context:e}){e.set("indicatorTransition",!0)},setIndicatorRect({context:e,event:t,scope:o}){const r=t.id??e.get("value");if(!qs(o))return;if(!r){e.set("indicatorTransition",!1);return}ko(o,r)&&(e.set("indicatorRect",uh(o,r)),Qo(()=>{e.set("indicatorTransition",!1)}))},syncSsr({context:e}){e.set("ssr",!1)},syncIndicatorRect({context:e,refs:t,scope:o}){const r=t.get("indicatorCleanup");r&&r();const i=e.get("value");if(!i){e.set("indicatorTransition",!1);return}const s=ko(o,i),a=qs(o);if(!s||!a)return;const c=gc([s],{measure(l){return Xs(l)},onEntry({rects:l}){const[d]=l;e.set("indicatorRect",Ys(d))}});t.set("indicatorCleanup",c)},navigateIfNeeded({context:e,prop:t,scope:o}){const r=e.get("value");if(!r)return;const i=ko(o,r);mi(i)&&t("navigate")?.({value:r,node:i,href:i.href})}}}});ue()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value","defaultValue"]),ue()(["disabled","value"]),ue()(["value"]);const gh=(e={},t)=>{const o=n.useId(),r=He(Ue),i=kt(yt),s=n.computed(()=>{const c=n.toValue(e);return{id:o,dir:i.value.dir,value:c.modelValue,getRootNode:r?.value.getRootNode,...Dt(c),onFocusChange:l=>{t?.("focusChange",l),c.onFocusChange?.(l)},onValueChange:l=>{t?.("valueChange",l),t?.("update:modelValue",l.value),c.onValueChange?.(l)}}}),a=Le(hh,s);return n.computed(()=>ph(a,tt))},qe=Object.freeze(Object.defineProperty({__proto__:null,Content:Jf,Context:th,Indicator:Zf,List:Qf,Root:n.defineComponent({__name:"tabs-root",props:n.mergeDefaults({activationMode:{},composite:{type:Boolean},defaultValue:{},deselectable:{type:Boolean},id:{},ids:{},loopFocus:{type:Boolean},modelValue:{},navigate:{type:Function},orientation:{},translations:{},lazyMount:{type:Boolean},unmountOnExit:{type:Boolean},asChild:{type:Boolean}},{composite:void 0,deselectable:void 0,loopFocus:void 0}),emits:["focusChange","valueChange","update:modelValue"],setup(e,{emit:t}){const o=e,i=gh(o,t);return Gs(i),$e(n.computed(()=>({lazyMount:o.lazyMount,unmountOnExit:o.unmountOnExit}))),N(),(s,a)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(i).getRootProps(),{"as-child":s.asChild}),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16,["as-child"]))}}),RootProvider:nh,Trigger:eh},Symbol.toStringTag,{value:"Module"}));var mh=ke("toast").parts("group","root","title","description","actionTrigger","closeTrigger"),zt=mh.build(),bh=e=>`toast-group:${e}`,Js=(e,t)=>e.getById(`toast-group:${t}`),Zs=e=>`toast:${e.id}`,Qs=e=>e.getById(Zs(e)),ea=e=>`toast:${e.id}:title`,ta=e=>`toast:${e.id}:description`,yh=e=>`toast${e.id}:close`,na={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function $r(e,t){return e??na[t]??na.DEFAULT}var kh=e=>typeof e=="string"?{left:e,right:e,bottom:e,top:e}:e;function _h(e,t){const{prop:o,computed:r,context:i}=e,{offsets:s,gap:a}=o("store").attrs,c=i.get("heights"),l=kh(s),d=o("dir")==="rtl",u=t.replace("-start",d?"-right":"-left").replace("-end",d?"-left":"-right"),g=u.includes("right"),h=u.includes("left"),p={position:"fixed",pointerEvents:r("count")>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${a}px`,"--first-height":`${c[0]?.height||0}px`,zIndex:Pl};let m="center";if(g&&(m="flex-end"),h&&(m="flex-start"),p.alignItems=m,u.includes("top")){const b=l.top;p.top=`max(env(safe-area-inset-top, 0px), ${b})`}if(u.includes("bottom")){const b=l.bottom;p.bottom=`max(env(safe-area-inset-bottom, 0px), ${b})`}if(!u.includes("left")){const b=l.right;p.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${b})`}if(!u.includes("right")){const b=l.left;p.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${b})`}return p}function wh(e,t){const{prop:o,context:r,computed:i}=e,s=o("parent"),a=s.computed("placement"),{gap:c}=s.prop("store").attrs,[l]=a.split("-"),d=r.get("mounted"),u=r.get("remainingTime"),g=i("height"),h=i("frontmost"),p=!h,m=!o("stacked"),b=o("stacked"),w=o("type")==="loading"?Number.MAX_SAFE_INTEGER:u,E=i("heightIndex")*c+i("heightBefore"),B={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${o("removeDelay")}ms`,"--duration":`${w}ms`,"--initial-height":`${g}px`,"--offset":`${E}px`,"--index":o("index"),"--z-index":i("zIndex"),"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},f=y=>Object.assign(B,y);return l==="top"?f({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):l==="bottom"&&f({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),d&&(f({"--y":"0","--opacity":"1"}),b&&f({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||f({"--opacity":"0",pointerEvents:"none"}),p&&m&&(f({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||f({"--y":"calc(var(--sign) * 40%)"})),p&&b&&!t&&f({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),h&&!t&&f({"--y":"calc(var(--lift) * -100%)"}),B}function xh(e,t){const{computed:o}=e,r={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"},i=s=>Object.assign(r,s);return o("frontmost")&&!t&&i({height:"calc(var(--initial-height) + 80%)"}),r}function Ch(){return{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"}}function Eh(e,t){const{context:o,prop:r,send:i,refs:s,computed:a}=e;return{getCount(){return o.get("toasts").length},getToasts(){return o.get("toasts")},getGroupProps(c={}){const{label:l="Notifications"}=c,{hotkey:d}=r("store").attrs,u=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=a("placement"),[h,p="center"]=g.split("-");return t.element({...zt.group.attrs,dir:r("dir"),tabIndex:-1,"aria-label":`${g} ${l} ${u}`,id:bh(g),"data-placement":g,"data-side":h,"data-align":p,"aria-live":"polite",role:"region",style:_h(e,g),onMouseMove(){i({type:"REGION.POINTER_ENTER",placement:g})},onMouseLeave(){i({type:"REGION.POINTER_LEAVE",placement:g})},onFocus(m){i({type:"REGION.FOCUS",target:m.relatedTarget})},onBlur(m){s.get("isFocusWithin")&&!Oe(m.currentTarget,m.relatedTarget)&&queueMicrotask(()=>i({type:"REGION.BLUR"}))}})},subscribe(c){return r("store").subscribe(()=>c(o.get("toasts")))}}}var Bh={props({props:e}){return{dir:"ltr",id:pi(),...e,store:e.store}},initialState({prop:e}){return e("store").attrs.overlap?"overlap":"stack"},refs(){return{lastFocusedEl:null,isFocusWithin:!1,dismissableCleanup:void 0}},context({bindable:e}){return{toasts:e(()=>({defaultValue:[],sync:!0,hash:t=>t.map(o=>o.id).join(",")})),heights:e(()=>({defaultValue:[],sync:!0}))}},computed:{count:({context:e})=>e.get("toasts").length,overlap:({prop:e})=>e("store").attrs.overlap,placement:({prop:e})=>e("store").attrs.placement},effects:["subscribeToStore","trackDocumentVisibility","trackHotKeyPress"],watch({track:e,context:t,action:o}){e([()=>t.hash("toasts")],()=>{queueMicrotask(()=>{o(["collapsedIfEmpty","setDismissableBranch"])})})},exit:["clearDismissableBranch","clearLastFocusedEl"],on:{"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["collapseToasts","resumeToasts","restoreLastFocusedEl"]},{target:"stack",actions:["resumeToasts","restoreLastFocusedEl"]}],"TOAST.REMOVE":{actions:["removeToast","removeHeight"]},"TOAST.PAUSE":{actions:["pauseToasts"]}},states:{stack:{on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","collapseToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap",actions:["collapseToasts"]},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{on:{"REGION.STACK":{target:"stack",actions:["expandToasts"]},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts","expandToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts","expandToasts"]}}}},implementations:{guards:{isOverlapping:({computed:e})=>e("overlap")},effects:{subscribeToStore({context:e,prop:t}){return t("store").subscribe(o=>{if(o.dismiss){e.set("toasts",r=>r.filter(i=>i.id!==o.id));return}e.set("toasts",r=>{const i=r.findIndex(s=>s.id===o.id);return i!==-1?[...r.slice(0,i),{...r[i],...o},...r.slice(i+1)]:[o,...r]})})},trackHotKeyPress({prop:e,send:t}){return de(document,"keydown",r=>{const{hotkey:i}=e("store").attrs;i.every(a=>r[a]||r.code===a)&&t({type:"DOC.HOTKEY"})},{capture:!0})},trackDocumentVisibility({prop:e,send:t,scope:o}){const{pauseOnPageIdle:r}=e("store").attrs;if(!r)return;const i=o.getDoc();return de(i,"visibilitychange",()=>{const s=i.visibilityState==="hidden";t({type:s?"PAUSE_ALL":"RESUME_ALL"})})}},actions:{setDismissableBranch({refs:e,context:t,computed:o,scope:r}){const i=t.get("toasts"),s=o("placement"),a=i.length>0;if(!a){e.get("dismissableCleanup")?.();return}if(a&&e.get("dismissableCleanup"))return;const l=Su(()=>Js(r,s),{defer:!0});e.set("dismissableCleanup",l)},clearDismissableBranch({refs:e}){e.get("dismissableCleanup")?.()},focusRegionEl({scope:e,computed:t}){queueMicrotask(()=>{Js(e,t("placement"))?.focus()})},pauseToasts({prop:e}){e("store").pause()},resumeToasts({prop:e}){e("store").resume()},expandToasts({prop:e}){e("store").expand()},collapseToasts({prop:e}){e("store").collapse()},removeToast({prop:e,event:t}){e("store").remove(t.id)},removeHeight({event:e,context:t}){e?.id!=null&&queueMicrotask(()=>{t.set("heights",o=>o.filter(r=>r.id!==e.id))})},collapsedIfEmpty({send:e,computed:t}){!t("overlap")||t("count")>1||e({type:"REGION.OVERLAP"})},setLastFocusedEl({refs:e,event:t}){e.get("isFocusWithin")||!t.target||(e.set("isFocusWithin",!0),e.set("lastFocusedEl",t.target))},restoreLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))},clearLastFocusedEl({refs:e}){e.get("lastFocusedEl")&&(e.get("lastFocusedEl")?.focus({preventScroll:!0}),e.set("lastFocusedEl",null),e.set("isFocusWithin",!1))}}}};function Ih(e,t){const{state:o,send:r,prop:i,scope:s,context:a,computed:c}=e,l=o.hasTag("visible"),d=o.hasTag("paused"),u=a.get("mounted"),g=c("frontmost"),h=i("parent").computed("placement"),p=i("type"),m=i("stacked"),b=i("title"),k=i("description"),w=i("action"),[E,B="center"]=h.split("-");return{type:p,title:b,description:k,placement:h,visible:l,paused:d,closable:!!i("closable"),pause(){r({type:"PAUSE"})},resume(){r({type:"RESUME"})},dismiss(){r({type:"DISMISS",src:"programmatic"})},getRootProps(){return t.element({...zt.root.attrs,dir:i("dir"),id:Zs(s),"data-state":l?"open":"closed","data-type":p,"data-placement":h,"data-align":B,"data-side":E,"data-mounted":F(u),"data-paused":F(d),"data-first":F(g),"data-sibling":F(!g),"data-stack":F(m),"data-overlap":F(!m),role:"status","aria-atomic":"true","aria-describedby":k?ta(s):void 0,"aria-labelledby":b?ea(s):void 0,tabIndex:0,style:wh(e,l),onKeyDown(f){f.defaultPrevented||f.key=="Escape"&&(r({type:"DISMISS",src:"keyboard"}),f.preventDefault())}})},getGhostBeforeProps(){return t.element({"data-ghost":"before",style:xh(e,l)})},getGhostAfterProps(){return t.element({"data-ghost":"after",style:Ch()})},getTitleProps(){return t.element({...zt.title.attrs,id:ea(s)})},getDescriptionProps(){return t.element({...zt.description.attrs,id:ta(s)})},getActionTriggerProps(){return t.button({...zt.actionTrigger.attrs,type:"button",onClick(f){f.defaultPrevented||(w?.onClick?.(),r({type:"DISMISS",src:"user"}))}})},getCloseTriggerProps(){return t.button({id:yh(s),...zt.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(f){f.defaultPrevented||r({type:"DISMISS",src:"user"})}})}}}var{not:Ph}=Gn(),Oh={props({props:e}){return Bl(e,["id","type","parent","removeDelay"],"toast"),{closable:!0,...e,duration:$r(e.duration,e.type)}},initialState({prop:e}){return e("type")==="loading"||e("duration")===1/0?"visible:persist":"visible"},context({prop:e,bindable:t}){return{remainingTime:t(()=>({defaultValue:$r(e("duration"),e("type"))})),createdAt:t(()=>({defaultValue:Date.now()})),mounted:t(()=>({defaultValue:!1})),initialHeight:t(()=>({defaultValue:0}))}},refs(){return{closeTimerStartTime:Date.now(),lastCloseStartTimerStartTime:0}},computed:{zIndex:({prop:e})=>{const t=e("parent").context.get("toasts"),o=t.findIndex(r=>r.id===e("id"));return t.length-o},height:({prop:e})=>e("parent").context.get("heights").find(r=>r.id===e("id"))?.height??0,heightIndex:({prop:e})=>e("parent").context.get("heights").findIndex(o=>o.id===e("id")),frontmost:({prop:e})=>e("index")===0,heightBefore:({prop:e})=>{const t=e("parent").context.get("heights"),o=t.findIndex(r=>r.id===e("id"));return t.reduce((r,i,s)=>s>=o?r:r+i.height,0)},shouldPersist:({prop:e})=>e("type")==="loading"||e("duration")===1/0},watch({track:e,prop:t,send:o}){e([()=>t("message")],()=>{const r=t("message");r&&o({type:r,src:"programmatic"})}),e([()=>t("type"),()=>t("duration")],()=>{o({type:"UPDATE"})})},on:{UPDATE:[{guard:"shouldPersist",target:"visible:persist",actions:["resetCloseTimer"]},{target:"visible:updating",actions:["resetCloseTimer"]}],MEASURE:{actions:["measureHeight"]}},entry:["setMounted","measureHeight","invokeOnVisible"],effects:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],effects:["waitForNextTick"],on:{SHOW:{target:"visible"}}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:Ph("isLoadingType"),target:"visible",actions:["setCloseTimer"]},DISMISS:{target:"dismissing"}}},visible:{tags:["visible"],effects:["waitForDuration"],on:{DISMISS:{target:"dismissing"},PAUSE:{target:"visible:persist",actions:["syncRemainingTime"]}}},dismissing:{entry:["invokeOnDismiss"],effects:["waitForRemoveDelay"],on:{REMOVE:{target:"unmounted",actions:["notifyParentToRemove"]}}},unmounted:{entry:["invokeOnUnmount"]}},implementations:{effects:{waitForRemoveDelay({prop:e,send:t}){return jo(()=>{t({type:"REMOVE",src:"timer"})},e("removeDelay"))},waitForDuration({send:e,context:t,computed:o}){if(!o("shouldPersist"))return jo(()=>{e({type:"DISMISS",src:"timer"})},t.get("remainingTime"))},waitForNextTick({send:e}){return jo(()=>{e({type:"SHOW",src:"timer"})},0)},trackHeight({scope:e,prop:t}){let o;return U(()=>{const r=Qs(e);if(!r)return;const i=()=>{const c=r.style.height;r.style.height="auto";const l=r.getBoundingClientRect().height;r.style.height=c;const d={id:t("id"),height:l};oa(t("parent"),d)},s=e.getWin(),a=new s.MutationObserver(i);a.observe(r,{childList:!0,subtree:!0,characterData:!0}),o=()=>a.disconnect()}),()=>o?.()}},guards:{isLoadingType:({prop:e})=>e("type")==="loading",shouldPersist:({computed:e})=>e("shouldPersist")},actions:{setMounted({context:e}){U(()=>{e.set("mounted",!0)})},measureHeight({scope:e,prop:t,context:o}){queueMicrotask(()=>{const r=Qs(e);if(!r)return;const i=r.style.height;r.style.height="auto";const s=r.getBoundingClientRect().height;r.style.height=i,o.set("initialHeight",s);const a={id:t("id"),height:s};oa(t("parent"),a)})},setCloseTimer({refs:e}){e.set("closeTimerStartTime",Date.now())},resetCloseTimer({context:e,refs:t,prop:o}){t.set("closeTimerStartTime",Date.now()),e.set("remainingTime",$r(o("duration"),o("type")))},syncRemainingTime({context:e,refs:t}){e.set("remainingTime",o=>{const r=t.get("closeTimerStartTime"),i=Date.now()-r;return t.set("lastCloseStartTimerStartTime",Date.now()),o-i})},notifyParentToRemove({prop:e}){e("parent").send({type:"TOAST.REMOVE",id:e("id")})},invokeOnDismiss({prop:e,event:t}){e("onStatusChange")?.({status:"dismissing",src:t.src})},invokeOnUnmount({prop:e}){e("onStatusChange")?.({status:"unmounted"})},invokeOnVisible({prop:e}){e("onStatusChange")?.({status:"visible"})}}}};function oa(e,t){const{id:o,height:r}=t;e.context.set("heights",i=>i.find(a=>a.id===o)?i.map(a=>a.id===o?{...a,height:r}:a):[{id:o,height:r},...i])}var vh=(e,t)=>({...t,...Ln(e)});function Th(e={}){const t=vh(e,{placement:"bottom",overlap:!1,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:!0});let o=[],r=[],i=new Set,s=[];const a=C=>(o.push(C),()=>{const I=o.indexOf(C);o.splice(I,1)}),c=C=>(o.forEach(I=>I(C)),C),l=C=>{if(r.length>=t.max){s.push(C);return}c(C),r.unshift(C)},d=()=>{for(;s.length>0&&r.length<t.max;){const C=s.shift();C&&(c(C),r.unshift(C))}},u=C=>{const I=C.id??`toast:${pi()}`,R=r.find(V=>V.id===I);return i.has(I)&&i.delete(I),R?r=r.map(V=>V.id===I?c({...V,...C,id:I}):V):l({id:I,duration:t.duration,removeDelay:t.removeDelay,type:"info",...C,stacked:!t.overlap,gap:t.gap}),I},g=C=>(i.add(C),C?(o.forEach(I=>I({id:C,dismiss:!0})),r=r.filter(I=>I.id!==C),d()):(r.forEach(I=>{o.forEach(R=>R({id:I.id,dismiss:!0}))}),r=[],s=[]),C);return{attrs:t,subscribe:a,create:u,update:(C,I)=>u({id:C,...I}),remove:g,dismiss:C=>{C!=null?r=r.map(I=>I.id===C?c({...I,message:"DISMISS"}):I):r=r.map(I=>c({...I,message:"DISMISS"}))},error:C=>u({...C,type:"error"}),success:C=>u({...C,type:"success"}),info:C=>u({...C,type:"info"}),warning:C=>u({...C,type:"warning"}),loading:C=>u({...C,type:"loading"}),getVisibleToasts:()=>r.filter(C=>!i.has(C.id)),getCount:()=>r.length,promise:(C,I,R={})=>{if(!I||!I.loading){vt("[zag-js > toast] toaster.promise() requires at least a 'loading' option to be specified");return}const V=u({...R,...I.loading,promise:C,type:"loading"});let H=!0,j;const Y=Fn(C).then(async W=>{if(j=["resolve",W],Sh(W)&&!W.ok){H=!1;const ht=Fn(I.error,`HTTP Error! status: ${W.status}`);u({...R,...ht,id:V,type:"error"})}else if(I.success!==void 0){H=!1;const ht=Fn(I.success,W);u({...R,...ht,id:V,type:"success"})}}).catch(async W=>{if(j=["reject",W],I.error!==void 0){H=!1;const ht=Fn(I.error,W);u({...R,...ht,id:V,type:"error"})}}).finally(()=>{H&&g(V),I.finally?.()});return{id:V,unwrap:()=>new Promise((W,ht)=>Y.then(()=>j[0]==="reject"?ht(j[1]):W(j[1])).catch(ht))}},pause:C=>{C!=null?r=r.map(I=>I.id===C?c({...I,message:"PAUSE"}):I):r=r.map(I=>c({...I,message:"PAUSE"}))},resume:C=>{C!=null?r=r.map(I=>I.id===C?c({...I,message:"RESUME"}):I):r=r.map(I=>c({...I,message:"RESUME"}))},isVisible:C=>!i.has(C)&&!!r.find(I=>I.id===C),isDismissed:C=>i.has(C),expand:()=>{r=r.map(C=>c({...C,stacked:!0}))},collapse:()=>{r=r.map(C=>c({...C,stacked:!1}))}}}var Sh=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ra={connect:Eh,machine:Bh};const Nh=e=>Th(e),[Rh,Wt]=ee("ToastContext"),Dh=n.defineComponent({__name:"toast-action-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Wt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getActionTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),$h=n.defineComponent({__name:"toast-close-trigger",props:{asChild:{type:Boolean}},setup(e){const t=Wt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).button,n.mergeProps(n.unref(t).getCloseTriggerProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Ah=n.defineComponent({__name:"toast-context",setup(e){const t=Wt();return(o,r)=>n.renderSlot(o.$slots,"default",n.normalizeProps(n.guardReactiveProps(n.unref(t))))}}),Vh=n.defineComponent({__name:"toast-description",props:{asChild:{type:Boolean}},setup(e){const t=Wt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getDescriptionProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Mh=n.defineComponent({__name:"toast-root",props:{asChild:{type:Boolean}},setup(e){const t=Wt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getRootProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(t).getGhostBeforeProps())),null,16),n.renderSlot(o.$slots,"default"),n.createElementVNode("div",n.normalizeProps(n.guardReactiveProps(n.unref(t).getGhostAfterProps())),null,16)]),_:3},16,["as-child"]))}}),Fh=n.defineComponent({__name:"toast-title",props:{asChild:{type:Boolean}},setup(e){const t=Wt();return N(),(o,r)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.mergeProps(n.unref(t).getTitleProps(),{"as-child":o.asChild}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16,["as-child"]))}}),Lh=n.defineComponent({__name:"toaster-item",props:{value:{},index:{},parent:{}},setup(e){const t=e,o=He(Ue),r=n.computed(()=>({...t.value,index:t.index,parent:t.parent,getRootNode:o?.value.getRootNode})),i=Le(Oh,r),s=n.computed(()=>Ih(i,tt));return Rh(s),N(),(a,c)=>n.renderSlot(a.$slots,"default",n.normalizeProps(n.guardReactiveProps(t.value)))}}),Hh=n.defineComponent({__name:"toaster",props:{toaster:{},asChild:{type:Boolean}},setup(e){const t=e,o=kt(yt),r=He(Ue),i=Le(ra.machine,{store:t.toaster,id:n.useId(),dir:o?.value.dir,getRootNode:r?.value.getRootNode}),s=n.computed(()=>ra.connect(i,tt));return N(),(a,c)=>(n.openBlock(),n.createBlock(n.unref(D).div,n.normalizeProps(n.guardReactiveProps(s.value.getGroupProps())),{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value.getToasts(),(l,d)=>(n.openBlock(),n.createBlock(Lh,{key:l.id,value:l,parent:n.unref(i),index:d},{default:n.withCtx(u=>[n.renderSlot(a.$slots,"default",n.mergeProps({ref_for:!0},u))]),_:3},8,["value","parent","index"]))),128))]),_:3},16))}}),En=Object.freeze(Object.defineProperty({__proto__:null,ActionTrigger:Dh,CloseTrigger:$h,Context:Ah,Description:Vh,Root:Mh,Title:Fh},Symbol.toStringTag,{value:"Module"}));function Xe(e){return e&&typeof e=="object"&&(e.setup||e.render||e.__vccOpts||e.name||e.__v_skip)}function lt(e){return typeof e=="string"}function ct(e){return typeof e=="function"&&!Xe(e)}function dt(){const e=n.inject(Q);if(!e)throw new Error("useUI must be used within a component that has access to CraftileEditor");const t=o=>{e.ui.state.activeSidebarPanel=o};return{toaster:e.ui.toaster,sidebarPanels:n.computed(()=>Array.from(e.ui.state.sidebarPanels.values()).sort((o,r)=>(o.order??0)-(r.order??0))),activeSidebarPanel:n.computed(()=>e.ui.state.activeSidebarPanel),registerSidebarPanel:e.ui.registerSidebarPanel.bind(e.ui),removeSidebarPanel:e.ui.removeSidebarPanel.bind(e.ui),setActiveSidebarPanel:t,headerActions:n.computed(()=>Array.from(e.ui.state.headerActions.values()).sort((o,r)=>(o.order??0)-(r.order??0))),registerHeaderAction:e.ui.registerHeaderAction.bind(e.ui),removeHeaderAction:e.ui.removeHeaderAction.bind(e.ui),configurationPanels:n.computed(()=>Array.from(e.ui.state.configurationPanels.values()).sort((o,r)=>(o.order??0)-(r.order??0))),registerConfigurationPanel:e.ui.registerConfigurationPanel.bind(e.ui),removeConfigurationPanel:e.ui.removeConfigurationPanel.bind(e.ui),modals:n.computed(()=>e.ui.state.modals),openModals:n.computed(()=>e.ui.state.openModals),openModal:e.ui.openModal.bind(e.ui),closeModal:e.ui.closeModal.bind(e.ui),propertyFields:n.computed(()=>e.ui.state.propertyFields),registerPropertyField:e.ui.registerPropertyField.bind(e.ui),removePropertyField:e.ui.removePropertyField.bind(e.ui),keyboardShortcuts:n.computed(()=>e.ui.state.keyboardShortcuts),registerKeyboardShortcut:e.ui.registerKeyboardShortcut.bind(e.ui),removeKeyboardShortcut:e.ui.removeKeyboardShortcut.bind(e.ui)}}const Uh={key:1,class:"border-b px-6 py-4 flex items-center justify-between"},jh=n.defineComponent({__name:"Modals",setup(e){const t=n.inject(Q),{openModals:o,modals:r,closeModal:i}=dt(),s=n.computed(()=>o.value.reduce((l,d)=>{const u=r.value.get(d);return u&&(l[d]=u),l},{})),a=l=>({xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"max-w-[calc(100vw-2rem)] w-full max-h-[calc(100vh-2rem)] h-full"})[l]||"max-w-md",c=(l,d)=>{l.open||i(d)};return(l,d)=>{const u=Fo,g=en;return n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),h=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:h},[n.unref(s)[h]?(n.openBlock(),n.createBlock(n.unref(xt).Root,{key:0,open:!0,onOpenChange:p=>c(p,h),modal:!0},{default:n.withCtx(()=>[n.createVNode(n.unref(xt).Backdrop,{class:"fixed inset-0 bg-black/50 z-50"}),n.createVNode(n.unref(xt).Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center p-4"},{default:n.withCtx(()=>[n.createVNode(n.unref(xt).Content,{class:n.normalizeClass(`relative bg-white rounded-lg shadow-xl ${a(n.unref(s)[h]?.size)} ${n.unref(s)[h]?.size!=="full"?"max-h-[90vh]":""} overflow-auto`)},{default:n.withCtx(()=>[n.unref(s)[h].title?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(xt).CloseTrigger,{key:0,class:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded p-1 z-10",onClick:p=>n.unref(i)(h)},{default:n.withCtx(()=>[n.createVNode(u,{class:"w-5 h-5"})]),_:1},8,["onClick"])),n.unref(s)[h].title?(n.openBlock(),n.createElementBlock("div",Uh,[n.createVNode(n.unref(xt).Title,{class:"text-lg font-semibold text-gray-900"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)[h].title),1)]),_:2},1024),n.createVNode(n.unref(xt).CloseTrigger,{class:"text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded p-1",onClick:p=>n.unref(i)(h)},{default:n.withCtx(()=>[n.createVNode(u,{class:"w-5 h-5"})]),_:1},8,["onClick"])])):n.createCommentVNode("",!0),n.unref(Xe)(n.unref(s)[h].render)||n.unref(lt)(n.unref(s)[h].render)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(s)[h].render),{key:2,"modal-id":h,editor:n.unref(t)},null,8,["modal-id","editor"])):n.unref(ct)(n.unref(s)[h].render)?(n.openBlock(),n.createBlock(g,{key:3,"render-fn":n.unref(s)[h].render},null,8,["render-fn"])):n.createCommentVNode("",!0)]),_:2},1032,["class"])]),_:2},1024)]),_:2},1032,["onOpenChange"])):n.createCommentVNode("",!0)],64))),128)}}}),ia={header:{undo:"Undo",redo:"Redo",auto:"Auto",apply:"Apply",devicePreview:"Device Preview",customDeviceSize:"Custom Size",deviceWidthPx:"Width (px)",savedCustomDevices:"Saved custom devices",enableInspector:"Enable inspection mode",disableInspector:"Disable inspection mode"},block:{show:"Show",hide:"Hide",duplicate:"Duplicate",remove:"Remove",moveToNext:"Move to Next",moveToPrevious:"Move to Previous",enable:"Enable",disable:"Disable"},layers:{title:"Layers",header:"Page content",collapseAll:"Collapse all blocks",addBlockToBlock:"Add block"},blocksPopover:{searchPlaceholder:"Search blocks...",tabBlocks:"Blocks",tabSaved:"Saved",noBlocksAvailable:"No blocks available",noBlocksFound:"No blocks found"},configPanels:{properties:"Properties",selectedBlock:"Select a block to edit its properties",noProperties:"This block has no editable properties",unknownFieldType:"Unknown field type"},common:{block:"Block",custom:"Custom",close:"Close",default:"Default"}};function zh(e,t){const o={...e};for(const r in t)if(t.hasOwnProperty(r)){const i=t[r],s=o[r];i&&typeof i=="object"&&!Array.isArray(i)&&s&&typeof s=="object"&&!Array.isArray(s)?o[r]={...s,...i}:i!==void 0&&(o[r]=i)}return o}function Wh(e,t){return t.split(".").reduce((o,r)=>o&&o[r]!==void 0?o[r]:void 0,e)}function Gh(e){return e?zh(ia,e):ia}function Kh(e){return function(o){const r=Wh(e,o);return r===void 0?(console.warn(`Translation key "${o}" not found, returning key as fallback`),o):typeof r!="string"?(console.warn(`Translation key "${o}" does not point to a string value`),o):r}}function le(){const e=n.inject(Q);if(!e)throw new Error("useI18n must be used within a component that has access to CraftileEditor");return{t:Kh(e.i18n)}}const qh={class:"group pointer-events-auto relative flex w-full min-w-96 max-w-lg justify-between gap-4 overflow-hidden rounded-lg border p-3 shadow-lg transition-all"},Xh={class:"flex-1 min-w-0"},Yh={key:1,class:"mt-3 flex gap-2"},Jh={class:"flex items-start"},Zh={class:"sr-only"},Qh=n.defineComponent({__name:"Toasts",setup(e){const{t}=le(),{toaster:o}=dt(),r=s=>{switch(s){case"error":return"bg-red-50 border-red-200 text-red-800";case"warning":return"bg-amber-50 border-amber-200 text-amber-800";case"success":return"bg-blue-50 border-blue-200 text-blue-800";case"info":default:return"bg-gray-50 border-gray-200 text-gray-800"}},i=s=>{switch(s){case"error":return"border-red-300 text-red-700 hover:bg-red-100";case"warning":return"border-amber-300 text-amber-700 hover:bg-amber-100";case"success":return"border-blue-300 text-blue-700 hover:bg-blue-100";case"info":default:return"border-gray-300 text-gray-700 hover:bg-gray-100"}};return(s,a)=>{const c=Fo;return n.openBlock(),n.createBlock(n.unref(Hh),{toaster:n.unref(o)},{default:n.withCtx(l=>[n.createVNode(n.unref(En).Root,{class:n.normalizeClass(r(l.type||"info"))},{default:n.withCtx(()=>[n.createElementVNode("div",qh,[n.createElementVNode("div",Xh,[n.createVNode(n.unref(En).Title,{class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.title),1)]),_:2},1024),l.description?(n.openBlock(),n.createBlock(n.unref(En).Description,{key:0,class:"mt-1 text-sm opacity-90"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.description),1)]),_:2},1024)):n.createCommentVNode("",!0),l.action?(n.openBlock(),n.createElementBlock("div",Yh,[n.createVNode(n.unref(En).ActionTrigger,{class:n.normalizeClass(["inline-flex items-center px-2 py-1 text-xs font-medium rounded border transition-colors",i(l.type||"info")])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.action.label),1)]),_:2},1032,["class"])])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Jh,[n.createVNode(n.unref(En).CloseTrigger,{class:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md opacity-70 hover:opacity-100 transition-opacity"},{default:n.withCtx(()=>[n.createVNode(c,{class:"h-4 w-4"}),n.createElementVNode("span",Zh,n.toDisplayString(n.unref(t)("common.close")),1)]),_:1})])])]),_:2},1032,["class"])]),_:1},8,["toaster"])}}}),eg={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tg(e,t){return n.openBlock(),n.createElementBlock("svg",eg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m19.5 8.25l-7.5 7.5l-7.5-7.5"},null,-1)])])}const Ar=n.markRaw({name:"heroicons-chevron-down",render:tg});function ng(){const e=n.inject(Q);if(!e)throw new Error("useEventBus must be used within a component that has access to CraftileEditor");return e.events}function og(e,t){const o=e instanceof Mo;let r,i;if(o)r=e,i=!0;else{const x=e||{},{autoSync:T=!0,...C}=x;r=new Mo(C),i=T}const s=n.ref({blocks:{},regions:[{name:"main",blocks:[]}]}),a=n.computed(()=>s.value.blocks),c=n.computed(()=>s.value.regions),l=n.ref(r.canUndo()),d=n.ref(r.canRedo()),u=n.computed(()=>{const x=[];for(const T of c.value)for(const C of T.blocks){const I=a.value[C];I&&x.push(I)}return x}),g=x=>a.value[x],h=x=>Object.values(a.value).filter(T=>T.type===x),p=x=>{const T=a.value[x];return T?T.children.map(C=>a.value[C]).filter(Boolean):[]},m=()=>{const x=n.toRaw(r.getPage());s.value=x,n.nextTick(()=>{l.value=r.canUndo(),d.value=r.canRedo()})};m();const b=[];i&&["page:set","block:insert","block:remove","block:move","block:toggle","block:duplicate","block:property:set","undo","redo"].forEach(T=>{const C=r.on(T,()=>{m()});b.push(C)});const k=(x,T)=>{const C=r.insertBlock(x,T);return i||m(),C},w=x=>{r.removeBlock(x),i||m()},E=(x,T)=>{r.moveBlock(x,T),i||m()},B=(x,T,C)=>{r.setBlockProperty(x,T,C),i||m()},f=(x,T)=>{r.toggleBlock(x,T),i||m()},y=x=>{const T=r.duplicateBlock(x);return i||m(),T},O=()=>{const x=r.undo();return i||m(),x},v=()=>{const x=r.redo();return i||m(),x},_=()=>{m()},P=()=>{b.forEach(x=>x()),b.length=0};return n.onUnmounted(()=>{P()}),{page:s,blocks:a,regions:c,engine:r,rootLevelBlocks:u,getBlockById:g,getBlocksByType:h,getChildrenBlocks:p,insertBlock:k,removeBlock:w,moveBlock:E,setBlockProperty:B,toggleBlock:f,duplicateBlock:y,undo:O,redo:v,canUndo:l,canRedo:d,refresh:_,destroy:P}}function Be(){const e=n.inject(Q);if(!e)throw new Error("useCraftileEngine must be used within a component that has access to CraftileEditor");return og(e.engine)}function Vr(){const e=n.inject(Q);if(!e)throw new Error("useBlocksPopover must be used within a component that has access to CraftileEditor");return{open:({anchor:s,context:a})=>{e.events.emit("blocks-popover:open",{anchor:s,context:a})},close:()=>{e.events.emit("blocks-popover:close")},getAllowedBlockSchemas:s=>{const a=e.engine.getBlocksManager(),c=Object.values(a.getAll());if(s.parentId){const l=e.engine.getBlockById(s.parentId);if(!l)return[];let d=c.filter(u=>a.canBeChild(u.type,l.type));return e.blockFilterFunction&&(d=d.filter(u=>e.blockFilterFunction(u,s))),d}return e.blockFilterFunction?c.filter(l=>e.blockFilterFunction(l,s)):c},getInsertionContext:(s,a)=>{const c=e.engine.getBlockById(s);if(!c)return{regionName:"main"};if(c.parentId){const l=e.engine.getBlockById(c.parentId);if(l){const d=l.children.indexOf(s),u=a==="before"?d:d+1;return{parentId:c.parentId,index:u}}}for(const l of e.engine.getPage().regions){const d=l.blocks.indexOf(s);if(d!==-1){const u=a==="before"?d:d+1;return{regionName:l.name,index:u}}}return{regionName:"main"}}}}function Mr(){const e=n.inject(Q);if(!e)throw new Error("useLayersPanel must be used within a component that has access to CraftileEditor");const t=n.computed(()=>e.ui.state.layersPanel.expandedBlocks),o=(l,d)=>{d?e.ui.state.layersPanel.expandedBlocks.add(l):e.ui.state.layersPanel.expandedBlocks.delete(l)},r=l=>e.ui.state.layersPanel.expandedBlocks.has(l),i=l=>{const d=!r(l);return o(l,d),d},s=l=>{l.forEach(d=>{e.ui.state.layersPanel.expandedBlocks.add(d)})},a=l=>{l.forEach(d=>{e.ui.state.layersPanel.expandedBlocks.delete(d)})};return{expandedBlocks:t,setExpanded:o,isExpanded:r,toggleExpanded:i,expandAll:s,collapseAll:a,collapseRegion:l=>{const d=e.engine.getPage(),u=d.regions.find(h=>h.name===l);if(!u)return;const g=h=>{const p=d.blocks[h];if(!p||!p.children)return[];let m=[];return p.children.forEach(b=>{m.push(b),m.push(...g(b))}),m};u.blocks.forEach(h=>{const p=[h,...g(h)];a(p)})}}}const rg={key:0,class:"text-center text-gray-500 py-8"},ig={key:0},sg={key:1},ag={key:1,class:"h-full overflow-y-auto"},lg={class:"text-sm font-medium text-gray-700"},cg={class:"pb-2"},dg={class:"grid grid-cols-2 gap-2 px-3"},ug=["onClick"],pg=["innerHTML"],fg={class:"flex-1 min-w-0"},hg={class:"font-medium text-sm text-gray-900 truncate"},gg=n.defineComponent({__name:"BlocksPopover",setup(e){const{t}=le(),o=ng(),{engine:r,insertBlock:i}=Be(),{getAllowedBlockSchemas:s}=Vr(),{setExpanded:a}=Mr(),c=n.ref(null),l=n.ref(null),d=n.ref(""),u=Ws({id:"blocks-popover",portalled:!0,closeOnInteractOutside:!0,positioning:{placement:"left-start",strategy:"fixed",slide:!0,offset:{crossAxis:-32},flip:["left","right"],fitViewport:!0,getAnchorRect:()=>c.value?.getBoundingClientRect()??null}}),g=E=>E.meta?.name||E.type.replace(/-/g," ").replace(/\b\w/g,B=>B.toUpperCase()),h=n.computed(()=>l.value?s(l.value):[]),p=n.computed(()=>{const E={};return h.value.forEach(B=>{const f=B.meta?.category||"Other";E[f]||(E[f]=[]),E[f].push(B)}),E}),m=n.computed(()=>{const E=d.value.trim().toLowerCase();if(!E)return p.value;const B={};return Object.entries(p.value).forEach(([f,y])=>{const O=y.filter(v=>{const _=(v.meta?.name||v.type).toLowerCase(),P=(v.meta?.description||"").toLowerCase();return _.includes(E)||P.includes(E)});O.length>0&&(B[f]=O)}),B}),b=E=>{if(!l.value)return;const B=i(E,{parentId:l.value.parentId,regionName:l.value.regionName,index:l.value.index}),f=r.getBlocksManager().get(E);f?.accepts&&f.accepts.length>0&&a(B,!0),w()},k=({anchor:E,context:B})=>{c.value=E,l.value=B||null,u.value.setOpen(!0),u.value.reposition()},w=()=>{u.value.setOpen(!1),l.value=null,c.value=null};return n.onMounted(()=>{o.on("blocks-popover:open",k),o.on("blocks-popover:close",w)}),n.onUnmounted(()=>{o.off("blocks-popover:open",k),o.off("blocks-popover:close",w)}),(E,B)=>{const f=Ar;return n.openBlock(),n.createBlock(n.unref(Ke).RootProvider,{value:n.unref(u)},{default:n.withCtx(()=>[n.createVNode(n.unref(Ke).Positioner,{class:"!z-[1100]"},{default:n.withCtx(()=>[n.createVNode(n.unref(Ke).Content,{class:"bg-white shadow rounded-md p-2 w-md h-[480px] border flex flex-col"},{default:n.withCtx(()=>[n.createVNode(n.unref(Is).Root,{class:"flex-none"},{default:n.withCtx(()=>[n.createVNode(n.unref(Is).Input,{modelValue:n.unref(d),"onUpdate:modelValue":B[0]||(B[0]=y=>n.isRef(d)?d.value=y:null),class:"rounded border w-full text-sm h-8 px-3 focus-visible:ring-2 focus-visible:border-transparent focus-visible:ring-accent focus-visible:outline-none",placeholder:n.unref(t)("blocksPopover.searchPlaceholder")},null,8,["modelValue","placeholder"])]),_:1}),n.createVNode(n.unref(qe).Root,{class:"flex-1 mt-2 flex-col overflow-y-hidden",defaultValue:"blocks"},{default:n.withCtx(()=>[n.createVNode(n.unref(qe).List,{class:"flex flex-none bg-gray-100 p-0.5 rounded"},{default:n.withCtx(()=>[n.createVNode(n.unref(qe).Trigger,{value:"blocks",class:"flex-1 py-1.5 rounded data-selected:bg-white data-selected:shadow"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t)("blocksPopover.tabBlocks")),1)]),_:1}),n.createVNode(n.unref(qe).Trigger,{value:"saved",class:"flex-1 py-1.5 rounded data-selected:bg-white data-selected:shadow"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t)("blocksPopover.tabSaved")),1)]),_:1})]),_:1}),n.createVNode(n.unref(qe).Content,{value:"blocks",class:"flex-1 overflow-hidden"},{default:n.withCtx(()=>[Object.keys(n.unref(m)).length===0?(n.openBlock(),n.createElementBlock("div",rg,[n.unref(d).trim()?(n.openBlock(),n.createElementBlock("p",ig,n.toDisplayString(n.unref(t)("blocksPopover.noBlocksFound"))+' "'+n.toDisplayString(n.unref(d))+'"',1)):(n.openBlock(),n.createElementBlock("p",sg,n.toDisplayString(n.unref(t)("blocksPopover.noBlocksAvailable")),1))])):(n.openBlock(),n.createElementBlock("div",ag,[n.createVNode(n.unref(Ae).Root,{class:"w-full",defaultValue:Object.keys(n.unref(m)),multiple:""},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(m),(y,O)=>(n.openBlock(),n.createBlock(n.unref(Ae).Item,{key:O,value:O,class:"border-b border-gray-100 last:border-b-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(Ae).ItemTrigger,{class:"flex w-full items-center justify-between p-3 text-left hover:bg-gray-50 transition-colors"},{default:n.withCtx(()=>[n.createElementVNode("span",lg,n.toDisplayString(O),1),n.createVNode(n.unref(Ae).ItemIndicator,{class:"transition-transform duration-200"},{default:n.withCtx(()=>[n.createVNode(f,{class:"w-4 h-4 text-gray-500"})]),_:1})]),_:2},1024),n.createVNode(n.unref(Ae).ItemContent,{class:"overflow-hidden"},{default:n.withCtx(()=>[n.createElementVNode("div",cg,[n.createElementVNode("div",dg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y,v=>(n.openBlock(),n.createElementBlock("button",{key:v.type,onClick:_=>b(v.type),class:"flex items-center gap-2 p-2 rounded border border-gray-200 hover:border-gray-300 hover:bg-gray-50 transition-colors text-left"},[n.createElementVNode("div",{class:"flex-none w-6 h-6 flex items-center justify-center text-gray-600",innerHTML:v.meta?.icon||""},null,8,pg),n.createElementVNode("div",fg,[n.createElementVNode("div",hg,n.toDisplayString(g(v)),1)])],8,ug))),128))])])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["defaultValue"])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["value"])}}}),mg={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function bg(e,t){return n.openBlock(),n.createElementBlock("svg",mg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M5 3.25V4H2.75a.75.75 0 0 0 0 1.5h.3l.815 8.15A1.5 1.5 0 0 0 5.357 15h5.286a1.5 1.5 0 0 0 1.492-1.35l.815-8.15h.3a.75.75 0 0 0 0-1.5H11v-.75A2.25 2.25 0 0 0 8.75 1h-1.5A2.25 2.25 0 0 0 5 3.25m2.25-.75a.75.75 0 0 0-.75.75V4h3v-.75a.75.75 0 0 0-.75-.75zM6.05 6a.75.75 0 0 1 .787.713l.275 5.5a.75.75 0 0 1-1.498.075l-.275-5.5A.75.75 0 0 1 6.05 6m3.9 0a.75.75 0 0 1 .712.787l-.275 5.5a.75.75 0 0 1-1.498-.075l.275-5.5a.75.75 0 0 1 .786-.711","clip-rule":"evenodd"},null,-1)])])}const yg=n.markRaw({name:"heroicons-trash16-solid",render:bg}),kg={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function _g(e,t){return n.openBlock(),n.createElementBlock("svg",kg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.28 2.22a.75.75 0 0 0-1.06 1.06l10.5 10.5a.75.75 0 1 0 1.06-1.06l-1.322-1.323a7 7 0 0 0 2.16-3.11a.87.87 0 0 0 0-.567A7.003 7.003 0 0 0 4.82 3.76zm3.196 3.195l1.135 1.136A1.502 1.502 0 0 1 9.45 8.389l1.136 1.135a3 3 0 0 0-4.109-4.109","clip-rule":"evenodd"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"m7.812 10.994l1.816 1.816A7.003 7.003 0 0 1 1.38 8.28a.87.87 0 0 1 0-.566a7 7 0 0 1 1.113-2.039l2.513 2.513a3 3 0 0 0 2.806 2.806"},null,-1)])])}const wg=n.markRaw({name:"heroicons-eye-slash16-solid",render:_g}),xg={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Cg(e,t){return n.openBlock(),n.createElementBlock("svg",xg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M5.5 3.5A1.5 1.5 0 0 1 7 2h2.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 1 .439 1.061V9.5A1.5 1.5 0 0 1 12 11V8.621a3 3 0 0 0-.879-2.121L9 4.379A3 3 0 0 0 6.879 3.5z"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"M4 5a1.5 1.5 0 0 0-1.5 1.5v6A1.5 1.5 0 0 0 4 14h5a1.5 1.5 0 0 0 1.5-1.5V8.621a1.5 1.5 0 0 0-.44-1.06L7.94 5.439A1.5 1.5 0 0 0 6.878 5z"},null,-1)])])}const Eg=n.markRaw({name:"heroicons-document-duplicate16-solid",render:Cg}),Bg={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Ig(e,t){return n.openBlock(),n.createElementBlock("svg",Bg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M8 2a.75.75 0 0 1 .75.75v8.69l1.22-1.22a.75.75 0 1 1 1.06 1.06l-2.5 2.5a.75.75 0 0 1-1.06 0l-2.5-2.5a.75.75 0 1 1 1.06-1.06l1.22 1.22V2.75A.75.75 0 0 1 8 2","clip-rule":"evenodd"},null,-1)])])}const Pg=n.markRaw({name:"heroicons-arrow-long-down16-solid",render:Ig}),Og=["disabled","title"],vg=n.defineComponent({__name:"PreviewToolbarButton",props:{disabled:{type:Boolean,default:!1},title:{},variant:{default:"default"}},emits:["click"],setup(e){const t=e,o=n.computed(()=>`w-6 h-6 flex items-center justify-center border-0 bg-transparent rounded-md cursor-pointer relative disabled:text-gray-600 disabled:cursor-not-allowed [&>svg]:w-3.5 &[&>svg]:h-3.5 ${{default:"text-gray-400 hover:enabled:bg-gray-500 hover:enabled:text-gray-100 active:enabled:bg-gray-600",danger:"text-gray-400 hover:enabled:bg-red-800 hover:enabled:text-red-200 active:enabled:bg-gray-600"}[t.variant]}`);return(r,i)=>(n.openBlock(),n.createElementBlock("button",{disabled:r.disabled,title:r.title,class:n.normalizeClass(o.value),onClick:i[0]||(i[0]=n.withModifiers(s=>r.$emit("click",s),["stop"]))},[n.renderSlot(r.$slots,"default")],10,Og))}}),Tg={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Sg(e,t){return n.openBlock(),n.createElementBlock("svg",Tg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M8 14a.75.75 0 0 0 .75-.75V4.56l1.22 1.22a.75.75 0 1 0 1.06-1.06l-2.5-2.5a.75.75 0 0 0-1.06 0l-2.5 2.5a.75.75 0 0 0 1.06 1.06l1.22-1.22v8.69c0 .414.336.75.75.75","clip-rule":"evenodd"},null,-1)])])}const Ng=n.markRaw({name:"heroicons-arrow-long-up16-solid",render:Sg});function _o(){const e=n.inject(Q);if(!e)throw new Error("useInspector must be used within a component that has access to CraftileEditor");const t=n.computed(()=>e.inspector.state.enabled),o=n.computed(()=>e.inspector.state.hoveredBlockRect),r=n.computed(()=>e.inspector.state.hoveredParentRect),i=n.computed(()=>e.inspector.state.hoveredBlockId),s=n.computed(()=>e.inspector.state.selectedBlockRect),a=n.computed(()=>e.inspector.state.parentFlexDirection),c=n.computed(()=>e.inspector.state.iframeRect);return{isEnabled:t,iframeRect:c,hoveredBlockId:i,hoveredBlockRect:o,hoveredParentRect:r,selectedBlockRect:s,parentFlexDirection:a,enable:()=>e.inspector.enable(),disable:()=>e.inspector.disable(),toggle:()=>e.inspector.toggle(),updateIframeRect:l=>e.inspector.setIframeRect(l)}}function Bt(){const e=n.inject(Q);if(!e)throw new Error("useSelectedBlock must be used within a component that has access to CraftileEditor");const{regions:t,blocks:o,moveBlock:r,duplicateBlock:i,toggleBlock:s,removeBlock:a}=Be(),c=n.computed(()=>!!e.ui.state.selectedBlockId),l=n.computed(()=>e.ui.state.selectedBlockId),d=n.computed(()=>e.ui.state.selectedBlockId&&o.value[e.ui.state.selectedBlockId]||null),u=f=>{e.ui.setSelectedBlock(f)},g=()=>{e.ui.clearSelectedBlock(),e.inspector.clearSelectedBlock()},h=n.computed(()=>{if(!d.value)return null;const f=d.value;for(const y of t.value){const O=y.blocks.indexOf(f.id);if(O!==-1)return{parentType:"region",parentId:y.name,currentIndex:O,siblingCount:y.blocks.length}}if(f.parentId){const y=o.value[f.parentId];if(y){const O=y.children.indexOf(f.id);if(O!==-1)return{parentType:"block",parentId:f.parentId,currentIndex:O,siblingCount:y.children.length}}}return null}),p=n.computed(()=>!d.value||d.value?.static?!1:h.value&&h.value.currentIndex>0),m=n.computed(()=>!d.value||d.value?.static?!1:h.value&&h.value.currentIndex<h.value.siblingCount-1);return{hasSelection:c,selectedBlockId:l,selectedBlock:d,canMoveToPrevious:p,canMoveToNext:m,selectBlock:u,clearSelection:g,moveToPrevious:()=>{if(!d.value||!h.value)return;const f=h.value.currentIndex-1;h.value.parentType==="region"?r(d.value.id,{targetRegionName:h.value.parentId,targetIndex:f}):h.value.parentType==="block"&&r(d.value.id,{targetParentId:h.value.parentId,targetIndex:f})},moveToNext:()=>{if(!d.value||!h.value)return;const f=h.value.currentIndex+1;h.value.parentType==="region"?r(d.value.id,{targetRegionName:h.value.parentId,targetIndex:f}):h.value.parentType==="block"&&r(d.value.id,{targetParentId:h.value.parentId,targetIndex:f})},duplicate:()=>{l.value&&i(l.value)},toggle:()=>{l.value&&s(l.value)},remove:()=>{l.value&&(a(l.value),g())}}}const Rg={key:0,class:"absolute -top-[18.5px] left-0 bg-blue-500/95 text-white px-1 py-0.5 font-semibold text-[0.6rem] flex items-center gap-0.5 pointer-events-none whitespace-nowrap shadow-lg rounded-t"},Dg=["innerHTML"],$g=n.defineComponent({__name:"SelectedBlockOverlay",props:{zoomScale:{default:1}},setup(e){const t=e,{t:o}=le(),{engine:r,getBlockById:i}=Be(),{isEnabled:s,selectedBlockRect:a,iframeRect:c}=_o(),{selectedBlock:l,canMoveToPrevious:d,canMoveToNext:u,moveToPrevious:g,moveToNext:h,duplicate:p,toggle:m,remove:b}=Bt(),k=n.ref(),w=n.ref({width:200,height:42}),E=n.computed(()=>s.value&&a.value&&c.value&&!l.value?.disabled),B=n.computed(()=>l.value?.static===!0),f=n.computed(()=>{if(!l.value)return{name:o("common.block"),icon:""};const x=i(l.value.id);if(!x)return{name:o("common.block"),icon:""};const T=r.getBlockSchema(x.type);return{name:T?.meta?.name||x.type||o("common.block"),icon:T?.meta?.icon||""}}),y=n.computed(()=>f.value.name),O=n.computed(()=>f.value.icon),v=n.computed(()=>{if(!a.value||!y.value)return!1;const x=20+y.value.length*7+20;return a.value.width>=x}),_=n.computed(()=>!a.value||!c.value?{}:{position:"absolute",left:`${a.value.left}px`,top:`${a.value.top}px`,width:`${a.value.width}px`,height:`${a.value.height}px`});n.watch([k,E],async()=>{if(k.value&&E.value&&(await n.nextTick(),k.value)){const x=k.value.getBoundingClientRect();w.value={width:x.width,height:x.height}}},{immediate:!0});const P=n.computed(()=>{if(!a.value||!c.value)return{};const x=a.value,T=c.value,{width:C,height:I}=w.value,R=2,V=t.zoomScale,H=x.width*V,Y=x.top-T.top<I+R?x.height+R:-((I+R)/V),se=H<=C,W={position:"absolute",top:`${Y}px`};return se?W.left="0px":W.right="0px",W});return(x,T)=>{const C=Ng,I=vg,R=Pg,V=Eg,H=wg,j=yg;return n.unref(E)?(n.openBlock(),n.createElementBlock("div",{key:0,class:"absolute inset-0 w-full h-full pointer-events-none z-10",style:n.normalizeStyle(n.unref(_))},[n.unref(v)?(n.openBlock(),n.createElementBlock("div",Rg,[n.createElementVNode("span",{class:"w-3 h-3 flex items-center justify-center [&_svg]:w-full [&_svg]:h-full [&_svg]:fill-current",innerHTML:n.unref(O)},null,8,Dg),n.createElementVNode("span",null,n.toDisplayString(n.unref(y)),1)])):n.createCommentVNode("",!0),T[0]||(T[0]=n.createElementVNode("div",{class:"absolute inset-0 border border-blue-500 bg-blue-500/5"},null,-1)),n.createElementVNode("div",{ref_key:"toolbarElement",ref:k,class:"absolute flex gap-0.5 bg-gray-800 rounded p-0.5 shadow-lg shadow-black/25 ring-1 ring-white/10 z-10 pointer-events-auto",style:n.normalizeStyle(n.unref(P))},[n.unref(B)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(I,{key:0,disabled:!n.unref(d),title:n.unref(o)("block.moveToPrevious"),onClick:n.unref(g)},{default:n.withCtx(()=>[n.createVNode(C,{class:"w-3.5 h-3.5"})]),_:1},8,["disabled","title","onClick"])),n.unref(B)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(I,{key:1,disabled:!n.unref(u),title:n.unref(o)("block.moveToNext"),onClick:n.unref(h)},{default:n.withCtx(()=>[n.createVNode(R)]),_:1},8,["disabled","title","onClick"])),n.createVNode(I,{title:n.unref(o)("block.duplicate"),onClick:n.unref(p)},{default:n.withCtx(()=>[n.createVNode(V)]),_:1},8,["title","onClick"]),n.unref(B)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(I,{key:2,title:n.unref(o)("block.disable"),onClick:n.unref(m)},{default:n.withCtx(()=>[n.createVNode(H)]),_:1},8,["title","onClick"])),n.unref(B)?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(I,{key:3,variant:"danger",title:n.unref(o)("block.remove"),onClick:n.unref(b)},{default:n.withCtx(()=>[n.createVNode(j)]),_:1},8,["title","onClick"]))],4)],4)):n.createCommentVNode("",!0)}}}),Ag={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Vg(e,t){return n.openBlock(),n.createElementBlock("svg",Ag,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)])])}const Fr=n.markRaw({name:"heroicons-plus",render:Vg}),Mg={key:0,class:"absolute top-0 left-0 w-full h-full pointer-events-none z-[1000]"},Fg={class:"bg-blue-500 text-white px-1 py-0.5 rounded-t font-medium text-[0.60rem] flex items-center gap-0.5 pointer-events-none absolute -left-[1px] -top-[19px]"},Lg=["innerHTML"],Hg=n.defineComponent({__name:"HoveredBlockOverlay",emits:["insertBefore","insertAfter","buttonEnter","buttonLeave"],setup(e,{emit:t}){const o=t,{t:r}=le(),{engine:i,getBlockById:s}=Be(),{isEnabled:a,iframeRect:c,hoveredBlockId:l,hoveredBlockRect:d,hoveredParentRect:u,parentFlexDirection:g}=_o(),{selectedBlockId:h}=Bt(),p=n.computed(()=>a.value&&l.value&&l.value!==h.value),m=n.computed(()=>{if(!l.value)return{name:r("common.block"),icon:""};const B=s(l.value);if(!B)return{name:r("common.block"),icon:""};const f=i.getBlockSchema(B.type);return{name:f?.meta?.name||B.type||r("common.block"),icon:f?.meta?.icon||""}}),b=n.computed(()=>m.value.name),k=n.computed(()=>m.value.icon),w=n.computed(()=>!u.value||!c.value?{}:{position:"absolute",left:`${u.value.left}px`,top:`${u.value.top}px`,width:`${u.value.width}px`,height:`${u.value.height}px`}),E=n.computed(()=>!d.value||!c.value?{}:{position:"absolute",left:`${d.value.left}px`,top:`${d.value.top}px`,width:`${d.value.width}px`,height:`${d.value.height}px`});return(B,f)=>{const y=Fr;return n.unref(p)?(n.openBlock(),n.createElementBlock("div",Mg,[n.unref(u)?(n.openBlock(),n.createElementBlock("div",{key:0,class:"border border-dashed border-slate-400 bg-transparent pointer-events-none box-border absolute",style:n.normalizeStyle(n.unref(w))},null,4)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"border border-dashed border-blue-500 bg-transparent pointer-events-none box-border relative",style:n.normalizeStyle(n.unref(E))},[n.createElementVNode("div",Fg,[n.createElementVNode("span",{class:"w-3 h-3 flex items-center justify-center [&_svg]:w-full [&_svg]:h-full [&_svg]:fill-current",innerHTML:n.unref(k)},null,8,Lg),n.createElementVNode("span",null,n.toDisplayString(n.unref(b)),1)]),n.createElementVNode("button",{class:n.normalizeClass(["w-4 h-4 bg-blue-500/90 border border-white/20 rounded-full flex items-center justify-center text-white cursor-pointer pointer-events-auto opacity-80 shadow-sm hover:opacity-100 hover:bg-blue-500 absolute",{"-top-2 left-1/2 -translate-x-1/2":n.unref(g)==="column","-left-2 top-1/2 -translate-y-1/2":n.unref(g)==="row"}]),onMouseenter:f[0]||(f[0]=O=>o("buttonEnter",n.unref(l))),onMouseleave:f[1]||(f[1]=O=>o("buttonLeave",n.unref(l))),onClick:f[2]||(f[2]=n.withModifiers(O=>o("insertBefore",n.unref(l),O),["stop"]))},[n.createVNode(y,{class:"w-3 h-3 fill-current"})],34),n.createElementVNode("button",{class:n.normalizeClass(["w-4 h-4 bg-blue-500/90 border border-white/20 rounded-full flex items-center justify-center text-white cursor-pointer pointer-events-auto opacity-80 shadow-sm hover:opacity-100 hover:bg-blue-500 absolute",{"-bottom-2 left-1/2 -translate-x-1/2":n.unref(g)==="column","-right-2 top-1/2 -translate-y-1/2":n.unref(g)==="row"}]),onMouseenter:f[3]||(f[3]=O=>o("buttonEnter",n.unref(l))),onMouseleave:f[4]||(f[4]=O=>o("buttonLeave",n.unref(l))),onClick:f[5]||(f[5]=n.withModifiers(O=>o("insertAfter",n.unref(l),O),["stop"]))},[n.createVNode(y,{class:"w-3 h-3 fill-current"})],34)],4)])):n.createCommentVNode("",!0)}}});function sa(){const e=n.inject(Q);if(!e)throw new Error("useDeviceMode must be used within a component that has access to CraftileEditor");return{currentDevice:n.computed(()=>e.devices.state.currentDevice),currentDeviceData:n.computed(()=>e.devices.getCurrentDeviceData()),savedCustomDevices:n.computed(()=>e.devices.state.savedCustomDevices),devicePresets:e.devices.devicePresets,setDeviceMode:t=>e.devices.setDeviceMode(t),addCustomDevice:t=>e.devices.addCustomDevice(t),removeCustomDevice:t=>e.devices.removeCustomDevice(t),getAllDevices:()=>e.devices.getAllDevices()}}function Ug(){const e=n.inject(Q);if(!e)throw new Error("usePreview must be used within a component that has access to CraftileEditor");const t=n.computed(()=>e.preview.state.previewUrl),o=n.computed(()=>e.preview.state.isIframeReady),r=n.computed(()=>e.preview.state.previewFrame);return{currentPreviewUrl:t,isIframeReady:o,previewFrame:r,registerFrame:e.preview._registerFrame.bind(e.preview),onMessage:e.preview.onMessage.bind(e.preview),sendMessage:e.preview.sendMessage.bind(e.preview),loadUrl:e.preview.loadUrl.bind(e.preview),loadFromHtml:e.preview.loadFromHtml.bind(e.preview),reload:e.preview.reload.bind(e.preview),getFrame:e.preview.getFrame.bind(e.preview)}}const jg=["src"],zg=n.defineComponent({__name:"PreviewCanvas",setup(e){const{currentDeviceData:t}=sa(),{currentPreviewUrl:o,registerFrame:r,sendMessage:i}=Ug(),{updateIframeRect:s}=_o(),{open:a,getInsertionContext:c}=Vr(),l=n.ref(),d=n.ref(),u=n.computed(()=>t.value?.width),g=()=>d.value?.getBoundingClientRect().width||0,h=n.computed(()=>{const f=g();if(f<=0||!u.value||u.value===0||u.value<=f)return 1;const y=f/u.value;return Math.min(y,1)}),p=n.computed(()=>{const f=h.value,y=u.value===0?"100%":`${u.value}px`,O=u.value===0?"none":`scale(${f})`;return{width:y,height:`${100/f}%`,transform:O,transformOrigin:"0 0"}}),m=()=>{if(l.value){const f=l.value.getBoundingClientRect();s(f)}},b=f=>{r(f.target),m()},k=f=>{i("craftile.inspector.overlay-button-enter",{blockId:f})},w=f=>{i("craftile.inspector.overlay-button-leave",{blockId:f})},E=(f,y)=>{const O=c(f,"before");a({anchor:y.target,context:O})},B=(f,y)=>{const O=c(f,"after");a({anchor:y.target,context:O})};return n.onMounted(()=>{window.addEventListener("scroll",m)}),n.onUnmounted(()=>{window.removeEventListener("scroll",m)}),(f,y)=>{const O=Hg,v=$g;return n.openBlock(),n.createElementBlock("div",{ref_key:"previewWrapper",ref:d,class:"h-full w-full relative preview-wrapper overflow-hidden"},[n.createElementVNode("div",{ref_key:"canvasContainer",ref:l,class:"bg-white mx-auto rounded-xs relative transition-transform duration-300 ease-out",style:n.normalizeStyle(n.unref(p))},[n.createElementVNode("iframe",{ref:"previewFrame",src:n.unref(o),class:"w-full h-full border-0 preview-iframe",onLoad:b},null,40,jg),n.createVNode(O,{onButtonEnter:k,onButtonLeave:w,onInsertBefore:E,onInsertAfter:B}),n.createVNode(v)],4)],512)}}}),Wg={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Gg(e,t){return n.openBlock(),n.createElementBlock("svg",Wg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"},null,-1)])])}const Kg=n.markRaw({name:"heroicons-adjustments-horizontal",render:Gg}),qg={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xg(e,t){return n.openBlock(),n.createElementBlock("svg",qg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.088 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const aa=n.markRaw({name:"heroicons-trash",render:Xg}),Yg={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jg(e,t){return n.openBlock(),n.createElementBlock("svg",Yg,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3.98 8.223A10.5 10.5 0 0 0 1.934 12c1.292 4.339 5.31 7.5 10.066 7.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.499a10.52 10.52 0 0 1-4.293 5.773M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"},null,-1)])])}const la=n.markRaw({name:"heroicons-eye-slash",render:Jg}),Zg={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qg(e,t){return n.openBlock(),n.createElementBlock("svg",Zg,[...t[0]||(t[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[n.createElementVNode("path",{d:"M2.036 12.322a1 1 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178c.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178"}),n.createElementVNode("path",{d:"M15 12a3 3 0 1 1-6 0a3 3 0 0 1 6 0"})],-1)])])}const ca=n.markRaw({name:"heroicons-eye",render:Qg}),em={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tm(e,t){return n.openBlock(),n.createElementBlock("svg",em,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"},null,-1)])])}const nm=n.markRaw({name:"heroicons-arrow-long-right",render:tm}),om={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rm(e,t){return n.openBlock(),n.createElementBlock("svg",om,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18"},null,-1)])])}const im=n.markRaw({name:"heroicons-arrow-long-left",render:rm}),sm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function am(e,t){return n.openBlock(),n.createElementBlock("svg",sm,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9 9 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9 9 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"},null,-1)])])}const lm=n.markRaw({name:"heroicons-document-duplicate",render:am}),cm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dm(e,t){return n.openBlock(),n.createElementBlock("svg",cm,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M12 6.75a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5m0 6a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5m0 6a.75.75 0 1 1 0-1.5a.75.75 0 0 1 0 1.5"},null,-1)])])}const um=n.markRaw({name:"heroicons-ellipsis-vertical",render:dm}),pm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fm(e,t){return n.openBlock(),n.createElementBlock("svg",pm,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15.75 19.5L8.25 12l7.5-7.5"},null,-1)])])}const hm=n.markRaw({name:"heroicons-chevron-left",render:fm}),gm=(e,t)=>t?.meta?.name?t.meta.name:e.type.replace(/-/g," ").replace(/\b\w/g,o=>o.toUpperCase());function da(){const e=n.inject(Q),{engine:t,getBlockById:o}=Be(),r=e?.blockLabelFunction||gm,i=c=>{const l=o(c);if(!l)return"Unknown Block";const d=t.getBlockSchema(l.type);return r(l,d)};return{getBlockLabel:i,getBlockLabelFromData:(c,l)=>r(c,l),getBlockLabelReactive:c=>n.computed(()=>i(c))}}const mm={key:0,class:"border-b border-gray-200 bg-white px-3 py-2 flex-none"},bm={class:"flex items-center gap-2"},ym=["aria-label"],km={class:"flex-1 text-sm font-medium text-gray-900 truncate"},_m=n.defineComponent({__name:"ConfigurationHeader",props:{isOverlay:{type:Boolean,default:!1}},setup(e){const t=e,{t:o}=le(),{engine:r,moveBlock:i,duplicateBlock:s,toggleBlock:a,removeBlock:c}=Be(),{selectedBlock:l,clearSelection:d}=Bt(),{getBlockLabel:u}=da(),g=n.computed(()=>l.value?u(l.value.id):""),h=n.computed(()=>{if(!l.value)return null;const f=r.getPage(),y=l.value;for(const O of f.regions){const v=O.blocks.indexOf(y.id);if(v!==-1)return{parentType:"region",parentId:O.name,currentIndex:v,siblingCount:O.blocks.length}}if(y.parentId){const O=f.blocks[y.parentId];if(O){const v=O.children.indexOf(y.id);if(v!==-1)return{parentType:"block",parentId:y.parentId,currentIndex:v,siblingCount:O.children.length}}}return null}),p=n.computed(()=>!l.value||l.value?.static?!1:h.value&&h.value.currentIndex>0),m=n.computed(()=>!l.value||l.value?.static?!1:h.value&&h.value.currentIndex<h.value.siblingCount-1);function b(){s(l.value.id)}function k(){if(!l.value||!h.value)return;const f=h.value.currentIndex+1;h.value.parentType==="region"?i(l.value.id,{targetRegionName:h.value.parentId,targetIndex:f}):h.value.parentType==="block"&&i(l.value.id,{targetParentId:h.value.parentId,targetIndex:f})}function w(){if(!l.value||!h.value)return;const f=h.value.currentIndex-1;h.value.parentType==="region"?i(l.value.id,{targetRegionName:h.value.parentId,targetIndex:f}):h.value.parentType==="block"&&i(l.value.id,{targetParentId:h.value.parentId,targetIndex:f})}function E(){l.value&&a(l.value.id)}function B(){!l.value||l.value.static||(c(l.value.id),d())}return(f,y)=>{const O=hm,v=um,_=lm,P=im,x=nm,T=ca,C=la,I=aa;return n.unref(l)?(n.openBlock(),n.createElementBlock("div",mm,[n.createElementVNode("div",bm,[t.isOverlay?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:y[0]||(y[0]=(...R)=>n.unref(d)&&n.unref(d)(...R)),class:"flex-none flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors","aria-label":n.unref(o)("common.close")},[n.createVNode(O,{class:"w-4 h-4 text-gray-600"})],8,ym)):n.createCommentVNode("",!0),n.createElementVNode("h3",km,n.toDisplayString(n.unref(g)),1),n.createVNode(n.unref(Ge).Root,null,{default:n.withCtx(()=>[n.createVNode(n.unref(Ge).Trigger,{class:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-gray-100 transition-colors"},{default:n.withCtx(()=>[n.createVNode(v,{class:"w-4 h-4 text-gray-600"})]),_:1}),n.createVNode(n.unref(Ge).Positioner,null,{default:n.withCtx(()=>[n.createVNode(n.unref(Ge).Content,{class:"bg-white rounded-lg shadow-lg border border-gray-200 py-1 min-w-[160px] z-50 focus:outline-none"},{default:n.withCtx(()=>[n.createVNode(n.unref(Ge).Item,{value:"duplicate",disabled:n.unref(l).static,onSelect:b,class:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(_,{class:"w-4 h-4"}),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("block.duplicate")),1)]),_:1},8,["disabled"]),n.createVNode(n.unref(Ge).Item,{value:"move-next",disabled:!n.unref(p),onSelect:w,class:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(P,{class:"w-4 h-4"}),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("block.moveToPrevious")),1)]),_:1},8,["disabled"]),n.createVNode(n.unref(Ge).Item,{value:"move-next",disabled:!n.unref(m),onSelect:k,class:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(x,{class:"w-4 h-4"}),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("block.moveToNext")),1)]),_:1},8,["disabled"]),n.createVNode(n.unref(Ge).Item,{value:"toggle",onSelect:E,class:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer"},{default:n.withCtx(()=>[n.unref(l).disabled?(n.openBlock(),n.createBlock(T,{key:0,class:"w-4 h-4"})):(n.openBlock(),n.createBlock(C,{key:1,class:"w-4 h-4"})),n.createTextVNode(" "+n.toDisplayString(n.unref(l).disabled?n.unref(o)("block.enable"):n.unref(o)("block.disable")),1)]),_:1}),n.createVNode(n.unref(Ge).Item,{value:"remove",disabled:n.unref(l).static,onSelect:B,class:"flex items-center gap-2 px-3 py-2 text-sm text-red-600 hover:bg-red-50 cursor-pointer data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"},{default:n.withCtx(()=>[n.createVNode(I,{class:"w-4 h-4"}),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("block.remove")),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})])])):n.createCommentVNode("",!0)}}}),wm={class:"h-full w-full flex flex-col bg-white"},xm={class:"flex-1 overflow-y-auto"},Cm={key:1,class:"flex-1 overflow-y-auto"},Em={key:1,class:"h-full flex flex-col items-center justify-center p-6 text-center"},Bm={class:"w-16 h-16 bg-gray-100 rounded-lg flex items-center justify-center mb-4"},Im={class:"text-lg font-medium text-gray-900 mb-2"},Pm={class:"text-sm text-gray-500 max-w-xs"},Om=n.defineComponent({__name:"ConfigurationPanels",props:{isOverlay:{type:Boolean,default:!1}},setup(e){const t=n.inject(Q),{t:o}=le(),{configurationPanels:r}=dt(),{hasSelection:i}=Bt(),s=n.ref("properties"),a=n.computed(()=>r.value.length>=2),c=n.computed(()=>i.value&&r.value.length>0?r.value[0]:null);return(l,d)=>{const u=_m,g=en,h=Kg;return n.openBlock(),n.createElementBlock("div",wm,[n.createVNode(u,{"is-overlay":l.isOverlay,class:"flex-none"},null,8,["is-overlay"]),n.unref(i)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(a)?(n.openBlock(),n.createBlock(n.unref(qe).Root,{key:0,modelValue:n.unref(s),"onUpdate:modelValue":d[0]||(d[0]=p=>n.isRef(s)?s.value=p:null),class:"flex-1 flex flex-col overflow-y-hidden"},{default:n.withCtx(()=>[n.createVNode(n.unref(qe).List,{class:"flex border-b flex-none"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(r),p=>(n.openBlock(),n.createBlock(n.unref(qe).Trigger,{key:p.id,value:p.id,class:"flex items-center gap-0.5 px-1.5 py-2 text-xs font-medium transition-colors text-gray-500 data-selected:border-b-2 data-selected:border-accent data-selected:text-accent hover:text-gray-700"},{default:n.withCtx(()=>[p.icon&&(n.unref(Xe)(p.icon)||n.unref(lt)(p.icon))?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.icon),{key:0,editor:n.unref(t),class:"w-3 h-3"},null,8,["editor"])):p.icon&&n.unref(ct)(p.icon)?(n.openBlock(),n.createBlock(g,{key:1,"render-fn":p.icon,class:"w-3 h-3"},null,8,["render-fn"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(p.title),1)]),_:2},1032,["value"]))),128))]),_:1}),n.createElementVNode("div",xm,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(r),p=>(n.openBlock(),n.createBlock(n.unref(qe).Content,{key:p.id,value:p.id},{default:n.withCtx(()=>[n.unref(Xe)(p.render)||n.unref(lt)(p.render)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.render),{editor:n.unref(t),key:p.id},null,8,["editor"])):n.unref(ct)(p.render)?(n.openBlock(),n.createBlock(g,{key:1,"render-fn":p.render,class:"h-full"},null,8,["render-fn"])):n.createCommentVNode("",!0)]),_:2},1032,["value"]))),128))])]),_:1},8,["modelValue"])):n.unref(c)?(n.openBlock(),n.createElementBlock("div",Cm,[n.unref(Xe)(n.unref(c).render)||n.unref(lt)(n.unref(c).render)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(c).render),{key:0,editor:n.unref(t)},null,8,["editor"])):n.unref(ct)(n.unref(c).render)?(n.openBlock(),n.createBlock(g,{key:1,"render-fn":n.unref(c).render},null,8,["render-fn"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock("div",Em,[n.createElementVNode("div",Bm,[n.createVNode(h,{class:"w-8 h-8 text-gray-400"})]),n.createElementVNode("h3",Im,n.toDisplayString(n.unref(o)("configPanels.properties")),1),n.createElementVNode("p",Pm,n.toDisplayString(n.unref(o)("configPanels.selectedBlock")),1)]))])}}}),vm=n.defineComponent({__name:"AddBlockBtn",props:{blockId:{}},setup(e){const t=e,{open:o,getInsertionContext:r}=Vr(),i=n.ref(null);function s(){i.value&&o({anchor:i.value,context:r(t.blockId,"after")})}return(a,c)=>{const l=Fr;return n.openBlock(),n.createElementBlock("div",{ref_key:"el",ref:i,class:"relative flex items-center w-full h-1.5 transition-colors group rounded"},[c[0]||(c[0]=n.createElementVNode("div",{class:"h-[2px] w-0 bg-accent/70 group-hover:w-full transition-[width] duration-100 absolute left-1/2 transform -translate-x-1/2"},null,-1)),n.createElementVNode("button",{class:"bg-accent text-accent-foreground h-4 w-4 hidden group-hover:flex items-center justify-center absolute left-1/2 transform -translate-x-1/2 rounded-full cursor-pointer hover:ring-2 hover:ring-accent/40",onClick:s},[n.createVNode(l,{class:"w-3 h-3"})])],512)}}}),Tm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Sm(e,t){return n.openBlock(),n.createElementBlock("svg",Tm,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25"},null,-1)])])}const Nm=n.markRaw({name:"heroicons-lock-closed",render:Sm}),Rm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Dm(e,t){return n.openBlock(),n.createElementBlock("svg",Rm,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5m0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25m9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25"},null,-1)])])}const $m=n.markRaw({name:"heroicons-squares-plus",render:Dm}),Am={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Vm(e,t){return n.openBlock(),n.createElementBlock("svg",Am,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m8.25 4.5l7.5 7.5l-7.5 7.5"},null,-1)])])}const Mm=n.markRaw({name:"heroicons-chevron-right",render:Vm});var Fm=Object.defineProperty,wo=Object.getOwnPropertySymbols,ua=Object.prototype.hasOwnProperty,pa=Object.prototype.propertyIsEnumerable,fa=(e,t,o)=>t in e?Fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Gt=(e,t)=>{for(var o in t||(t={}))ua.call(t,o)&&fa(e,o,t[o]);if(wo)for(var o of wo(t))pa.call(t,o)&&fa(e,o,t[o]);return e},ha=(e,t)=>{var o={};for(var r in e)ua.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&wo)for(var r of wo(e))t.indexOf(r)<0&&pa.call(e,r)&&(o[r]=e[r]);return o};const ga="[vue-draggable-plus]: ";function Lm(e){console.warn(ga+e)}function Hm(e){console.error(ga+e)}function ma(e,t,o){return o>=0&&o<e.length&&e.splice(o,0,e.splice(t,1)[0]),e}function Um(e){return e.replace(/-(\w)/g,(t,o)=>o?o.toUpperCase():"")}function jm(e){return Object.keys(e).reduce((t,o)=>(typeof e[o]<"u"&&(t[Um(o)]=e[o]),t),{})}function ba(e,t){return Array.isArray(e)&&e.splice(t,1),e}function ya(e,t,o){return Array.isArray(e)&&e.splice(t,0,o),e}function zm(e){return typeof e>"u"}function Wm(e){return typeof e=="string"}function ka(e,t,o){const r=e.children[o];e.insertBefore(t,r)}function Lr(e){e.parentNode&&e.parentNode.removeChild(e)}function Gm(e,t=document){var o;let r=null;return typeof t?.querySelector=="function"?r=(o=t?.querySelector)==null?void 0:o.call(t,e):r=document.querySelector(e),r||Lm(`Element not found: ${e}`),r}function Km(e,t,o=null){return function(...r){return e.apply(o,r),t.apply(o,r)}}function qm(e,t){const o=Gt({},e);return Object.keys(t).forEach(r=>{o[r]?o[r]=Km(e[r],t[r]):o[r]=t[r]}),o}function Xm(e){return e instanceof HTMLElement}function _a(e,t){Object.keys(e).forEach(o=>{t(o,e[o])})}function Ym(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}const Jm=Object.assign;/**!
3
+ * Sortable 1.15.2
4
+ * @author RubaXa <trash@rubaxa.org>
5
+ * @author owenm <owen23355@gmail.com>
6
+ * @license MIT
7
+ */function wa(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function Me(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?wa(Object(o),!0).forEach(function(r){Zm(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):wa(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function xo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xo=function(t){return typeof t}:xo=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(e)}function Zm(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Ye(){return Ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},Ye.apply(this,arguments)}function Qm(e,t){if(e==null)return{};var o={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(o[i]=e[i]);return o}function eb(e,t){if(e==null)return{};var o=Qm(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var tb="1.15.2";function Je(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Ze=Je(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Bn=Je(/Edge/i),xa=Je(/firefox/i),In=Je(/safari/i)&&!Je(/chrome/i)&&!Je(/android/i),Ca=Je(/iP(ad|od|hone)/i),Ea=Je(/chrome/i)&&Je(/android/i),Ba={capture:!1,passive:!1};function z(e,t,o){e.addEventListener(t,o,!Ze&&Ba)}function L(e,t,o){e.removeEventListener(t,o,!Ze&&Ba)}function Co(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function nb(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ie(e,t,o,r){if(e){o=o||document;do{if(t!=null&&(t[0]===">"?e.parentNode===o&&Co(e,t):Co(e,t))||r&&e===o)return e;if(e===o)break}while(e=nb(e))}return null}var Ia=/\s+/g;function me(e,t,o){if(e&&t)if(e.classList)e.classList[o?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Ia," ").replace(" "+t+" "," ");e.className=(r+(o?" "+t:"")).replace(Ia," ")}}function $(e,t,o){var r=e&&e.style;if(r){if(o===void 0)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),t===void 0?o:o[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=o+(typeof o=="string"?"":"px")}}function Kt(e,t){var o="";if(typeof e=="string")o=e;else do{var r=$(e,"transform");r&&r!=="none"&&(o=r+" "+o)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(o)}function Pa(e,t,o){if(e){var r=e.getElementsByTagName(t),i=0,s=r.length;if(o)for(;i<s;i++)o(r[i],i);return r}return[]}function Fe(){var e=document.scrollingElement;return e||document.documentElement}function J(e,t,o,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var s,a,c,l,d,u,g;if(e!==window&&e.parentNode&&e!==Fe()?(s=e.getBoundingClientRect(),a=s.top,c=s.left,l=s.bottom,d=s.right,u=s.height,g=s.width):(a=0,c=0,l=window.innerHeight,d=window.innerWidth,u=window.innerHeight,g=window.innerWidth),(t||o)&&e!==window&&(i=i||e.parentNode,!Ze))do if(i&&i.getBoundingClientRect&&($(i,"transform")!=="none"||o&&$(i,"position")!=="static")){var h=i.getBoundingClientRect();a-=h.top+parseInt($(i,"border-top-width")),c-=h.left+parseInt($(i,"border-left-width")),l=a+s.height,d=c+s.width;break}while(i=i.parentNode);if(r&&e!==window){var p=Kt(i||e),m=p&&p.a,b=p&&p.d;p&&(a/=b,c/=m,g/=m,u/=b,l=a+u,d=c+g)}return{top:a,left:c,bottom:l,right:d,width:g,height:u}}}function Oa(e,t,o){for(var r=ut(e,!0),i=J(e)[t];r;){var s=J(r)[o],a=void 0;if(a=i>=s,!a)return r;if(r===Fe())break;r=ut(r,!1)}return!1}function qt(e,t,o,r){for(var i=0,s=0,a=e.children;s<a.length;){if(a[s].style.display!=="none"&&a[s]!==A.ghost&&(r||a[s]!==A.dragged)&&Ie(a[s],o.draggable,e,!1)){if(i===t)return a[s];i++}s++}return null}function Hr(e,t){for(var o=e.lastElementChild;o&&(o===A.ghost||$(o,"display")==="none"||t&&!Co(o,t));)o=o.previousElementSibling;return o||null}function we(e,t){var o=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==A.clone&&(!t||Co(e,t))&&o++;return o}function va(e){var t=0,o=0,r=Fe();if(e)do{var i=Kt(e),s=i.a,a=i.d;t+=e.scrollLeft*s,o+=e.scrollTop*a}while(e!==r&&(e=e.parentNode));return[t,o]}function ob(e,t){for(var o in e)if(e.hasOwnProperty(o)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[o][r])return Number(o)}return-1}function ut(e,t){if(!e||!e.getBoundingClientRect)return Fe();var o=e,r=!1;do if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var i=$(o);if(o.clientWidth<o.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||o.clientHeight<o.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!o.getBoundingClientRect||o===document.body)return Fe();if(r||t)return o;r=!0}}while(o=o.parentNode);return Fe()}function rb(e,t){if(e&&t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function Ur(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Pn;function Ta(e,t){return function(){if(!Pn){var o=arguments,r=this;o.length===1?e.call(r,o[0]):e.apply(r,o),Pn=setTimeout(function(){Pn=void 0},t)}}}function ib(){clearTimeout(Pn),Pn=void 0}function Sa(e,t,o){e.scrollLeft+=t,e.scrollTop+=o}function Na(e){var t=window.Polymer,o=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):o?o(e).clone(!0)[0]:e.cloneNode(!0)}function Ra(e,t,o){var r={};return Array.from(e.children).forEach(function(i){var s,a,c,l;if(!(!Ie(i,t.draggable,e,!1)||i.animated||i===o)){var d=J(i);r.left=Math.min((s=r.left)!==null&&s!==void 0?s:1/0,d.left),r.top=Math.min((a=r.top)!==null&&a!==void 0?a:1/0,d.top),r.right=Math.max((c=r.right)!==null&&c!==void 0?c:-1/0,d.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,d.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var be="Sortable"+new Date().getTime();function sb(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!($(r,"display")==="none"||r===A.ghost)){e.push({target:r,rect:J(r)});var i=Me({},e[e.length-1].rect);if(r.thisAnimationDuration){var s=Kt(r,!0);s&&(i.top-=s.f,i.left-=s.e)}r.fromRect=i}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ob(e,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var i=!1,s=0;e.forEach(function(a){var c=0,l=a.target,d=l.fromRect,u=J(l),g=l.prevFromRect,h=l.prevToRect,p=a.rect,m=Kt(l,!0);m&&(u.top-=m.f,u.left-=m.e),l.toRect=u,l.thisAnimationDuration&&Ur(g,u)&&!Ur(d,u)&&(p.top-u.top)/(p.left-u.left)===(d.top-u.top)/(d.left-u.left)&&(c=lb(p,g,h,r.options)),Ur(u,d)||(l.prevFromRect=d,l.prevToRect=u,c||(c=r.options.animation),r.animate(l,p,u,c)),c&&(i=!0,s=Math.max(s,c),clearTimeout(l.animationResetTimer),l.animationResetTimer=setTimeout(function(){l.animationTime=0,l.prevFromRect=null,l.fromRect=null,l.prevToRect=null,l.thisAnimationDuration=null},c),l.thisAnimationDuration=c)}),clearTimeout(t),i?t=setTimeout(function(){typeof o=="function"&&o()},s):typeof o=="function"&&o(),e=[]},animate:function(o,r,i,s){if(s){$(o,"transition",""),$(o,"transform","");var a=Kt(this.el),c=a&&a.a,l=a&&a.d,d=(r.left-i.left)/(c||1),u=(r.top-i.top)/(l||1);o.animatingX=!!d,o.animatingY=!!u,$(o,"transform","translate3d("+d+"px,"+u+"px,0)"),this.forRepaintDummy=ab(o),$(o,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),$(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){$(o,"transition",""),$(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},s)}}}}function ab(e){return e.offsetWidth}function lb(e,t,o,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-o.top,2)+Math.pow(t.left-o.left,2))*r.animation}var Xt=[],jr={initializeByDefault:!0},On={mount:function(e){for(var t in jr)jr.hasOwnProperty(t)&&!(t in e)&&(e[t]=jr[t]);Xt.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Xt.push(e)},pluginEvent:function(e,t,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";Xt.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][i]&&t[s.pluginName][i](Me({sortable:t},o)),t.options[s.pluginName]&&t[s.pluginName][e]&&t[s.pluginName][e](Me({sortable:t},o)))})},initializePlugins:function(e,t,o,r){Xt.forEach(function(a){var c=a.pluginName;if(!(!e.options[c]&&!a.initializeByDefault)){var l=new a(e,t,e.options);l.sortable=e,l.options=e.options,e[c]=l,Ye(o,l.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var s=this.modifyOption(e,i,e.options[i]);typeof s<"u"&&(e.options[i]=s)}},getEventProperties:function(e,t){var o={};return Xt.forEach(function(r){typeof r.eventProperties=="function"&&Ye(o,r.eventProperties.call(t[r.pluginName],e))}),o},modifyOption:function(e,t,o){var r;return Xt.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]=="function"&&(r=i.optionListeners[t].call(e[i.pluginName],o))}),r}};function cb(e){var t=e.sortable,o=e.rootEl,r=e.name,i=e.targetEl,s=e.cloneEl,a=e.toEl,c=e.fromEl,l=e.oldIndex,d=e.newIndex,u=e.oldDraggableIndex,g=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t=t||o&&o[be],!!t){var b,k=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Ze&&!Bn?b=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent(r,!0,!0)),b.to=a||o,b.from=c||o,b.item=i||o,b.clone=s,b.oldIndex=l,b.newIndex=d,b.oldDraggableIndex=u,b.newDraggableIndex=g,b.originalEvent=h,b.pullMode=p?p.lastPutMode:void 0;var E=Me(Me({},m),On.getEventProperties(r,t));for(var B in E)b[B]=E[B];o&&o.dispatchEvent(b),k[w]&&k[w].call(t,b)}}var db=["evt"],fe=function(e,t){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=eb(o,db);On.pluginEvent.bind(A)(e,t,Me({dragEl:S,parentEl:X,ghostEl:M,rootEl:G,nextEl:It,lastDownEl:Eo,cloneEl:q,cloneHidden:pt,dragStarted:Tn,putSortable:oe,activeSortable:A.active,originalEvent:r,oldIndex:Yt,oldDraggableIndex:vn,newIndex:ye,newDraggableIndex:ft,hideGhostForTarget:La,unhideGhostForTarget:Ha,cloneNowHidden:function(){pt=!0},cloneNowShown:function(){pt=!1},dispatchSortableEvent:function(s){ce({sortable:t,name:s,originalEvent:r})}},i))};function ce(e){cb(Me({putSortable:oe,cloneEl:q,targetEl:S,rootEl:G,oldIndex:Yt,oldDraggableIndex:vn,newIndex:ye,newDraggableIndex:ft},e))}var S,X,M,G,It,Eo,q,pt,Yt,ye,vn,ft,Bo,oe,Jt=!1,Io=!1,Po=[],Pt,Pe,zr,Wr,Da,$a,Tn,Zt,Sn,Nn=!1,Oo=!1,vo,ie,Gr=[],Kr=!1,To=[],So=typeof document<"u",No=Ca,Aa=Bn||Ze?"cssFloat":"float",ub=So&&!Ea&&!Ca&&"draggable"in document.createElement("div"),Va=(function(){if(So){if(Ze)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),Ma=function(e,t){var o=$(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=qt(e,0,t),s=qt(e,1,t),a=i&&$(i),c=s&&$(s),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+J(i).width,d=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+J(s).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return s&&(c.clear==="both"||c.clear===u)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||l>=r&&o[Aa]==="none"||s&&o[Aa]==="none"&&l+d>r)?"vertical":"horizontal"},pb=function(e,t,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,s=o?e.width:e.height,a=o?t.left:t.top,c=o?t.right:t.bottom,l=o?t.width:t.height;return r===a||i===c||r+s/2===a+l/2},fb=function(e,t){var o;return Po.some(function(r){var i=r[be].options.emptyInsertThreshold;if(!(!i||Hr(r))){var s=J(r),a=e>=s.left-i&&e<=s.right+i,c=t>=s.top-i&&t<=s.bottom+i;if(a&&c)return o=r}}),o},Fa=function(e){function t(i,s){return function(a,c,l,d){var u=a.options.group.name&&c.options.group.name&&a.options.group.name===c.options.group.name;if(i==null&&(s||u))return!0;if(i==null||i===!1)return!1;if(s&&i==="clone")return i;if(typeof i=="function")return t(i(a,c,l,d),s)(a,c,l,d);var g=(s?a:c).options.group.name;return i===!0||typeof i=="string"&&i===g||i.join&&i.indexOf(g)>-1}}var o={},r=e.group;(!r||xo(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=t(r.pull,!0),o.checkPut=t(r.put),o.revertClone=r.revertClone,e.group=o},La=function(){!Va&&M&&$(M,"display","none")},Ha=function(){!Va&&M&&$(M,"display","")};So&&!Ea&&document.addEventListener("click",function(e){if(Io)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Io=!1,!1},!0);var Ot=function(e){if(S){e=e.touches?e.touches[0]:e;var t=fb(e.clientX,e.clientY);if(t){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=t,o.preventDefault=void 0,o.stopPropagation=void 0,t[be]._onDragOver(o)}}},hb=function(e){S&&S.parentNode[be]._isOutsideThisEl(e.target)};function A(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Ye({},t),e[be]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ma(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:A.supportPointer!==!1&&"PointerEvent"in window&&!In,emptyInsertThreshold:5};On.initializePlugins(this,e,o);for(var r in o)!(r in t)&&(t[r]=o[r]);Fa(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:ub,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?z(e,"pointerdown",this._onTapStart):(z(e,"mousedown",this._onTapStart),z(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(z(e,"dragover",this),z(e,"dragenter",this)),Po.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Ye(this,sb())}A.prototype={constructor:A,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Zt=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,S):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,o=this.el,r=this.options,i=r.preventOnFilter,s=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(a||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,d=r.filter;if(xb(o),!S&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||r.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&In&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Ie(c,r.draggable,o,!1),!(c&&c.animated)&&Eo!==c)){if(Yt=we(c),vn=we(c,r.draggable),typeof d=="function"){if(d.call(this,e,c,this)){ce({sortable:t,rootEl:l,name:"filter",targetEl:c,toEl:o,fromEl:o}),fe("filter",t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(u){if(u=Ie(l,u.trim(),o,!1),u)return ce({sortable:t,rootEl:u,name:"filter",targetEl:c,fromEl:o,toEl:o}),fe("filter",t,{evt:e}),!0}),d)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!Ie(l,r.handle,o,!1)||this._prepareDragStart(e,a,c)}}},_prepareDragStart:function(e,t,o){var r=this,i=r.el,s=r.options,a=i.ownerDocument,c;if(o&&!S&&o.parentNode===i){var l=J(o);if(G=i,S=o,X=S.parentNode,It=S.nextSibling,Eo=o,Bo=s.group,A.dragged=S,Pt={target:S,clientX:(t||e).clientX,clientY:(t||e).clientY},Da=Pt.clientX-l.left,$a=Pt.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,S.style["will-change"]="all",c=function(){if(fe("delayEnded",r,{evt:e}),A.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!xa&&r.nativeDraggable&&(S.draggable=!0),r._triggerDragStart(e,t),ce({sortable:r,name:"choose",originalEvent:e}),me(S,s.chosenClass,!0)},s.ignore.split(",").forEach(function(d){Pa(S,d.trim(),qr)}),z(a,"dragover",Ot),z(a,"mousemove",Ot),z(a,"touchmove",Ot),z(a,"mouseup",r._onDrop),z(a,"touchend",r._onDrop),z(a,"touchcancel",r._onDrop),xa&&this.nativeDraggable&&(this.options.touchStartThreshold=4,S.draggable=!0),fe("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Bn||Ze))){if(A.eventCanceled){this._onDrop();return}z(a,"mouseup",r._disableDelayedDrag),z(a,"touchend",r._disableDelayedDrag),z(a,"touchcancel",r._disableDelayedDrag),z(a,"mousemove",r._delayedDragTouchMoveHandler),z(a,"touchmove",r._delayedDragTouchMoveHandler),s.supportPointer&&z(a,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(c,s.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){S&&qr(S),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;L(e,"mouseup",this._disableDelayedDrag),L(e,"touchend",this._disableDelayedDrag),L(e,"touchcancel",this._disableDelayedDrag),L(e,"mousemove",this._delayedDragTouchMoveHandler),L(e,"touchmove",this._delayedDragTouchMoveHandler),L(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?z(document,"pointermove",this._onTouchMove):t?z(document,"touchmove",this._onTouchMove):z(document,"mousemove",this._onTouchMove):(z(S,"dragend",this),z(G,"dragstart",this._onDragStart));try{document.selection?Do(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Jt=!1,G&&S){fe("dragStarted",this,{evt:t}),this.nativeDraggable&&z(document,"dragover",hb);var o=this.options;!e&&me(S,o.dragClass,!1),me(S,o.ghostClass,!0),A.active=this,e&&this._appendGhost(),ce({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Pe){this._lastX=Pe.clientX,this._lastY=Pe.clientY,La();for(var e=document.elementFromPoint(Pe.clientX,Pe.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Pe.clientX,Pe.clientY),e!==t);)t=e;if(S.parentNode[be]._isOutsideThisEl(e),t)do{if(t[be]){var o=void 0;if(o=t[be]._onDragOver({clientX:Pe.clientX,clientY:Pe.clientY,target:e,rootEl:t}),o&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Ha()}},_onTouchMove:function(e){if(Pt){var t=this.options,o=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,s=M&&Kt(M,!0),a=M&&s&&s.a,c=M&&s&&s.d,l=No&&ie&&va(ie),d=(i.clientX-Pt.clientX+r.x)/(a||1)+(l?l[0]-Gr[0]:0)/(a||1),u=(i.clientY-Pt.clientY+r.y)/(c||1)+(l?l[1]-Gr[1]:0)/(c||1);if(!A.active&&!Jt){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(M){s?(s.e+=d-(zr||0),s.f+=u-(Wr||0)):s={a:1,b:0,c:0,d:1,e:d,f:u};var g="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");$(M,"webkitTransform",g),$(M,"mozTransform",g),$(M,"msTransform",g),$(M,"transform",g),zr=d,Wr=u,Pe=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!M){var e=this.options.fallbackOnBody?document.body:G,t=J(S,!0,No,!0,e),o=this.options;if(No){for(ie=e;$(ie,"position")==="static"&&$(ie,"transform")==="none"&&ie!==document;)ie=ie.parentNode;ie!==document.body&&ie!==document.documentElement?(ie===document&&(ie=Fe()),t.top+=ie.scrollTop,t.left+=ie.scrollLeft):ie=Fe(),Gr=va(ie)}M=S.cloneNode(!0),me(M,o.ghostClass,!1),me(M,o.fallbackClass,!0),me(M,o.dragClass,!0),$(M,"transition",""),$(M,"transform",""),$(M,"box-sizing","border-box"),$(M,"margin",0),$(M,"top",t.top),$(M,"left",t.left),$(M,"width",t.width),$(M,"height",t.height),$(M,"opacity","0.8"),$(M,"position",No?"absolute":"fixed"),$(M,"zIndex","100000"),$(M,"pointerEvents","none"),A.ghost=M,e.appendChild(M),$(M,"transform-origin",Da/parseInt(M.style.width)*100+"% "+$a/parseInt(M.style.height)*100+"%")}},_onDragStart:function(e,t){var o=this,r=e.dataTransfer,i=o.options;if(fe("dragStart",this,{evt:e}),A.eventCanceled){this._onDrop();return}fe("setupClone",this),A.eventCanceled||(q=Na(S),q.removeAttribute("id"),q.draggable=!1,q.style["will-change"]="",this._hideClone(),me(q,this.options.chosenClass,!1),A.clone=q),o.cloneId=Do(function(){fe("clone",o),!A.eventCanceled&&(o.options.removeCloneOnHide||G.insertBefore(q,S),o._hideClone(),ce({sortable:o,name:"clone"}))}),!t&&me(S,i.dragClass,!0),t?(Io=!0,o._loopId=setInterval(o._emulateDragOver,50)):(L(document,"mouseup",o._onDrop),L(document,"touchend",o._onDrop),L(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,S)),z(document,"drop",o),$(S,"transform","translateZ(0)")),Jt=!0,o._dragStartId=Do(o._dragStarted.bind(o,t,e)),z(document,"selectstart",o),Tn=!0,In&&$(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,o=e.target,r,i,s,a=this.options,c=a.group,l=A.active,d=Bo===c,u=a.sort,g=oe||l,h,p=this,m=!1;if(Kr)return;function b(j,Y){fe(j,p,Me({evt:e,isOwner:d,axis:h?"vertical":"horizontal",revert:s,dragRect:r,targetRect:i,canSort:u,fromSortable:g,target:o,completed:w,onMove:function(se,W){return Ro(G,t,S,r,se,J(se),e,W)},changed:E},Y))}function k(){b("dragOverAnimationCapture"),p.captureAnimationState(),p!==g&&g.captureAnimationState()}function w(j){return b("dragOverCompleted",{insertion:j}),j&&(d?l._hideClone():l._showClone(p),p!==g&&(me(S,oe?oe.options.ghostClass:l.options.ghostClass,!1),me(S,a.ghostClass,!0)),oe!==p&&p!==A.active?oe=p:p===A.active&&oe&&(oe=null),g===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){b("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==g&&(g.animateAll(),g._ignoreWhileAnimating=null)),(o===S&&!S.animated||o===t&&!o.animated)&&(Zt=null),!a.dragoverBubble&&!e.rootEl&&o!==document&&(S.parentNode[be]._isOutsideThisEl(e.target),!j&&Ot(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function E(){ye=we(S),ft=we(S,a.draggable),ce({sortable:p,name:"change",toEl:t,newIndex:ye,newDraggableIndex:ft,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=Ie(o,a.draggable,t,!0),b("dragOver"),A.eventCanceled)return m;if(S.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return w(!1);if(Io=!1,l&&!a.disabled&&(d?u||(s=X!==G):oe===this||(this.lastPutMode=Bo.checkPull(this,l,S,e))&&c.checkPut(this,l,S,e))){if(h=this._getDirection(e,o)==="vertical",r=J(S),b("dragOverValid"),A.eventCanceled)return m;if(s)return X=G,k(),this._hideClone(),b("revert"),A.eventCanceled||(It?G.insertBefore(S,It):G.appendChild(S)),w(!0);var B=Hr(t,a.draggable);if(!B||yb(e,h,this)&&!B.animated){if(B===S)return w(!1);if(B&&t===e.target&&(o=B),o&&(i=J(o)),Ro(G,t,S,r,o,i,e,!!o)!==!1)return k(),B&&B.nextSibling?t.insertBefore(S,B.nextSibling):t.appendChild(S),X=t,E(),w(!0)}else if(B&&bb(e,h,this)){var f=qt(t,0,a,!0);if(f===S)return w(!1);if(o=f,i=J(o),Ro(G,t,S,r,o,i,e,!1)!==!1)return k(),t.insertBefore(S,f),X=t,E(),w(!0)}else if(o.parentNode===t){i=J(o);var y=0,O,v=S.parentNode!==t,_=!pb(S.animated&&S.toRect||r,o.animated&&o.toRect||i,h),P=h?"top":"left",x=Oa(o,"top","top")||Oa(S,"top","top"),T=x?x.scrollTop:void 0;Zt!==o&&(O=i[P],Nn=!1,Oo=!_&&a.invertSwap||v),y=kb(e,o,i,h,_?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Oo,Zt===o);var C;if(y!==0){var I=we(S);do I-=y,C=X.children[I];while(C&&($(C,"display")==="none"||C===M))}if(y===0||C===o)return w(!1);Zt=o,Sn=y;var R=o.nextElementSibling,V=!1;V=y===1;var H=Ro(G,t,S,r,o,i,e,V);if(H!==!1)return(H===1||H===-1)&&(V=H===1),Kr=!0,setTimeout(mb,30),k(),V&&!R?t.appendChild(S):o.parentNode.insertBefore(S,V?R:o),x&&Sa(x,0,T-x.scrollTop),X=S.parentNode,O!==void 0&&!Oo&&(vo=Math.abs(O-J(o)[P])),E(),w(!0)}if(t.contains(S))return w(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){L(document,"mousemove",this._onTouchMove),L(document,"touchmove",this._onTouchMove),L(document,"pointermove",this._onTouchMove),L(document,"dragover",Ot),L(document,"mousemove",Ot),L(document,"touchmove",Ot)},_offUpEvents:function(){var e=this.el.ownerDocument;L(e,"mouseup",this._onDrop),L(e,"touchend",this._onDrop),L(e,"pointerup",this._onDrop),L(e,"touchcancel",this._onDrop),L(document,"selectstart",this)},_onDrop:function(e){var t=this.el,o=this.options;if(ye=we(S),ft=we(S,o.draggable),fe("drop",this,{evt:e}),X=S&&S.parentNode,ye=we(S),ft=we(S,o.draggable),A.eventCanceled){this._nulling();return}Jt=!1,Oo=!1,Nn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Xr(this.cloneId),Xr(this._dragStartId),this.nativeDraggable&&(L(document,"drop",this),L(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),In&&$(document.body,"user-select",""),$(S,"transform",""),e&&(Tn&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),M&&M.parentNode&&M.parentNode.removeChild(M),(G===X||oe&&oe.lastPutMode!=="clone")&&q&&q.parentNode&&q.parentNode.removeChild(q),S&&(this.nativeDraggable&&L(S,"dragend",this),qr(S),S.style["will-change"]="",Tn&&!Jt&&me(S,oe?oe.options.ghostClass:this.options.ghostClass,!1),me(S,this.options.chosenClass,!1),ce({sortable:this,name:"unchoose",toEl:X,newIndex:null,newDraggableIndex:null,originalEvent:e}),G!==X?(ye>=0&&(ce({rootEl:X,name:"add",toEl:X,fromEl:G,originalEvent:e}),ce({sortable:this,name:"remove",toEl:X,originalEvent:e}),ce({rootEl:X,name:"sort",toEl:X,fromEl:G,originalEvent:e}),ce({sortable:this,name:"sort",toEl:X,originalEvent:e})),oe&&oe.save()):ye!==Yt&&ye>=0&&(ce({sortable:this,name:"update",toEl:X,originalEvent:e}),ce({sortable:this,name:"sort",toEl:X,originalEvent:e})),A.active&&((ye==null||ye===-1)&&(ye=Yt,ft=vn),ce({sortable:this,name:"end",toEl:X,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){fe("nulling",this),G=S=X=M=It=q=Eo=pt=Pt=Pe=Tn=ye=ft=Yt=vn=Zt=Sn=oe=Bo=A.dragged=A.ghost=A.clone=A.active=null,To.forEach(function(e){e.checked=!0}),To.length=zr=Wr=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":S&&(this._onDragOver(e),gb(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,o=this.el.children,r=0,i=o.length,s=this.options;r<i;r++)t=o[r],Ie(t,s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||wb(t));return e},sort:function(e,t){var o={},r=this.el;this.toArray().forEach(function(i,s){var a=r.children[s];Ie(a,this.options.draggable,r,!1)&&(o[i]=a)},this),t&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ie(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var o=this.options;if(t===void 0)return o[e];var r=On.modifyOption(this,e,t);typeof r<"u"?o[e]=r:o[e]=t,e==="group"&&Fa(o)},destroy:function(){fe("destroy",this);var e=this.el;e[be]=null,L(e,"mousedown",this._onTapStart),L(e,"touchstart",this._onTapStart),L(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(L(e,"dragover",this),L(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Po.splice(Po.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!pt){if(fe("hideClone",this),A.eventCanceled)return;$(q,"display","none"),this.options.removeCloneOnHide&&q.parentNode&&q.parentNode.removeChild(q),pt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(pt){if(fe("showClone",this),A.eventCanceled)return;S.parentNode==G&&!this.options.group.revertClone?G.insertBefore(q,S):It?G.insertBefore(q,It):G.appendChild(q),this.options.group.revertClone&&this.animate(S,q),$(q,"display",""),pt=!1}}};function gb(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Ro(e,t,o,r,i,s,a,c){var l,d=e[be],u=d.options.onMove,g;return window.CustomEvent&&!Ze&&!Bn?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=o,l.draggedRect=r,l.related=i||t,l.relatedRect=s||J(t),l.willInsertAfter=c,l.originalEvent=a,e.dispatchEvent(l),u&&(g=u.call(d,l,a)),g}function qr(e){e.draggable=!1}function mb(){Kr=!1}function bb(e,t,o){var r=J(qt(o.el,0,o.options,!0)),i=Ra(o.el,o.options,M),s=10;return t?e.clientX<i.left-s||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-s||e.clientY<r.bottom&&e.clientX<r.left}function yb(e,t,o){var r=J(Hr(o.el,o.options.draggable)),i=Ra(o.el,o.options,M),s=10;return t?e.clientX>i.right+s||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+s||e.clientX>r.right&&e.clientY>r.top}function kb(e,t,o,r,i,s,a,c){var l=r?e.clientY:e.clientX,d=r?o.height:o.width,u=r?o.top:o.left,g=r?o.bottom:o.right,h=!1;if(!a){if(c&&vo<d*i){if(!Nn&&(Sn===1?l>u+d*s/2:l<g-d*s/2)&&(Nn=!0),Nn)h=!0;else if(Sn===1?l<u+vo:l>g-vo)return-Sn}else if(l>u+d*(1-i)/2&&l<g-d*(1-i)/2)return _b(t)}return h=h||a,h&&(l<u+d*s/2||l>g-d*s/2)?l>u+d/2?1:-1:0}function _b(e){return we(S)<we(e)?1:-1}function wb(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,o=t.length,r=0;o--;)r+=t.charCodeAt(o);return r.toString(36)}function xb(e){To.length=0;for(var t=e.getElementsByTagName("input"),o=t.length;o--;){var r=t[o];r.checked&&To.push(r)}}function Do(e){return setTimeout(e,0)}function Xr(e){return clearTimeout(e)}So&&z(document,"touchmove",function(e){(A.active||Jt)&&e.cancelable&&e.preventDefault()}),A.utils={on:z,off:L,css:$,find:Pa,is:function(e,t){return!!Ie(e,t,e,!1)},extend:rb,throttle:Ta,closest:Ie,toggleClass:me,clone:Na,index:we,nextTick:Do,cancelNextTick:Xr,detectDirection:Ma,getChild:qt},A.get=function(e){return e[be]},A.mount=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t[0].constructor===Array&&(t=t[0]),t.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(A.utils=Me(Me({},A.utils),r.utils)),On.mount(r)})},A.create=function(e,t){return new A(e,t)},A.version=tb;var Z=[],Rn,Yr,Jr=!1,Zr,Qr,$o,Dn;function Cb(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(t){var o=t.originalEvent;this.sortable.nativeDraggable?z(document,"dragover",this._handleAutoScroll):this.options.supportPointer?z(document,"pointermove",this._handleFallbackAutoScroll):o.touches?z(document,"touchmove",this._handleFallbackAutoScroll):z(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var o=t.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?L(document,"dragover",this._handleAutoScroll):(L(document,"pointermove",this._handleFallbackAutoScroll),L(document,"touchmove",this._handleFallbackAutoScroll),L(document,"mousemove",this._handleFallbackAutoScroll)),Ua(),Ao(),ib()},nulling:function(){$o=Yr=Rn=Jr=Dn=Zr=Qr=null,Z.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,o){var r=this,i=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=document.elementFromPoint(i,s);if($o=t,o||this.options.forceAutoScrollFallback||Bn||Ze||In){ei(t,this.options,a,o);var c=ut(a,!0);Jr&&(!Dn||i!==Zr||s!==Qr)&&(Dn&&Ua(),Dn=setInterval(function(){var l=ut(document.elementFromPoint(i,s),!0);l!==c&&(c=l,Ao()),ei(t,r.options,l,o)},10),Zr=i,Qr=s)}else{if(!this.options.bubbleScroll||ut(a,!0)===Fe()){Ao();return}ei(t,this.options,ut(a,!1),!1)}}},Ye(e,{pluginName:"scroll",initializeByDefault:!0})}function Ao(){Z.forEach(function(e){clearInterval(e.pid)}),Z=[]}function Ua(){clearInterval(Dn)}var ei=Ta(function(e,t,o,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,c=t.scrollSpeed,l=Fe(),d=!1,u;Yr!==o&&(Yr=o,Ao(),Rn=t.scroll,u=t.scrollFn,Rn===!0&&(Rn=ut(o,!0)));var g=0,h=Rn;do{var p=h,m=J(p),b=m.top,k=m.bottom,w=m.left,E=m.right,B=m.width,f=m.height,y=void 0,O=void 0,v=p.scrollWidth,_=p.scrollHeight,P=$(p),x=p.scrollLeft,T=p.scrollTop;p===l?(y=B<v&&(P.overflowX==="auto"||P.overflowX==="scroll"||P.overflowX==="visible"),O=f<_&&(P.overflowY==="auto"||P.overflowY==="scroll"||P.overflowY==="visible")):(y=B<v&&(P.overflowX==="auto"||P.overflowX==="scroll"),O=f<_&&(P.overflowY==="auto"||P.overflowY==="scroll"));var C=y&&(Math.abs(E-i)<=a&&x+B<v)-(Math.abs(w-i)<=a&&!!x),I=O&&(Math.abs(k-s)<=a&&T+f<_)-(Math.abs(b-s)<=a&&!!T);if(!Z[g])for(var R=0;R<=g;R++)Z[R]||(Z[R]={});(Z[g].vx!=C||Z[g].vy!=I||Z[g].el!==p)&&(Z[g].el=p,Z[g].vx=C,Z[g].vy=I,clearInterval(Z[g].pid),(C!=0||I!=0)&&(d=!0,Z[g].pid=setInterval((function(){r&&this.layer===0&&A.active._onTouchMove($o);var V=Z[this.layer].vy?Z[this.layer].vy*c:0,H=Z[this.layer].vx?Z[this.layer].vx*c:0;typeof u=="function"&&u.call(A.dragged.parentNode[be],H,V,e,$o,Z[this.layer].el)!=="continue"||Sa(Z[this.layer].el,H,V)}).bind({layer:g}),24))),g++}while(t.bubbleScroll&&h!==l&&(h=ut(h,!1)));Jr=d}},30),ja=function(e){var t=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,s=e.dispatchSortableEvent,a=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var l=o||i;a();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(d.clientX,d.clientY);c(),l&&!l.el.contains(u)&&(s("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function ti(){}ti.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=qt(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),o&&o.animateAll()},drop:ja},Ye(ti,{pluginName:"revertOnSpill"});function ni(){}ni.prototype={onSpill:function(e){var t=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),r.animateAll()},drop:ja},Ye(ni,{pluginName:"removeOnSpill"}),A.mount(new Cb),A.mount(ni,ti);function Eb(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Bb(e){n.getCurrentInstance()&&n.onUnmounted(e)}function Ib(e){n.getCurrentInstance()?n.onMounted(e):n.nextTick(e)}let za=null,Wa=null;function Ga(e=null,t=null){za=e,Wa=t}function Pb(){return{data:za,clonedData:Wa}}const Ka=Symbol("cloneElement");function Ob(...e){var t,o;const r=(t=n.getCurrentInstance())==null?void 0:t.proxy;let i=null;const s=e[0];let[,a,c]=e;Array.isArray(n.unref(a))||(c=a,a=null);let l=null;const{immediate:d=!0,clone:u=Eb,customUpdate:g}=(o=n.unref(c))!=null?o:{};function h(_){var P;const{from:x,oldIndex:T,item:C}=_;i=Array.from(x.childNodes);const I=n.unref((P=n.unref(a))==null?void 0:P[T]),R=u(I);Ga(I,R),C[Ka]=R}function p(_){const P=_.item[Ka];if(!zm(P)){if(Lr(_.item),n.isRef(a)){const x=[...n.unref(a)];a.value=ya(x,_.newDraggableIndex,P);return}ya(n.unref(a),_.newDraggableIndex,P)}}function m(_){const{from:P,item:x,oldIndex:T,oldDraggableIndex:C,pullMode:I,clone:R}=_;if(ka(P,x,T),I==="clone"){Lr(R);return}if(n.isRef(a)){const V=[...n.unref(a)];a.value=ba(V,C);return}ba(n.unref(a),C)}function b(_){if(g){g(_);return}const{from:P,item:x,oldIndex:T,oldDraggableIndex:C,newDraggableIndex:I}=_;if(Lr(x),ka(P,x,T),n.isRef(a)){const R=[...n.unref(a)];a.value=ma(R,C,I);return}ma(n.unref(a),C,I)}function k(_){const{newIndex:P,oldIndex:x,from:T,to:C}=_;let I=null;const R=P===x&&T===C;try{if(R){let V=null;i?.some((H,j)=>{if(V&&i?.length!==C.childNodes.length)return T.insertBefore(V,H.nextSibling),!0;const Y=C.childNodes[j];V=C?.replaceChild(H,Y)})}}catch(V){I=V}finally{i=null}n.nextTick(()=>{if(Ga(),I)throw I})}const w={onUpdate:b,onStart:h,onAdd:p,onRemove:m,onEnd:k};function E(_){const P=n.unref(s);return _||(_=Wm(P)?Gm(P,r?.$el):P),_&&!Xm(_)&&(_=_.$el),_||Hm("Root element not found"),_}function B(){var _;const P=(_=n.unref(c))!=null?_:{},{immediate:x,clone:T}=P,C=ha(P,["immediate","clone"]);return _a(C,(I,R)=>{Ym(I)&&(C[I]=(V,...H)=>{const j=Pb();return Jm(V,j),R(V,...H)})}),qm(a===null?{}:w,C)}const f=_=>{_=E(_),l&&y.destroy(),l=new A(_,B())};n.watch(()=>c,()=>{l&&_a(B(),(_,P)=>{l?.option(_,P)})},{deep:!0});const y={option:(_,P)=>l?.option(_,P),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(..._)=>l?.closest(..._)},O=()=>y?.option("disabled",!0),v=()=>y?.option("disabled",!1);return Ib(()=>{d&&f()}),Bb(y.destroy),Gt({start:f,pause:O,resume:v},y)}const oi=["update","start","add","remove","choose","unchoose","end","sort","filter","clone","move","change"],vb=["clone","animation","ghostClass","group","sort","disabled","store","handle","draggable","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","chosenClass","dragClass","ignore","filter","preventOnFilter","easing","setData","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","emptyInsertThreshold","scroll","forceAutoScrollFallback","scrollSensitivity","scrollSpeed","bubbleScroll","modelValue","tag","target","customUpdate",...oi.map(e=>`on${e.replace(/^\S/,t=>t.toUpperCase())}`)],Tb=n.defineComponent({name:"VueDraggable",model:{prop:"modelValue",event:"update:modelValue"},props:vb,emits:["update:modelValue",...oi],setup(e,{slots:t,emit:o,expose:r,attrs:i}){const s=oi.reduce((u,g)=>{const h=`on${g.replace(/^\S/,p=>p.toUpperCase())}`;return u[h]=(...p)=>o(g,...p),u},{}),a=n.computed(()=>{const u=n.toRefs(e),{modelValue:g}=u,h=ha(u,["modelValue"]),p=Object.entries(h).reduce((m,[b,k])=>{const w=n.unref(k);return w!==void 0&&(m[b]=w),m},{});return Gt(Gt({},s),jm(Gt(Gt({},i),p)))}),c=n.computed({get:()=>e.modelValue,set:u=>o("update:modelValue",u)}),l=n.ref(),d=n.reactive(Ob(e.target||l,c,a));return r(d),()=>{var u;return n.h(e.tag||"div",{ref:l},(u=t?.default)==null?void 0:u.call(t,d))}}});function Sb(e){const{engine:t,blocks:o,getBlockById:r,getChildrenBlocks:i,setBlockProperty:s,toggleBlock:a,removeBlock:c,duplicateBlock:l,moveBlock:d,regions:u}=Be(),g=n.computed(()=>r(e)),h=n.computed(()=>g.value?.properties||{}),p=n.computed(()=>g.value?.type),m=n.computed(()=>g.value?.disabled),b=n.computed(()=>{if(g.value)return t.getBlockSchema(g.value.type)}),k=n.computed(()=>{if(w.value)return w.value.children?.indexOf(e)??-1;for(const I of u.value){const R=I.blocks.indexOf(e);if(R!==-1)return R}}),w=n.computed(()=>{if(g.value){for(const I of u.value)if(I.blocks.includes(e))return;for(const I of Object.values(o.value))if(I.children?.includes(e))return I}}),E=n.computed(()=>i(e)),B=n.computed(()=>{if(!(k.value===void 0||k.value<=0)){if(w.value){const I=w.value.children[k.value-1];return r(I)}for(const I of u.value)if(I.blocks.includes(e)){const R=I.blocks[k.value-1];return r(R)}}}),f=n.computed(()=>{if(!(k.value===void 0||k.value<0)){if(w.value){if(k.value>=w.value.children.length-1)return;const I=w.value.children[k.value+1];return r(I)}for(const I of u.value)if(I.blocks.includes(e)){if(k.value>=I.blocks.length-1)return;const R=I.blocks[k.value+1];return r(R)}}}),y=n.computed(()=>w.value===void 0),O=n.computed(()=>E.value.length>0),v=n.computed(()=>b.value?.accepts&&b.value.accepts.length>0||O.value);return{block:g,properties:h,type:p,disabled:m,schema:b,index:k,parent:w,children:E,isRootLevel:y,hasChildren:O,canHaveChildren:v,previousSibling:B,nextSibling:f,setProperty:(I,R)=>{s(e,I,R)},toggle:I=>{a(e,I)},remove:()=>{c(e)},duplicate:()=>l(e),moveChild:(I,R)=>{d(I,{targetParentId:e,targetIndex:R})}}}const Nb=["data-block-id","data-selected"],Rb={key:1,class:"w-4 h-full"},Db={class:"w-4 h-4 mr-1 flex items-center justify-center relative"},$b={class:"flex-1"},Ab={class:"flex items-center gap-0.5"},Vb=["title"],Mb=["title"],Fb={key:0,class:"ml-3 py-1"},Lb={key:1,class:"ml-3 space-y-1"},Hb=n.defineComponent({__name:"BlockItem",props:{blockId:{},level:{},isDragging:{type:Boolean}},setup(e){const t=e,{t:o}=le(),r=n.ref(!1),{block:i,children:s,hasChildren:a,canHaveChildren:c,nextSibling:l,toggle:d,remove:u,moveChild:g}=Sb(t.blockId),{isExpanded:h,toggleExpanded:p}=Mr(),{getBlockLabelReactive:m}=da(),{selectedBlockId:b,selectBlock:k}=Bt(),w=n.computed(()=>b.value===t.blockId),E=n.computed(()=>h(t.blockId)),B=n.computed(()=>i.value?.static===!0),f=m(t.blockId),y=n.computed(()=>!l.value||l.value.static!==!0);function O(){}function v(P){const{oldIndex:x,newIndex:T}=P;if(typeof T>"u"||x===T)return;const C=s.value[x];C&&g(C.id,T)}function _(P){if(P.related&&P.related.classList.contains("is-static"))return!1}return(P,x)=>{const T=Mm,C=$m,I=Nm,R=aa,V=la,H=ca,j=Fr,Y=n.resolveComponent("BlockItem",!0),se=vm;return n.unref(i)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass({"bg-gray-100":n.unref(r),"is-static":n.unref(B)})},[n.createElementVNode("div",{"data-block-id":n.unref(i).id,"data-selected":n.unref(w)?"true":void 0,class:n.normalizeClass(["flex items-center h-8 text-sm hover:bg-gray-50 data-selected:bg-accent/10 data-selected:border data-selected:border-accent/20 data-selected:hover:bg-accent/10 cursor-pointer rounded-md group transition-all duration-200",{"text-gray-700":!n.unref(i).disabled,"text-gray-400":n.unref(i).disabled}]),onClick:x[3]||(x[3]=W=>n.unref(k)(n.unref(i).id))},[n.unref(c)?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:x[0]||(x[0]=n.withModifiers(()=>n.unref(p)(t.blockId),["stop"])),class:"h-full mr-0.5 px-1 flex items-center justify-center hover:bg-gray-200 rounded cursor-pointer"},[n.createVNode(T,{class:n.normalizeClass(["w-3 h-3 transition-transform duration-200",{"rotate-90":n.unref(E)}])},null,8,["class"])])):(n.openBlock(),n.createElementBlock("div",Rb)),n.createElementVNode("div",Db,[n.createVNode(C,{class:n.normalizeClass([{"group-hover:opacity-0":n.unref(B)},"transition-opacity"])},null,8,["class"]),n.unref(B)?(n.openBlock(),n.createBlock(I,{key:0,class:"w-4 h-4 absolute opacity-0 group-hover:opacity-100 transition-opacity text-gray-400"})):n.createCommentVNode("",!0)]),n.createElementVNode("span",$b,n.toDisplayString(n.unref(f)),1),n.createElementVNode("div",Ab,[n.withDirectives(n.createElementVNode("button",{onClick:x[1]||(x[1]=n.withModifiers((...W)=>n.unref(u)&&n.unref(u)(...W),["stop"])),class:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors opacity-0 group-hover:opacity-100",title:n.unref(o)("block.remove")},[n.createVNode(R,{class:"w-4 h-4"})],8,Vb),[[n.vShow,!n.unref(i).disabled&&!n.unref(B)]]),n.createElementVNode("button",{onClick:x[2]||(x[2]=n.withModifiers(()=>n.unref(d)(),["stop"])),class:n.normalizeClass(["p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",{"opacity-100":n.unref(i).disabled,"opacity-0 group-hover:opacity-100":!n.unref(i).disabled}]),title:n.unref(i).disabled?n.unref(o)("block.show"):n.unref(o)("block.hide")},[n.unref(i).disabled?(n.openBlock(),n.createBlock(V,{key:0,class:"w-4 h-4"})):(n.openBlock(),n.createBlock(H,{key:1,class:"w-4 h-4"}))],10,Mb)])],10,Nb),!n.unref(a)&&n.unref(E)?(n.openBlock(),n.createElementBlock("div",Fb,[n.createElementVNode("button",{onClick:O,class:"flex items-center gap-1.5 w-full p-1.5 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded transition-colors"},[n.createVNode(j,{class:"w-3 h-3"}),n.createElementVNode("span",null,n.toDisplayString(n.unref(o)("layers.addBlockToBlock")),1)])])):n.createCommentVNode("",!0),n.unref(a)&&n.unref(E)?(n.openBlock(),n.createElementBlock("div",Lb,[n.createVNode(n.unref(Tb),{"model-value":n.unref(i).children,animation:200,"ghost-class":"ghost-block","chosen-class":"chosen-block","drag-class":"drag-block",filter:".is-static",onEnd:v,onMove:_},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s),W=>(n.openBlock(),n.createBlock(Y,{key:W.id,"block-id":W.id,level:P.level+1},null,8,["block-id","level"]))),128))]),_:1},8,["model-value"])])):n.createCommentVNode("",!0),n.unref(y)?(n.openBlock(),n.createBlock(se,{key:`add-block-${n.unref(i).id}`,"block-id":n.unref(i).id,onMouseenter:x[4]||(x[4]=W=>r.value=!0),onMouseleave:x[5]||(x[5]=W=>r.value=!1)},null,8,["block-id"])):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0)}}}),ri=(e,t)=>{const o=e.__vccOpts||e;for(const[r,i]of t)o[r]=i;return o},Ub={},jb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"w-4 h-4"};function zb(e,t){return n.openBlock(),n.createElementBlock("svg",jb,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M4 2a2 2 0 0 0-2 2v10h2V4h10V2zm4 4a2 2 0 0 0-2 2v10h2V8h10V6zm12 6v8h-8v-8zm0-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2m-1 7h-6v-2h6z"},null,-1)])])}const Wb=ri(Ub,[["render",zb]]),Gb={class:"h-full flex flex-col overflow-y-hidden"},Kb={class:"flex-none h-12 flex items-center border-b px-4"},qb={class:"flex-1 overflow-y-auto"},Xb={class:"flex items-center justify-between"},Yb={class:"text-sm capitalize"},Jb=["title","onClick"],Zb={class:"my-2"},Qb=n.defineComponent({__name:"LayersPanel",setup(e){const{t}=le(),{regions:o}=Be(),{collapseRegion:r}=Mr(),i=n.computed(()=>Array.isArray(o.value)?o.value:[]);return(s,a)=>{const c=Hb;return n.openBlock(),n.createElementBlock("div",Gb,[n.createElementVNode("div",Kb,[n.createElementVNode("h2",null,n.toDisplayString(n.unref(t)("layers.header")),1)]),n.createElementVNode("div",qb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),l=>(n.openBlock(),n.createElementBlock("div",{key:l.name,class:"not-last:border-b px-4 mt-2"},[n.createElementVNode("div",Xb,[n.createElementVNode("h3",Yb,n.toDisplayString(l.name),1),l.blocks.length>0?(n.openBlock(),n.createElementBlock("button",{key:0,class:"p-1 hover:bg-gray-200 rounded text-gray-500 hover:text-gray-700 transition-colors",title:n.unref(t)("layers.collapseAll"),onClick:d=>n.unref(r)(l.name)},[n.createVNode(Wb,{class:"w-4 h-4"})],8,Jb)):n.createCommentVNode("",!0)]),n.createElementVNode("div",Zb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.blocks,d=>(n.openBlock(),n.createBlock(c,{key:d,"block-id":d,level:0},null,8,["block-id"]))),128))])]))),128))])])}}}),ey={class:"h-full w-75 border-r flex-none relative"},ty=n.defineComponent({__name:"Panels",setup(e){const t=n.inject(Q),{activeSidebarPanel:o,sidebarPanels:r}=dt(),i=n.computed(()=>r.value.find(s=>s.id===o.value));return(s,a)=>{const c=Qb,l=en;return n.openBlock(),n.createElementBlock("aside",ey,[n.unref(o)==="layers"?(n.openBlock(),n.createBlock(c,{key:0,class:"h-full"})):n.unref(i)?(n.openBlock(),n.createBlock(n.KeepAlive,{key:1},[n.unref(Xe)(n.unref(i).render)||n.unref(lt)(n.unref(i).render)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(i).render),{key:0,editor:n.unref(t),class:"h-full"},null,8,["editor"])):n.unref(ct)(n.unref(i).render)?(n.openBlock(),n.createBlock(l,{key:1,"render-fn":n.unref(i).render,class:"h-full"},null,8,["render-fn"])):n.createCommentVNode("",!0)],1024)):n.createCommentVNode("",!0)])}}}),ny={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oy(e,t){return n.openBlock(),n.createElementBlock("svg",ny,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M6.429 9.75L2.25 12l4.179 2.25m0-4.5l5.571 3l5.571-3m-11.142 0L2.25 7.5L12 2.25l9.75 5.25l-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0l4.179 2.25L12 21.75L2.25 16.5l4.179-2.25m11.142 0l-5.571 3l-5.571-3"},null,-1)])])}const ry=n.markRaw({name:"heroicons-square3-stack3d",render:oy}),iy={class:"h-full w-14 border-r bg-white"},sy={class:"flex flex-col gap-1 p-1.5"},ay=["title"],ly=["onClick","title"],cy={key:2},dy=n.defineComponent({__name:"Sidebar",setup(e){const{t}=le(),{activeSidebarPanel:o,setActiveSidebarPanel:r,sidebarPanels:i}=dt(),s=n.inject(Q);return(a,c)=>{const l=ry,d=en;return n.openBlock(),n.createElementBlock("div",iy,[n.createElementVNode("div",sy,[n.createElementVNode("button",{onClick:c[0]||(c[0]=u=>n.unref(r)("layers")),class:n.normalizeClass(["aspect-square flex items-center justify-center rounded-md cursor-pointer transition-colors",n.unref(o)==="layers"?"bg-accent-foreground text-accent":"hover:bg-gray-100 text-gray-700"]),title:n.unref(t)("layers.title")},[n.createVNode(l,{class:"w-5"})],10,ay),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),u=>(n.openBlock(),n.createElementBlock("button",{key:"panel-icon-"+u.id,onClick:g=>n.unref(r)(u.id),class:n.normalizeClass(["aspect-square flex items-center justify-center rounded-md cursor-pointer transition-colors text-sm font-medium",n.unref(o)===u.id?"bg-accent-foreground text-accent":"hover:bg-gray-100 text-gray-700"]),title:u.title},[u.icon&&(n.unref(Xe)(u.icon)||n.unref(lt)(u.icon))?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(u.icon),{key:0,editor:n.unref(s),class:"w-5 h-5"},null,8,["editor"])):u.icon&&n.unref(ct)(u.icon)?(n.openBlock(),n.createBlock(d,{key:1,"render-fn":u.icon,class:"w-5 h-5"},null,8,["render-fn"])):(n.openBlock(),n.createElementBlock("span",cy,n.toDisplayString(u.title.charAt(0).toUpperCase()),1))],10,ly))),128))])])}}}),uy=["type","disabled"],Qt=n.defineComponent({__name:"Button",props:{variant:{default:"default"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},square:{type:Boolean,default:!1}},setup(e){const t={default:"bg-white text-gray-900 hover:bg-gray-50 border border-gray-200",primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90",accent:"bg-accent text-accent-foreground hover:bg-accent/90",sutble:"bg-accent-foreground text-accent shadow",destructive:"bg-red-600 text-white hover:bg-red-700"},o={sm:"h-6 px-3 text-xs",md:"h-8 px-4",lg:"h-10 px-6 text-base"},r={sm:"w-6 h-6 text-xs p-0",md:"w-8 h-8 p-0",lg:"w-10 h-10 text-base p-0"},i=e;return(s,a)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass(["inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none cursor-pointer",[t[s.variant],i.square?r[s.size]:o[s.size],s.fullWidth&&"w-full"]]),type:s.type,disabled:i.disabled},[n.renderSlot(s.$slots,"default")],10,uy))}}),py=n.defineComponent({__name:"HeaderActionRenderer",props:{action:{}},setup(e){const t=n.inject(Q);return(o,r)=>{const i=Qt,s=en;return n.openBlock(),n.createBlock(n.KeepAlive,null,[o.action.button?(n.openBlock(),n.createBlock(i,{key:0,variant:o.action.button.variant||"default",onClick:o.action.button.onClick},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(o.action.button.text),1)]),_:1},8,["variant","onClick"])):n.unref(Xe)(o.action.render)||n.unref(lt)(o.action.render)?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.action.render),{key:1,editor:n.unref(t)},null,8,["editor"])):n.unref(ct)(o.action.render)?(n.openBlock(),n.createBlock(s,{key:2,"render-fn":o.action.render},null,8,["render-fn"])):n.createCommentVNode("",!0)],1024)}}}),fy={class:"h-14 flex items-center justify-between relative z-50 px-4 border-b bg-white"},hy={class:"flex items-center gap-3"},gy={class:"flex items-center gap-3"},my={class:"flex items-center gap-3"},by=n.defineComponent({__name:"Header",setup(e){const{headerActions:t}=dt(),o=n.computed(()=>t.value.filter(s=>s.slot==="left")),r=n.computed(()=>t.value.filter(s=>s.slot==="center")),i=n.computed(()=>t.value.filter(s=>s.slot==="right"));return(s,a)=>{const c=py;return n.openBlock(),n.createElementBlock("header",fy,[n.createElementVNode("div",hy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),l=>(n.openBlock(),n.createBlock(c,{key:l.id,action:l},null,8,["action"]))),128))]),n.createElementVNode("div",gy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(r),l=>(n.openBlock(),n.createBlock(c,{key:l.id,action:l},null,8,["action"]))),128))]),n.createElementVNode("div",my,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),l=>(n.openBlock(),n.createBlock(c,{key:l.id,action:l},null,8,["action"]))),128))])])}}}),$n={small:640,medium:768,large:1024,extraLarge:1280,extraExtraLarge:1536};function yy(){const e=n.ref(0),t=()=>{e.value=window.innerWidth},o=n.computed(()=>e.value>=$n.small),r=n.computed(()=>e.value>=$n.medium),i=n.computed(()=>e.value>=$n.large),s=n.computed(()=>e.value>=$n.extraLarge),a=n.computed(()=>e.value>=$n.extraExtraLarge);return n.onMounted(()=>{t(),window.addEventListener("resize",t)}),n.onUnmounted(()=>{window.removeEventListener("resize",t)}),{width:e,isSmall:o,isMedium:r,isLarge:i,isExtraLarge:s,isExtraExtraLarge:a}}const ky={class:"h-full w-full flex flex-col overflow-hidden"},_y={class:"flex-1 flex overflow-hidden relative"},wy={key:0,class:"absolute left-14 top-0 h-full w-75 z-10"},xy={class:"flex-1 p-3 bg-gray-100 overflow-auto preview-container flex justify-center"},Cy={key:1,class:"h-full flex-none overflow-y-hidden w-75 border-l"},Ey=n.defineComponent({__name:"Editor",setup(e){const{isExtraExtraLarge:t}=yy(),{hasSelection:o}=Bt(),{keyboardShortcuts:r}=dt(),i=n.inject(Q),s=a=>{const c=[a.ctrlKey&&"ctrl",a.metaKey&&"meta",a.shiftKey&&"shift",a.altKey&&"alt",a.key.toLowerCase()].filter(Boolean).join("+"),l=r.value.get(c);l&&(a.preventDefault(),a.stopPropagation(),l.handler({editor:i}))};return(a,c)=>{const l=by,d=dy,u=ty,g=Om,h=zg,p=gg,m=Qh,b=jh;return n.openBlock(),n.createElementBlock("div",{class:"__craftile",style:{height:"100%",width:"100%"},tabindex:"0",onKeydown:s},[n.createElementVNode("div",ky,[n.createVNode(l),n.createElementVNode("main",_y,[n.createVNode(d),n.createVNode(u),n.unref(o)&&!n.unref(t)?(n.openBlock(),n.createElementBlock("div",wy,[n.createVNode(g,{"is-overlay":""})])):n.createCommentVNode("",!0),n.createElementVNode("div",xy,[n.createVNode(h)]),n.unref(t)?(n.openBlock(),n.createElementBlock("aside",Cy,[n.createVNode(g)])):n.createCommentVNode("",!0)])]),n.createVNode(p),n.createVNode(m),n.createVNode(b)],32)}}});class By{events;state;toaster;constructor(t){this.events=t,this.state=n.reactive({activeSidebarPanel:"layers",sidebarPanels:new Map,headerActions:new Map,configurationPanels:new Map,modals:new Map,openModals:[],keyboardShortcuts:new Map,propertyFields:new Map,selectedBlockId:null,layersPanel:{expandedBlocks:new Set}}),this.toaster=Nh({placement:"bottom",overlap:!0,gap:16})}generateId(t){return t+"-"+(Date.now().toString(36)+Math.random().toString(36).substr(2))}setSelectedBlock(t){this.state.selectedBlockId=t,this.events.emit("ui:block:select",{blockId:t})}clearSelectedBlock(){this.state.selectedBlockId=null,this.events.emit("ui:block:clear-selection",{blockId:null})}toast(t){typeof t=="string"?this.toaster.create({description:t,type:"info"}):this.toaster.create(t)}registerSidebarPanel(t){const o={...t,id:t.id||this.generateId("sidebar-panel"),render:typeof t.render=="object"?n.markRaw(t.render):t.render,icon:t.icon&&typeof t.icon=="object"?n.markRaw(t.icon):t.icon};this.state.sidebarPanels.set(o.id,o)}removeSidebarPanel(t){this.state.sidebarPanels.delete(t)}registerHeaderAction(t){if(!t.render&&!t.button)throw new Error("HeaderAction must have either a render or button configuration");if(t.render&&t.button)throw new Error("HeaderAction cannot have both render and button configurations");const o={...t,id:t.id||this.generateId("header-action"),render:typeof t.render=="object"?n.markRaw(t.render):t.render};this.state.headerActions.set(o.id,o)}removeHeaderAction(t){this.state.headerActions.delete(t)}registerConfigurationPanel(t){const o={...t,id:t.id||this.generateId("config-panel"),render:typeof t.render=="object"?n.markRaw(t.render):t.render,icon:t.icon&&typeof t.icon=="object"?n.markRaw(t.icon):t.icon};this.state.configurationPanels.set(o.id,o)}removeConfigurationPanel(t){this.state.configurationPanels.delete(t)}registerPropertyField(t){const o={...t,render:typeof t.render=="object"?n.markRaw(t.render):t.render};this.state.propertyFields.set(t.type,o)}removePropertyField(t){this.state.propertyFields.delete(t)}registerModal(t){const o={...t,id:t.id||this.generateId("modal"),render:typeof t.render=="object"?n.markRaw(t.render):t.render};this.state.modals.set(o.id,o)}unregisterModal(t){this.state.modals.delete(t),this.closeModal(t)}openModal(t){this.state.openModals.includes(t)||(this.state.openModals.push(t),this.events.emit("ui:modal:open",{modalId:t}))}closeModal(t){const o=this.state.openModals.indexOf(t);o>=0&&(this.state.openModals.splice(o,1),this.events.emit("ui:modal:close",{modalId:t}))}registerKeyboardShortcut(t){this.state.keyboardShortcuts.set(t.key,t)}removeKeyboardShortcut(t){this.state.keyboardShortcuts.delete(t)}}const Iy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Py(e,t){return n.openBlock(),n.createElementBlock("svg",Iy,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10.5 19.5h3m-6.75 2.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-15a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 4.5v15a2.25 2.25 0 0 0 2.25 2.25"},null,-1)])])}const qa=n.markRaw({name:"heroicons-device-tablet",render:Py}),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vy(e,t){return n.openBlock(),n.createElementBlock("svg",Oy,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"},null,-1)])])}const Xa=n.markRaw({name:"heroicons-computer-desktop",render:vy}),Ty={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Sy(e,t){return n.openBlock(),n.createElementBlock("svg",Ty,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"},null,-1)])])}const Ny=n.markRaw({name:"heroicons-device-phone-mobile",render:Sy}),Ry={class:"text-xs whitespace-nowrap capitalize max-w-[120px] overflow-hidden text-ellipsis"},Dy={class:"flex items-center justify-between px-4 py-3 border-b border-solid"},$y={class:"text-sm font-semibold text-gray-900 m-0"},Ay={class:"rounded cursor-pointer text-gray-500 transition-all duration-200 flex items-center justify-center p-1 hover:text-gray-700"},Vy={class:"flex flex-col gap-1 p-2"},My=["onClick"],Fy={class:"text-xs ml-auto"},Ly={class:"px-4 py-3 border-t"},Hy={class:"text-[13px] font-semibold text-gray-700 mt-0 mb-3 mx-0"},Uy={class:"flex flex-wrap gap-2"},jy={class:"flex-1"},zy={for:"custom-width",class:"block text-xs text-gray-500 mb-1"},Wy={class:"mt-4"},Gy={class:"flex flex-col gap-1 mt-2"},Ky=["onClick"],qy={class:"flex-1"},Xy=["onClick"],Yy={inheritAttrs:!1},Jy=n.defineComponent({...Yy,__name:"DeviceModeSwitcher",setup(e){const{t}=le(),{currentDevice:o,currentDeviceData:r,devicePresets:i,savedCustomDevices:s,setDeviceMode:a,addCustomDevice:c,removeCustomDevice:l}=sa(),d=n.ref(!1),u=n.ref(768),g={desktop:Xa,tablet:qa,mobile:Ny},h=w=>g[w||"desktop"]||Xa,p=()=>h(r.value.icon),m=w=>{a(w),d.value=!1},b=()=>{const w=`custom-${u.value}`;c({id:w,label:`${t("common.custom")} ${u.value}px`,width:u.value}),a(w),d.value=!1},k=w=>{l(w)};return(w,E)=>{const B=Ar,f=Qt,y=Fo,O=qa;return n.openBlock(),n.createBlock(n.unref(Ke).Root,{open:n.unref(d),"onUpdate:open":E[1]||(E[1]=v=>n.isRef(d)?d.value=v:null),positioning:{placement:"top-end",gutter:0}},{default:n.withCtx(()=>[n.createVNode(n.unref(Ke).Trigger,{"as-child":""},{default:n.withCtx(()=>[n.createVNode(f,{class:"gap-1"},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p()),{class:"device-icon"})),n.createElementVNode("span",Ry,n.toDisplayString(n.unref(r).label),1),n.createVNode(n.unref(Ke).Indicator,{"as-child":""},{default:n.withCtx(()=>[n.createVNode(B,{class:"w-3.5 h-3.5 transition-transform duration-200 data-[state=open]:rotate-180"})]),_:1})]),_:1})]),_:1}),n.createVNode(n.unref(Ke).Positioner,null,{default:n.withCtx(()=>[n.createVNode(n.unref(Ke).Content,{class:"w-72 border shadow-xs overflow-hidden mt-1 rounded-lg bg-white"},{default:n.withCtx(()=>[n.createElementVNode("div",Dy,[n.createElementVNode("h4",$y,n.toDisplayString(n.unref(t)("header.devicePreview")),1),n.createVNode(n.unref(Ke).CloseTrigger,{"as-child":""},{default:n.withCtx(()=>[n.createElementVNode("button",Ay,[n.createVNode(y,{class:"w-4 h-4"})])]),_:1})]),n.createElementVNode("div",Vy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(i),v=>(n.openBlock(),n.createElementBlock("button",{key:v.id,class:n.normalizeClass(["flex items-center gap-2 cursor-pointer text-left text-sm text-gray-700 transition-[background] duration-[0.2s] px-3 py-2.5 rounded-md border-[none]",{"text-accent! bg-accent/8":n.unref(o)===v.id}]),onClick:_=>m(v.id)},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(h(v.icon)),{class:"w-5 h-5"})),n.createElementVNode("span",null,n.toDisplayString(v.label),1),n.createElementVNode("span",Fy,n.toDisplayString(v.width===0?n.unref(t)("header.auto"):v.width+"px"),1)],10,My))),128))]),n.createElementVNode("div",Ly,[n.createElementVNode("h5",Hy,n.toDisplayString(n.unref(t)("header.customDeviceSize")),1),n.createElementVNode("div",Uy,[n.createElementVNode("div",jy,[n.createElementVNode("label",zy,n.toDisplayString(n.unref(t)("header.deviceWidthPx")),1),n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":E[0]||(E[0]=v=>n.isRef(u)?u.value=v:null),type:"number",id:"custom-width",min:"320",max:"2560",class:"w-full border rounded text-sm px-3 py-2"},null,512),[[n.vModelText,n.unref(u)]])]),n.createElementVNode("button",{class:"w-full text-accent-foreground bg-accent rounded text-[13px] font-medium cursor-pointer transition-[background] duration-[0.2s] mt-2 p-2 border-[none]",onClick:b},n.toDisplayString(n.unref(t)("header.apply")),1)]),n.createElementVNode("div",Wy,[n.createElementVNode("h5",null,n.toDisplayString(n.unref(t)("header.savedCustomDevices")),1),n.createElementVNode("div",Gy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s),(v,_)=>(n.openBlock(),n.createElementBlock("div",{key:_,role:"button",class:n.normalizeClass(["flex items-center gap-2 rounded text-left text-sm text-gray-700 px-3 py-2 cursor-pointer",{"text-accent! bg-accent/8":n.unref(o)===`custom-${v.width}`}]),onClick:P=>m(`custom-${v.width}`)},[n.createVNode(O,{class:"w-5 h-5 flex-none"}),n.createElementVNode("span",qy,n.toDisplayString(v.width)+"px",1),n.createElementVNode("button",{class:"flex-none rounded cursor-pointer text-gray-500 flex items-center justify-center transition-all duration-[0.2s] p-1 border-[none] hover:text-red-600",onClick:n.withModifiers(P=>k(v.id),["stop"])},[n.createVNode(y)],8,Xy)],10,Ky))),128))])])])]),_:1})]),_:1})]),_:1},8,["open"])}}}),Zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qy(e,t){return n.openBlock(),n.createElementBlock("svg",Zy,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"},null,-1)])])}const ek=n.markRaw({name:"heroicons-arrow-left",render:Qy}),tk={};function nk(e,t){const o=ek,r=Qt;return n.openBlock(),n.createBlock(r,{square:"",title:"Back"},{default:n.withCtx(()=>[n.createVNode(o)]),_:1})}const ok=ri(tk,[["render",nk]]),rk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ik(e,t){return n.openBlock(),n.createElementBlock("svg",rk,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"m15 15l6-6m0 0l-6-6m6 6H9a6 6 0 0 0 0 12h3"},null,-1)])])}const sk=n.markRaw({name:"heroicons-arrow-uturn-right",render:ik}),ak=n.defineComponent({__name:"RedoButton",setup(e){const{t}=le(),{redo:o,canRedo:r}=Be(),i=()=>{o()};return(s,a)=>{const c=sk,l=Qt;return n.openBlock(),n.createBlock(l,{square:"",disabled:!n.unref(r),onClick:i,title:n.unref(t)("header.redo")},{default:n.withCtx(()=>[n.createVNode(c)]),_:1},8,["disabled","title"])}}}),lk={},ck={class:"text-xl"};function dk(e,t){return n.openBlock(),n.createElementBlock("h1",ck,"Craftile Editor")}const uk=ri(lk,[["render",dk]]),pk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fk(e,t){return n.openBlock(),n.createElementBlock("svg",pk,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 15L3 9m0 0l6-6M3 9h12a6 6 0 0 1 0 12h-3"},null,-1)])])}const hk=n.markRaw({name:"heroicons-arrow-uturn-left",render:fk}),gk=n.defineComponent({__name:"UndoButton",setup(e){const{t}=le(),{undo:o,canUndo:r}=Be(),i=()=>{o()};return(s,a)=>{const c=hk,l=Qt;return n.openBlock(),n.createBlock(l,{square:"",disabled:!n.unref(r),onClick:i,title:n.unref(t)("header.undo")},{default:n.withCtx(()=>[n.createVNode(c)]),_:1},8,["disabled","title"])}}}),mk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bk(e,t){return n.openBlock(),n.createElementBlock("svg",mk,[...t[0]||(t[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225l.569-9.47l5.227 7.917zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"},null,-1)])])}const yk=n.markRaw({name:"heroicons-cursor-arrow-rays",render:bk}),kk=n.defineComponent({__name:"ToggleInspector",setup(e){const{t}=le(),{isEnabled:o,toggle:r}=_o();return(i,s)=>{const a=yk,c=Qt;return n.openBlock(),n.createBlock(c,{onClick:n.unref(r),variant:n.unref(o)?"sutble":"default",square:"",title:n.unref(o)?n.unref(t)("header.disableInspector"):n.unref(t)("header.enableInspector")},{default:n.withCtx(()=>[n.createVNode(a,{class:"w-4 h-4"})]),_:1},8,["onClick","variant","title"])}}});function _k(e){e.registerHeaderAction({id:"back-button",slot:"left",render:ok,order:-20}),e.registerHeaderAction({id:"title",slot:"left",render:uk,order:-10}),e.registerHeaderAction({id:"device-mode",slot:"right",render:Jy,order:-40}),e.registerHeaderAction({id:"inspection-mode",slot:"right",render:kk,order:-30}),e.registerHeaderAction({id:"undo",slot:"right",render:gk,order:-20}),e.registerHeaderAction({id:"redo",slot:"right",render:ak,order:-10})}const Ya=({editor:e})=>{const t=e.engine;t&&t.canUndo()&&t.undo()},ii=({editor:e})=>{const t=e.engine;t&&t.canRedo()&&t.redo()};function wk(e){e.registerKeyboardShortcut({key:"ctrl+z",handler:Ya}),e.registerKeyboardShortcut({key:"meta+z",handler:Ya}),e.registerKeyboardShortcut({key:"ctrl+y",handler:ii}),e.registerKeyboardShortcut({key:"ctrl+shift+z",handler:ii}),e.registerKeyboardShortcut({key:"meta+shift+z",handler:ii})}class xk{state;devicePresets;constructor(t={}){const o={id:"fit",label:"Auto",width:0,icon:"desktop"},r=t.presets?.filter(a=>a.id!=="fit");r&&r.length>0?this.devicePresets=[o,...r]:this.devicePresets=[o,{id:"desktop",label:"Desktop",width:1440,icon:"desktop"},{id:"laptop",label:"Laptop",width:1024,icon:"desktop"},{id:"tablet",label:"Tablet",width:768,icon:"tablet"},{id:"mobile",label:"Mobile",width:375,icon:"mobile"},{id:"mobile-sm",label:"Small Mobile",width:320,icon:"mobile"}];const i=t.default||"fit",s=this.devicePresets.some(a=>a.id===i);this.state=n.reactive({currentDevice:s?i:"fit",savedCustomDevices:[]})}getCurrentDeviceData(){const t=this.devicePresets.find(r=>r.id===this.state.currentDevice);if(t)return t;const o=this.state.savedCustomDevices.find(r=>r.id===this.state.currentDevice);return o||this.devicePresets[0]}setDeviceMode(t){this.state.currentDevice=t}addCustomDevice(t){this.state.savedCustomDevices.push(t)}removeCustomDevice(t){const o=this.state.savedCustomDevices.findIndex(r=>r.id===t);o>-1&&this.state.savedCustomDevices.splice(o,1),this.state.currentDevice===t&&(this.state.currentDevice="fit")}getAllDevices(){return[...this.devicePresets,...this.state.savedCustomDevices]}}const Ck=n.defineComponent({__name:"PropertyFieldRenderWrapper",props:{renderFn:{type:Function},field:{},value:{},onChange:{type:Function},onBlur:{type:Function},class:{}},setup(e){const t=e,o=n.ref(),r=()=>{if(o.value&&t.renderFn){o.value.innerHTML="";const i=t.renderFn({field:t.field,value:t.value,onChange:t.onChange,onBlur:t.onBlur});o.value.appendChild(i)}};return n.onMounted(()=>{r()}),n.watch(()=>t.value,()=>{r()}),(i,s)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"containerRef",ref:o,class:n.normalizeClass(t.class)},null,2))}}),Ek={key:2,class:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md"},Bk={class:"text-sm text-red-600"},Ik={class:"font-mono"},Pk=n.defineComponent({__name:"PropertyField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,r=t,{t:i}=le(),{propertyFields:s}=dt(),a=n.computed(()=>s.value.get(o.field.type)?.render),c=l=>{r("update:modelValue",l)};return(l,d)=>{const u=Ck;return n.openBlock(),n.createElementBlock("div",null,[n.unref(Xe)(n.unref(a))||n.unref(lt)(n.unref(a))?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(a)),{key:0,field:l.field,"model-value":l.modelValue,"onUpdate:modelValue":c},null,8,["field","model-value"])):n.unref(ct)(n.unref(a))?(n.openBlock(),n.createBlock(u,{key:1,"render-fn":n.unref(a),field:l.field,value:l.modelValue,"on-change":c},null,8,["render-fn","field","value"])):(n.openBlock(),n.createElementBlock("div",Ek,[n.createElementVNode("p",Bk,[n.createTextVNode(n.toDisplayString(n.unref(i)("configPanels.unknownFieldType"))+" ",1),n.createElementVNode("code",Ik,n.toDisplayString(l.field.type),1)])]))])}}}),Ok={key:0},vk={class:"text-sm font-medium text-gray-700 capitalize"},Tk={class:"p-3 space-y-4"},Sk={key:1,class:"p-4 space-y-4"},Nk={key:1,class:"text-center py-8"},Rk={class:"text-sm text-gray-500"},Dk=n.defineComponent({__name:"PropertiesPanel",setup(e){const{t}=le(),{selectedBlock:o}=Bt(),{engine:r,setBlockProperty:i}=Be(),s=n.computed(()=>{if(!o.value)return[];const g=r.getBlockSchema(o.value.type);return!g||!g.properties?[]:g.properties}),a=n.computed(()=>s.value.some(g=>g.group)),c=n.computed(()=>{if(!a.value)return[];const g=new Map;return s.value.forEach(h=>{const p=h.group||"default",m=h.group||t("common.default");g.has(p)||g.set(p,{id:p,label:m,fields:[]}),g.get(p).fields.push(h)}),Array.from(g.values())}),l=n.computed(()=>c.value.length===0?[]:[c.value[0].id]),d=g=>o.value?.properties?.[g];function u(g,h){o.value&&i(o.value.id,g,h)}return(g,h)=>{const p=Ar,m=Pk;return n.unref(o)?(n.openBlock(),n.createElementBlock("div",Ok,[n.unref(s).length>0?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(a)?(n.openBlock(),n.createBlock(n.unref(Ae).Root,{key:0,class:"w-full","default-value":n.unref(l),multiple:""},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(c),b=>(n.openBlock(),n.createBlock(n.unref(Ae).Item,{key:b.id,value:b.id,class:"border-b border-gray-100"},{default:n.withCtx(()=>[n.createVNode(n.unref(Ae).ItemTrigger,{class:"flex w-full items-center justify-between p-3 text-left hover:bg-gray-50 transition-colors"},{default:n.withCtx(()=>[n.createElementVNode("span",vk,n.toDisplayString(b.label),1),n.createVNode(n.unref(Ae).ItemIndicator,{class:"transition-transform duration-200 data-[state=open]:rotate-180"},{default:n.withCtx(()=>[n.createVNode(p,{class:"w-4 h-4 text-gray-500"})]),_:1})]),_:2},1024),n.createVNode(n.unref(Ae).ItemContent,{class:"overflow-hidden"},{default:n.withCtx(()=>[n.createElementVNode("div",Tk,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.fields,k=>(n.openBlock(),n.createBlock(m,{key:k.id,field:k,"model-value":d(k.id),"onUpdate:modelValue":w=>u(k.id,w)},null,8,["field","model-value","onUpdate:modelValue"]))),128))])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["default-value"])):(n.openBlock(),n.createElementBlock("div",Sk,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(s),b=>(n.openBlock(),n.createBlock(m,{key:b.id,field:b,"model-value":d(b.id),"onUpdate:modelValue":k=>u(b.id,k)},null,8,["field","model-value","onUpdate:modelValue"]))),128))]))],64)):(n.openBlock(),n.createElementBlock("div",Nk,[n.createElementVNode("p",Rk,n.toDisplayString(n.unref(t)("configPanels.noProperties")),1)]))])):n.createCommentVNode("",!0)}}});function $k(e){e.registerConfigurationPanel({id:"properties",title:"Properties",render:Dk,order:-10})}class Ak{editor;plugins=new Set;constructor(t){this.editor=t}setupPlugins(t){this.plugins.forEach(o=>{o({vueApp:t,editor:this.editor})})}register(t){return this.plugins.add(t),this}unregister(t){return this.plugins.delete(t),this}getAllPlugins(){return Array.from(this.plugins.values())}}class Vk{handlers=new Map;targetWindow;targetOrigin;fallbackHandler;constructor(t,o="*"){this.targetWindow=t,this.targetOrigin=o,window.addEventListener("message",this.handleMessage.bind(this))}handleMessage(t){const o=t.data;if(!o.type)return;const r=this.handlers.get(o.type);r?r.forEach(i=>i(o.payload,t)):this.fallbackHandler&&this.fallbackHandler(t.data,t)}send(t,o){const r={type:t,payload:o};this.targetWindow.postMessage(r,this.targetOrigin)}listen(t,o){return this.handlers.has(t)||this.handlers.set(t,[]),this.handlers.get(t).push(o),()=>{const r=this.handlers.get(t);if(r){const i=r.indexOf(o);i>-1&&r.splice(i,1)}}}registerFallbackHandler(t){this.fallbackHandler=t}}function Mk(e,t="*"){return new Vk(e.contentWindow,t)}class Fk{state;messenger;readyListenerInitialized=!1;readyCallbacks=[];constructor(){this.state=n.reactive({previewUrl:"about:blank",previewFrame:null,isIframeReady:!1,messageQueue:[]})}loadUrl(t){this.state.previewUrl=t}loadFromHtml(t){const o=new Blob([t],{type:"text/html"}),r=URL.createObjectURL(o);this.state.previewUrl=r,setTimeout(()=>URL.revokeObjectURL(r),1e3)}reload(){this.state.previewFrame&&this.state.previewFrame.contentWindow?.location.reload()}getFrame(){return this.state.previewFrame}_registerFrame(t){this.state.previewFrame=t,this.messenger=Mk(t),this.readyListenerInitialized||(this.messenger.listen("craftile.preview.ready",()=>{this.state.isIframeReady=!0,this.runReadyCallbacks(),this.flushMessageQueue()}),this.readyListenerInitialized=!0)}sendMessage(t,o){this.state.isIframeReady?this.messenger.send(t,o):this.state.messageQueue.push({type:t,payload:o})}onMessage(t,o){return this.messenger.listen(t,o)}onReady(t){this.readyCallbacks.push(t)}runReadyCallbacks(){this.readyCallbacks.forEach(t=>t.call(this)),this.readyCallbacks=[]}flushMessageQueue(){if(this.state.isIframeReady&&this.state.previewFrame?.contentWindow)for(;this.state.messageQueue.length>0;){const t=this.state.messageQueue.shift();this.messenger.send(t.type,t.payload)}}}function Lk(e,t){const o={added:new Set,updated:new Set,removed:new Set,moved:new Map,blocksToInclude:new Set};let r=null;const i=[],s=()=>{if(o.added.size||o.updated.size||o.removed.size||o.moved.size){const l=e.getPage(),d={};o.blocksToInclude.forEach(u=>{l.blocks[u]&&(d[u]=structuredClone(l.blocks[u]))}),t?.onUpdates({blocks:d,regions:structuredClone(l.regions),changes:{added:Array.from(o.added),updated:Array.from(o.updated),removed:Array.from(o.removed),moved:Object.fromEntries(o.moved)}}),o.added.clear(),o.updated.clear(),o.removed.clear(),o.moved.clear(),o.blocksToInclude.clear()}},a=()=>{r&&clearTimeout(r),r=setTimeout(s,t?.debounceMs||0)},c=(l,d)=>{d.add(l);const g=e.getPage().blocks[l];g?.children&&g.children.forEach(h=>{c(h,d)})};return i.push(e.on("block:insert",({blockId:l,parentId:d})=>{o.added.add(l),o.blocksToInclude.add(l),d&&o.blocksToInclude.add(d),a()})),i.push(e.on("block:remove",({blockId:l,parentId:d})=>{o.added.delete(l),o.updated.delete(l),o.removed.add(l),o.blocksToInclude.delete(l),d&&o.blocksToInclude.add(d),a()})),i.push(e.on("block:property:set",({blockId:l})=>{o.added.has(l)||o.updated.add(l),o.blocksToInclude.add(l),a()})),i.push(e.on("block:move",({blockId:l,sourceParentId:d,targetParentId:u,targetIndex:g,targetRegionName:h})=>{o.moved.set(l,{toRegion:h,toParent:u,toIndex:g??0}),o.blocksToInclude.add(l),d&&o.blocksToInclude.add(d),u&&o.blocksToInclude.add(u),a()})),i.push(e.on("block:toggle",({blockId:l})=>{o.added.has(l)||o.updated.add(l),o.blocksToInclude.add(l);const u=e.getPage().blocks[l];u?.parentId&&o.blocksToInclude.add(u.parentId),a()})),i.push(e.on("block:duplicate",({newBlockId:l,parentId:d})=>{o.added.add(l),c(l,o.blocksToInclude),d&&o.blocksToInclude.add(d),a()})),()=>{r&&clearTimeout(r),i.forEach(l=>l())}}class Hk{state;events;preview;ui;constructor(t,o,r){this.events=t,this.preview=o,this.ui=r,this.state=n.reactive({enabled:!0,hoveredBlockId:null,hoveredBlockRect:null,hoveredParentRect:null,parentFlexDirection:"column",selectedBlockId:null,selectedBlockRect:null,iframeRect:null}),this.preview.onReady(()=>{this.preview.onMessage("craftile.preview.block-hover",i=>{this.setHoveredBlock(i.blockId,i.blockRect,i.parentRect),this.state.parentFlexDirection=i.parentFlexDirection}),this.preview.onMessage("craftile.preview.block-select",i=>{this.setSelectedBlock(i.blockId,i.blockRect),this.ui.setSelectedBlock(i.blockId)}),this.preview.onMessage("craftile.preview.update-selected-block",i=>{this.state.selectedBlockId&&this.setSelectedBlock(i.blockId,i.blockRect)}),this.preview.onMessage("craftile.preview.block-leave",()=>{this.clearHoveredBlock()})})}enable(){this.state.enabled=!0,this.events.emit("inspector:enabled",{}),this.preview.sendMessage("craftile.inspector.enable")}disable(){this.state.enabled=!1,this.events.emit("inspector:disabled",{}),this.preview.sendMessage("craftile.inspector.disable")}toggle(){this.state.enabled?this.disable():this.enable()}setHoveredBlock(t,o,r){this.state.hoveredBlockId=t,this.state.hoveredBlockRect=o,this.state.hoveredParentRect=r||null}setSelectedBlock(t,o){this.state.selectedBlockId=t,this.state.selectedBlockRect=o}clearHoveredBlock(){this.state.hoveredBlockId=null,this.state.hoveredBlockRect=null,this.state.hoveredParentRect=null}clearSelectedBlock(){this.state.selectedBlockId=null,this.state.selectedBlockRect=null}setIframeRect(t){this.state.iframeRect=t}}class Uk{engine;ui;i18n;events;devices;preview;plugins;inspector;blockLabelFunction;blockFilterFunction;previewUpdateDelay;vueApp=null;constructor(t={}){this.engine=new Mo({blockSchemas:t.blockSchemas,page:t.initialPage}),this.events=new si,this.i18n=Gh(t.i18n),this.devices=new xk(t.devices),this.preview=new Fk,this.ui=new By(this.events),this.plugins=new Ak(this),this.inspector=new Hk(this.events,this.preview,this.ui),this.blockLabelFunction=t.blockLabelFunction,this.blockFilterFunction=t.blockFilterFunction,this.previewUpdateDelay=t.previewUpdateDelay,t.plugins?.forEach(o=>this.plugins.register(o)),this.setup()}getActiveBlock(){return this.ui.state.selectedBlockId?this.engine.getBlockById(this.ui.state.selectedBlockId):void 0}getBlockProperty(t,o){const r=this.engine.getBlockById(t);return r?r.properties[o]:null}setBlockProperty(t,o,r){return this.engine.setBlockProperty(t,o,r)}setup(){_k(this.ui),wk(this.ui),$k(this.ui),this.vueApp=n.createApp({setup:()=>{n.provide(Q,this);const t=this.setupEngineWatcher(this.previewUpdateDelay??150);return n.onBeforeUnmount(t),()=>n.h(Ey)}}),this.plugins.setupPlugins(this.vueApp)}setupEngineWatcher(t){return Lk(this.engine,{debounceMs:t,onUpdates:o=>{this.preview.sendMessage("craftile.editor.updates",o),this.events.emit("updates",o)}})}mount(t){this.vueApp.mount(t)}}function jk(e={}){const{el:t,...o}=e,r=new Uk(o);return t&&r.mount(t),r}gt.createCraftileEditor=jk,Object.defineProperty(gt,Symbol.toStringTag,{value:"Module"})}));