slidecanvas 1.1.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var ka=Object.create;var Ye=Object.defineProperty,Ca=Object.defineProperties,La=Object.getOwnPropertyDescriptor,za=Object.getOwnPropertyDescriptors,Sa=Object.getOwnPropertyNames,Xt=Object.getOwnPropertySymbols,Ia=Object.getPrototypeOf,Yt=Object.prototype.hasOwnProperty,Ma=Object.prototype.propertyIsEnumerable;var _t=(u,a,c)=>a in u?Ye(u,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):u[a]=c,I=(u,a)=>{for(var c in a||(a={}))Yt.call(a,c)&&_t(u,c,a[c]);if(Xt)for(var c of Xt(a))Ma.call(a,c)&&_t(u,c,a[c]);return u},j=(u,a)=>Ca(u,za(a));var Aa=(u,a)=>{for(var c in a)Ye(u,c,{get:a[c],enumerable:!0})},Kt=(u,a,c,m)=>{if(a&&typeof a=="object"||typeof a=="function")for(let v of Sa(a))!Yt.call(u,v)&&v!==c&&Ye(u,v,{get:()=>a[v],enumerable:!(m=La(a,v))||m.enumerable});return u};var Fe=(u,a,c)=>(c=u!=null?ka(Ia(u)):{},Kt(a||!u||!u.__esModule?Ye(c,"default",{value:u,enumerable:!0}):c,u)),Ba=u=>Kt(Ye({},"__esModule",{value:!0}),u);var Ga={};Aa(Ga,{PptEditor:()=>Za,PptxBlobExporter:()=>Lt,PptxExporter:()=>Ke,PptxParser:()=>Je});module.exports=Ba(Ga);function yt(u,{insertAt:a}={}){if(!u||typeof document=="undefined")return;let c=document.head||document.getElementsByTagName("head")[0],m=document.createElement("style");m.type="text/css",a==="top"&&c.firstChild?c.insertBefore(m,c.firstChild):c.appendChild(m),m.styleSheet?m.styleSheet.cssText=u:m.appendChild(document.createTextNode(u))}yt(`@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lato:wght@400;700&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@400;700&family=Playfair+Display:wght@400;700&family=Merriweather:wght@400;700&family=Nunito+Sans:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Oswald:wght@400;500&family=Raleway:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=Lora:wght@400;700&family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&family=Play:wght@400;700&family=Arvo:wght@400;700&family=Kanit:wght@400;500;600&display=swap";/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--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-400: oklch(70.4% .191 22.216);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-orange-50: oklch(98% .016 73.684);--color-orange-500: oklch(70.5% .213 47.604);--color-amber-500: oklch(76.9% .188 70.08);--color-green-500: oklch(72.3% .219 149.579);--color-emerald-50: oklch(97.9% .021 166.113);--color-emerald-100: oklch(95% .052 163.051);--color-emerald-400: oklch(76.5% .177 163.223);--color-emerald-500: oklch(69.6% .17 162.48);--color-emerald-600: oklch(59.6% .145 163.225);--color-emerald-700: oklch(50.8% .118 165.612);--color-teal-500: oklch(70.4% .14 182.503);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-indigo-500: oklch(58.5% .233 277.117);--color-purple-50: oklch(97.7% .014 308.299);--color-purple-100: oklch(94.6% .033 307.174);--color-purple-300: oklch(82.7% .119 306.383);--color-purple-400: oklch(71.4% .203 305.504);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-purple-700: oklch(49.6% .265 301.924);--color-pink-500: oklch(65.6% .241 354.308);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-100: oklch(96.8% .007 247.896);--color-slate-200: oklch(92.9% .013 255.508);--color-slate-300: oklch(86.9% .022 252.894);--color-slate-400: oklch(70.4% .04 256.788);--color-slate-500: oklch(55.4% .046 257.417);--color-slate-600: oklch(44.6% .043 257.281);--color-slate-700: oklch(37.2% .044 257.287);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-black: #000;--color-white: #fff;--spacing: .25rem;--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);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-weight-black: 900;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-wide: .025em;--tracking-wider: .05em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--ease-out: cubic-bezier(0, 0, .2, 1);--animate-spin: spin 1s linear infinite;--blur-sm: 8px;--blur-md: 12px;--aspect-video: 16 / 9;--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)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;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}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,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}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-5{top:calc(var(--spacing) * 5)}.top-10{top:calc(var(--spacing) * 10)}.top-\\[24px\\]{top:24px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-6{right:calc(var(--spacing) * 6)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-1{bottom:calc(var(--spacing) * 1)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-10{bottom:calc(var(--spacing) * 10)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1000\\]{z-index:1000}.z-\\[2000\\]{z-index:2000}.z-\\[2001\\]{z-index:2001}.z-\\[5000\\]{z-index:5000}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.z-\\[10000\\]{z-index:10000}.z-\\[11000\\]{z-index:11000}.z-\\[99999\\]{z-index:99999}.col-span-1{grid-column:span 1 / span 1}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0{margin-right:calc(var(--spacing) * 0)}.mr-0\\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-0{margin-left:calc(var(--spacing) * -0)}.-ml-0\\.5{margin-left:calc(var(--spacing) * -.5)}.ml-0{margin-left:calc(var(--spacing) * 0)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0{height:calc(var(--spacing) * 0)}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-7\\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-32{height:calc(var(--spacing) * 32)}.h-48{height:calc(var(--spacing) * 48)}.h-\\[1px\\]{height:1px}.h-\\[2\\.5px\\]{height:2.5px}.h-\\[4px\\]{height:4px}.h-\\[22px\\]{height:22px}.h-\\[28px\\]{height:28px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[250px\\]{max-height:250px}.max-h-\\[300px\\]{max-height:300px}.min-h-\\[56px\\]{min-height:56px}.min-h-\\[300px\\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-15{width:calc(var(--spacing) * 15)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\\[1px\\]{width:1px}.w-\\[15px\\]{width:15px}.w-\\[32px\\]{width:32px}.w-\\[480px\\]{width:480px}.w-\\[500px\\]{width:500px}.w-\\[600px\\]{width:600px}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[90vw\\]{max-width:90vw}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[400px\\]{max-width:400px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[40px\\]{min-width:40px}.min-w-\\[45px\\]{min-width:45px}.min-w-\\[50px\\]{min-width:50px}.min-w-\\[72px\\]{min-width:72px}.min-w-\\[80px\\]{min-width:80px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[280px\\]{min-width:280px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-bottom-left{transform-origin:0 100%}.origin-center{transform-origin:center}.origin-top-left{transform-origin:0 0}.-translate-x-1{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[1px\\]{--tw-translate-y: 1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x: 75%;--tw-scale-y: 75%;--tw-scale-z: 75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-stretch{justify-content:stretch}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>: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)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.self-start{align-self:flex-start}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[2\\.5rem\\]{border-radius:2.5rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-\\[3px\\]{border-top-left-radius:3px;border-bottom-left-radius:3px}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-\\[3px\\]{border-top-right-radius:3px;border-bottom-right-radius:3px}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-none{--tw-border-style: none;border-style:none}.border-solid{--tw-border-style: solid;border-style:solid}.border-black{border-color:var(--color-black)}.border-blue-100{border-color:var(--color-blue-100)}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\\/50{border-color:color-mix(in srgb,oklch(95% .052 163.051) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-purple-100{border-color:var(--color-purple-100)}.border-red-200{border-color:var(--color-red-200)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\\/50{border-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/60{border-color:color-mix(in srgb,oklch(92.9% .013 255.508) 60%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-white\\/10{border-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-\\[\\#0A0A0A\\]{background-color:#0a0a0a}.bg-black{background-color:var(--color-black)}.bg-black\\/20{background-color:color-mix(in srgb,#000 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\\/40{background-color:color-mix(in srgb,#000 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\\/60{background-color:color-mix(in srgb,#000 60%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\\/50{background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-100\\/50{background-color:color-mix(in srgb,oklch(93.2% .032 255.585) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-100) 50%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\\/50{background-color:color-mix(in srgb,oklch(97.9% .021 166.113) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-50\\/50{background-color:color-mix(in srgb,oklch(97.7% .014 308.299) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-purple-50) 50%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\\/50{background-color:color-mix(in srgb,oklch(98.4% .003 247.858) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\\/50{background-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\\/50{background-color:color-mix(in srgb,oklch(92.9% .013 255.508) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\\/40{background-color:color-mix(in srgb,oklch(20.8% .042 265.755) 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\\/50{background-color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\\/80{background-color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black{--tw-gradient-from: var(--color-black);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from: color-mix(in srgb, #000 60%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-gradient-from: color-mix(in oklab, var(--color-black) 60%, transparent)}--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to: transparent;--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-purple-300{fill:var(--color-purple-300)}.fill-slate-700{fill:var(--color-slate-700)}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-11{padding-left:calc(var(--spacing) * 11)}.pl-12{padding-left:calc(var(--spacing) * 12)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[6px\\]{font-size:6px}.text-\\[7px\\]{font-size:7px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight: var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking: .2em;letter-spacing:.2em}.tracking-\\[0\\.15em\\]{--tw-tracking: .15em;letter-spacing:.15em}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking: var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking: var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking: var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\\/70{color:color-mix(in srgb,oklch(59.6% .145 163.225) 70%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-emerald-600) 70%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-green-500{color:var(--color-green-500)}.text-indigo-500{color:var(--color-indigo-500)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-400{color:var(--color-purple-400)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-400\\/80{color:color-mix(in srgb,oklch(70.4% .191 22.216) 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-500{color:var(--color-teal-500)}.text-white{color:var(--color-white)}.text-white\\/50{color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\\/80{color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0%}.opacity-25{opacity:25%}.opacity-40{opacity:40%}.opacity-50{opacity:50%}.opacity-75{opacity:75%}.opacity-100{opacity:100%}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / .25));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_20px_50px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow: 0 20px 50px var(--tw-shadow-color, rgba(0,0,0,.15));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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)}.ring-4{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + 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)}.shadow-black{--tw-shadow-color: #000;@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-black) var(--tw-shadow-alpha), transparent)}}.shadow-black\\/80{--tw-shadow-color: color-mix(in srgb, #000 80%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 80%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500{--tw-shadow-color: oklch(62.3% .214 259.815);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-blue-500) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500{--tw-shadow-color: oklch(69.6% .17 162.48);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-emerald-500) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(69.6% .17 162.48) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-black{--tw-ring-color: var(--color-black)}.ring-black\\/5{--tw-ring-color: color-mix(in srgb, #000 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-black) 5%, transparent)}}.ring-purple-100{--tw-ring-color: var(--color-purple-100)}.ring-white{--tw-ring-color: var(--color-white)}.backdrop-blur-\\[1px\\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[2px\\]{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur: blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur: blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.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))}.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))}.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))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.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))}.duration-150{--tw-duration: .15s;transition-duration:.15s}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.duration-700{--tw-duration: .7s;transition-duration:.7s}.ease-out{--tw-ease: var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\\:text-slate-600{&:is(:where(.group):focus-within *){color:var(--color-slate-600)}}.group-hover\\:scale-105{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:scale-110{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:bg-blue-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-50)}}}.group-hover\\:bg-blue-100{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-100)}}}.group-hover\\:bg-blue-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-600)}}}.group-hover\\:bg-emerald-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-50)}}}.group-hover\\:bg-emerald-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-600)}}}.group-hover\\:bg-purple-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-purple-600)}}}.group-hover\\:bg-red-500{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-red-500)}}}.group-hover\\:bg-slate-200{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-slate-200)}}}.group-hover\\:fill-slate-900{&:is(:where(.group):hover *){@media(hover:hover){fill:var(--color-slate-900)}}}.group-hover\\:text-blue-600{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-blue-600)}}}.group-hover\\:text-slate-700{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-700)}}}.group-hover\\:text-slate-900{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-900)}}}.group-hover\\:text-white{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-white)}}}.group-hover\\:opacity-100{&:is(:where(.group):hover *){@media(hover:hover){opacity:100%}}}.group-hover\\:shadow-sm{&:is(:where(.group):hover *){@media(hover:hover){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.placeholder\\:text-slate-400{&::placeholder{color:var(--color-slate-400)}}.hover\\:border-blue-400{&:hover{@media(hover:hover){border-color:var(--color-blue-400)}}}.hover\\:border-slate-100{&:hover{@media(hover:hover){border-color:var(--color-slate-100)}}}.hover\\:border-slate-200{&:hover{@media(hover:hover){border-color:var(--color-slate-200)}}}.hover\\:border-slate-300{&:hover{@media(hover:hover){border-color:var(--color-slate-300)}}}.hover\\:bg-black{&:hover{@media(hover:hover){background-color:var(--color-black)}}}.hover\\:bg-blue-50{&:hover{@media(hover:hover){background-color:var(--color-blue-50)}}}.hover\\:bg-blue-50\\/50{&:hover{@media(hover:hover){background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}}}.hover\\:bg-blue-700{&:hover{@media(hover:hover){background-color:var(--color-blue-700)}}}.hover\\:bg-emerald-50{&:hover{@media(hover:hover){background-color:var(--color-emerald-50)}}}.hover\\:bg-emerald-700{&:hover{@media(hover:hover){background-color:var(--color-emerald-700)}}}.hover\\:bg-purple-50{&:hover{@media(hover:hover){background-color:var(--color-purple-50)}}}.hover\\:bg-red-50{&:hover{@media(hover:hover){background-color:var(--color-red-50)}}}.hover\\:bg-red-100{&:hover{@media(hover:hover){background-color:var(--color-red-100)}}}.hover\\:bg-slate-50{&:hover{@media(hover:hover){background-color:var(--color-slate-50)}}}.hover\\:bg-slate-100{&:hover{@media(hover:hover){background-color:var(--color-slate-100)}}}.hover\\:bg-slate-200{&:hover{@media(hover:hover){background-color:var(--color-slate-200)}}}.hover\\:bg-white{&:hover{@media(hover:hover){background-color:var(--color-white)}}}.hover\\:bg-white\\/20{&:hover{@media(hover:hover){background-color:color-mix(in srgb,#fff 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}}}.hover\\:text-blue-500{&:hover{@media(hover:hover){color:var(--color-blue-500)}}}.hover\\:text-blue-600{&:hover{@media(hover:hover){color:var(--color-blue-600)}}}.hover\\:text-blue-700{&:hover{@media(hover:hover){color:var(--color-blue-700)}}}.hover\\:text-emerald-700{&:hover{@media(hover:hover){color:var(--color-emerald-700)}}}.hover\\:text-purple-600{&:hover{@media(hover:hover){color:var(--color-purple-600)}}}.hover\\:text-purple-700{&:hover{@media(hover:hover){color:var(--color-purple-700)}}}.hover\\:text-red-500{&:hover{@media(hover:hover){color:var(--color-red-500)}}}.hover\\:text-slate-500{&:hover{@media(hover:hover){color:var(--color-slate-500)}}}.hover\\:text-slate-600{&:hover{@media(hover:hover){color:var(--color-slate-600)}}}.hover\\:text-slate-700{&:hover{@media(hover:hover){color:var(--color-slate-700)}}}.hover\\:text-white{&:hover{@media(hover:hover){color:var(--color-white)}}}.hover\\:opacity-100{&:hover{@media(hover:hover){opacity:100%}}}.hover\\:shadow-md{&:hover{@media(hover:hover){--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.focus\\:border-blue-500{&:focus{border-color:var(--color-blue-500)}}.focus\\:border-slate-400{&:focus{border-color:var(--color-slate-400)}}.focus\\:ring-0{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + 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)}}.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)}}.focus\\:ring-4{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + 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)}}.focus\\:ring-blue-500\\/10{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 10%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}}.focus\\:ring-blue-500\\/20{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}}.focus\\:ring-slate-400\\/5{&:focus{--tw-ring-color: color-mix(in srgb, oklch(70.4% .04 256.788) 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-slate-400) 5%, transparent)}}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.active\\:scale-95{&:active{--tw-scale-x: 95%;--tw-scale-y: 95%;--tw-scale-z: 95%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.active\\:scale-\\[0\\.98\\]{&:active{scale:.98}}.active\\:cursor-grabbing{&:active{cursor:grabbing}}.disabled\\:cursor-not-allowed{&:disabled{cursor:not-allowed}}.disabled\\:bg-slate-100{&:disabled{background-color:var(--color-slate-100)}}.disabled\\:bg-slate-300{&:disabled{background-color:var(--color-slate-300)}}.disabled\\:text-slate-400{&:disabled{color:var(--color-slate-400)}}.disabled\\:opacity-20{&:disabled{opacity:20%}}.disabled\\:opacity-40{&:disabled{opacity:40%}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.disabled\\:active\\:scale-100{&:disabled{&:active{--tw-scale-x: 100%;--tw-scale-y: 100%;--tw-scale-z: 100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.md\\:space-y-8{@media(width>=48rem){:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}}}.md\\:p-12{@media(width>=48rem){padding:calc(var(--spacing) * 12)}}}@keyframes blob{0%{transform:translate(0) scale(1)}33%{transform:translate(30px,-50px) scale(1.1)}66%{transform:translate(-20px,20px) scale(.9)}to{transform:translate(0) scale(1)}}.animate-blob{animation:blob 7s infinite}.animation-delay-2000{animation-delay:2s}.animation-delay-4000{animation-delay:4s}@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-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@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-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: "<length-percentage>"; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: "<length-percentage>"; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: "<length-percentage>"; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{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: 0px;}@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-backdrop-blur{syntax: "*"; inherits: false;}@property --tw-backdrop-brightness{syntax: "*"; inherits: false;}@property --tw-backdrop-contrast{syntax: "*"; inherits: false;}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false;}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false;}@property --tw-backdrop-invert{syntax: "*"; inherits: false;}@property --tw-backdrop-opacity{syntax: "*"; inherits: false;}@property --tw-backdrop-saturate{syntax: "*"; inherits: false;}@property --tw-backdrop-sepia{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1;--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-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: 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-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial;--tw-ease: initial}}}
|
|
3
|
-
`);var A=require("react");var ge=Fe(require("react")),w=require("lucide-react");var Jt=require("clsx"),Qt=require("tailwind-merge");function M(...u){return(0,Qt.twMerge)((0,Jt.clsx)(u))}var e=require("react/jsx-runtime"),Pa=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],Ta=[12,14,16,18,20,24,28,32,36,48,64,72,96],Ha=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],ja=({type:u,className:a})=>{switch(u){case"rect":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"currentColor"})});case"circle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor"})});case"triangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 18H4L12 4Z",fill:"currentColor"})});case"rightTriangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 4V20H20L4 4Z",fill:"currentColor"})});case"rhombus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 12L12 20L4 12L12 4Z",fill:"currentColor"})});case"parallelogram":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M7 4H21L17 20H3L7 4Z",fill:"currentColor"})});case"trapezoid":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M6 4H18L21 20H3L6 4Z",fill:"currentColor"})});case"pentagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L21 9V19H3V9L12 3Z",fill:"currentColor"})});case"hexagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z",fill:"currentColor"})});case"heptagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L18.5 6L21 13L16 20H8L3 13L5.5 6L12 3Z",fill:"currentColor"})});case"octagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M8.5 3H15.5L21 8.5V15.5L15.5 21H8.5L3 15.5V8.5L8.5 3Z",fill:"currentColor"})});case"heart":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",fill:"currentColor"})});case"smiley":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"15",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M8 15C8 15 9.5 17 12 17C14.5 17 16 15 16 15",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"sun":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"moon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9",fill:"currentColor"})});case"arrowRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 11h11.5l-3.5-3.5 1.5-1.5 6 6-6 6-1.5-1.5 3.5-3.5H4z",fill:"currentColor"})});case"arrowLeft":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M20 11H8.5l3.5-3.5L10.5 6l-6 6 6 6 1.5-1.5-3.5-3.5H20z",fill:"currentColor"})});case"arrowUp":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 20V8.5l3.5 3.5 1.5-1.5-6-6-6 6 1.5 1.5 3.5-3.5V20z",fill:"currentColor"})});case"arrowDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M11 4v11.5l-3.5-3.5-1.5 1.5 6 6 6-6-1.5-1.5-3.5 3.5V4z",fill:"currentColor"})});case"arrowLeftRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 12l4-4v3h8V8l4 4-4 4v-3H8v3l-4-4z",fill:"currentColor"})});case"arrowUpDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4l-4 4h3v8H8l4 4 4-4h-3V8h3l-4-4z",fill:"currentColor"})});case"star4":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 8 8 2-8 2-2 8-2-8-8-2 8-2 2-8z",fill:"currentColor"})});case"star5":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2.5 7.5H22l-6 4.5 2.5 7.5-6.5-4.5-6.5 4.5 2.5-7.5-6-4.5h7.5L12 2z",fill:"currentColor"})});case"star6":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l3 5 6-1-4 4.5 2 6.5-7-3-7 3 2-6.5-4-4.5 6 1 3-5z",fill:"currentColor"})});case"star8":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 4 4-2-2 4 4 2-4 2 2 4-4-2-2 4-2-4-4 2 2-4-4-2 4-2-2-4 4 2 2-4z",fill:"currentColor"})});case"cloud":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M17.5 19c-3 0-5.5-2.5-5.5-5.5 0-.2 0-.4.1-.6-2-.8-3.6-2.5-4.1-4.7C6.5 7.4 5 6 3 6c-1.7 0-3 1.3-3 3s1.3 3 3 3c.4 0 .8-.1 1.2-.2C4.1 13 5 14.5 6.5 15.5c.3 1.8 1.4 3.4 3 4.3.4.2.8.3 1.2.4 1.2.4 2.5.6 3.8.6 4.4 0 8-3.6 8-8s-3.6-8-8-8c-.4 0-.8 0-1.2.1-1.2.2-2.3.7-3.2 1.5C11 4.2 12.4 3.5 14 3.5c4.1 0 7.5 3.4 7.5 7.5s-1.8 7.5-4 8z",fill:"currentColor",transform:"scale(0.8) translate(3,3)"})});case"lightning":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 2L3 14h9v8l10-12h-9l3-8z",fill:"currentColor"})});case"plus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})});case"minus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})});case"multiply":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:"currentColor"})});case"divide":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"7",r:"2",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"2",fill:"currentColor"}),(0,e.jsx)("rect",{x:"5",y:"11",width:"14",height:"2",fill:"currentColor"})]});case"equal":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 10H5V8h14v2zm0 6H5v-2h14v2z",fill:"currentColor"})});default:return(0,e.jsx)("div",{className:"w-6 h-6 bg-slate-200 rounded-sm"})}},Ra=({onAddShape:u,uiScale:a})=>{let[c,m]=(0,ge.useState)(!1);return ge.default.useEffect(()=>(window._toggleShapesMenu=()=>m(!c),()=>{window._toggleShapesMenu=void 0}),[c]),c?(0,e.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",style:{width:`${320*a}px`,maxHeight:`${480*a}px`},children:(0,e.jsx)("div",{className:"flex flex-col gap-6",children:Ha.map(v=>(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",style:{fontSize:`${10*a}px`},children:v.name}),(0,e.jsx)("div",{className:"grid grid-cols-5 gap-1",children:v.shapes.map(s=>(0,e.jsx)("button",{onClick:()=>{u(s),m(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group p-1",title:s,children:(0,e.jsx)("div",{className:"w-full h-full bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden p-1.5",children:(0,e.jsx)(ja,{type:s,className:"w-full h-full text-slate-400 group-hover:text-blue-600 transition-colors"})})},s))})]},v.name))})}):null},Et=({onAddText:u,onAddImage:a,onAddShape:c,onAddSlide:m,onExport:v,onFormatText:s,onDeleteElement:R,onApplyLayout:T,onPlay:P,selectedElement:r,onNewPresentation:H,onLoadPresentation:g,appBgColor:S="#B7472A",uiScale:y,source:B,onGenerateImageClick:k,onGenerateInfographicClick:f,onUploadImageClick:G,onRefineAction:$,refineResponse:E,isAiLoading:ee})=>{let N=ge.default.useRef(null),[L,re]=(0,ge.useState)("Home"),[X,O]=(0,ge.useState)(!1),[te,n]=(0,ge.useState)(!1),[x,l]=(0,ge.useState)(!1),[h,C]=(0,ge.useState)(!1),[F,D]=(0,ge.useState)("file"),[oe,ie]=(0,ge.useState)(""),[Z,he]=(0,ge.useState)(!1),[ae,_]=(0,ge.useState)(!1),[Y,le]=(0,ge.useState)(!1),[Ne,be]=(0,ge.useState)(!1),Te=U=>{if(!W||!r)return;let de=r.content||"",ve=de;switch(U){case"sentence":ve=de.charAt(0).toUpperCase()+de.slice(1).toLowerCase();break;case"lowercase":ve=de.toLowerCase();break;case"uppercase":ve=de.toUpperCase();break;case"capitalize":ve=de.split(" ").map(ke=>ke.charAt(0).toUpperCase()+ke.slice(1).toLowerCase()).join(" ");break;case"toggle":ve=de.split("").map(ke=>ke===ke.toUpperCase()?ke.toLowerCase():ke.toUpperCase()).join("");break}s({content:ve}),he(!1)},W=(r==null?void 0:r.type)==="text",He=(r==null?void 0:r.type)==="shape",zt=(r==null?void 0:r.type)==="image",je="#B7472A";return(0,e.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",style:{fontSize:`${12*y}px`},children:[(0,e.jsxs)("div",{className:"bg-white flex items-center justify-center border-b border-slate-200/60 transition-all duration-300 relative z-[1000]",style:{minHeight:`${120*y}px`,overflow:"visible"},children:[(0,e.jsxs)("div",{className:M("flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",y<.84?"min-w-0":"min-w-fit"),children:[(0,e.jsx)("div",{className:"flex items-center justify-center gap-1 my-auto",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>O(!X),className:M("flex flex-col items-left gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg transition-all min-w-[45px]",X&&"bg-slate-100"),children:[(0,e.jsx)("div",{className:"bg-orange-50 p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:Math.max(14,20*y),style:{color:S}})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500 whitespace-nowrap",children:"Slides"})]}),X&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-3xl p-2 w-60 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200 ring-4 ring-black/5",children:[(0,e.jsxs)("button",{onClick:m,className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.FilePen,{size:18})}),"Blank Slide"]}),(0,e.jsxs)("button",{onClick:()=>{T("title"),O(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.FileText,{size:18})}),"Title Slide"]}),(0,e.jsxs)("button",{onClick:()=>{T("content"),O(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.List,{size:18})}),"Title & Content"]}),(0,e.jsxs)("button",{onClick:()=>{T("split"),O(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.Columns,{size:18})}),"Two Columns"]})]})]})}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,e.jsxs)("div",{className:M("flex items-center flex-col border-r border-slate-200 h-full py-2 relative justify-center gap-2",y<.85?"px-1":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden",children:[(0,e.jsx)("select",{disabled:!W,value:(r==null?void 0:r.fontFamily)||"Open Sans",onChange:U=>s({fontFamily:U.target.value}),className:M("h-full px-1.5 text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer",y<.85?"w-20":"w-32"),style:{fontSize:`${Math.max(10,12*y)}px`},children:Pa.map(U=>(0,e.jsx)("option",{value:U,children:U},U))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-1"})]}),(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden w-15",children:[(0,e.jsx)("select",{disabled:!W,value:(r==null?void 0:r.fontSize)||10,onChange:U=>s({fontSize:parseInt(U.target.value)}),className:"h-full w-full px-1 text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer text-center",style:{fontSize:`${Math.max(10,12*y)}px`},children:Ta.map(U=>(0,e.jsx)("option",{value:U,children:U},U))}),(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400 mr-0.5"})]}),(0,e.jsxs)("button",{disabled:!W,onClick:()=>s({fontSize:Math.min(200,((r==null?void 0:r.fontSize)||24)+2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Increase Font Size",children:[(0,e.jsx)("span",{className:"text-[16px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(w.ChevronUp,{size:10,color:"black"})]}),(0,e.jsxs)("button",{disabled:!W,onClick:()=>s({fontSize:Math.max(8,((r==null?void 0:r.fontSize)||24)-2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Decrease Font Size",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(w.ChevronDown,{size:10,color:"black"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!W,onClick:()=>_(!ae),className:M("h-8 px-1.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",ae?"bg-slate-100":"hover:bg-slate-100"),title:"Character Spacing",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700 -ml-0.5",children:"V"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0",children:[(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25C0"}),(0,e.jsx)("div",{className:"w-2.5 h-[1px] bg-blue-500"}),(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25B6"})]})]}),ae&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-32 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-50}),_(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Tight",(r==null?void 0:r.charSpacing)===-50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-25}),_(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Tight",(r==null?void 0:r.charSpacing)===-25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:0}),_(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Normal",((r==null?void 0:r.charSpacing)===0||!(r!=null&&r.charSpacing))&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:25}),_(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Loose",(r==null?void 0:r.charSpacing)===25&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:50}),_(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Loose",(r==null?void 0:r.charSpacing)===50&&(0,e.jsx)(w.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,e.jsx)("button",{className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 disabled:opacity-50",children:"More Spacing..."})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("button",{disabled:!W,onClick:()=>s({isBold:!r.isBold}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isBold?"bg-blue-100":"hover:bg-slate-100"),title:"Bold",children:(0,e.jsx)("span",{className:`text-[15px] font-bold ${r!=null&&r.isBold?"text-slate-900":"text-slate-600"}`,children:"B"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>s({isItalic:!r.isItalic}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isItalic?"bg-blue-100":"hover:bg-slate-100"),title:"Italic",children:(0,e.jsx)("span",{className:`text-[15px] italic font-serif ${r!=null&&r.isItalic?"text-slate-900":"text-slate-600"}`,children:"I"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>s({isUnderline:!r.isUnderline}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isUnderline?"bg-blue-100":"hover:bg-slate-100"),title:"Underline",children:(0,e.jsx)("span",{className:`text-[15px] underline underline-offset-2 ${r!=null&&r.isUnderline?"text-slate-900":"text-slate-600"}`,children:"U"})}),(0,e.jsxs)("button",{disabled:!W,onClick:()=>s({isStrikethrough:!r.isStrikethrough}),className:M("h-8 px-1.5 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isStrikethrough?"bg-blue-100":"hover:bg-slate-100"),title:"Strikethrough",children:[(0,e.jsx)("span",{className:`text-[12px] font-medium line-through ${r!=null&&r.isStrikethrough?"text-slate-900":"text-slate-600"}`,children:"abc"}),(0,e.jsx)(w.ChevronDown,{size:12,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!W,onClick:()=>he(!Z),className:"h-8 px-1.5 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Change Case",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-700",children:"Aa"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),Z&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-44 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>Te("sentence"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400",children:"Aa"})," Sentence case."]}),(0,e.jsxs)("button",{onClick:()=>Te("lowercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"l"})," lowercase"]}),(0,e.jsxs)("button",{onClick:()=>Te("uppercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"U"})," UPPERCASE"]}),(0,e.jsxs)("button",{onClick:()=>Te("capitalize"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"C"})," Capitalize Each Word"]}),(0,e.jsxs)("button",{onClick:()=>Te("toggle"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"t"})," tOGGLE cASE"]})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-5 bg-slate-200 mx-1.5"}),(0,e.jsx)("div",{className:"relative",children:(0,e.jsxs)("button",{disabled:!W,onClick:()=>s({isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000",isStrikethrough:!1}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Clear All Formatting",children:[(0,e.jsx)("span",{className:"text-[16px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(w.Eraser,{size:Math.max(8,11*y),className:"text-pink-500 -ml-0.5"})]})}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{disabled:!W,className:M("w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.highlightColor?"bg-slate-100":"hover:bg-slate-100"),title:"Text Highlight Color",children:[(0,e.jsx)(w.Highlighter,{size:18,strokeWidth:1.5,className:r!=null&&r.highlightColor?"text-slate-900":"text-slate-500"}),(0,e.jsx)("div",{className:"absolute top-[24px] left-1 right-3 h-0.5",style:{backgroundColor:(r==null?void 0:r.highlightColor)||"transparent"}})]}),(0,e.jsx)("input",{type:"color",disabled:!W,className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full disabled:cursor-not-allowed",value:(r==null?void 0:r.highlightColor)||"#ffff00",onChange:U=>s({highlightColor:U.target.value}),title:"Choose Highlight Color"}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{className:"w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all",title:"Font Color",children:[(0,e.jsx)("span",{className:"text-[15px] font-medium text-slate-600 leading-none",children:"A"}),(0,e.jsx)("div",{className:"w-6 h-[4px] rounded-sm mt-0.5",style:{backgroundColor:(r==null?void 0:r.color)||"#ff0000"}}),(0,e.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(r==null?void 0:r.color)||"#ff0000",onChange:U=>s({color:U.target.value})})]}),(0,e.jsx)(w.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]})]}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Font"})]}),(0,e.jsxs)("div",{className:M("flex flex-col border-r border-slate-200 h-full py-2 relative justify-center gap-2",y<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!W,onClick:()=>{r!=null&&r.isBulleted?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"})},className:M("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isBulleted?"bg-blue-100":"hover:bg-slate-100"),title:"Bullets",children:(0,e.jsx)(w.List,{size:Math.max(13,19*y),className:r!=null&&r.isBulleted?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>le(!Y),className:M("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Y?"bg-slate-100":"hover:bg-slate-200"),title:"Bullet Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Y&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!1,listType:"none"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square-outlined"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-diamond"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-arrow"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),le(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!W,onClick:()=>{r!=null&&r.isNumbered?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!1,isNumbered:!0,listType:"number-decimal"})},className:M("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isNumbered?"bg-blue-100":"hover:bg-slate-100"),title:"Numbering",children:(0,e.jsx)(w.ListOrdered,{size:Math.max(13,19*y),className:r!=null&&r.isNumbered?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>be(!Ne),className:M("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",Ne?"bg-slate-100":"hover:bg-slate-200"),title:"Numbering Options",children:(0,e.jsx)(w.ChevronDown,{size:13,className:"text-slate-400"})}),Ne&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!1,listType:"none"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-upper"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"I."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"II."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"III."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-upper"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"A."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"B."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"C."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower-paren"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),be(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"i."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"ii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"iii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-6 bg-slate-200 mx-1.5"}),(0,e.jsx)("button",{disabled:!W,className:"w-7 h-7 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Decrease List Level",children:(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M2 7L4 9L2 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,e.jsx)("button",{disabled:!W,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Increase List Level",children:(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M4 7L2 9L4 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{disabled:!W,onClick:()=>s({textAlign:"left"}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="left"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Left",children:(0,e.jsx)(w.AlignLeft,{size:Math.max(13,19*y),className:(r==null?void 0:r.textAlign)==="left"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>s({textAlign:"center"}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="center"?"bg-blue-100":"hover:bg-slate-100"),title:"Center",children:(0,e.jsx)(w.AlignCenter,{size:Math.max(13,19*y),className:(r==null?void 0:r.textAlign)==="center"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>s({textAlign:"right"}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="right"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Right",children:(0,e.jsx)(w.AlignRight,{size:Math.max(13,19*y),className:(r==null?void 0:r.textAlign)==="right"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!W,onClick:()=>s({textAlign:"justify"}),className:M("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="justify"?"bg-blue-100":"hover:bg-slate-100"),title:"Justify",children:(0,e.jsx)(w.AlignJustify,{size:Math.max(13,19*y),className:(r==null?void 0:r.textAlign)==="justify"?"text-slate-900":"text-slate-600"})})]}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Paragraph"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("div",{className:"relative group/shapes flex justify-center",children:[(0,e.jsxs)("button",{className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[50px]",onClick:()=>{var U;return(U=window._toggleShapesMenu)==null?void 0:U.call(window)},children:[(0,e.jsx)("div",{className:"bg-blue-50 p-1.5 rounded-lg group-hover:scale-105 transition-transform",children:(0,e.jsx)(w.Square,{size:Math.max(14,20*y),className:"text-blue-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"Shapes"})]}),(0,e.jsx)(Ra,{onAddShape:U=>{c(U)},uiScale:y})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:u,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[50px]",title:"Text Box",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Type,{size:Math.max(14,20*y)})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Text Box"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:()=>{var U;return(U=N.current)==null?void 0:U.click()},className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[50px]",title:"Image",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(w.Image,{size:Math.max(14,20*y)})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Image"}),(0,e.jsx)("input",{type:"file",ref:N,className:"hidden",accept:"image/*",onChange:U=>{var de;return((de=U.target.files)==null?void 0:de[0])&&a(U.target.files[0])}})]})]}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-1 gap-1 h-full py-1.5 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-0.5 my-auto h-full relative",children:[(0,e.jsxs)("button",{disabled:!W||ee,onClick:()=>n(!te),className:M("flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[72px] outline-none focus:outline-none focus:ring-0 border-none",te&&"bg-slate-100 text-slate-900"),children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Sparkles,{size:Math.max(14,20*y),className:"text-purple-500"})}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Refine"}),(0,e.jsx)(w.ChevronDown,{size:10,className:"text-slate-400"})]})]}),te&&(0,e.jsxs)("div",{className:"absolute top-full right-0 mt-2 bg-white border border-slate-200 rounded-xl shadow-xl w-48 z-[100] animate-in fade-in zoom-in-95 duration-150 overflow-hidden",children:[(0,e.jsxs)("button",{onClick:()=>{$==null||$(r.id,"shorten"),n(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.CaseSensitive,{size:18})}),"Shorten"]}),(0,e.jsxs)("button",{onClick:()=>{$==null||$(r.id,"reframe"),n(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.RotateCw,{size:18})}),"Reframe"]}),(0,e.jsxs)("button",{onClick:()=>{$==null||$(r.id,"lengthen"),n(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(w.Type,{size:18})}),"Lengthen"]})]})]}),ee&&(0,e.jsx)("div",{className:"absolute inset-x-0 top-2 bottom-8 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,e.jsx)(w.RefreshCw,{size:16,className:"text-blue-600 animate-spin"})}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center pl-3 pr-3 gap-1 h-full py-2 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,e.jsxs)("button",{onClick:P,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[40px] group",title:"Present",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Play,{size:Math.max(14,20*y),className:"fill-slate-700 group-hover:fill-slate-900"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Present"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:v,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[50px] group",title:"Export",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Download,{size:Math.max(14,20*y),className:"text-emerald-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Export"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:R,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-red-50 rounded-lg text-red-600 transition-all min-w-[50px] group",title:"Delete",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Trash2,{size:Math.max(14,20*y)})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Delete"})]})]})]}),(0,e.jsxs)("div",{className:"absolute top-2 right-3 flex items-center gap-1 px-1.5 py-0.5 bg-emerald-50/50 rounded-md border border-emerald-100/50",children:[(0,e.jsx)(w.Check,{size:9,className:"text-emerald-500"}),(0,e.jsx)("span",{className:"text-[7px] font-black text-emerald-600/70 tracking-tighter uppercase",children:"Saved"})]}),y>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]})]}),h&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>C(!1)}),(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,e.jsx)(w.Download,{size:20})}),"Upload Presentation"]}),(0,e.jsx)("button",{onClick:()=>C(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,e.jsx)(w.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,e.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,e.jsx)("button",{onClick:()=>D("file"),className:M("flex-1 py-3 text-xs font-black rounded-xl transition-all",F==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,e.jsx)("button",{onClick:()=>D("link"),className:M("flex-1 py-3 text-xs font-black rounded-xl transition-all",F==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),F==="file"?(0,e.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,e.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,e.jsx)(w.Plus,{size:24,className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,e.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:U=>{var ve;let de=(ve=U.target.files)==null?void 0:ve[0];de&&(g(de),C(!1))}})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative",children:(0,e.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:oe,onChange:U=>ie(U.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,e.jsx)("button",{onClick:()=>{oe.trim()&&(g(oe.trim()),C(!1))},disabled:!oe.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var $e=require("lucide-react"),fe=require("@dnd-kit/core"),Ae=require("@dnd-kit/sortable"),ta=require("@dnd-kit/utilities");var Q=require("react/jsx-runtime"),ea={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Da=({slide:u,index:a,isActive:c,onSelect:m,onDelete:v,onDuplicate:s,showDelete:R,uiScale:T,appBgColor:P})=>{let{attributes:r,listeners:H,setNodeRef:g,transform:S,transition:y,isDragging:B}=(0,Ae.useSortable)({id:u.id}),k={transform:ta.CSS.Transform.toString(S),transition:y,zIndex:B?2:1,opacity:B?.5:1};return(0,Q.jsxs)("div",{ref:g,onClick:m,className:M("cursor-pointer border-[1.5px] border-solid p-2 transition-all duration-300 group relative select-none",c?"bg-white":"border hover:border-slate-200 bg-white/50 hover:bg-white"),style:j(I({},k),{border:c?`1px solid ${P}`:"1px solid transparent"}),children:[(0,Q.jsxs)("div",{className:M("text-xs font-bold mb-1 flex items-center justify-between transition-colors",!c&&"text-slate-400"),style:{color:c?P:void 0},children:[(0,Q.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Q.jsx)("div",j(I(I({},r),H),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 text-slate-300 hover:text-slate-500",children:(0,Q.jsx)($e.GripVertical,{size:14})})),(0,Q.jsxs)("span",{children:["SLIDE ",a+1]})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-1",children:[c&&(0,Q.jsx)("span",{className:"h-1.5 w-1.5",style:{backgroundColor:P}}),(0,Q.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,Q.jsx)("button",{onClick:f=>{f.stopPropagation(),s()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 transition-all",title:"Duplicate Slide",children:(0,Q.jsx)($e.Copy,{size:13})}),R&&(0,Q.jsx)("button",{onClick:f=>{f.stopPropagation(),v()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 transition-all",title:"Delete Slide",children:(0,Q.jsx)($e.Trash2,{size:13})})]})]})]}),(0,Q.jsx)("div",{className:"aspect-video bg-white flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,Q.jsx)("div",{className:"origin-center pointer-events-none select-none shrink-0",style:{width:"1200px",height:"675px",transform:`scale(${(Math.max(220,256*T)-48)/1200})`,backgroundColor:"#ffffff"},children:u.elements.sort((f,G)=>(f.zIndex||0)-(G.zIndex||0)).map(f=>{var $;let G={position:"absolute",left:f.x,top:f.y,width:f.width,height:f.height,opacity:($=f.opacity)!=null?$:1};if(f.type==="text")return(0,Q.jsx)("div",{style:j(I({},G),{fontSize:f.fontSize,fontFamily:f.fontFamily,color:f.color,textAlign:f.textAlign||"left",fontWeight:f.isBold?"bold":"normal",fontStyle:f.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:f.content},f.id);if(f.type==="shape"){let E=ea[f.shapeType]||(f.shapeType==="ellipse"?ea.circle:null);return E?(0,Q.jsx)("svg",{viewBox:"0 0 24 24",style:j(I({},G),{fill:f.fill}),preserveAspectRatio:"none",children:(0,Q.jsx)("path",{d:E})},f.id):(0,Q.jsx)("div",{style:j(I({},G),{backgroundColor:f.fill,borderRadius:f.shapeType==="ellipse"?"50%":"0"})},f.id)}else if(f.type==="image")return(0,Q.jsx)("img",{src:f.src,alt:"",style:j(I({},G),{objectFit:"contain"})},f.id);return null})})})]})},aa=({slides:u,currentSlideIndex:a,onSelectSlide:c,onDeleteSlide:m,onDuplicateSlide:v,onReorderSlides:s,uiScale:R,appBgColor:T="#B7472A"})=>{let P=(0,fe.useSensors)((0,fe.useSensor)(fe.PointerSensor,{activationConstraint:{distance:5}}),(0,fe.useSensor)(fe.KeyboardSensor,{coordinateGetter:Ae.sortableKeyboardCoordinates})),r=H=>{let{active:g,over:S}=H;if(g.id!==(S==null?void 0:S.id)){let y=u.findIndex(k=>k.id===g.id),B=u.findIndex(k=>k.id===(S==null?void 0:S.id));s(y,B)}};return(0,Q.jsx)("div",{className:"bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",style:{width:`${Math.max(220,256*R)}px`},children:(0,Q.jsx)(fe.DndContext,{sensors:P,collisionDetection:fe.closestCenter,onDragEnd:r,children:(0,Q.jsx)(Ae.SortableContext,{items:u.map(H=>H.id),strategy:Ae.verticalListSortingStrategy,children:u.map((H,g)=>(0,Q.jsx)(Da,{slide:H,index:g,isActive:g===a,onSelect:()=>c(g),onDelete:()=>m(g),onDuplicate:()=>v(g),showDelete:u.length>1,uiScale:R,appBgColor:T},H.id))})})})};var ue=require("react"),ne=Fe(require("fabric")),Be=require("lucide-react");var V=require("react/jsx-runtime"),Va={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Ua=(u,a,c,m)=>{if(a)switch(u){case"bullet-disc":return"\u2022";case"bullet-circle":return"\u25CB";case"bullet-square":return"\u25A0";case"bullet-square-outlined":return"\u25A1";case"bullet-diamond":return"\u25C6";case"bullet-arrow":return"\u27A4";case"bullet-check":return"\u2713";case"none":return"";default:return"\u2022"}else if(c){let v=m+1;switch(u){case"number-decimal":return`${v}.`;case"number-decimal-paren":return`${v})`;case"number-roman-upper":return ra(v)+".";case"number-roman-lower":return ra(v).toLowerCase()+".";case"number-alpha-upper":return Nt(v)+".";case"number-alpha-lower":return Nt(v).toLowerCase()+".";case"number-alpha-lower-paren":return Nt(v).toLowerCase()+")";case"none":return"";default:return`${v}.`}}return""},ra=u=>{let a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},c="";for(let m in a)for(;u>=a[m];)c+=m,u-=a[m];return c},Nt=u=>String.fromCharCode(64+u),it=class extends ne.Textbox{_renderTextLine(a,c,m,v,s,R){if(super._renderTextLine(a,c,m,v,s,R),(this.isBulleted||this.isNumbered)&&this.listType!=="none"){let T=Ua(this.listType,this.isBulleted,this.isNumbered,R);if(T){c.save();let P=this.fontSize||22,r=-P*1,H=P*.6;c.font=`${this.fontStyle} ${this.fontWeight} ${H}px ${this.fontFamily}`,c.fillStyle=this.fill,c.fillText(T,v+r,s-P*.35),c.restore()}}}},lt=({slide:u,onElementUpdate:a,onSelect:c,uiScale:m,onSlashCommand:v,selectedElementId:s,onAiGenerateClick:R,onAiGenerateInfographicClick:T,onUploadImageClick:P,onDeleteElement:r})=>{let H=(0,ue.useRef)(null),g=(0,ue.useRef)(null),S=(0,ue.useRef)(!1),y=(0,ue.useRef)(a),B=(0,ue.useRef)(c),k=(0,ue.useRef)(null),[f,G]=(0,ue.useState)(1),[$,E]=(0,ue.useState)(!1),ee=(0,ue.useRef)({x:0,y:0});(0,ue.useEffect)(()=>{if(!k.current)return;let L=new ResizeObserver(re=>{let X=re[0];if(X){let{width:O,height:te}=X.contentRect,n=O/1200,x=te/675,l=Math.min(n,x)*.95;G(l)}});return L.observe(k.current),()=>L.disconnect()},[]),(0,ue.useEffect)(()=>{y.current=a,B.current=c},[a,c]),(0,ue.useEffect)(()=>{if(H.current&&!g.current){let L=new ne.Canvas(H.current,{width:1200,height:675,backgroundColor:"white",selection:!0,preserveObjectStacking:!0});g.current=L,E(!0);let re=l=>{l.left<0&&l.set("left",0),l.top<0&&l.set("top",0);let h=l.getBoundingRect();h.left+h.width>(L.width||1200)&&l.set("left",(L.width||1200)-h.width),h.top+h.height>(L.height||675)&&l.set("top",(L.height||675)-h.height)};L.on("object:moving",l=>re(l.target)),L.on("object:scaling",l=>re(l.target));let X=l=>{var F;if(S.current)return;let h=l.target,C=(F=h.get("data"))==null?void 0:F.id;h&&C&&y.current(C,I({x:h.left,y:h.top,width:h.getScaledWidth(),height:h.getScaledHeight()},h.isType("textbox")?{content:h.text,textAlign:h.textAlign,fontSize:h.fontSize,fontFamily:h.fontFamily,color:h.fill}:{fill:h.fill}))};L.on("object:modified",X),L.on("text:changed",X);let O=l=>{if(!(!l||!l.isType("textbox")))return{fontFamily:l.fontFamily,fontSize:l.fontSize,isBold:l.fontWeight==="bold",isItalic:l.fontStyle==="italic",isUnderline:l.underline,textAlign:l.textAlign,color:l.fill,highlightColor:l.textBackgroundColor,isBulleted:!!l.isBulleted,isNumbered:!!l.isNumbered}},te=(l,h=!1)=>{var C;try{let F=(C=H.current)==null?void 0:C.getBoundingClientRect();if(!F||!l)return;let D=0,oe=0,ie=(ae,_)=>typeof ae=="object"&&ae!==null&&typeof ae[_]=="function",Z=ie(l,"isType")&&l.isType("textbox");if(Z&&l.isEditing){let _=(Y=>{try{let le=Y.selectionStart||0;if(ie(Y,"getCursorCoords"))return Y.getCursorCoords(le);if(ie(Y,"_getCursorCoords"))return Y._getCursorCoords(le)}catch(le){}return null})(l);if(_){let Y=ne.util.transformPoint(new ne.Point(_.left,_.top),ie(l,"calcTransformMatrix")?l.calcTransformMatrix():[1,0,0,1,0,0]),le=L.viewportTransform||[1,0,0,1,0,0],Ne=ne.util.transformPoint(Y,le);D=F.left+Ne.x*f,oe=F.top+Ne.y*f}else{let Y=ie(l,"getBoundingRect")?l.getBoundingRect():{left:0,top:0,width:0,height:0};D=F.left+(Y.left+Y.width/2)*f,oe=F.top+Y.top*f}}else{let ae=ie(l,"getBoundingRect")?l.getBoundingRect():{left:ee.current.x,top:ee.current.y,width:0,height:0};D=F.left+(ae.left+ae.width/2)*f,oe=F.top+ae.top*f}if(D&&oe){let ae=h?"text-selection":Z?"textbox":"default",_=D,Y=oe;ae==="default"?(_=D+5,Y=oe+5):(_=D-220,Y=oe-140),v({x:_,y:Y},ae,O(l))}}catch(F){console.error("Critical error in triggerSlashMenu:",F)}},n=l=>{var C,F;let h=((C=l.selected)==null?void 0:C[0])||l.target;if(h){let D=(F=h.get("data"))==null?void 0:F.id;B.current(D),h.isType("textbox")&&!S.current&&te(h)}};L.on("selection:created",n),L.on("selection:updated",n),L.on("selection:cleared",()=>{B.current(null),v({x:0,y:0},"default")}),L.on("text:selection:changed",l=>{let h=l.target;h&&h.isType("textbox")&&h.selectionStart!==h.selectionEnd&&te(h,!0)}),L.on("mouse:move",l=>{l.pointer&&(ee.current={x:l.pointer.x,y:l.pointer.y})});let x=l=>{let h=g.current;if(!h)return;let C=h.getActiveObject();if(l.key==="/"){l.preventDefault(),te(C||{isType:()=>!1,getBoundingRect:()=>({left:ee.current.x,top:ee.current.y,width:0,height:0})});return}if(C&&C.isType("textbox")&&C.isEditing||!C)return;let F=l.shiftKey?10:1,D=!1;switch(l.key){case"ArrowLeft":C.set("left",C.left-F),D=!0;break;case"ArrowRight":C.set("left",C.left+F),D=!0;break;case"ArrowUp":C.set("top",C.top-F),D=!0;break;case"ArrowDown":C.set("top",C.top+F),D=!0;break}D&&(re(C),h.requestRenderAll(),X({target:C}))};window.addEventListener("keydown",x),L._keyboardListener=x}return()=>{if(g.current){let L=g.current._keyboardListener;L&&window.removeEventListener("keydown",L),g.current.dispose(),g.current=null}}},[]),(0,ue.useEffect)(()=>{if(!g.current)return;let L=g.current;(async()=>{S.current=!0;let X=L.getObjects(),O=new Set(u.elements.map(n=>n.id));X.forEach(n=>{var l;let x=(l=n.get("data"))==null?void 0:l.id;x&&!O.has(x)&&L.remove(n)});let te=[...u.elements].sort((n,x)=>(n.zIndex||0)-(x.zIndex||0));for(let n of te){let x=X.find(l=>{var h;return((h=l.get("data"))==null?void 0:h.id)===n.id});if(x&&x.type==="textbox"&&!(x instanceof it)&&(L.remove(x),x=null),x){if(x===L.getActiveObject()&&x.isType("textbox")&&x.isEditing)continue;let l={left:n.x,top:n.y,opacity:n.opacity!==void 0?n.opacity:1,zIndex:n.zIndex};n.type==="text"&&x.isType("textbox")?(l.text=n.content||" ",l.fontSize=n.fontSize||22,l.fill=n.color||"#000000",l.textBackgroundColor=n.highlightColor||"",l.textAlign=n.textAlign||"left",l.fontWeight=n.isBold?"bold":"normal",l.fontStyle=n.isItalic?"italic":"normal",l.underline=n.isUnderline||!1,l.linethrough=n.isStrikethrough||!1,l.charSpacing=n.charSpacing||0,l.fontFamily=n.fontFamily||"Arial",x.isBulleted=n.isBulleted,x.isNumbered=n.isNumbered,x.listType=n.listType,l.width=Math.max(n.width||50,10)):n.type==="shape"?(l.fill=n.fill||"#cccccc",l.scaleX=(n.width||50)/(x.width||1),l.scaleY=(n.height||50)/(x.height||1)):n.type==="image"&&(l.scaleX=(n.width||100)/(x.width||1),l.scaleY=(n.height||100)/(x.height||1)),x.set(l)}else{let l=null,h={left:n.x,top:n.y,data:{id:n.id},originX:"left",originY:"top",opacity:n.opacity!==void 0?n.opacity:1};if(n.type==="text")l=new it(n.content||" ",j(I({},h),{width:Math.max(n.width||200,10),fontSize:n.fontSize||22,fill:n.color||"#000000",backgroundColor:n.highlightColor||"",fontFamily:n.fontFamily||"Inter, Arial, sans-serif",textAlign:n.textAlign||"left",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isItalic?"italic":"normal",underline:n.isUnderline||!1,linethrough:n.isStrikethrough||!1,charSpacing:n.charSpacing||0,splitByGrapheme:!1,objectCaching:!1})),l.isBulleted=n.isBulleted,l.isNumbered=n.isNumbered,l.listType=n.listType;else if(n.type==="shape"){let C=n.fill||"#3b82f6";if(n.shapeType==="ellipse")l=new ne.Circle(j(I({},h),{radius:(n.width||100)/2,scaleY:(n.height||100)/(n.width||100),fill:C}));else if(n.shapeType==="rect")l=new ne.Rect(j(I({},h),{width:n.width||100,height:n.height||100,fill:C}));else{let F=Va[n.shapeType];if(F){l=new ne.Path(F,j(I({},h),{fill:C}));let D=l;D.set({scaleX:(n.width||100)/(D.width||1),scaleY:(n.height||100)/(D.height||1)})}else l=new ne.Rect(j(I({},h),{width:n.width||100,height:n.height||100,fill:C}))}}else if(n.type==="image")try{let C=await ne.FabricImage.fromURL(n.src);C.set(j(I({},h),{scaleX:(n.width||100)/(C.width||1),scaleY:(n.height||100)/(C.height||1)})),l=C}catch(C){console.error(C)}l&&L.add(l)}}L.renderAll(),S.current=!1})()},[u,$]);let N=u.elements.find(L=>L.id===s);return(0,V.jsx)("div",{ref:k,className:"w-full h-full flex items-center justify-center overflow-hidden relative",children:(0,V.jsxs)("div",{className:"border border-slate-200 overflow-hidden bg-white shadow-xl transition-all duration-300 ease-out shrink-0 relative",style:{transform:`scale(${f})`,transformOrigin:"center center"},children:[(0,V.jsx)("canvas",{ref:H}),u.elements.length===0&&(0,V.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none select-none animate-in fade-in duration-700",children:(0,V.jsx)("div",{className:"flex flex-col items-center gap-4 text-slate-300",children:(0,V.jsx)("div",{className:"flex flex-col items-center gap-1 text-center",children:(0,V.jsxs)("h1",{className:"text-2xl font-medium text-slate-400",children:["Click ",(0,V.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 rounded-md text-slate-500 font-bold",children:"/"})," for options"]})})})}),N&&N.type==="image"&&(0,V.jsxs)("div",{className:"absolute z-[5000] flex flex-col w-96 bg-white border border-slate-200 shadow-2xl rounded-2xl overflow-hidden animate-in fade-in zoom-in duration-200",style:{left:N.x+N.width/2>600?`${N.x-12}px`:`${N.x+N.width+12}px`,top:`${N.y+N.height/2}px`,transform:N.x+N.width/2>600?"translate(-100%, -50%)":"translate(0, -50%)"},children:[(0,V.jsx)("div",{className:"px-5 py-3.5 text-sm uppercase tracking-wider font-bold text-slate-400 bg-slate-50/50 border-b border-slate-100",children:"Image Actions"}),(0,V.jsxs)("div",{className:"p-2.5 flex flex-col gap-1",children:[(0,V.jsxs)("button",{onClick:L=>{L.stopPropagation(),R()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,V.jsx)("div",{className:"p-3 rounded-xl bg-blue-50 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,V.jsx)(Be.Sparkles,{size:28})}),(0,V.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,V.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Generate Image"}),(0,V.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Create an image with AI prompt"})]})]}),(0,V.jsxs)("button",{onClick:L=>{L.stopPropagation(),T()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,V.jsx)("div",{className:"p-3 rounded-xl bg-purple-50 text-purple-600 group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,V.jsx)(Be.PieChart,{size:28})}),(0,V.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,V.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Infographic"}),(0,V.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Generate chart or diagram"})]})]}),(0,V.jsxs)("button",{onClick:L=>{L.stopPropagation(),P()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,V.jsx)("div",{className:"p-3 rounded-xl bg-slate-100 text-slate-500 group-hover:bg-slate-200 group-hover:text-slate-700 transition-colors",children:(0,V.jsx)(Be.Image,{size:28})}),(0,V.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,V.jsx)("span",{className:"text-lg font-bold text-slate-700",children:"Change Image"}),(0,V.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Replace with local file"})]})]}),(0,V.jsx)("div",{className:"h-[1px] bg-slate-100 my-1 mx-3"}),(0,V.jsxs)("button",{onClick:L=>{L.stopPropagation(),r()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-red-50 group",children:[(0,V.jsx)("div",{className:"p-3 rounded-xl bg-red-50 text-red-500 group-hover:bg-red-500 group-hover:text-white transition-colors",children:(0,V.jsx)(Be.Trash2,{size:28})}),(0,V.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,V.jsx)("span",{className:"text-lg font-bold text-red-600",children:"Delete Element"}),(0,V.jsx)("span",{className:"text-sm text-red-400/80 truncate leading-tight",children:"Remove from slide"})]})]})]})]})]})})};var sa=Fe(require("pptxgenjs"));var Ke=class{async export(a){var r,H;let c=new sa.default,m=((r=a.layout)==null?void 0:r.width)||12192e3,v=((H=a.layout)==null?void 0:H.height)||6858e3,s=1200,R=675,T=g=>g/s*(m/914400),P=g=>g/R*(v/914400);a.slides.forEach(g=>{let S=c.addSlide();[...g.elements].sort((B,k)=>B.zIndex-k.zIndex).forEach(B=>{var G,$;let k=B.opacity!==void 0?(1-B.opacity)*100:0,f={x:T(B.x),y:P(B.y),w:T(B.width),h:P(B.height)};if(B.type==="text")S.addText(B.content,j(I({},f),{fontSize:(B.fontSize||18)/2,color:((G=B.color)==null?void 0:G.replace("#",""))||"000000",fontFace:B.fontFamily||"Arial"}));else if(B.type==="image")S.addImage(j(I({},f),{path:B.src,transparency:k}));else if(B.type==="shape"){let E=B.shapeType==="ellipse"?c.ShapeType.ellipse:c.ShapeType.rect;S.addShape(E,j(I({},f),{fill:{color:(($=B.fill)==null?void 0:$.replace("#",""))||"CCCCCC",transparency:k>0?Math.min(k+10,100):0}}))}})}),await c.writeFile({fileName:"presentation.pptx"})}};var oa=Fe(require("jszip")),Je=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(a){var H,g;let c=a;if(typeof a=="string"){let S=await fetch(a);if(!S.ok){let y=S.status,B=S.statusText,k="";try{let f=await S.json();k=f.details||f.error||""}catch(f){}throw new Error(`Failed to fetch PPTX from ${a}: ${y} ${B} ${k?`(${k})`:""}`)}c=await S.arrayBuffer()}let m=await oa.default.loadAsync(c),v=await((H=m.file("ppt/presentation.xml"))==null?void 0:H.async("string"));if(!v)throw new Error("Invalid PPTX");let R=new DOMParser().parseFromString(v,"text/xml"),T=this.findFirstByLocalName(R,"sldSz");T&&(this.slideWidth=parseInt(this.getAttr(T,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(T,"cy")||"6858000"));let P=Array.from(R.getElementsByTagNameNS("*","sldId")),r=[];for(let S=0;S<P.length;S++){let y=S+1,B=`ppt/slides/slide${y}.xml`,k=await((g=m.file(B))==null?void 0:g.async("string"));if(k){let f=await this.parseSlide(k,y,m);r.push(f)}}return{slides:r,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(a,c){return a.getAttribute(c)||a.getAttribute(`a:${c}`)||a.getAttribute(`p:${c}`)||a.getAttribute(`r:${c}`)}findFirstByLocalName(a,c){let m=a.getElementsByTagNameNS("*",c);return m.length>0?m[0]:null}findAllByLocalName(a,c){return Array.from(a.getElementsByTagNameNS("*",c))}scaleX(a){return a/this.slideWidth*this.CANVAS_WIDTH}scaleY(a){return a/this.slideHeight*this.CANVAS_HEIGHT}parseColor(a){let c=this.findFirstByLocalName(a,"srgbClr");if(c){let v=`#${this.getAttr(c,"val")}`,s=this.findFirstByLocalName(c,"alpha"),R=s?parseInt(this.getAttr(s,"val")||"100000")/1e5:1;return{color:v,opacity:R}}let m=this.findFirstByLocalName(a,"schemeClr");if(m){let v=this.findFirstByLocalName(m,"alpha");return{color:"#000000",opacity:v?parseInt(this.getAttr(v,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(a,c,m){var r,H;let v=await((r=m.file(`ppt/slides/_rels/slide${c}.xml.rels`))==null?void 0:r.async("string"));if(!v)return null;let R=new DOMParser().parseFromString(v,"text/xml"),T=Array.from(R.getElementsByTagName("Relationship")).find(g=>g.getAttribute("Id")===a),P=T==null?void 0:T.getAttribute("Target");if(P){let g=(P.startsWith("../")?`ppt/${P.substring(3)}`:`ppt/slides/${P}`).replace("ppt/slides/../","ppt/");return await((H=m.file(g))==null?void 0:H.async("blob"))||null}return null}async parseSlide(a,c,m){let s=new DOMParser().parseFromString(a,"text/xml"),R=[],T=0,P=this.findFirstByLocalName(s,"bg");if(P){let g=this.findFirstByLocalName(P,"blip"),S=(g==null?void 0:g.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(g==null?void 0:g.getAttribute("r:embed"));if(S){let y=await this.resolveImage(S,c,m);y&&R.push({id:`bg-${c}`,type:"image",src:URL.createObjectURL(y),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:T++,opacity:1})}}let r=this.findFirstByLocalName(s,"spTree");if(!r)return{id:`slide-${c}`,elements:R};let H=Array.from(r.children);for(let g of H){let S=g.localName;if(S==="sp"){let y=this.findFirstByLocalName(g,"txBody"),B=this.findFirstByLocalName(g,"nvSpPr"),k=B?this.findFirstByLocalName(B,"nvPr"):null,f=k?this.findFirstByLocalName(k,"ph"):null,G=f?this.getAttr(f,"type"):null,$=f&&(!G||G==="body"),E=this.findFirstByLocalName(g,"xfrm"),ee=E?this.findFirstByLocalName(E,"off"):null,N=E?this.findFirstByLocalName(E,"ext"):null;if(y&&ee&&N){let re=this.findAllByLocalName(y,"p"),X="",O=18,te="#000000",n=1,x=!1,l=!1;for(let h of re){let C=this.findFirstByLocalName(h,"pPr"),F=C?this.findFirstByLocalName(C,"buNone"):null,D="";C&&!F?this.findFirstByLocalName(C,"buAutoNum")?l=!0:(this.findFirstByLocalName(C,"buChar")||parseInt(this.getAttr(C,"indent")||"0")<0||$)&&(x=!0):!C&&$&&(x=!0);let oe=this.findAllByLocalName(h,"r");for(let he of oe){let ae=this.findFirstByLocalName(he,"t");ae&&(D+=ae.textContent);let _=this.findFirstByLocalName(he,"rPr");if(_){let Y=this.getAttr(_,"sz");Y&&(O=parseInt(Y)/100*2);let le=this.parseColor(_);te=le.color,n=le.opacity}}let ie=/^\s*([•\u2022\u2023\u25E6\u2043\u2219])\s+/;D.match(ie)&&(x=!0,D=D.replace(ie,"")),X+=D+`
|
|
4
|
-
`}if(X.trim()){R.push({id:`el-${c}-${Date.now()}-${T}`,type:"text",content:X.trim(),x:this.scaleX(parseInt(this.getAttr(ee,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(ee,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(N,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(N,"cy")||"0")),fontSize:O,color:te,fontFamily:"Arial",zIndex:T++,isBulleted:x,isNumbered:l,listType:l?"number-decimal":x?"bullet-disc":"none",opacity:n});continue}}let L=this.findFirstByLocalName(g,"prstGeom");if(L&&ee&&N){let re=this.getAttr(L,"prst")||"rect",X=this.findFirstByLocalName(g,"spPr"),O=X?this.parseColor(X):{color:"#cccccc",opacity:1},te={rect:"rect",roundRect:"rect",ellipse:"ellipse",circle:"ellipse",triangle:"triangle",rtTriangle:"rightTriangle",diamond:"rhombus",parallelogram:"parallelogram",trapezoid:"trapezoid",pentagon:"pentagon",hexagon:"hexagon",heptagon:"heptagon",octagon:"octagon",heart:"heart",smileyFace:"smiley",sun:"sun",moon:"moon",rightArrow:"arrowRight",leftArrow:"arrowLeft",upArrow:"arrowUp",downArrow:"arrowDown",leftRightArrow:"arrowLeftRight",upDownArrow:"arrowUpDown",star4:"star4",star5:"star5",star6:"star6",star8:"star8",cloud:"cloud",lightningBolt:"lightning",plus:"plus",minus:"minus",multiply:"multiply",divide:"divide",equal:"equal"};R.push({id:`el-${c}-${Date.now()}-${T}`,type:"shape",shapeType:te[re]||"rect",fill:O.color,opacity:O.opacity,x:this.scaleX(parseInt(this.getAttr(ee,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(ee,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(N,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(N,"cy")||"0")),zIndex:T++})}}if(S==="pic"){let y=this.findFirstByLocalName(g,"blip"),B=(y==null?void 0:y.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(y==null?void 0:y.getAttribute("r:embed")),k=this.findFirstByLocalName(g,"xfrm"),f=k?this.findFirstByLocalName(k,"off"):null,G=k?this.findFirstByLocalName(k,"ext"):null;if(B&&f&&G){let $=await this.resolveImage(B,c,m);$&&R.push({id:`el-${c}-${Date.now()}-${T}`,type:"image",src:URL.createObjectURL($),x:this.scaleX(parseInt(this.getAttr(f,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(f,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(G,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(G,"cy")||"0")),zIndex:T++,opacity:1})}}}return{id:`slide-${c}`,elements:R}}};var Ze=require("react"),Ge=require("lucide-react");var me=require("react/jsx-runtime"),kt=({presentation:u,initialSlideIndex:a,onClose:c})=>{let[m,v]=(0,Ze.useState)(a),s=u.slides[m],R=()=>{m>0&&v(m-1)},T=()=>{m<u.slides.length-1&&v(m+1)};(0,Ze.useEffect)(()=>{let H=g=>{g.key==="ArrowRight"||g.key===" "||g.key==="PageDown"?T():g.key==="ArrowLeft"||g.key==="Backspace"||g.key==="PageUp"?R():g.key==="Escape"&&c()};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[m]);let[P,r]=(0,Ze.useState)(1);return(0,Ze.useEffect)(()=>{let H=()=>{let S=window.innerWidth-40,y=window.innerHeight-40,B=1200,k=675,f=S/B,G=y/k,$=Math.min(f,G);r($)};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),(0,me.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-[#0A0A0A] flex flex-col items-center justify-center overflow-hidden",children:[(0,me.jsxs)("div",{className:"absolute top-0 left-0 right-0 p-6 flex justify-between items-center opacity-0 hover:opacity-100 transition-opacity bg-gradient-to-b from-black/60 to-transparent z-[100] pointer-events-none",children:[(0,me.jsxs)("div",{className:"text-white/80 font-bold ml-4 pointer-events-auto",children:["Slide ",m+1," of ",u.slides.length]}),(0,me.jsx)("button",{onClick:c,className:"p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all pointer-events-auto",children:(0,me.jsx)(Ge.X,{size:24})})]}),(0,me.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,me.jsx)("div",{className:"relative shadow-2xl shadow-black/80 bg-white",style:{width:"1200px",height:"675px",transform:`scale(${P})`,transformOrigin:"center center"},children:(0,me.jsx)(lt,{slide:s,onElementUpdate:()=>{},onSelect:()=>{},uiScale:.75,onSlashCommand:()=>{},selectedElementId:null,onAiGenerateClick:()=>{},onAiGenerateInfographicClick:()=>{},onUploadImageClick:()=>{},onDeleteElement:()=>{}})})}),(0,me.jsxs)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center gap-6 opacity-0 hover:opacity-100 transition-opacity bg-black/40 backdrop-blur-md px-6 py-3 rounded-full border border-white/10 pointer-events-auto",children:[(0,me.jsx)("button",{disabled:m===0,onClick:R,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,me.jsx)(Ge.ChevronLeft,{size:32})}),(0,me.jsx)("div",{className:"h-6 w-[1px] bg-white/10"}),(0,me.jsx)("button",{disabled:m===u.slides.length-1,onClick:T,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,me.jsx)(Ge.ChevronRight,{size:32})})]})]})};var Ct=require("@google/generative-ai");var xe=require("lucide-react"),K=require("react/jsx-runtime"),ia=({result:u,isLoading:a,onAction:c,onClose:m,position:v})=>(0,K.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[2000] w-80 bg-white border border-slate-200 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 overflow-hidden text-left",children:[(0,K.jsxs)("div",{className:"px-3 py-2.5 bg-blue-50/50 border-b border-blue-100 flex items-center justify-between",children:[(0,K.jsxs)("span",{className:"text-xs font-bold text-blue-700 uppercase tracking-wider flex items-center gap-2",children:[(0,K.jsx)(xe.Sparkles,{size:12}),"Refined Text"]}),(0,K.jsx)("button",{onClick:m,className:"text-slate-400 hover:text-slate-600",children:(0,K.jsx)(xe.X,{size:14})})]}),a?(0,K.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center gap-3 text-slate-400",children:[(0,K.jsx)(xe.RefreshCw,{size:24,className:"animate-spin text-blue-500"}),(0,K.jsx)("span",{className:"text-xs font-medium",children:"Refining text..."})]}):(0,K.jsxs)("div",{className:"flex flex-col",children:[(0,K.jsx)("div",{className:"p-4 bg-slate-50/50 max-h-[300px] overflow-y-auto text-sm text-slate-700 leading-relaxed border-b border-slate-100",children:u}),(0,K.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,K.jsxs)("button",{onClick:()=>c("replace"),className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,K.jsx)(xe.Check,{size:14,className:"text-slate-400"}),(0,K.jsx)("span",{children:"Replace selection"})]}),(0,K.jsxs)("button",{onClick:()=>c("addBelow"),className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,K.jsx)(xe.ArrowRightFromLine,{size:14,className:"text-slate-400 rotate-90"}),(0,K.jsx)("span",{children:"Insert below"})]}),(0,K.jsxs)("button",{onClick:()=>c("regenerate"),className:"flex items-center gap-2 px-2 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors text-left",children:[(0,K.jsx)(xe.RefreshCw,{size:14}),(0,K.jsx)("span",{children:"Try again"})]}),(0,K.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,K.jsxs)("button",{onClick:()=>c("discard"),className:"flex items-center gap-2 px-2 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors text-left",children:[(0,K.jsx)(xe.Trash2,{size:14}),(0,K.jsx)("span",{children:"Discard"})]})]})]})]});var se=Fe(require("react")),b=require("lucide-react");var t=require("react/jsx-runtime"),Fa=["Inter","Arial","Lato","Open Sans","Poppins","Roboto","Georgia","Times New Roman"],$a=[8,9,10,11,12,14,16,18,20,24,28,32,36,48,64,72,96],la=({onClose:u,onAction:a,position:c,canUseAi:m,mode:v="default",context:s,aiResult:R,isAiLoading:T,onAiResponseAction:P})=>{let[r,H]=(0,se.useState)(""),[g,S]=(0,se.useState)(0),y=(0,se.useRef)(null),[B,k]=(0,se.useState)(!1),[f,G]=(0,se.useState)(!1),[$,E]=(0,se.useState)(!1),[ee,N]=(0,se.useState)(!1),[L,re]=(0,se.useState)(!1),X=(0,se.useMemo)(()=>[{id:"generate-image",label:"AI Generate Image",icon:b.Sparkles,category:"AI",description:"Create an image with AI prompt",action:()=>a("generate-image")},{id:"generate-infographic",label:"AI Generate Infographic",icon:b.PieChart,category:"AI",description:"Create an infographic with AI prompt",action:()=>a("generate-infographic")},{id:"text",label:"Text Box",icon:b.Type,category:"Basic",description:"Insert a new text element",action:()=>a("add-text")},{id:"image",label:"Image",icon:b.Image,category:"Basic",description:"Upload and insert an image",action:()=>a("add-image")},{id:"new-slide",label:"New Slide",icon:b.PlusCircle,category:"Canvas",description:"Add a fresh slide to deck",action:()=>a("new-slide")},{id:"rect",label:"Rectangle",icon:b.Square,category:"Shapes",action:()=>a("add-shape","rect")},{id:"circle",label:"Circle",icon:b.Circle,category:"Shapes",action:()=>a("add-shape","circle")},{id:"triangle",label:"Triangle",icon:b.Triangle,category:"Shapes",action:()=>a("add-shape","triangle")},{id:"star5",label:"Star",icon:b.Star,category:"Shapes",action:()=>a("add-shape","star5")},{id:"arrowRight",label:"Arrow",icon:b.ArrowRight,category:"Shapes",action:()=>a("add-shape","arrowRight")}],[a]),O=(0,se.useMemo)(()=>X.filter(x=>x.label.toLowerCase().includes(r.toLowerCase())||x.category.toLowerCase().includes(r.toLowerCase())),[X,r]);if((0,se.useEffect)(()=>{S(0)},[r]),(0,se.useEffect)(()=>{let x=l=>{v==="default"&&(l.key==="ArrowDown"?(l.preventDefault(),S(h=>(h+1)%O.length)):l.key==="ArrowUp"?(l.preventDefault(),S(h=>(h-1+O.length)%O.length)):l.key==="Enter"&&(l.preventDefault(),O[g]&&O[g].action())),l.key==="Escape"&&(l.preventDefault(),u())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[O,g,u,v]),(0,se.useEffect)(()=>{if(v==="default"&&y.current){let x=y.current.children[g];x&&x.scrollIntoView({block:"nearest"})}},[g,v]),v==="default"&&O.length===0&&r==="")return null;if(v==="textbox"||v==="text-selection"){let x=(s==null?void 0:s.fontFamily)||"Arial",l=(s==null?void 0:s.fontSize)||24,h=(0,se.useRef)(null),[C,F]=(0,se.useState)(null);se.default.useLayoutEffect(()=>{if(h.current){let Z=h.current.getBoundingClientRect(),he=window.innerWidth,ae=window.innerHeight,_=c.x,Y=c.y;_+Z.width>he-100&&(_=he-Z.width-100),_=Math.max(10,_),Y+Z.height>ae-20&&(Y=ae-Z.height-20),F({x:_,y:Y})}},[c.x,c.y]);let D=C||{x:c.x,y:c.y},oe=C?1:0,ie=D.y>window.innerHeight/2;return(0,t.jsxs)("div",{ref:h,className:"fixed z-[9999] bg-white rounded-xl shadow-[0_20px_50px_rgba(0,0,0,0.15)] border border-slate-200 p-2.5 flex flex-col gap-2.5 animate-in fade-in zoom-in-95 duration-200",style:{left:`${D.x}px`,top:`${D.y}px`,width:"auto",minWidth:"440px",maxWidth:"90vw",opacity:oe},onClick:Z=>Z.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 h-9",children:[(0,t.jsxs)("div",{className:"flex items-center bg-slate-50 border border-slate-200 rounded-lg h-full flex-1 shadow-sm",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsxs)("button",{onClick:()=>{k(!B),G(!1)},className:"w-full flex items-center justify-between px-3 h-full text-xs font-bold text-slate-800 hover:bg-white transition-colors border-r border-slate-100 rounded-l-lg",children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(b.ChevronDown,{size:14,className:"text-slate-400"})]}),B&&(0,t.jsx)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[180px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:Fa.map(Z=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontFamily:Z}),k(!1)},className:M("w-full text-left px-4 py-2 text-xs hover:bg-blue-50 transition-colors",x===Z?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),style:{fontFamily:Z},children:Z},Z))})]}),(0,t.jsxs)("div",{className:"relative w-16",children:[(0,t.jsxs)("button",{onClick:()=>{G(!f),k(!1)},className:"w-full flex items-center justify-between px-2 h-full text-xs font-black text-slate-900 hover:bg-white transition-colors rounded-r-lg",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)(b.ChevronDown,{size:14,className:"text-slate-400"})]}),f&&(0,t.jsx)("div",{className:"absolute top-full right-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[80px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:$a.map(Z=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontSize:Z}),G(!1)},className:M("w-full text-center px-4 py-2 text-xs hover:bg-blue-50 transition-colors",l===Z?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),children:Z},Z))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-1 bg-slate-50 border border-slate-200 rounded-lg h-full shadow-sm",children:[(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:l+2}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Increase font size",children:[(0,t.jsx)("span",{className:"text-[13px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(b.ChevronUp,{size:10,strokeWidth:4,className:"ml-0.5"})]}),(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:Math.max(1,l-2)}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Decrease font size",children:[(0,t.jsx)("span",{className:"text-[11px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(b.ChevronDown,{size:10,strokeWidth:4,className:"ml-0.5"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 border-t border-slate-100 pt-2.5 flex-nowrap",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!(s!=null&&s.isBold)}),className:M("p-1 rounded-[3px] transition-all",s!=null&&s.isBold?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Bold",children:(0,t.jsx)(b.Bold,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{isItalic:!(s!=null&&s.isItalic)}),className:M("p-1 rounded-[3px] transition-all",s!=null&&s.isItalic?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Italic",children:(0,t.jsx)(b.Italic,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{isUnderline:!(s!=null&&s.isUnderline)}),className:M("p-1 rounded-[3px] transition-all",s!=null&&s.isUnderline?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Underline",children:(0,t.jsx)(b.Underline,{size:14,strokeWidth:2.5})}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>re(!L),className:M("flex items-center gap-1 px-1.5 py-0.5 rounded-[3px] transition-all text-xs font-bold whitespace-nowrap border border-transparent",L?"bg-purple-50 text-purple-600 border-purple-100":"text-slate-500 hover:bg-purple-50 hover:text-purple-600"),children:[(0,t.jsx)(b.Sparkles,{size:12,className:L?"fill-purple-300":""}),(0,t.jsx)("span",{children:"Ask AI"}),(0,t.jsx)(b.ChevronDown,{size:10,className:"opacity-50"})]}),L&&(0,t.jsxs)("div",{className:M("absolute left-0 w-80 bg-white border border-slate-200 rounded-xl shadow-2xl z-[1000] animate-in fade-in zoom-in-95 duration-200 overflow-hidden text-left flex flex-col max-h-[300px]",ie?"bottom-full mb-2 origin-bottom-left":"top-full mt-2 origin-top-left"),children:[(0,t.jsx)("div",{className:"px-3 py-2.5 bg-purple-50/50 border-b border-purple-100 flex items-center justify-between",children:(0,t.jsxs)("span",{className:"text-xs font-bold text-purple-700 uppercase tracking-wider flex items-center gap-2",children:[(0,t.jsx)(b.Sparkles,{size:12}),"Ask AI"]})}),T?(0,t.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center gap-3 text-slate-400",children:[(0,t.jsx)(b.RefreshCw,{size:24,className:"animate-spin text-purple-500"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"AI is thinking..."})]}):R?(0,t.jsxs)("div",{className:"flex flex-col overflow-y-auto max-h-[200px]",children:[(0,t.jsx)("div",{className:"p-4 bg-slate-50/50 text-sm text-slate-700 leading-relaxed border-b border-slate-100",children:R}),(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{P==null||P("replace"),re(!1)},className:"flex items-center gap-2 px-1 py-1 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.Check,{size:14,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Replace selection"})]}),(0,t.jsxs)("button",{onClick:()=>{P==null||P("addBelow"),re(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.ArrowRightFromLine,{size:14,className:"text-slate-400 rotate-90"}),(0,t.jsx)("span",{children:"Insert below"})]}),(0,t.jsxs)("button",{onClick:()=>{P==null||P("regenerate"),re(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.RefreshCw,{size:14}),(0,t.jsx)("span",{children:"Try again"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsxs)("button",{onClick:()=>{P==null||P("discard"),re(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.Trash2,{size:14}),(0,t.jsx)("span",{children:"Discard"})]})]})]}):(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5 overflow-y-auto max-h-[200px]",children:[(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Edit Selection"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","rewrite")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.RefreshCw,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Improve writing"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","grammar")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.SpellCheck,{size:14,className:"text-green-500"}),(0,t.jsx)("span",{children:"Fix grammar"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","shorten")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.ALargeSmall,{size:14,className:"text-orange-500"}),(0,t.jsx)("span",{children:"Make shorter"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","lengthen")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.ArrowRightFromLine,{size:14,className:"text-purple-500"}),(0,t.jsx)("span",{children:"Make longer"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Generate"}),(0,t.jsxs)("button",{onClick:()=>{a("generate-image"),re(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.Image,{size:14,className:"text-pink-500"}),(0,t.jsx)("span",{children:"Generate Image"})]}),(0,t.jsxs)("button",{onClick:()=>{a("generate-infographic"),re(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.PieChart,{size:14,className:"text-indigo-500"}),(0,t.jsx)("span",{children:"Generate Infographic"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"More"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","continue")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(b.MoveDown,{size:14,className:"text-teal-500"}),(0,t.jsx)("span",{children:"Continue writing"})]})]})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBulleted:!(s!=null&&s.isBulleted),isNumbered:!1,listType:s!=null&&s.isBulleted?"none":"bullet-disc"}),className:M("p-1 rounded-l-[3px] transition-all",s!=null&&s.isBulleted?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Bullets",children:(0,t.jsx)(b.List,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>E(!$),className:M("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",$?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(b.ChevronDown,{size:10,className:"text-slate-400"})}),$&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!1,listType:"none"}),E(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),E(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),E(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),E(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),E(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsxs)("div",{className:"relative text-black flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isNumbered:!(s!=null&&s.isNumbered),isBulleted:!1,listType:s!=null&&s.isNumbered?"none":"number-decimal"}),className:M("p-1 rounded-l-[3px] transition-all",s!=null&&s.isNumbered?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Numbering",children:(0,t.jsx)(b.ListOrdered,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>N(!ee),className:M("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",ee?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(b.ChevronDown,{size:10,className:"text-slate-400"})}),ee&&(0,t.jsxs)("div",{className:"absolute text-black top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!1,listType:"none"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),N(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"i."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"ii."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Font Color",children:[(0,t.jsx)("span",{className:"text-[13px] font-black text-slate-800 leading-none",children:"A"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.color)||"#000000"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.color)||"#000000",onChange:Z=>a("format",{color:Z.target.value})})]}),(0,t.jsx)(b.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Highlight Color",children:[(0,t.jsx)(b.Highlighter,{size:14,strokeWidth:2.5,className:s!=null&&s.highlightColor?"text-slate-900":"text-slate-500"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.highlightColor)||"transparent"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.highlightColor)||"#ffff00",onChange:Z=>a("format",{highlightColor:Z.target.value})})]}),(0,t.jsx)(b.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000"}),className:"p-1 rounded-[3px] text-slate-400 hover:bg-slate-50 hover:text-slate-600 transition-all",title:"Clear Formatting",children:(0,t.jsx)(b.Eraser,{size:14,strokeWidth:2.5})}),(0,t.jsxs)("div",{className:"gap-0.5 ml-auto",children:[(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"left"}),className:M("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="left"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(b.AlignLeft,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"center"}),className:M("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="center"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(b.AlignCenter,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"right"}),className:M("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="right"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(b.AlignRight,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"justify"}),className:M("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="justify"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(b.AlignJustify,{size:12,strokeWidth:2.5})})]})]})]})}let te=Math.max(10,Math.min(c.x,window.innerWidth-300)),n=Math.max(10,Math.min(c.y,window.innerHeight-450));return(0,t.jsxs)("div",{className:"fixed z-[9999] w-72 bg-white rounded-xl shadow-2xl border border-slate-200 overflow-hidden flex flex-col animate-in fade-in zoom-in duration-200",style:{left:`${te}px`,top:`${n}px`,maxHeight:"400px"},onClick:x=>x.stopPropagation(),children:[(0,t.jsxs)("div",{className:"p-3 border-b border-slate-100 flex items-center gap-2 bg-slate-50/50",children:[(0,t.jsx)(b.Search,{size:14,className:"text-slate-400"}),(0,t.jsx)("input",{autoFocus:!0,type:"text",placeholder:"Type a command...",className:"bg-transparent border-none outline-none text-sm w-full font-medium text-slate-700 placeholder:text-slate-400",value:r,onChange:x=>H(x.target.value)})]}),(0,t.jsx)("div",{ref:y,className:"overflow-y-auto py-2 px-1 custom-scrollbar",children:O.length>0?O.map((x,l)=>{let h=l===g,C=l===0||O[l-1].category!==x.category;return(0,t.jsxs)(se.default.Fragment,{children:[C&&(0,t.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider font-bold text-slate-400",children:x.category}),(0,t.jsxs)("button",{className:M("w-full flex items-center gap-3 px-3 py-2 text-left transition-all duration-150 rounded-lg group",h?"bg-slate-100":"hover:bg-slate-50"),onClick:()=>x.action(),onMouseEnter:()=>S(l),children:[(0,t.jsx)("div",{className:M("p-1.5 rounded-md transition-colors flex items-center justify-center relative",h?"bg-white shadow-sm text-blue-600":"bg-slate-100 text-slate-500 group-hover:text-slate-700"),children:(0,t.jsx)(x.icon,{size:16})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:M("text-sm font-semibold truncate",h?"text-slate-900":"text-slate-700"),children:x.label}),x.description&&(0,t.jsx)("span",{className:"text-[11px] text-slate-400 truncate leading-tight",children:x.description})]}),h&&(0,t.jsx)("div",{className:"ml-auto text-[10px] font-mono font-bold text-slate-400 flex items-center gap-1 border border-slate-200 rounded px-1 bg-white",children:(0,t.jsx)("span",{children:"\u21B5"})})]})]},x.id)}):(0,t.jsxs)("div",{className:"px-3 py-8 text-center flex flex-col items-center gap-2",children:[(0,t.jsx)("div",{className:"p-3 bg-slate-50 rounded-full",children:(0,t.jsx)(b.Search,{size:20,className:"text-slate-300"})}),(0,t.jsxs)("span",{className:"text-sm text-slate-400 font-medium whitespace-nowrap",children:['No commands found for "',r,'"']})]})}),(0,t.jsxs)("div",{className:"px-3 py-2 border-t border-slate-100 bg-slate-50/50 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"\u2191\u2193"}),(0,t.jsx)("span",{children:"to navigate"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"Esc"}),(0,t.jsx)("span",{children:"to close"})]})]})]})};var q=require("lucide-react");var na=require("react"),Pe=require("lucide-react");var Ie=require("react/jsx-runtime"),ca=({message:u,type:a="info",isOpen:c,onClose:m,autoHideDuration:v=4e3})=>{if((0,na.useEffect)(()=>{if(c&&v>0){let T=setTimeout(()=>{m()},v);return()=>clearTimeout(T)}},[c,v,m]),!c)return null;let s={error:(0,Ie.jsx)(Pe.AlertCircle,{size:20,className:"text-white"}),success:(0,Ie.jsx)(Pe.CheckCircle,{size:20,className:"text-white"}),info:(0,Ie.jsx)(Pe.Info,{size:20,className:"text-white"})};return(0,Ie.jsxs)("div",{className:M("fixed bottom-6 right-6 z-[10000] flex items-center gap-3 px-4 py-2 rounded-md shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300 min-w-[280px] max-w-[400px]",{error:"bg-red-500",success:"bg-emerald-500",info:"bg-slate-800"}[a]),children:[s[a],(0,Ie.jsx)("span",{className:"text-white text-sm font-medium flex-1",children:u}),(0,Ie.jsx)("button",{onClick:m,className:"p-1 hover:bg-white/20 rounded-full transition-colors ml-1",children:(0,Ie.jsx)(Pe.X,{size:14,className:"text-white"})})]})};var i=require("react/jsx-runtime"),Za=({initialPresentation:u,url:a,appName:c="My Studio",onChange:m,geminiApiKey:v="AIzaSyAcBfseKzoFZJMfuRzhRJjygQ-u2UKFxOw",width:s,height:R,appBgColor:T="#B7472A",showHomeOnEmpty:P=!1,initialSource:r,onSourceChange:H,proxyUrl:g,onGenerateImage:S,onGenerateInfographic:y,onAiRewrite:B,onAiGrammar:k,onAiShorten:f,onAiLengthen:G,onAiContinue:$,isTwoStepInfographicGeneration:E,onRefineInfographicPrompt:ee})=>{var Wt,qt;let[N,L]=(0,A.useState)(u||{slides:[{id:"slide-1",elements:[]}],layout:{width:12192e3,height:6858e3}}),[re,X]=(0,A.useState)([]),[O,te]=(0,A.useState)([]),[n,x]=(0,A.useState)(0),[l,h]=(0,A.useState)(null),[C,F]=(0,A.useState)(!1),[D,oe]=(0,A.useState)(null),[ie,Z]=(0,A.useState)(null),[he,ae]=(0,A.useState)(!1),[_,Y]=(0,A.useState)(r||(a?"url":null)),[le,Ne]=(0,A.useState)(P&&!u&&!a&&!r),[be,Te]=(0,A.useState)(""),[W,He]=(0,A.useState)({visible:!1,position:{x:0,y:0},mode:"default"}),[zt,je]=(0,A.useState)(!1),[U,de]=(0,A.useState)(""),[ve,ke]=(0,A.useState)(!1),[Ce,Qe]=(0,A.useState)(null),[nt,St]=(0,A.useState)(!1),[Ee,De]=(0,A.useState)(!1),[pa,et]=(0,A.useState)(!1),[ct,It]=(0,A.useState)(""),[dt,Mt]=(0,A.useState)(!1),[Le,tt]=(0,A.useState)(null),[pt,At]=(0,A.useState)(!1),[ga,Bt]=(0,A.useState)(!1),[gt,Oe]=(0,A.useState)(null),[ua,Pt]=(0,A.useState)(!1),[ut,Tt]=(0,A.useState)({open:!1,message:"",type:"info"}),Me=(o,p="info")=>{Tt({open:!0,message:o,type:p})};(0,A.useEffect)(()=>{Ce&&(St(!1),De(!0))},[Ce]),(0,A.useEffect)(()=>{Le&&(At(!1),De(!0))},[Le]),(0,A.useEffect)(()=>{a&&st(a)},[a]);let[mt,Re]=(0,A.useState)(!1),[ze,We]=(0,A.useState)(null);(0,A.useEffect)(()=>{oe(null),Z(null),We(null),Re(!1)},[l]);let at=(0,A.useMemo)(()=>{let o=typeof s=="number"?s:parseInt(String(s));return isNaN(o)?1:Math.min(Math.max(o/1600,.7),1)},[s]),we=N.slides[n],Ve=(0,A.useMemo)(()=>we.elements.find(o=>o.id===l)||null,[we,l]),qe=(0,A.useCallback)(o=>{X(p=>[...p.slice(-19),N]),te([]),L(o),m==null||m(o)},[m,N]),Ht=()=>{if(re.length===0)return;let o=re[re.length-1];te(p=>[...p,N]),X(p=>p.slice(0,-1)),L(o)},bt=()=>{if(O.length===0)return;let o=O[O.length-1];X(p=>[...p,N]),te(p=>p.slice(0,-1)),L(o)},Se=(0,A.useCallback)(o=>{L(p=>{let d=[...p.slides];d[n]=I(I({},d[n]),o);let z=j(I({},p),{slides:d});return X(J=>[...J.slice(-19),p]),te([]),m==null||m(z),z})},[n,m]),Ue=(0,A.useCallback)((o,p)=>{L(d=>{let z=d.slides[n],J=z.elements.map(ce=>ce.id===o?I(I({},ce),p):ce),pe=[...d.slides];pe[n]=j(I({},z),{elements:J});let ye=j(I({},d),{slides:pe});return m==null||m(ye),ye})},[n,m]),jt=o=>{if(!l)return;if(we.elements.find(d=>d.id===l)){Ue(l,o);let d=N.slides[n],z=d.elements.map(pe=>pe.id===l?I(I({},pe),o):pe),J=[...N.slides];J[n]=j(I({},d),{elements:z}),qe(j(I({},N),{slides:J}))}},Xe=(0,A.useCallback)(()=>{if(!l)return;let p=N.slides[n].elements.filter(d=>d.id!==l);Se({elements:p}),h(null)},[l,n,N,Se]),Rt=()=>{let o={id:`text-${Date.now()}`,type:"text",content:"New Text",x:100,y:100,width:400,height:100,fontSize:48,fontFamily:"Arial",color:"#000000",zIndex:we.elements.length};Se({elements:[...we.elements,o]})},_e=(0,A.useCallback)(async o=>{let p="";typeof o=="string"?p=o:p=await new Promise(J=>{let pe=new FileReader;pe.onload=ye=>{var ce;return J((ce=ye.target)==null?void 0:ce.result)},pe.readAsDataURL(o)});let d=`img-${Date.now()}`,z={id:d,type:"image",src:p,x:100,y:100,width:400,height:250,zIndex:we.elements.length};Se({elements:[...we.elements,z]}),h(d)},[we.elements,Se,h]),Dt=o=>{let p={id:`shape-${Date.now()}`,type:"shape",shapeType:o,fill:"#3b82f6",x:200,y:200,width:200,height:200,zIndex:we.elements.length};Se({elements:[...we.elements,p]})},Vt=()=>{let o={id:`slide-${Date.now()}`,elements:[]};qe(j(I({},N),{slides:[...N.slides,o]})),x(N.slides.length)},ma=o=>{if(N.slides.length<=1)return;let p=N.slides.filter((d,z)=>z!==o);qe(j(I({},N),{slides:p})),o<=n&&x(Math.max(0,n-1))},ba=o=>{let p=N.slides[o],d=j(I({},p),{id:`slide-${Date.now()}`,elements:p.elements.map(J=>j(I({},J),{id:`${J.type}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}))}),z=[...N.slides];z.splice(o+1,0,d),qe(j(I({},N),{slides:z})),x(o+1)},ha=(o,p)=>{if(o===p)return;let d=[...N.slides],[z]=d.splice(o,1);d.splice(p,0,z),qe(j(I({},N),{slides:d})),n===o?x(p):n>o&&n<=p?x(n-1):n<o&&n>=p&&x(n+1)},fa=o=>{let p=[],d=Date.now();o==="title"?p=[{id:`text-title-${d}`,type:"text",content:"Presentation Title",x:100,y:200,width:1e3,height:150,fontSize:80,fontFamily:"Inter",color:"#000000",textAlign:"center",isBold:!0,zIndex:0},{id:`text-sub-${d}`,type:"text",content:"Subtitle goes here",x:200,y:380,width:800,height:80,fontSize:36,fontFamily:"Inter",color:"#64748b",textAlign:"center",zIndex:1}]:o==="content"?p=[{id:`text-title-${d}`,type:"text",content:"Slide Title",x:60,y:40,width:800,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,zIndex:0},{id:`text-body-${d}`,type:"text",content:`\u2022 Add your points here
|
|
2
|
+
"use strict";var Ia=Object.create;var Ke=Object.defineProperty,Ma=Object.defineProperties,Aa=Object.getOwnPropertyDescriptor,Ba=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertyNames,Qt=Object.getOwnPropertySymbols,Ta=Object.getPrototypeOf,ea=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable;var Et=(m,a,l)=>a in m?Ke(m,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):m[a]=l,P=(m,a)=>{for(var l in a||(a={}))ea.call(a,l)&&Et(m,l,a[l]);if(Qt)for(var l of Qt(a))Ha.call(a,l)&&Et(m,l,a[l]);return m},F=(m,a)=>Ma(m,Ba(a));var ja=(m,a)=>{for(var l in a)Ke(m,l,{get:a[l],enumerable:!0})},ta=(m,a,l,h)=>{if(a&&typeof a=="object"||typeof a=="function")for(let x of Pa(a))!ea.call(m,x)&&x!==l&&Ke(m,x,{get:()=>a[x],enumerable:!(h=Aa(a,x))||h.enumerable});return m};var $e=(m,a,l)=>(l=m!=null?Ia(Ta(m)):{},ta(a||!m||!m.__esModule?Ke(l,"default",{value:m,enumerable:!0}):l,m)),Ra=m=>ta(Ke({},"__esModule",{value:!0}),m);var _a={};ja(_a,{PptEditor:()=>Xa,PptxBlobExporter:()=>St,PptxExporter:()=>Je,PptxParser:()=>Qe});module.exports=Ra(_a);function Ct(m,{insertAt:a}={}){if(!m||typeof document=="undefined")return;let l=document.head||document.getElementsByTagName("head")[0],h=document.createElement("style");h.type="text/css",a==="top"&&l.firstChild?l.insertBefore(h,l.firstChild):l.appendChild(h),h.styleSheet?h.styleSheet.cssText=m:h.appendChild(document.createTextNode(m))}Ct(`@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lato:wght@400;700&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@400;700&family=Playfair+Display:wght@400;700&family=Merriweather:wght@400;700&family=Nunito+Sans:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Oswald:wght@400;500&family=Raleway:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=Lora:wght@400;700&family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&family=Play:wght@400;700&family=Arvo:wght@400;700&family=Kanit:wght@400;500;600&display=swap";/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--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-400: oklch(70.4% .191 22.216);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-orange-50: oklch(98% .016 73.684);--color-orange-500: oklch(70.5% .213 47.604);--color-amber-500: oklch(76.9% .188 70.08);--color-green-500: oklch(72.3% .219 149.579);--color-emerald-50: oklch(97.9% .021 166.113);--color-emerald-100: oklch(95% .052 163.051);--color-emerald-400: oklch(76.5% .177 163.223);--color-emerald-500: oklch(69.6% .17 162.48);--color-emerald-600: oklch(59.6% .145 163.225);--color-emerald-700: oklch(50.8% .118 165.612);--color-teal-500: oklch(70.4% .14 182.503);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-indigo-500: oklch(58.5% .233 277.117);--color-purple-50: oklch(97.7% .014 308.299);--color-purple-100: oklch(94.6% .033 307.174);--color-purple-300: oklch(82.7% .119 306.383);--color-purple-400: oklch(71.4% .203 305.504);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-purple-700: oklch(49.6% .265 301.924);--color-pink-500: oklch(65.6% .241 354.308);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-100: oklch(96.8% .007 247.896);--color-slate-200: oklch(92.9% .013 255.508);--color-slate-300: oklch(86.9% .022 252.894);--color-slate-400: oklch(70.4% .04 256.788);--color-slate-500: oklch(55.4% .046 257.417);--color-slate-600: oklch(44.6% .043 257.281);--color-slate-700: oklch(37.2% .044 257.287);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-black: #000;--color-white: #fff;--spacing: .25rem;--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);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-weight-black: 900;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-wide: .025em;--tracking-wider: .05em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--ease-out: cubic-bezier(0, 0, .2, 1);--animate-spin: spin 1s linear infinite;--blur-sm: 8px;--blur-md: 12px;--aspect-video: 16 / 9;--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)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;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}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,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}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-5{top:calc(var(--spacing) * 5)}.top-10{top:calc(var(--spacing) * 10)}.top-\\[24px\\]{top:24px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-6{right:calc(var(--spacing) * 6)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-1{bottom:calc(var(--spacing) * 1)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-10{bottom:calc(var(--spacing) * 10)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1000\\]{z-index:1000}.z-\\[2000\\]{z-index:2000}.z-\\[2001\\]{z-index:2001}.z-\\[5000\\]{z-index:5000}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.z-\\[10000\\]{z-index:10000}.z-\\[11000\\]{z-index:11000}.z-\\[99999\\]{z-index:99999}.col-span-1{grid-column:span 1 / span 1}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0{margin-right:calc(var(--spacing) * 0)}.mr-0\\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.-ml-0{margin-left:calc(var(--spacing) * -0)}.-ml-0\\.5{margin-left:calc(var(--spacing) * -.5)}.ml-0{margin-left:calc(var(--spacing) * 0)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0{height:calc(var(--spacing) * 0)}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-7\\.5{height:calc(var(--spacing) * 7.5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-32{height:calc(var(--spacing) * 32)}.h-48{height:calc(var(--spacing) * 48)}.h-\\[1px\\]{height:1px}.h-\\[2\\.5px\\]{height:2.5px}.h-\\[4px\\]{height:4px}.h-\\[22px\\]{height:22px}.h-\\[28px\\]{height:28px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[200px\\]{max-height:200px}.max-h-\\[250px\\]{max-height:250px}.max-h-\\[300px\\]{max-height:300px}.min-h-\\[56px\\]{min-height:56px}.min-h-\\[300px\\]{min-height:300px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-15{width:calc(var(--spacing) * 15)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\\[1px\\]{width:1px}.w-\\[15px\\]{width:15px}.w-\\[32px\\]{width:32px}.w-\\[480px\\]{width:480px}.w-\\[500px\\]{width:500px}.w-\\[600px\\]{width:600px}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[90vw\\]{max-width:90vw}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[400px\\]{max-width:400px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[40px\\]{min-width:40px}.min-w-\\[45px\\]{min-width:45px}.min-w-\\[50px\\]{min-width:50px}.min-w-\\[72px\\]{min-width:72px}.min-w-\\[80px\\]{min-width:80px}.min-w-\\[180px\\]{min-width:180px}.min-w-\\[280px\\]{min-width:280px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-bottom-left{transform-origin:0 100%}.origin-center{transform-origin:center}.origin-top-left{transform-origin:0 0}.-translate-x-1{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[1px\\]{--tw-translate-y: 1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x: 75%;--tw-scale-y: 75%;--tw-scale-z: 75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-stretch{justify-content:stretch}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>: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)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.self-start{align-self:flex-start}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[2\\.5rem\\]{border-radius:2.5rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-\\[3px\\]{border-top-left-radius:3px;border-bottom-left-radius:3px}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-\\[3px\\]{border-top-right-radius:3px;border-bottom-right-radius:3px}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-none{--tw-border-style: none;border-style:none}.border-solid{--tw-border-style: solid;border-style:solid}.border-black{border-color:var(--color-black)}.border-blue-100{border-color:var(--color-blue-100)}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\\/50{border-color:color-mix(in srgb,oklch(95% .052 163.051) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-purple-100{border-color:var(--color-purple-100)}.border-red-200{border-color:var(--color-red-200)}.border-slate-50{border-color:var(--color-slate-50)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-100\\/50{border-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/60{border-color:color-mix(in srgb,oklch(92.9% .013 255.508) 60%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-slate-300{border-color:var(--color-slate-300)}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-white\\/10{border-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-\\[\\#0A0A0A\\]{background-color:#0a0a0a}.bg-black{background-color:var(--color-black)}.bg-black\\/20{background-color:color-mix(in srgb,#000 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\\/40{background-color:color-mix(in srgb,#000 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\\/60{background-color:color-mix(in srgb,#000 60%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\\/50{background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-100\\/50{background-color:color-mix(in srgb,oklch(93.2% .032 255.585) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-100) 50%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\\/50{background-color:color-mix(in srgb,oklch(97.9% .021 166.113) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\\/50{background-color:color-mix(in srgb,oklch(98.4% .003 247.858) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-100\\/50{background-color:color-mix(in srgb,oklch(96.8% .007 247.896) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-200\\/50{background-color:color-mix(in srgb,oklch(92.9% .013 255.508) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-200) 50%,transparent)}}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\\/40{background-color:color-mix(in srgb,oklch(20.8% .042 265.755) 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\\/50{background-color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\\/80{background-color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black{--tw-gradient-from: var(--color-black);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from: color-mix(in srgb, #000 60%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-gradient-from: color-mix(in oklab, var(--color-black) 60%, transparent)}--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to: transparent;--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-purple-300{fill:var(--color-purple-300)}.fill-slate-700{fill:var(--color-slate-700)}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-10{padding:calc(var(--spacing) * 10)}.p-12{padding:calc(var(--spacing) * 12)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-11{padding-left:calc(var(--spacing) * 11)}.pl-12{padding-left:calc(var(--spacing) * 12)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[6px\\]{font-size:6px}.text-\\[7px\\]{font-size:7px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight: var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking: .2em;letter-spacing:.2em}.tracking-\\[0\\.15em\\]{--tw-tracking: .15em;letter-spacing:.15em}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking: var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-wide{--tw-tracking: var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking: var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\\/70{color:color-mix(in srgb,oklch(59.6% .145 163.225) 70%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-emerald-600) 70%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-green-500{color:var(--color-green-500)}.text-indigo-500{color:var(--color-indigo-500)}.text-orange-500{color:var(--color-orange-500)}.text-pink-500{color:var(--color-pink-500)}.text-purple-400{color:var(--color-purple-400)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-400\\/80{color:color-mix(in srgb,oklch(70.4% .191 22.216) 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-slate-200{color:var(--color-slate-200)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-teal-500{color:var(--color-teal-500)}.text-white{color:var(--color-white)}.text-white\\/50{color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\\/80{color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0%}.opacity-25{opacity:25%}.opacity-40{opacity:40%}.opacity-50{opacity:50%}.opacity-75{opacity:75%}.opacity-100{opacity:100%}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / .25));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_20px_50px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow: 0 20px 50px var(--tw-shadow-color, rgba(0,0,0,.15));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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)}.ring-4{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + 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)}.shadow-black{--tw-shadow-color: #000;@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-black) var(--tw-shadow-alpha), transparent)}}.shadow-black\\/80{--tw-shadow-color: color-mix(in srgb, #000 80%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 80%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500{--tw-shadow-color: oklch(62.3% .214 259.815);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-blue-500) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500{--tw-shadow-color: oklch(69.6% .17 162.48);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-emerald-500) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(69.6% .17 162.48) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-black{--tw-ring-color: var(--color-black)}.ring-black\\/5{--tw-ring-color: color-mix(in srgb, #000 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-black) 5%, transparent)}}.ring-purple-100{--tw-ring-color: var(--color-purple-100)}.ring-white{--tw-ring-color: var(--color-white)}.backdrop-blur-\\[1px\\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[2px\\]{--tw-backdrop-blur: blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur: blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur: blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.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))}.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))}.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))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.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))}.duration-150{--tw-duration: .15s;transition-duration:.15s}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.duration-700{--tw-duration: .7s;transition-duration:.7s}.ease-out{--tw-ease: var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\\:text-slate-600{&:is(:where(.group):focus-within *){color:var(--color-slate-600)}}.group-hover\\:scale-105{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:scale-110{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:bg-blue-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-50)}}}.group-hover\\:bg-blue-100{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-100)}}}.group-hover\\:bg-blue-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-600)}}}.group-hover\\:bg-emerald-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-50)}}}.group-hover\\:bg-emerald-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-600)}}}.group-hover\\:bg-purple-600{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-purple-600)}}}.group-hover\\:bg-red-500{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-red-500)}}}.group-hover\\:bg-slate-200{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-slate-200)}}}.group-hover\\:fill-slate-900{&:is(:where(.group):hover *){@media(hover:hover){fill:var(--color-slate-900)}}}.group-hover\\:text-blue-600{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-blue-600)}}}.group-hover\\:text-slate-700{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-700)}}}.group-hover\\:text-slate-900{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-slate-900)}}}.group-hover\\:text-white{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-white)}}}.group-hover\\:opacity-100{&:is(:where(.group):hover *){@media(hover:hover){opacity:100%}}}.group-hover\\:shadow-sm{&:is(:where(.group):hover *){@media(hover:hover){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.placeholder\\:text-slate-400{&::placeholder{color:var(--color-slate-400)}}.hover\\:border-blue-400{&:hover{@media(hover:hover){border-color:var(--color-blue-400)}}}.hover\\:border-slate-100{&:hover{@media(hover:hover){border-color:var(--color-slate-100)}}}.hover\\:border-slate-200{&:hover{@media(hover:hover){border-color:var(--color-slate-200)}}}.hover\\:border-slate-300{&:hover{@media(hover:hover){border-color:var(--color-slate-300)}}}.hover\\:bg-black{&:hover{@media(hover:hover){background-color:var(--color-black)}}}.hover\\:bg-blue-50{&:hover{@media(hover:hover){background-color:var(--color-blue-50)}}}.hover\\:bg-blue-50\\/50{&:hover{@media(hover:hover){background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}}}.hover\\:bg-blue-700{&:hover{@media(hover:hover){background-color:var(--color-blue-700)}}}.hover\\:bg-emerald-50{&:hover{@media(hover:hover){background-color:var(--color-emerald-50)}}}.hover\\:bg-emerald-700{&:hover{@media(hover:hover){background-color:var(--color-emerald-700)}}}.hover\\:bg-purple-50{&:hover{@media(hover:hover){background-color:var(--color-purple-50)}}}.hover\\:bg-red-50{&:hover{@media(hover:hover){background-color:var(--color-red-50)}}}.hover\\:bg-red-100{&:hover{@media(hover:hover){background-color:var(--color-red-100)}}}.hover\\:bg-slate-50{&:hover{@media(hover:hover){background-color:var(--color-slate-50)}}}.hover\\:bg-slate-100{&:hover{@media(hover:hover){background-color:var(--color-slate-100)}}}.hover\\:bg-slate-200{&:hover{@media(hover:hover){background-color:var(--color-slate-200)}}}.hover\\:bg-white{&:hover{@media(hover:hover){background-color:var(--color-white)}}}.hover\\:bg-white\\/20{&:hover{@media(hover:hover){background-color:color-mix(in srgb,#fff 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}}}.hover\\:text-blue-500{&:hover{@media(hover:hover){color:var(--color-blue-500)}}}.hover\\:text-blue-600{&:hover{@media(hover:hover){color:var(--color-blue-600)}}}.hover\\:text-blue-700{&:hover{@media(hover:hover){color:var(--color-blue-700)}}}.hover\\:text-emerald-700{&:hover{@media(hover:hover){color:var(--color-emerald-700)}}}.hover\\:text-purple-700{&:hover{@media(hover:hover){color:var(--color-purple-700)}}}.hover\\:text-red-500{&:hover{@media(hover:hover){color:var(--color-red-500)}}}.hover\\:text-slate-500{&:hover{@media(hover:hover){color:var(--color-slate-500)}}}.hover\\:text-slate-600{&:hover{@media(hover:hover){color:var(--color-slate-600)}}}.hover\\:text-slate-700{&:hover{@media(hover:hover){color:var(--color-slate-700)}}}.hover\\:text-white{&:hover{@media(hover:hover){color:var(--color-white)}}}.hover\\:opacity-100{&:hover{@media(hover:hover){opacity:100%}}}.hover\\:shadow-md{&:hover{@media(hover:hover){--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.focus\\:border-blue-500{&:focus{border-color:var(--color-blue-500)}}.focus\\:border-slate-400{&:focus{border-color:var(--color-slate-400)}}.focus\\:ring-0{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + 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)}}.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)}}.focus\\:ring-4{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + 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)}}.focus\\:ring-blue-500\\/10{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 10%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}}.focus\\:ring-blue-500\\/20{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}}.focus\\:ring-slate-400\\/5{&:focus{--tw-ring-color: color-mix(in srgb, oklch(70.4% .04 256.788) 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-slate-400) 5%, transparent)}}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.active\\:scale-95{&:active{--tw-scale-x: 95%;--tw-scale-y: 95%;--tw-scale-z: 95%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.active\\:scale-\\[0\\.98\\]{&:active{scale:.98}}.active\\:cursor-grabbing{&:active{cursor:grabbing}}.disabled\\:cursor-not-allowed{&:disabled{cursor:not-allowed}}.disabled\\:bg-slate-100{&:disabled{background-color:var(--color-slate-100)}}.disabled\\:bg-slate-300{&:disabled{background-color:var(--color-slate-300)}}.disabled\\:text-slate-400{&:disabled{color:var(--color-slate-400)}}.disabled\\:opacity-20{&:disabled{opacity:20%}}.disabled\\:opacity-40{&:disabled{opacity:40%}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.disabled\\:active\\:scale-100{&:disabled{&:active{--tw-scale-x: 100%;--tw-scale-y: 100%;--tw-scale-z: 100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.md\\:space-y-8{@media(width>=48rem){:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}}}.md\\:p-12{@media(width>=48rem){padding:calc(var(--spacing) * 12)}}}@keyframes blob{0%{transform:translate(0) scale(1)}33%{transform:translate(30px,-50px) scale(1.1)}66%{transform:translate(-20px,20px) scale(.9)}to{transform:translate(0) scale(1)}}.animate-blob{animation:blob 7s infinite}.animation-delay-2000{animation-delay:2s}.animation-delay-4000{animation-delay:4s}@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-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@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-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: "<length-percentage>"; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: "<length-percentage>"; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: "<length-percentage>"; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{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: 0px;}@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-backdrop-blur{syntax: "*"; inherits: false;}@property --tw-backdrop-brightness{syntax: "*"; inherits: false;}@property --tw-backdrop-contrast{syntax: "*"; inherits: false;}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false;}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false;}@property --tw-backdrop-invert{syntax: "*"; inherits: false;}@property --tw-backdrop-opacity{syntax: "*"; inherits: false;}@property --tw-backdrop-saturate{syntax: "*"; inherits: false;}@property --tw-backdrop-sepia{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1;--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-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: 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-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial;--tw-ease: initial}}}
|
|
3
|
+
`);var j=require("react");var ge=$e(require("react")),v=require("lucide-react");var aa=require("clsx"),ra=require("tailwind-merge");function B(...m){return(0,ra.twMerge)((0,aa.clsx)(m))}var e=require("react/jsx-runtime"),Da=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],Va=[12,14,16,18,20,24,28,32,36,48,64,72,96],Fa=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],$a=({type:m,className:a})=>{switch(m){case"rect":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"currentColor"})});case"circle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor"})});case"triangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 18H4L12 4Z",fill:"currentColor"})});case"rightTriangle":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 4V20H20L4 4Z",fill:"currentColor"})});case"rhombus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4L20 12L12 20L4 12L12 4Z",fill:"currentColor"})});case"parallelogram":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M7 4H21L17 20H3L7 4Z",fill:"currentColor"})});case"trapezoid":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M6 4H18L21 20H3L6 4Z",fill:"currentColor"})});case"pentagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L21 9V19H3V9L12 3Z",fill:"currentColor"})});case"hexagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z",fill:"currentColor"})});case"heptagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3L18.5 6L21 13L16 20H8L3 13L5.5 6L12 3Z",fill:"currentColor"})});case"octagon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M8.5 3H15.5L21 8.5V15.5L15.5 21H8.5L3 15.5V8.5L8.5 3Z",fill:"currentColor"})});case"heart":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",fill:"currentColor"})});case"smiley":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"15",cy:"9",r:"1.5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M8 15C8 15 9.5 17 12 17C14.5 17 16 15 16 15",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"sun":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"}),(0,e.jsx)("path",{d:"M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"moon":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9",fill:"currentColor"})});case"arrowRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 11h11.5l-3.5-3.5 1.5-1.5 6 6-6 6-1.5-1.5 3.5-3.5H4z",fill:"currentColor"})});case"arrowLeft":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M20 11H8.5l3.5-3.5L10.5 6l-6 6 6 6 1.5-1.5-3.5-3.5H20z",fill:"currentColor"})});case"arrowUp":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 20V8.5l3.5 3.5 1.5-1.5-6-6-6 6 1.5 1.5 3.5-3.5V20z",fill:"currentColor"})});case"arrowDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M11 4v11.5l-3.5-3.5-1.5 1.5 6 6 6-6-1.5-1.5-3.5 3.5V4z",fill:"currentColor"})});case"arrowLeftRight":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M4 12l4-4v3h8V8l4 4-4 4v-3H8v3l-4-4z",fill:"currentColor"})});case"arrowUpDown":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 4l-4 4h3v8H8l4 4 4-4h-3V8h3l-4-4z",fill:"currentColor"})});case"star4":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 8 8 2-8 2-2 8-2-8-8-2 8-2 2-8z",fill:"currentColor"})});case"star5":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2.5 7.5H22l-6 4.5 2.5 7.5-6.5-4.5-6.5 4.5 2.5-7.5-6-4.5h7.5L12 2z",fill:"currentColor"})});case"star6":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l3 5 6-1-4 4.5 2 6.5-7-3-7 3 2-6.5-4-4.5 6 1 3-5z",fill:"currentColor"})});case"star8":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M12 2l2 4 4-2-2 4 4 2-4 2 2 4-4-2-2 4-2-4-4 2 2-4-4-2 4-2-2-4 4 2 2-4z",fill:"currentColor"})});case"cloud":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M17.5 19c-3 0-5.5-2.5-5.5-5.5 0-.2 0-.4.1-.6-2-.8-3.6-2.5-4.1-4.7C6.5 7.4 5 6 3 6c-1.7 0-3 1.3-3 3s1.3 3 3 3c.4 0 .8-.1 1.2-.2C4.1 13 5 14.5 6.5 15.5c.3 1.8 1.4 3.4 3 4.3.4.2.8.3 1.2.4 1.2.4 2.5.6 3.8.6 4.4 0 8-3.6 8-8s-3.6-8-8-8c-.4 0-.8 0-1.2.1-1.2.2-2.3.7-3.2 1.5C11 4.2 12.4 3.5 14 3.5c4.1 0 7.5 3.4 7.5 7.5s-1.8 7.5-4 8z",fill:"currentColor",transform:"scale(0.8) translate(3,3)"})});case"lightning":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M13 2L3 14h9v8l10-12h-9l3-8z",fill:"currentColor"})});case"plus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})});case"minus":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})});case"multiply":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:"currentColor"})});case"divide":return(0,e.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,e.jsx)("circle",{cx:"12",cy:"7",r:"2",fill:"currentColor"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"2",fill:"currentColor"}),(0,e.jsx)("rect",{x:"5",y:"11",width:"14",height:"2",fill:"currentColor"})]});case"equal":return(0,e.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,e.jsx)("path",{d:"M19 10H5V8h14v2zm0 6H5v-2h14v2z",fill:"currentColor"})});default:return(0,e.jsx)("div",{className:"w-6 h-6 bg-slate-200 rounded-sm"})}},Ua=({onAddShape:m,uiScale:a})=>{let[l,h]=(0,ge.useState)(!1);return ge.default.useEffect(()=>(window._toggleShapesMenu=()=>h(!l),()=>{window._toggleShapesMenu=void 0}),[l]),l?(0,e.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",style:{width:`${320*a}px`,maxHeight:`${480*a}px`},children:(0,e.jsx)("div",{className:"flex flex-col gap-6",children:Fa.map(x=>(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",style:{fontSize:`${10*a}px`},children:x.name}),(0,e.jsx)("div",{className:"grid grid-cols-5 gap-1",children:x.shapes.map(s=>(0,e.jsx)("button",{onClick:()=>{m(s),h(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group p-1",title:s,children:(0,e.jsx)("div",{className:"w-full h-full bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden p-1.5",children:(0,e.jsx)($a,{type:s,className:"w-full h-full text-slate-400 group-hover:text-blue-600 transition-colors"})})},s))})]},x.name))})}):null},sa=({onAddText:m,onAddImage:a,onAddShape:l,onAddSlide:h,onExport:x,onFormatText:s,onDeleteElement:V,onApplyLayout:D,onPlay:R,selectedElement:r,onNewPresentation:T,onLoadPresentation:b,appBgColor:I="#B7472A",uiScale:w,source:H,onGenerateImageClick:C,onGenerateInfographicClick:f,onUploadImageClick:O,onRefineAction:G,refineResponse:oe,isAiLoading:Y})=>{let _=ge.default.useRef(null),[A,ne]=(0,ge.useState)("Home"),[q,L]=(0,ge.useState)(!1),[ee,g]=(0,ge.useState)(!1),[S,c]=(0,ge.useState)(!1),[k,n]=(0,ge.useState)(!1),[z,N]=(0,ge.useState)("file"),[K,pe]=(0,ge.useState)(""),[he,be]=(0,ge.useState)(!1),[J,M]=(0,ge.useState)(!1),[W,re]=(0,ge.useState)(!1),[fe,xe]=(0,ge.useState)(!1),Re=U=>{if(!Q||!r)return;let le=r.content||"",Ce=le;switch(U){case"sentence":Ce=le.charAt(0).toUpperCase()+le.slice(1).toLowerCase();break;case"lowercase":Ce=le.toLowerCase();break;case"uppercase":Ce=le.toUpperCase();break;case"capitalize":Ce=le.split(" ").map(ve=>ve.charAt(0).toUpperCase()+ve.slice(1).toLowerCase()).join(" ");break;case"toggle":Ce=le.split("").map(ve=>ve===ve.toUpperCase()?ve.toLowerCase():ve.toUpperCase()).join("");break}s({content:Ce}),be(!1)},Q=(r==null?void 0:r.type)==="text",et=(r==null?void 0:r.type)==="shape",We=(r==null?void 0:r.type)==="image",It="#B7472A";return(0,e.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",style:{fontSize:`${12*w}px`},children:[(0,e.jsxs)("div",{className:"bg-white flex items-center justify-center border-b border-slate-200/60 transition-all duration-300 relative z-[1000]",style:{minHeight:`${120*w}px`,overflow:"visible"},children:[(0,e.jsxs)("div",{className:B("flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",w<.84?"min-w-0":"min-w-fit"),children:[(0,e.jsx)("div",{className:"flex items-center justify-center gap-1 my-auto",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>L(!q),className:B("flex flex-col items-left gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg transition-all min-w-[45px]",q&&"bg-slate-100"),children:[(0,e.jsx)("div",{className:"bg-orange-50 p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Plus,{size:Math.max(14,20*w),style:{color:I}})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500 whitespace-nowrap",children:"Slides"})]}),q&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-3xl p-2 w-60 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200 ring-4 ring-black/5",children:[(0,e.jsxs)("button",{onClick:h,className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.FilePen,{size:18})}),"Blank Slide"]}),(0,e.jsxs)("button",{onClick:()=>{D("title"),L(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-lg group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.FileText,{size:18})}),"Title Slide"]}),(0,e.jsxs)("button",{onClick:()=>{D("content"),L(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.List,{size:18})}),"Title & Content"]}),(0,e.jsxs)("button",{onClick:()=>{D("split"),L(!1)},className:"flex items-center gap-3 px-4 py-3 hover:bg-slate-50 rounded-xl text-[13px] font-bold text-slate-700 transition-all border border-transparent hover:border-slate-100 group",children:[(0,e.jsx)("div",{className:"p-2 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.Columns,{size:18})}),"Two Columns"]})]})]})}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,e.jsxs)("div",{className:B("flex items-center flex-col border-r border-slate-200 h-full py-2 relative justify-center gap-2",w<.85?"px-1":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden",children:[(0,e.jsx)("select",{disabled:!Q,value:(r==null?void 0:r.fontFamily)||"Open Sans",onChange:U=>s({fontFamily:U.target.value}),className:B("h-full px-1.5 text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer",w<.85?"w-20":"w-32"),style:{fontSize:`${Math.max(10,12*w)}px`},children:Da.map(U=>(0,e.jsx)("option",{value:U,children:U},U))}),(0,e.jsx)(v.ChevronDown,{size:13,className:"text-slate-400 mr-1"})]}),(0,e.jsxs)("div",{className:"flex items-center bg-white border border-slate-300 rounded-[3px] h-[28px] overflow-hidden w-15",children:[(0,e.jsx)("select",{disabled:!Q,value:(r==null?void 0:r.fontSize)||10,onChange:U=>s({fontSize:parseInt(U.target.value)}),className:"h-full w-full px-1 text-slate-800 font-normal bg-transparent outline-none disabled:opacity-50 appearance-none cursor-pointer text-center",style:{fontSize:`${Math.max(10,12*w)}px`},children:Va.map(U=>(0,e.jsx)("option",{value:U,children:U},U))}),(0,e.jsx)(v.ChevronDown,{size:13,className:"text-slate-400 mr-0.5"})]}),(0,e.jsxs)("button",{disabled:!Q,onClick:()=>s({fontSize:Math.min(200,((r==null?void 0:r.fontSize)||24)+2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Increase Font Size",children:[(0,e.jsx)("span",{className:"text-[16px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(v.ChevronUp,{size:10,color:"black"})]}),(0,e.jsxs)("button",{disabled:!Q,onClick:()=>s({fontSize:Math.max(8,((r==null?void 0:r.fontSize)||24)-2)}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Decrease Font Size",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(v.ChevronDown,{size:10,color:"black"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!Q,onClick:()=>M(!J),className:B("h-8 px-1.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",J?"bg-slate-100":"hover:bg-slate-100"),title:"Character Spacing",children:[(0,e.jsxs)("div",{className:"flex items-center",children:[(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700",children:"A"}),(0,e.jsx)("span",{className:"text-[12px] font-bold text-slate-700 -ml-0.5",children:"V"}),(0,e.jsx)(v.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0",children:[(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25C0"}),(0,e.jsx)("div",{className:"w-2.5 h-[1px] bg-blue-500"}),(0,e.jsx)("span",{className:"text-[7px] text-blue-500",children:"\u25B6"})]})]}),J&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-32 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-50}),M(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Tight",(r==null?void 0:r.charSpacing)===-50&&(0,e.jsx)(v.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:-25}),M(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Tight",(r==null?void 0:r.charSpacing)===-25&&(0,e.jsx)(v.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:0}),M(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Normal",((r==null?void 0:r.charSpacing)===0||!(r!=null&&r.charSpacing))&&(0,e.jsx)(v.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:25}),M(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Loose",(r==null?void 0:r.charSpacing)===25&&(0,e.jsx)(v.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsxs)("button",{onClick:()=>{s({charSpacing:50}),M(!1)},className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Very Loose",(r==null?void 0:r.charSpacing)===50&&(0,e.jsx)(v.Check,{size:12,className:"text-blue-600 ml-auto"})]}),(0,e.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,e.jsx)("button",{className:"w-full px-3 py-1.5 text-left text-[11px] text-slate-700 hover:bg-slate-50 disabled:opacity-50",children:"More Spacing..."})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({isBold:!r.isBold}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isBold?"bg-blue-100":"hover:bg-slate-100"),title:"Bold",children:(0,e.jsx)("span",{className:`text-[15px] font-bold ${r!=null&&r.isBold?"text-slate-900":"text-slate-600"}`,children:"B"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({isItalic:!r.isItalic}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isItalic?"bg-blue-100":"hover:bg-slate-100"),title:"Italic",children:(0,e.jsx)("span",{className:`text-[15px] italic font-serif ${r!=null&&r.isItalic?"text-slate-900":"text-slate-600"}`,children:"I"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({isUnderline:!r.isUnderline}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isUnderline?"bg-blue-100":"hover:bg-slate-100"),title:"Underline",children:(0,e.jsx)("span",{className:`text-[15px] underline underline-offset-2 ${r!=null&&r.isUnderline?"text-slate-900":"text-slate-600"}`,children:"U"})}),(0,e.jsxs)("button",{disabled:!Q,onClick:()=>s({isStrikethrough:!r.isStrikethrough}),className:B("h-8 px-1.5 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.isStrikethrough?"bg-blue-100":"hover:bg-slate-100"),title:"Strikethrough",children:[(0,e.jsx)("span",{className:`text-[12px] font-medium line-through ${r!=null&&r.isStrikethrough?"text-slate-900":"text-slate-600"}`,children:"abc"}),(0,e.jsx)(v.ChevronDown,{size:12,className:"text-slate-400 ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{disabled:!Q,onClick:()=>be(!he),className:"h-8 px-1.5 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Change Case",children:[(0,e.jsx)("span",{className:"text-[14px] font-medium text-slate-700",children:"Aa"}),(0,e.jsx)(v.ChevronDown,{size:11,className:"text-slate-400 ml-0.5"})]}),he&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl py-1 w-44 z-[100] animate-in fade-in zoom-in-95 duration-150",children:[(0,e.jsxs)("button",{onClick:()=>Re("sentence"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400",children:"Aa"})," Sentence case."]}),(0,e.jsxs)("button",{onClick:()=>Re("lowercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"l"})," lowercase"]}),(0,e.jsxs)("button",{onClick:()=>Re("uppercase"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"U"})," UPPERCASE"]}),(0,e.jsxs)("button",{onClick:()=>Re("capitalize"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"C"})," Capitalize Each Word"]}),(0,e.jsxs)("button",{onClick:()=>Re("toggle"),className:"w-full px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-slate-400 underline",children:"t"})," tOGGLE cASE"]})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-5 bg-slate-200 mx-1.5"}),(0,e.jsx)("div",{className:"relative",children:(0,e.jsxs)("button",{disabled:!Q,onClick:()=>s({isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000",isStrikethrough:!1}),className:"w-9 h-[28px] flex items-center justify-center hover:bg-slate-100 rounded-[3px] transition-colors disabled:opacity-40",title:"Clear All Formatting",children:[(0,e.jsx)("span",{className:"text-[16px] font-medium text-slate-600",children:"A"}),(0,e.jsx)(v.Eraser,{size:Math.max(8,11*w),className:"text-pink-500 -ml-0.5"})]})}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{disabled:!Q,className:B("w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] transition-all disabled:opacity-40",r!=null&&r.highlightColor?"bg-slate-100":"hover:bg-slate-100"),title:"Text Highlight Color",children:[(0,e.jsx)(v.Highlighter,{size:18,strokeWidth:1.5,className:r!=null&&r.highlightColor?"text-slate-900":"text-slate-500"}),(0,e.jsx)("div",{className:"absolute top-[24px] left-1 right-3 h-0.5",style:{backgroundColor:(r==null?void 0:r.highlightColor)||"transparent"}})]}),(0,e.jsx)("input",{type:"color",disabled:!Q,className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full disabled:cursor-not-allowed",value:(r==null?void 0:r.highlightColor)||"#ffff00",onChange:U=>s({highlightColor:U.target.value}),title:"Choose Highlight Color"}),(0,e.jsx)(v.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]}),(0,e.jsxs)("div",{className:"relative flex items-center",children:[(0,e.jsxs)("button",{className:"w-9 h-7.5 flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all",title:"Font Color",children:[(0,e.jsx)("span",{className:"text-[15px] font-medium text-slate-600 leading-none",children:"A"}),(0,e.jsx)("div",{className:"w-6 h-[4px] rounded-sm mt-0.5",style:{backgroundColor:(r==null?void 0:r.color)||"#ff0000"}}),(0,e.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(r==null?void 0:r.color)||"#ff0000",onChange:U=>s({color:U.target.value})})]}),(0,e.jsx)(v.ChevronDown,{size:11,className:"text-slate-400 -ml-0.5"})]})]}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Font"})]}),(0,e.jsxs)("div",{className:B("flex flex-col border-r border-slate-200 h-full py-2 relative justify-center gap-2",w<.85?"px-2":"px-4"),children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!Q,onClick:()=>{r!=null&&r.isBulleted?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"})},className:B("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isBulleted?"bg-blue-100":"hover:bg-slate-100"),title:"Bullets",children:(0,e.jsx)(v.List,{size:Math.max(13,19*w),className:r!=null&&r.isBulleted?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>re(!W),className:B("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",W?"bg-slate-100":"hover:bg-slate-200"),title:"Bullet Options",children:(0,e.jsx)(v.ChevronDown,{size:13,className:"text-slate-400"})}),W&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!1,listType:"none"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-square-outlined"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 border border-black bg-transparent"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-diamond"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("div",{className:"w-1 h-1 bg-black rotate-45 scale-75"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-arrow"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u27A4"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),re(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] leading-none",children:"\u2713"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsxs)("div",{className:"relative flex items-center rounded-[3px] hover:bg-slate-100 transition-all",children:[(0,e.jsx)("button",{disabled:!Q,onClick:()=>{r!=null&&r.isNumbered?s({isBulleted:!1,isNumbered:!1,listType:"none"}):s({isBulleted:!1,isNumbered:!0,listType:"number-decimal"})},className:B("w-[32px] h-8 flex items-center justify-center rounded-l-[3px] transition-all disabled:opacity-40",r!=null&&r.isNumbered?"bg-blue-100":"hover:bg-slate-100"),title:"Numbering",children:(0,e.jsx)(v.ListOrdered,{size:Math.max(13,19*w),className:r!=null&&r.isNumbered?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>xe(!fe),className:B("w-[15px] h-8 flex items-center justify-center rounded-r-[3px] border-l border-transparent hover:border-slate-200 transition-all disabled:opacity-40",fe?"bg-slate-100":"hover:bg-slate-200"),title:"Numbering Options",children:(0,e.jsx)(v.ChevronDown,{size:13,className:"text-slate-400"})}),fe&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!1,listType:"none"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,e.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"1)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"2)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"3)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-upper"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"I."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"II."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"III."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-upper"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"A."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"B."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"C."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower-paren"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c)"}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-alpha-lower"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"a."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"b."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"c."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,e.jsx)("button",{onClick:()=>{s({isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),xe(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"i."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"ii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[6px] font-bold",children:"iii."}),(0,e.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,e.jsx)("div",{className:"w-[1px] h-6 bg-slate-200 mx-1.5"}),(0,e.jsx)("button",{disabled:!Q,className:"w-7 h-7 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Decrease List Level",children:(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M2 7L4 9L2 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,e.jsx)("button",{disabled:!Q,className:"w-8 h-8 flex items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all disabled:opacity-40",title:"Increase List Level",children:(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 14 14",fill:"none",className:"text-slate-600",children:(0,e.jsx)("path",{d:"M2 3H12M6 7H12M6 11H12M4 7L2 9L4 11",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({textAlign:"left"}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="left"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Left",children:(0,e.jsx)(v.AlignLeft,{size:Math.max(13,19*w),className:(r==null?void 0:r.textAlign)==="left"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({textAlign:"center"}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="center"?"bg-blue-100":"hover:bg-slate-100"),title:"Center",children:(0,e.jsx)(v.AlignCenter,{size:Math.max(13,19*w),className:(r==null?void 0:r.textAlign)==="center"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({textAlign:"right"}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="right"?"bg-blue-100":"hover:bg-slate-100"),title:"Align Right",children:(0,e.jsx)(v.AlignRight,{size:Math.max(13,19*w),className:(r==null?void 0:r.textAlign)==="right"?"text-slate-900":"text-slate-600"})}),(0,e.jsx)("button",{disabled:!Q,onClick:()=>s({textAlign:"justify"}),className:B("w-8 h-8 flex items-center justify-center rounded-[3px] transition-all disabled:opacity-40",(r==null?void 0:r.textAlign)==="justify"?"bg-blue-100":"hover:bg-slate-100"),title:"Justify",children:(0,e.jsx)(v.AlignJustify,{size:Math.max(13,19*w),className:(r==null?void 0:r.textAlign)==="justify"?"text-slate-900":"text-slate-600"})})]}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] text-center uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Paragraph"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-2 gap-1 h-full py-1.5 shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,e.jsxs)("div",{className:"relative group/shapes flex justify-center",children:[(0,e.jsxs)("button",{className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[50px]",onClick:()=>{var U;return(U=window._toggleShapesMenu)==null?void 0:U.call(window)},children:[(0,e.jsx)("div",{className:"bg-blue-50 p-1.5 rounded-lg group-hover:scale-105 transition-transform",children:(0,e.jsx)(v.Square,{size:Math.max(14,20*w),className:"text-blue-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"Shapes"})]}),(0,e.jsx)(Ua,{onAddShape:U=>{l(U)},uiScale:w})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:m,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[50px]",title:"Text Box",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(v.Type,{size:Math.max(14,20*w)})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Text Box"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:()=>{var U;return(U=_.current)==null?void 0:U.click()},className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[50px]",title:"Image",children:[(0,e.jsx)("div",{className:"p-1.5",children:(0,e.jsx)(v.Image,{size:Math.max(14,20*w)})}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Image"}),(0,e.jsx)("input",{type:"file",ref:_,className:"hidden",accept:"image/*",onChange:U=>{var le;return((le=U.target.files)==null?void 0:le[0])&&a(U.target.files[0])}})]})]}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-1 gap-1 h-full py-1.5 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-0.5 my-auto h-full relative",children:[(0,e.jsxs)("button",{disabled:!Q||Y,onClick:()=>g(!ee),className:B("flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[72px] outline-none focus:outline-none focus:ring-0 border-none",ee&&"bg-slate-100 text-slate-900"),children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Sparkles,{size:Math.max(14,20*w),className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Refine"}),(0,e.jsx)(v.ChevronDown,{size:10,className:"text-slate-400"})]})]}),ee&&(0,e.jsxs)("div",{className:"absolute top-full right-0 mt-2 bg-white border border-slate-200 rounded-xl shadow-xl w-48 z-[100] animate-in fade-in zoom-in-95 duration-150 overflow-hidden",children:[(0,e.jsxs)("button",{onClick:()=>{G==null||G(r.id,"shorten"),g(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 text-[13px] font-bold text-slate-700 transition-all ",children:[(0,e.jsx)("div",{className:"p-2 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.ArrowDownWideNarrow,{size:14,className:"text-blue-500"})}),"Shorten"]}),(0,e.jsxs)("button",{onClick:()=>{G==null||G(r.id,"reframe"),g(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 text-[13px] font-bold text-slate-700 transition-all ",children:[(0,e.jsx)("div",{className:"p-2 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.RefreshCcwDot,{size:14,className:"text-blue-500"})}),"Reframe"]}),(0,e.jsxs)("button",{onClick:()=>{G==null||G(r.id,"lengthen"),g(!1)},className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-slate-50 text-[13px] font-bold text-slate-700 transition-all ",children:[(0,e.jsx)("div",{className:"p-2 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,e.jsx)(v.WrapText,{size:14,className:"text-blue-500"})}),"Lengthen"]})]})]}),Y&&(0,e.jsx)("div",{className:"absolute inset-x-0 top-2 bottom-8 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,e.jsx)(v.RefreshCw,{size:16,className:"text-blue-600 animate-spin"})}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center pl-3 pr-3 gap-1 h-full py-2 relative",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,e.jsxs)("button",{onClick:R,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[40px] group",title:"Present",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Play,{size:Math.max(14,20*w),className:"fill-slate-700 group-hover:fill-slate-900"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Present"})]}),(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:x,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[50px] group",title:"Export",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Download,{size:Math.max(14,20*w),className:"text-emerald-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Export"})]}),r&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,e.jsxs)("button",{onClick:V,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-red-50 rounded-lg text-red-600 transition-all min-w-[50px] group",title:"Delete",children:[(0,e.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Trash2,{size:Math.max(14,20*w)})}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Delete"})]})]})]}),(0,e.jsxs)("div",{className:"absolute top-2 right-3 flex items-center gap-1 px-1.5 py-0.5 bg-emerald-50/50 rounded-md border border-emerald-100/50",children:[(0,e.jsx)(v.Check,{size:9,className:"text-emerald-500"}),(0,e.jsx)("span",{className:"text-[7px] font-black text-emerald-600/70 tracking-tighter uppercase",children:"Saved"})]}),w>=.45&&(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]})]}),k&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>n(!1)}),(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,e.jsx)(v.Download,{size:20})}),"Upload Presentation"]}),(0,e.jsx)("button",{onClick:()=>n(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,e.jsx)(v.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,e.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,e.jsx)("button",{onClick:()=>N("file"),className:B("flex-1 py-3 text-xs font-black rounded-xl transition-all",z==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,e.jsx)("button",{onClick:()=>N("link"),className:B("flex-1 py-3 text-xs font-black rounded-xl transition-all",z==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),z==="file"?(0,e.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,e.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,e.jsx)(v.Plus,{size:24,className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,e.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:U=>{var Ce;let le=(Ce=U.target.files)==null?void 0:Ce[0];le&&(b(le),n(!1))}})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative",children:(0,e.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:K,onChange:U=>pe(U.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,e.jsx)("button",{onClick:()=>{K.trim()&&(b(K.trim()),n(!1))},disabled:!K.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var Ue=require("lucide-react"),we=require("@dnd-kit/core"),Te=require("@dnd-kit/sortable"),ia=require("@dnd-kit/utilities");var te=require("react/jsx-runtime"),oa={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Za=({slide:m,index:a,isActive:l,onSelect:h,onDelete:x,onDuplicate:s,showDelete:V,uiScale:D,appBgColor:R})=>{let{attributes:r,listeners:T,setNodeRef:b,transform:I,transition:w,isDragging:H}=(0,Te.useSortable)({id:m.id}),C={transform:ia.CSS.Transform.toString(I),transition:w,zIndex:H?2:1,opacity:H?.5:1};return(0,te.jsxs)("div",{ref:b,onClick:h,className:B("cursor-pointer border-[1.5px] border-solid p-2 transition-all duration-300 group relative select-none",l?"bg-white":"border hover:border-slate-200 bg-white/50 hover:bg-white"),style:F(P({},C),{border:l?`1px solid ${R}`:"1px solid transparent"}),children:[(0,te.jsxs)("div",{className:B("text-xs font-bold mb-1 flex items-center justify-between transition-colors",!l&&"text-slate-400"),style:{color:l?R:void 0},children:[(0,te.jsxs)("div",{className:"flex items-center gap-1",children:[(0,te.jsx)("div",F(P(P({},r),T),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 text-slate-300 hover:text-slate-500",children:(0,te.jsx)(Ue.GripVertical,{size:14})})),(0,te.jsxs)("span",{children:["SLIDE ",a+1]})]}),(0,te.jsxs)("div",{className:"flex items-center gap-1",children:[l&&(0,te.jsx)("span",{className:"h-1.5 w-1.5",style:{backgroundColor:R}}),(0,te.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,te.jsx)("button",{onClick:f=>{f.stopPropagation(),s()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 transition-all",title:"Duplicate Slide",children:(0,te.jsx)(Ue.Copy,{size:13})}),V&&(0,te.jsx)("button",{onClick:f=>{f.stopPropagation(),x()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 transition-all",title:"Delete Slide",children:(0,te.jsx)(Ue.Trash2,{size:13})})]})]})]}),(0,te.jsx)("div",{className:"aspect-video bg-white flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,te.jsx)("div",{className:"origin-center pointer-events-none select-none shrink-0",style:{width:"1200px",height:"675px",transform:`scale(${(Math.max(220,256*D)-48)/1200})`,backgroundColor:"#ffffff"},children:m.elements.sort((f,O)=>(f.zIndex||0)-(O.zIndex||0)).map(f=>{var G;let O={position:"absolute",left:f.x,top:f.y,width:f.width,height:f.height,opacity:(G=f.opacity)!=null?G:1};if(f.type==="text")return(0,te.jsx)("div",{style:F(P({},O),{fontSize:f.fontSize,fontFamily:f.fontFamily,color:f.color,textAlign:f.textAlign||"left",fontWeight:f.isBold?"bold":"normal",fontStyle:f.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:f.content},f.id);if(f.type==="shape"){let oe=oa[f.shapeType]||(f.shapeType==="ellipse"?oa.circle:null);return oe?(0,te.jsx)("svg",{viewBox:"0 0 24 24",style:F(P({},O),{fill:f.fill}),preserveAspectRatio:"none",children:(0,te.jsx)("path",{d:oe})},f.id):(0,te.jsx)("div",{style:F(P({},O),{backgroundColor:f.fill,borderRadius:f.shapeType==="ellipse"?"50%":"0"})},f.id)}else if(f.type==="image")return(0,te.jsx)("img",{src:f.src,alt:"",style:F(P({},O),{objectFit:"contain"})},f.id);return null})})})]})},la=({slides:m,currentSlideIndex:a,onSelectSlide:l,onDeleteSlide:h,onDuplicateSlide:x,onReorderSlides:s,uiScale:V,appBgColor:D="#B7472A"})=>{let R=(0,we.useSensors)((0,we.useSensor)(we.PointerSensor,{activationConstraint:{distance:5}}),(0,we.useSensor)(we.KeyboardSensor,{coordinateGetter:Te.sortableKeyboardCoordinates})),r=T=>{let{active:b,over:I}=T;if(b.id!==(I==null?void 0:I.id)){let w=m.findIndex(C=>C.id===b.id),H=m.findIndex(C=>C.id===(I==null?void 0:I.id));s(w,H)}};return(0,te.jsx)("div",{className:"bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",style:{width:`${Math.max(220,256*V)}px`},children:(0,te.jsx)(we.DndContext,{sensors:R,collisionDetection:we.closestCenter,onDragEnd:r,children:(0,te.jsx)(Te.SortableContext,{items:m.map(T=>T.id),strategy:Te.verticalListSortingStrategy,children:m.map((T,b)=>(0,te.jsx)(Za,{slide:T,index:b,isActive:b===a,onSelect:()=>l(b),onDelete:()=>h(b),onDuplicate:()=>x(b),showDelete:m.length>1,uiScale:V,appBgColor:D},T.id))})})})};var ue=require("react"),ce=$e(require("fabric")),He=require("lucide-react");var $=require("react/jsx-runtime"),Ga={triangle:"M 12,4 L 20,18 H 4 L 12,4 Z",rightTriangle:"M 4,4 V 20 H 20 L 4,4 Z",rhombus:"M 12,4 L 20,12 L 12,20 L 4,12 L 12,4 Z",parallelogram:"M 7,4 H 21 L 17,20 H 3 L 7,4 Z",trapezoid:"M 6,4 H 18 L 21,20 H 3 L 6,4 Z",pentagon:"M 12,3 L 21,9 V 19 H 3 V 9 L 12,3 Z",hexagon:"M 12,3 L 20,7.5 V 16.5 L 12,21 L 4,16.5 V 7.5 L 12,3 Z",heptagon:"M 12,3 L 18.5,6 L 21,13 L 16,20 H 8 L 3,13 L 5.5,6 L 12,3 Z",octagon:"M 8.5,3 H 15.5 L 21,8.5 V 15.5 L 15.5,21 H 8.5 L 3,15.5 V 8.5 L 8.5,3 Z",heart:"M 12,21.35 L 10.55,20.03 C 5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3 C 9.24,3 10.91,3.81 12,5.09 C 13.09,3.81 14.76,3 16.5,3 C 19.58,3 22,5.42 22,8.5 C 22,12.28 18.6,15.36 13.45,20.04 L 12,21.35 Z",smiley:"M 12,3 A 9,9 0 1,0 12,21 A 9,9 0 1,0 12,3 M 9,9 A 1.5,1.5 0 1,1 9,10.5 A 1.5,1.5 0 1,1 9,9 M 15,9 A 1.5,1.5 0 1,1 15,10.5 A 1.5,1.5 0 1,1 15,9 M 8,15 C 8,15 9.5,17 12,17 C 14.5,17 16,15 16,15",sun:"M 12,7 A 5,5 0 1,1 12,17 A 5,5 0 1,1 12,7 M 12,2 V 4 M 12,20 V 22 M 4,12 H 2 M 22,12 H 20 M 19.07,4.93 L 17.66,6.34 M 6.34,17.66 L 4.93,19.07 M 4.93,4.93 L 6.34,6.34 M 17.66,17.66 L 19.07,19.07",moon:"M 12,3 A 9,9 0 1,0 12,21 A 7,7 0 0,1 12,3 Z",circle:"M 12,3 A 9,9 0 1,1 12,21 A 9,9 0 1,1 12,3 Z",arrowRight:"M 4,11 H 15.5 L 12,7.5 L 13.5,6 L 19.5,12 L 13.5,18 L 12,16.5 L 15.5,13 H 4 Z",arrowLeft:"M 20,11 H 8.5 L 12,7.5 L 10.5,6 L 4.5,12 L 10.5,18 L 12,16.5 L 8.5,13 H 20 Z",arrowUp:"M 13,20 V 8.5 L 16.5,12 L 18,10.5 L 12,4.5 L 6,10.5 L 7.5,12 L 11,8.5 V 20 Z",arrowDown:"M 11,4 V 15.5 L 7.5,12 L 6,13.5 L 12,19.5 L 18,13.5 L 16.5,12 L 13,15.5 V 4 Z",arrowLeftRight:"M 4,12 L 8,8 V 11 H 16 V 8 L 20,12 L 16,16 V 13 H 8 V 16 L 4,12 Z",arrowUpDown:"M 12,4 L 8,8 H 11 V 16 H 8 L 12,20 L 16,16 H 13 V 8 H 16 L 12,4 Z",star4:"M 12,2 L 14,10 L 22,12 L 14,14 L 12,22 L 10,14 L 2,12 L 10,10 L 12,2 Z",star5:"M 12,2 L 14.5,9.5 H 22 L 16,14 L 18.5,21.5 L 12,17 L 5.5,21.5 L 8,14 L 2,9.5 H 9.5 L 12,2 Z",star6:"M 12,2 L 15,7 L 21,6 L 17,10.5 L 19,17 L 12,14 L 5,17 L 7,10.5 L 3,6 L 9,7 L 12,2 Z",star8:"M 12,2 L 14,6 L 18,4 L 16,8 L 20,10 L 16,12 L 18,16 L 14,14 L 12,18 L 10,14 L 6,16 L 8,12 L 4,10 L 8,8 L 6,4 L 10,6 L 12,2 Z",cloud:"M 17,19 C 14.8,19 13.1,17.7 12.3,15.8 C 11.4,16 10.5,16.2 9.6,16.2 C 7,16.2 4.7,14.6 3.7,12.3 C 1.5,11.8 0,9.9 0,7.6 C 0,5 2.1,2.9 4.7,2.9 C 5.3,2.9 5.8,3 6.3,3.1 C 7.6,1.4 9.6,0.3 11.9,0.3 C 12.5,0.3 13.1,0.4 13.7,0.5 C 15,1.9 15.9,3.7 16,5.7 C 18.2,6.1 20,8.1 20,10.5 C 20,13.2 17.8,15.4 15.1,15.4 C 14.8,15.4 14.5,15.4 14.2,15.3 C 14.2,15.4 14.2,15.4 14.2,15.5 C 14.2,17.4 15.5,19 17,19 Z",lightning:"M 13,2 L 3,14 H 12 V 22 L 22,10 H 13 L 16,2 Z",plus:"M 19,13 H 13 V 19 H 11 V 13 H 5 V 11 H 11 V 5 H 13 V 11 H 19 V 13 Z",minus:"M 19,13 H 5 V 11 H 19 V 13 Z",multiply:"M 19,6.41 L 17.59,5 L 12,10.59 L 6.41,5 L 5,6.41 L 10.59,12 L 5,17.59 L 6.41,19 L 12,13.41 L 17.59,19 L 19,17.59 L 13.41,12 L 19,6.41 Z",divide:"M 12,7 A 2,2 0 1,1 12,11 A 2,2 0 1,1 12,7 M 12,17 A 2,2 0 1,1 12,21 A 2,2 0 1,1 12,17 M 5,11 H 19 V 13 H 5 V 11 Z",equal:"M 19,10 H 5 V 8 H 19 V 10 M 19,16 H 5 V 14 H 19 V 16 Z"},Wa=(m,a,l,h)=>{if(a)switch(m){case"bullet-disc":return"\u2022";case"bullet-circle":return"\u25CB";case"bullet-square":return"\u25A0";case"bullet-square-outlined":return"\u25A1";case"bullet-diamond":return"\u25C6";case"bullet-arrow":return"\u27A4";case"bullet-check":return"\u2713";case"none":return"";default:return"\u2022"}else if(l){let x=h+1;switch(m){case"number-decimal":return`${x}.`;case"number-decimal-paren":return`${x})`;case"number-roman-upper":return na(x)+".";case"number-roman-lower":return na(x).toLowerCase()+".";case"number-alpha-upper":return Lt(x)+".";case"number-alpha-lower":return Lt(x).toLowerCase()+".";case"number-alpha-lower-paren":return Lt(x).toLowerCase()+")";case"none":return"";default:return`${x}.`}}return""},na=m=>{let a={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},l="";for(let h in a)for(;m>=a[h];)l+=h,m-=a[h];return l},Lt=m=>String.fromCharCode(64+m),nt=class extends ce.Textbox{_renderTextLine(a,l,h,x,s,V){if(super._renderTextLine(a,l,h,x,s,V),(this.isBulleted||this.isNumbered)&&this.listType!=="none"){let D=Wa(this.listType,this.isBulleted,this.isNumbered,V);if(D){l.save();let R=this.fontSize||22,r=-R*1,T=R*.6;l.font=`${this.fontStyle} ${this.fontWeight} ${T}px ${this.fontFamily}`,l.fillStyle=this.fill,l.fillText(D,x+r,s-R*.35),l.restore()}}}},ct=({slide:m,onElementUpdate:a,onSelect:l,uiScale:h,onSlashCommand:x,selectedElementId:s,onAiGenerateClick:V,onAiGenerateInfographicClick:D,onUploadImageClick:R,onDeleteElement:r})=>{let T=(0,ue.useRef)(null),b=(0,ue.useRef)(null),I=(0,ue.useRef)(!1),w=(0,ue.useRef)(a),H=(0,ue.useRef)(l),C=(0,ue.useRef)(null),[f,O]=(0,ue.useState)(1),[G,oe]=(0,ue.useState)(!1),Y=(0,ue.useRef)({x:0,y:0});(0,ue.useEffect)(()=>{if(!C.current)return;let A=new ResizeObserver(ne=>{let q=ne[0];if(q){let{width:L,height:ee}=q.contentRect,g=L/1200,S=ee/675,c=Math.min(g,S)*.95;O(c)}});return A.observe(C.current),()=>A.disconnect()},[]),(0,ue.useEffect)(()=>{w.current=a,H.current=l},[a,l]),(0,ue.useEffect)(()=>{if(T.current&&!b.current){let A=new ce.Canvas(T.current,{width:1200,height:675,backgroundColor:"white",selection:!0,preserveObjectStacking:!0});b.current=A,oe(!0);let ne=c=>{c.left<0&&c.set("left",0),c.top<0&&c.set("top",0);let k=c.getBoundingRect();k.left+k.width>(A.width||1200)&&c.set("left",(A.width||1200)-k.width),k.top+k.height>(A.height||675)&&c.set("top",(A.height||675)-k.height)};A.on("object:moving",c=>ne(c.target)),A.on("object:scaling",c=>ne(c.target));let q=c=>{var z;if(I.current)return;let k=c.target,n=(z=k.get("data"))==null?void 0:z.id;k&&n&&w.current(n,P({x:k.left,y:k.top,width:k.getScaledWidth(),height:k.getScaledHeight()},k.isType("textbox")?{content:k.text,textAlign:k.textAlign,fontSize:k.fontSize,fontFamily:k.fontFamily,color:k.fill}:{fill:k.fill}))};A.on("object:modified",q),A.on("text:changed",q);let L=c=>{if(!(!c||!c.isType("textbox")))return{fontFamily:c.fontFamily,fontSize:c.fontSize,isBold:c.fontWeight==="bold",isItalic:c.fontStyle==="italic",isUnderline:c.underline,textAlign:c.textAlign,color:c.fill,highlightColor:c.textBackgroundColor,isBulleted:!!c.isBulleted,isNumbered:!!c.isNumbered}},ee=(c,k=!1)=>{var n;try{let z=(n=T.current)==null?void 0:n.getBoundingClientRect();if(!z||!c)return;let N=0,K=0,pe=(J,M)=>typeof J=="object"&&J!==null&&typeof J[M]=="function",he=pe(c,"isType")&&c.isType("textbox");if(he&&c.isEditing){let M=(W=>{try{let re=W.selectionStart||0;if(pe(W,"getCursorCoords"))return W.getCursorCoords(re);if(pe(W,"_getCursorCoords"))return W._getCursorCoords(re)}catch(re){}return null})(c);if(M){let W=ce.util.transformPoint(new ce.Point(M.left,M.top),pe(c,"calcTransformMatrix")?c.calcTransformMatrix():[1,0,0,1,0,0]),re=A.viewportTransform||[1,0,0,1,0,0],fe=ce.util.transformPoint(W,re);N=z.left+fe.x*f,K=z.top+fe.y*f}else{let W=pe(c,"getBoundingRect")?c.getBoundingRect():{left:0,top:0,width:0,height:0};N=z.left+(W.left+W.width/2)*f,K=z.top+W.top*f}}else{let J=pe(c,"getBoundingRect")?c.getBoundingRect():{left:Y.current.x,top:Y.current.y,width:0,height:0};N=z.left+(J.left+J.width/2)*f,K=z.top+J.top*f}if(N&&K){let J=k?"text-selection":he?"textbox":"default",M=N,W=K;J==="default"?(M=N+5,W=K+5):(M=N-220,W=K-140),x({x:M,y:W},J,L(c))}}catch(z){console.error("Critical error in triggerSlashMenu:",z)}},g=c=>{var n,z;let k=((n=c.selected)==null?void 0:n[0])||c.target;if(k){let N=(z=k.get("data"))==null?void 0:z.id;H.current(N),k.isType("textbox")&&!I.current&&ee(k)}};A.on("selection:created",g),A.on("selection:updated",g),A.on("selection:cleared",()=>{H.current(null),x({x:0,y:0},"default")}),A.on("text:selection:changed",c=>{let k=c.target;k&&k.isType("textbox")&&k.selectionStart!==k.selectionEnd&&ee(k,!0)}),A.on("mouse:move",c=>{c.pointer&&(Y.current={x:c.pointer.x,y:c.pointer.y})});let S=c=>{let k=b.current;if(!k)return;let n=k.getActiveObject();if(c.key==="/"){c.preventDefault(),ee(n||{isType:()=>!1,getBoundingRect:()=>({left:Y.current.x,top:Y.current.y,width:0,height:0})});return}if(n&&n.isType("textbox")&&n.isEditing||!n)return;let z=c.shiftKey?10:1,N=!1;switch(c.key){case"ArrowLeft":n.set("left",n.left-z),N=!0;break;case"ArrowRight":n.set("left",n.left+z),N=!0;break;case"ArrowUp":n.set("top",n.top-z),N=!0;break;case"ArrowDown":n.set("top",n.top+z),N=!0;break}N&&(ne(n),k.requestRenderAll(),q({target:n}))};window.addEventListener("keydown",S),A._keyboardListener=S}return()=>{if(b.current){let A=b.current._keyboardListener;A&&window.removeEventListener("keydown",A),b.current.dispose(),b.current=null}}},[]),(0,ue.useEffect)(()=>{if(!b.current)return;let A=b.current;(async()=>{I.current=!0;let q=A.getObjects(),L=new Set(m.elements.map(g=>g.id));q.forEach(g=>{var c;let S=(c=g.get("data"))==null?void 0:c.id;S&&!L.has(S)&&A.remove(g)});let ee=[...m.elements].sort((g,S)=>(g.zIndex||0)-(S.zIndex||0));for(let g of ee){let S=q.find(c=>{var k;return((k=c.get("data"))==null?void 0:k.id)===g.id});if(S&&S.type==="textbox"&&!(S instanceof nt)&&(A.remove(S),S=null),S){if(S===A.getActiveObject()&&S.isType("textbox")&&S.isEditing)continue;let c={left:g.x,top:g.y,opacity:g.opacity!==void 0?g.opacity:1,zIndex:g.zIndex};g.type==="text"&&S.isType("textbox")?(c.text=g.content||" ",c.fontSize=g.fontSize||22,c.fill=g.color||"#000000",c.textBackgroundColor=g.highlightColor||"",c.textAlign=g.textAlign||"left",c.fontWeight=g.isBold?"bold":"normal",c.fontStyle=g.isItalic?"italic":"normal",c.underline=g.isUnderline||!1,c.linethrough=g.isStrikethrough||!1,c.charSpacing=g.charSpacing||0,c.fontFamily=g.fontFamily||"Arial",S.isBulleted=g.isBulleted,S.isNumbered=g.isNumbered,S.listType=g.listType,c.width=Math.max(g.width||50,10)):g.type==="shape"?(c.fill=g.fill||"#cccccc",c.scaleX=(g.width||50)/(S.width||1),c.scaleY=(g.height||50)/(S.height||1)):g.type==="image"&&(c.scaleX=(g.width||100)/(S.width||1),c.scaleY=(g.height||100)/(S.height||1)),S.set(c)}else{let c=null,k={left:g.x,top:g.y,data:{id:g.id},originX:"left",originY:"top",opacity:g.opacity!==void 0?g.opacity:1};if(g.type==="text")c=new nt(g.content||" ",F(P({},k),{width:Math.max(g.width||200,10),fontSize:g.fontSize||22,fill:g.color||"#000000",backgroundColor:g.highlightColor||"",fontFamily:g.fontFamily||"Inter, Arial, sans-serif",textAlign:g.textAlign||"left",fontWeight:g.isBold?"bold":"normal",fontStyle:g.isItalic?"italic":"normal",underline:g.isUnderline||!1,linethrough:g.isStrikethrough||!1,charSpacing:g.charSpacing||0,splitByGrapheme:!1,objectCaching:!1})),c.isBulleted=g.isBulleted,c.isNumbered=g.isNumbered,c.listType=g.listType;else if(g.type==="shape"){let n=g.fill||"#3b82f6";if(g.shapeType==="ellipse")c=new ce.Circle(F(P({},k),{radius:(g.width||100)/2,scaleY:(g.height||100)/(g.width||100),fill:n}));else if(g.shapeType==="rect")c=new ce.Rect(F(P({},k),{width:g.width||100,height:g.height||100,fill:n}));else{let z=Ga[g.shapeType];if(z){c=new ce.Path(z,F(P({},k),{fill:n}));let N=c;N.set({scaleX:(g.width||100)/(N.width||1),scaleY:(g.height||100)/(N.height||1)})}else c=new ce.Rect(F(P({},k),{width:g.width||100,height:g.height||100,fill:n}))}}else if(g.type==="image")try{let n=await ce.FabricImage.fromURL(g.src);n.set(F(P({},k),{scaleX:(g.width||100)/(n.width||1),scaleY:(g.height||100)/(n.height||1)})),c=n}catch(n){console.error(n)}c&&A.add(c)}}A.renderAll(),I.current=!1})()},[m,G]);let _=m.elements.find(A=>A.id===s);return(0,$.jsx)("div",{ref:C,className:"w-full h-full flex items-center justify-center overflow-hidden relative",children:(0,$.jsxs)("div",{className:"border border-slate-200 overflow-hidden bg-white shadow-xl transition-all duration-300 ease-out shrink-0 relative",style:{transform:`scale(${f})`,transformOrigin:"center center"},children:[(0,$.jsx)("canvas",{ref:T}),m.elements.length===0&&(0,$.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none select-none animate-in fade-in duration-700",children:(0,$.jsx)("div",{className:"flex flex-col items-center gap-4 text-slate-300",children:(0,$.jsx)("div",{className:"flex flex-col items-center gap-1 text-center",children:(0,$.jsxs)("h1",{className:"text-2xl font-medium text-slate-400",children:["Click ",(0,$.jsx)("span",{className:"px-2 py-0.5 bg-slate-100 rounded-md text-slate-500 font-bold",children:"/"})," for options"]})})})}),_&&_.type==="image"&&(0,$.jsxs)("div",{className:"absolute z-[5000] flex flex-col w-96 bg-white border border-slate-200 shadow-2xl rounded-2xl overflow-hidden animate-in fade-in zoom-in duration-200",style:{left:_.x+_.width/2>600?`${_.x-12}px`:`${_.x+_.width+12}px`,top:`${_.y+_.height/2}px`,transform:_.x+_.width/2>600?"translate(-100%, -50%)":"translate(0, -50%)"},children:[(0,$.jsx)("div",{className:"px-5 py-3.5 text-sm uppercase tracking-wider font-bold text-slate-400 bg-slate-50/50 border-b border-slate-100",children:"Image Actions"}),(0,$.jsxs)("div",{className:"p-2.5 flex flex-col gap-1",children:[(0,$.jsxs)("button",{onClick:A=>{A.stopPropagation(),V()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,$.jsx)("div",{className:"p-3 rounded-xl bg-blue-50 text-blue-600 group-hover:bg-blue-600 group-hover:text-white transition-colors",children:(0,$.jsx)(He.Sparkles,{size:28})}),(0,$.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,$.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Generate Image"}),(0,$.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Create an image with AI prompt"})]})]}),(0,$.jsxs)("button",{onClick:A=>{A.stopPropagation(),D()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,$.jsx)("div",{className:"p-3 rounded-xl bg-purple-50 text-purple-600 group-hover:bg-purple-600 group-hover:text-white transition-colors",children:(0,$.jsx)(He.PieChart,{size:28})}),(0,$.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,$.jsx)("span",{className:"text-lg font-bold text-slate-900",children:"AI Infographic"}),(0,$.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Generate chart or diagram"})]})]}),(0,$.jsxs)("button",{onClick:A=>{A.stopPropagation(),R()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-slate-50 group",children:[(0,$.jsx)("div",{className:"p-3 rounded-xl bg-slate-100 text-slate-500 group-hover:bg-slate-200 group-hover:text-slate-700 transition-colors",children:(0,$.jsx)(He.Image,{size:28})}),(0,$.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,$.jsx)("span",{className:"text-lg font-bold text-slate-700",children:"Change Image"}),(0,$.jsx)("span",{className:"text-sm text-slate-400 truncate leading-tight",children:"Replace with local file"})]})]}),(0,$.jsx)("div",{className:"h-[1px] bg-slate-100 my-1 mx-3"}),(0,$.jsxs)("button",{onClick:A=>{A.stopPropagation(),r()},className:"w-full flex items-center gap-5 px-5 py-4 text-left transition-all duration-150 rounded-xl hover:bg-red-50 group",children:[(0,$.jsx)("div",{className:"p-3 rounded-xl bg-red-50 text-red-500 group-hover:bg-red-500 group-hover:text-white transition-colors",children:(0,$.jsx)(He.Trash2,{size:28})}),(0,$.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,$.jsx)("span",{className:"text-lg font-bold text-red-600",children:"Delete Element"}),(0,$.jsx)("span",{className:"text-sm text-red-400/80 truncate leading-tight",children:"Remove from slide"})]})]})]})]})]})})};var ca=$e(require("pptxgenjs"));var Je=class{async export(a){var r,T;let l=new ca.default,h=((r=a.layout)==null?void 0:r.width)||12192e3,x=((T=a.layout)==null?void 0:T.height)||6858e3,s=1200,V=675,D=b=>b/s*(h/914400),R=b=>b/V*(x/914400);a.slides.forEach(b=>{let I=l.addSlide();[...b.elements].sort((H,C)=>H.zIndex-C.zIndex).forEach(H=>{var O,G;let C=H.opacity!==void 0?(1-H.opacity)*100:0,f={x:D(H.x),y:R(H.y),w:D(H.width),h:R(H.height)};if(H.type==="text")I.addText(H.content,F(P({},f),{fontSize:(H.fontSize||18)/2,color:((O=H.color)==null?void 0:O.replace("#",""))||"000000",fontFace:H.fontFamily||"Arial"}));else if(H.type==="image")I.addImage(F(P({},f),{path:H.src,transparency:C}));else if(H.type==="shape"){let oe=H.shapeType==="ellipse"?l.ShapeType.ellipse:l.ShapeType.rect;I.addShape(oe,F(P({},f),{fill:{color:((G=H.fill)==null?void 0:G.replace("#",""))||"CCCCCC",transparency:C>0?Math.min(C+10,100):0}}))}})}),await l.writeFile({fileName:"presentation.pptx"})}};var da=$e(require("jszip")),Qe=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(a){var T,b;let l=a;if(typeof a=="string"){let I=await fetch(a);if(!I.ok){let w=I.status,H=I.statusText,C="";try{let f=await I.json();C=f.details||f.error||""}catch(f){}throw new Error(`Failed to fetch PPTX from ${a}: ${w} ${H} ${C?`(${C})`:""}`)}l=await I.arrayBuffer()}let h=await da.default.loadAsync(l),x=await((T=h.file("ppt/presentation.xml"))==null?void 0:T.async("string"));if(!x)throw new Error("Invalid PPTX");let V=new DOMParser().parseFromString(x,"text/xml"),D=this.findFirstByLocalName(V,"sldSz");D&&(this.slideWidth=parseInt(this.getAttr(D,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(D,"cy")||"6858000"));let R=Array.from(V.getElementsByTagNameNS("*","sldId")),r=[];for(let I=0;I<R.length;I++){let w=I+1,H=`ppt/slides/slide${w}.xml`,C=await((b=h.file(H))==null?void 0:b.async("string"));if(C){let f=await this.parseSlide(C,w,h);r.push(f)}}return{slides:r,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(a,l){return a.getAttribute(l)||a.getAttribute(`a:${l}`)||a.getAttribute(`p:${l}`)||a.getAttribute(`r:${l}`)}findFirstByLocalName(a,l){let h=a.getElementsByTagNameNS("*",l);return h.length>0?h[0]:null}findAllByLocalName(a,l){return Array.from(a.getElementsByTagNameNS("*",l))}scaleX(a){return a/this.slideWidth*this.CANVAS_WIDTH}scaleY(a){return a/this.slideHeight*this.CANVAS_HEIGHT}parseColor(a){let l=this.findFirstByLocalName(a,"srgbClr");if(l){let x=`#${this.getAttr(l,"val")}`,s=this.findFirstByLocalName(l,"alpha"),V=s?parseInt(this.getAttr(s,"val")||"100000")/1e5:1;return{color:x,opacity:V}}let h=this.findFirstByLocalName(a,"schemeClr");if(h){let x=this.findFirstByLocalName(h,"alpha");return{color:"#000000",opacity:x?parseInt(this.getAttr(x,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(a,l,h){var r,T;let x=await((r=h.file(`ppt/slides/_rels/slide${l}.xml.rels`))==null?void 0:r.async("string"));if(!x)return null;let V=new DOMParser().parseFromString(x,"text/xml"),D=Array.from(V.getElementsByTagName("Relationship")).find(b=>b.getAttribute("Id")===a),R=D==null?void 0:D.getAttribute("Target");if(R){let b=(R.startsWith("../")?`ppt/${R.substring(3)}`:`ppt/slides/${R}`).replace("ppt/slides/../","ppt/");return await((T=h.file(b))==null?void 0:T.async("blob"))||null}return null}async parseSlide(a,l,h){let s=new DOMParser().parseFromString(a,"text/xml"),V=[],D=0,R=this.findFirstByLocalName(s,"bg");if(R){let b=this.findFirstByLocalName(R,"blip"),I=(b==null?void 0:b.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(b==null?void 0:b.getAttribute("r:embed"));if(I){let w=await this.resolveImage(I,l,h);w&&V.push({id:`bg-${l}`,type:"image",src:URL.createObjectURL(w),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:D++,opacity:1})}}let r=this.findFirstByLocalName(s,"spTree");if(!r)return{id:`slide-${l}`,elements:V};let T=Array.from(r.children);for(let b of T){let I=b.localName;if(I==="sp"){let w=this.findFirstByLocalName(b,"txBody"),H=this.findFirstByLocalName(b,"nvSpPr"),C=H?this.findFirstByLocalName(H,"nvPr"):null,f=C?this.findFirstByLocalName(C,"ph"):null,O=f?this.getAttr(f,"type"):null,G=f&&(!O||O==="body"),oe=this.findFirstByLocalName(b,"xfrm"),Y=oe?this.findFirstByLocalName(oe,"off"):null,_=oe?this.findFirstByLocalName(oe,"ext"):null;if(w&&Y&&_){let ne=this.findAllByLocalName(w,"p"),q="",L=18,ee="#000000",g=1,S=!1,c=!1;for(let k of ne){let n=this.findFirstByLocalName(k,"pPr"),z=n?this.findFirstByLocalName(n,"buNone"):null,N="";n&&!z?this.findFirstByLocalName(n,"buAutoNum")?c=!0:(this.findFirstByLocalName(n,"buChar")||parseInt(this.getAttr(n,"indent")||"0")<0||G)&&(S=!0):!n&&G&&(S=!0);let K=this.findAllByLocalName(k,"r");for(let be of K){let J=this.findFirstByLocalName(be,"t");J&&(N+=J.textContent);let M=this.findFirstByLocalName(be,"rPr");if(M){let W=this.getAttr(M,"sz");W&&(L=parseInt(W)/100*2);let re=this.parseColor(M);ee=re.color,g=re.opacity}}let pe=/^\s*([•\u2022\u2023\u25E6\u2043\u2219])\s+/;N.match(pe)&&(S=!0,N=N.replace(pe,"")),q+=N+`
|
|
4
|
+
`}if(q.trim()){V.push({id:`el-${l}-${Date.now()}-${D}`,type:"text",content:q.trim(),x:this.scaleX(parseInt(this.getAttr(Y,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(Y,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(_,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(_,"cy")||"0")),fontSize:L,color:ee,fontFamily:"Arial",zIndex:D++,isBulleted:S,isNumbered:c,listType:c?"number-decimal":S?"bullet-disc":"none",opacity:g});continue}}let A=this.findFirstByLocalName(b,"prstGeom");if(A&&Y&&_){let ne=this.getAttr(A,"prst")||"rect",q=this.findFirstByLocalName(b,"spPr"),L=q?this.parseColor(q):{color:"#cccccc",opacity:1},ee={rect:"rect",roundRect:"rect",ellipse:"ellipse",circle:"ellipse",triangle:"triangle",rtTriangle:"rightTriangle",diamond:"rhombus",parallelogram:"parallelogram",trapezoid:"trapezoid",pentagon:"pentagon",hexagon:"hexagon",heptagon:"heptagon",octagon:"octagon",heart:"heart",smileyFace:"smiley",sun:"sun",moon:"moon",rightArrow:"arrowRight",leftArrow:"arrowLeft",upArrow:"arrowUp",downArrow:"arrowDown",leftRightArrow:"arrowLeftRight",upDownArrow:"arrowUpDown",star4:"star4",star5:"star5",star6:"star6",star8:"star8",cloud:"cloud",lightningBolt:"lightning",plus:"plus",minus:"minus",multiply:"multiply",divide:"divide",equal:"equal"};V.push({id:`el-${l}-${Date.now()}-${D}`,type:"shape",shapeType:ee[ne]||"rect",fill:L.color,opacity:L.opacity,x:this.scaleX(parseInt(this.getAttr(Y,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(Y,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(_,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(_,"cy")||"0")),zIndex:D++})}}if(I==="pic"){let w=this.findFirstByLocalName(b,"blip"),H=(w==null?void 0:w.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(w==null?void 0:w.getAttribute("r:embed")),C=this.findFirstByLocalName(b,"xfrm"),f=C?this.findFirstByLocalName(C,"off"):null,O=C?this.findFirstByLocalName(C,"ext"):null;if(H&&f&&O){let G=await this.resolveImage(H,l,h);G&&V.push({id:`el-${l}-${Date.now()}-${D}`,type:"image",src:URL.createObjectURL(G),x:this.scaleX(parseInt(this.getAttr(f,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(f,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(O,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(O,"cy")||"0")),zIndex:D++,opacity:1})}}}return{id:`slide-${l}`,elements:V}}};var Ze=require("react"),Ge=require("lucide-react");var me=require("react/jsx-runtime"),zt=({presentation:m,initialSlideIndex:a,onClose:l})=>{let[h,x]=(0,Ze.useState)(a),s=m.slides[h],V=()=>{h>0&&x(h-1)},D=()=>{h<m.slides.length-1&&x(h+1)};(0,Ze.useEffect)(()=>{let T=b=>{b.key==="ArrowRight"||b.key===" "||b.key==="PageDown"?D():b.key==="ArrowLeft"||b.key==="Backspace"||b.key==="PageUp"?V():b.key==="Escape"&&l()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[h]);let[R,r]=(0,Ze.useState)(1);return(0,Ze.useEffect)(()=>{let T=()=>{let I=window.innerWidth-40,w=window.innerHeight-40,H=1200,C=675,f=I/H,O=w/C,G=Math.min(f,O);r(G)};return T(),window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),(0,me.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-[#0A0A0A] flex flex-col items-center justify-center overflow-hidden",children:[(0,me.jsxs)("div",{className:"absolute top-0 left-0 right-0 p-6 flex justify-between items-center opacity-0 hover:opacity-100 transition-opacity bg-gradient-to-b from-black/60 to-transparent z-[100] pointer-events-none",children:[(0,me.jsxs)("div",{className:"text-white/80 font-bold ml-4 pointer-events-auto",children:["Slide ",h+1," of ",m.slides.length]}),(0,me.jsx)("button",{onClick:l,className:"p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all pointer-events-auto",children:(0,me.jsx)(Ge.X,{size:24})})]}),(0,me.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,me.jsx)("div",{className:"relative shadow-2xl shadow-black/80 bg-white",style:{width:"1200px",height:"675px",transform:`scale(${R})`,transformOrigin:"center center"},children:(0,me.jsx)(ct,{slide:s,onElementUpdate:()=>{},onSelect:()=>{},uiScale:.75,onSlashCommand:()=>{},selectedElementId:null,onAiGenerateClick:()=>{},onAiGenerateInfographicClick:()=>{},onUploadImageClick:()=>{},onDeleteElement:()=>{}})})}),(0,me.jsxs)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center gap-6 opacity-0 hover:opacity-100 transition-opacity bg-black/40 backdrop-blur-md px-6 py-3 rounded-full border border-white/10 pointer-events-auto",children:[(0,me.jsx)("button",{disabled:h===0,onClick:V,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,me.jsx)(Ge.ChevronLeft,{size:32})}),(0,me.jsx)("div",{className:"h-6 w-[1px] bg-white/10"}),(0,me.jsx)("button",{disabled:h===m.slides.length-1,onClick:D,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,me.jsx)(Ge.ChevronRight,{size:32})})]})]})};var dt=require("@google/generative-ai");var ye=require("lucide-react"),E=require("react/jsx-runtime"),pa=({result:m,isLoading:a,onAction:l,onClose:h,position:x})=>(0,E.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[2000] w-80 bg-white border border-slate-200 rounded-xl shadow-2xl animate-in fade-in zoom-in-95 duration-200 overflow-hidden text-left",children:[(0,E.jsxs)("div",{className:"px-3 py-2.5 bg-blue-50/50 border-b border-blue-100 flex items-center justify-between",children:[(0,E.jsxs)("span",{className:"text-xs font-bold text-blue-700 uppercase tracking-wider flex items-center gap-2",children:[(0,E.jsx)(ye.Sparkles,{size:12}),"Refined Text"]}),(0,E.jsx)("button",{onClick:h,className:"text-slate-400 hover:text-slate-600",children:(0,E.jsx)(ye.X,{size:14})})]}),a?(0,E.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center gap-3 text-slate-400",children:[(0,E.jsx)(ye.RefreshCw,{size:24,className:"animate-spin text-blue-500"}),(0,E.jsx)("span",{className:"text-xs font-medium",children:"Refining text..."})]}):(0,E.jsxs)("div",{className:"flex flex-col",children:[(0,E.jsx)("div",{className:"p-4 bg-slate-50/50 max-h-[300px] overflow-y-auto text-sm text-slate-700 leading-relaxed border-b border-slate-100",children:m}),(0,E.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,E.jsxs)("button",{onClick:()=>l("replace"),className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,E.jsx)(ye.Check,{size:14,className:"text-slate-400"}),(0,E.jsx)("span",{children:"Replace selection"})]}),(0,E.jsxs)("button",{onClick:()=>l("addBelow"),className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,E.jsx)(ye.ArrowRightFromLine,{size:14,className:"text-slate-400 rotate-90"}),(0,E.jsx)("span",{children:"Insert below"})]}),(0,E.jsxs)("button",{onClick:()=>l("regenerate"),className:"flex items-center gap-2 px-2 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors text-left",children:[(0,E.jsx)(ye.RefreshCw,{size:14}),(0,E.jsx)("span",{children:"Try again"})]}),(0,E.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,E.jsxs)("button",{onClick:()=>l("discard"),className:"flex items-center gap-2 px-2 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors text-left",children:[(0,E.jsx)(ye.Trash2,{size:14}),(0,E.jsx)("span",{children:"Discard"})]})]})]})]});var se=$e(require("react")),u=require("lucide-react");var t=require("react/jsx-runtime"),Ee={rewrite:{label:"Improve writing",icon:u.RefreshCcwDot,color:"text-blue-500"},grammar:{label:"Fix grammar",icon:u.CheckCheck,color:"text-blue-500"},shorten:{label:"Make shorter",icon:u.ArrowDownWideNarrow,color:"text-blue-500"},lengthen:{label:"Make longer",icon:u.WrapText,color:"text-blue-500"},continue:{label:"Continue writing",icon:u.StepForward,color:"text-blue-500"},reframe:{label:"Reframe",icon:u.RefreshCw,color:"text-blue-500"}},Oa=["Inter","Arial","Lato","Open Sans","Poppins","Roboto","Georgia","Times New Roman"],qa=[8,9,10,11,12,14,16,18,20,24,28,32,36,48,64,72,96],ga=({onClose:m,onAction:a,position:l,canUseAi:h,mode:x="default",context:s,aiResult:V,isAiLoading:D,onAiResponseAction:R,lastAiAction:r})=>{let[T,b]=(0,se.useState)(""),[I,w]=(0,se.useState)(0),H=(0,se.useRef)(null),[C,f]=(0,se.useState)(!1),[O,G]=(0,se.useState)(!1),[oe,Y]=(0,se.useState)(!1),[_,A]=(0,se.useState)(!1),[ne,q]=(0,se.useState)(!1),[L,ee]=(0,se.useState)(""),g=(0,se.useMemo)(()=>[{id:"generate-image",label:"AI Generate Image",icon:u.Sparkles,category:"AI",description:"Create an image with AI prompt",action:()=>a("generate-image")},{id:"generate-infographic",label:"AI Generate Infographic",icon:u.PieChart,category:"AI",description:"Create an infographic with AI prompt",action:()=>a("generate-infographic")},{id:"text",label:"Text Box",icon:u.Type,category:"Basic",description:"Insert a new text element",action:()=>a("add-text")},{id:"image",label:"Image",icon:u.Image,category:"Basic",description:"Upload and insert an image",action:()=>a("add-image")},{id:"new-slide",label:"New Slide",icon:u.PlusCircle,category:"Canvas",description:"Add a fresh slide to deck",action:()=>a("new-slide")},{id:"rect",label:"Rectangle",icon:u.Square,category:"Shapes",action:()=>a("add-shape","rect")},{id:"circle",label:"Circle",icon:u.Circle,category:"Shapes",action:()=>a("add-shape","circle")},{id:"triangle",label:"Triangle",icon:u.Triangle,category:"Shapes",action:()=>a("add-shape","triangle")},{id:"star5",label:"Star",icon:u.Star,category:"Shapes",action:()=>a("add-shape","star5")},{id:"arrowRight",label:"Arrow",icon:u.ArrowRight,category:"Shapes",action:()=>a("add-shape","arrowRight")}],[a]),S=(0,se.useMemo)(()=>g.filter(n=>n.label.toLowerCase().includes(T.toLowerCase())||n.category.toLowerCase().includes(T.toLowerCase())),[g,T]);if((0,se.useEffect)(()=>{w(0)},[T]),(0,se.useEffect)(()=>{let n=z=>{x==="default"&&(z.key==="ArrowDown"?(z.preventDefault(),w(N=>(N+1)%S.length)):z.key==="ArrowUp"?(z.preventDefault(),w(N=>(N-1+S.length)%S.length)):z.key==="Enter"&&(z.preventDefault(),S[I]&&S[I].action())),z.key==="Escape"&&(z.preventDefault(),m())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[S,I,m,x]),(0,se.useEffect)(()=>{if(x==="default"&&H.current){let n=H.current.children[I];n&&n.scrollIntoView({block:"nearest"})}},[I,x]),x==="default"&&S.length===0&&T==="")return null;if(x==="textbox"||x==="text-selection"){let n=(s==null?void 0:s.fontFamily)||"Arial",z=(s==null?void 0:s.fontSize)||24,N=(0,se.useRef)(null),[K,pe]=(0,se.useState)(null);se.default.useLayoutEffect(()=>{if(N.current){let M=N.current.getBoundingClientRect(),W=window.innerWidth,re=window.innerHeight,fe=l.x,xe=l.y;fe+M.width>W-100&&(fe=W-M.width-100),fe=Math.max(10,fe),xe+M.height>re-20&&(xe=re-M.height-20),pe({x:fe,y:xe})}},[l.x,l.y]);let he=K||{x:l.x,y:l.y},be=K?1:0,J=he.y>window.innerHeight/2;return(0,t.jsxs)("div",{ref:N,className:"fixed z-[9999] bg-white rounded-xl shadow-[0_20px_50px_rgba(0,0,0,0.15)] border border-slate-200 p-2.5 flex flex-col gap-2.5 animate-in fade-in zoom-in-95 duration-200",style:{left:`${he.x}px`,top:`${he.y}px`,width:"auto",minWidth:"440px",maxWidth:"90vw",opacity:be},onClick:M=>M.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 h-9",children:[(0,t.jsxs)("div",{className:"flex items-center bg-slate-50 border border-slate-200 rounded-lg h-full flex-1 shadow-sm",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsxs)("button",{onClick:()=>{f(!C),G(!1)},className:"w-full flex items-center justify-between px-3 h-full text-xs font-bold text-slate-800 hover:bg-white transition-colors border-r border-slate-100 rounded-l-lg",children:[(0,t.jsx)("span",{className:"truncate",children:n}),(0,t.jsx)(u.ChevronDown,{size:14,className:"text-slate-400"})]}),C&&(0,t.jsx)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[180px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:Oa.map(M=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontFamily:M}),f(!1)},className:B("w-full text-left px-4 py-2 text-xs hover:bg-blue-50 transition-colors",n===M?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),style:{fontFamily:M},children:M},M))})]}),(0,t.jsxs)("div",{className:"relative w-16",children:[(0,t.jsxs)("button",{onClick:()=>{G(!O),f(!1)},className:"w-full flex items-center justify-between px-2 h-full text-xs font-black text-slate-900 hover:bg-white transition-colors rounded-r-lg",children:[(0,t.jsx)("span",{children:z}),(0,t.jsx)(u.ChevronDown,{size:14,className:"text-slate-400"})]}),O&&(0,t.jsx)("div",{className:"absolute top-full right-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-2xl z-50 py-1 min-w-[80px] max-h-[250px] overflow-y-auto animate-in fade-in slide-in-from-top-2",children:qa.map(M=>(0,t.jsx)("button",{onClick:()=>{a("format",{fontSize:M}),G(!1)},className:B("w-full text-center px-4 py-2 text-xs hover:bg-blue-50 transition-colors",z===M?"text-blue-600 font-bold bg-blue-100/50":"text-slate-700"),children:M},M))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 px-1 bg-slate-50 border border-slate-200 rounded-lg h-full shadow-sm",children:[(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:z+2}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Increase font size",children:[(0,t.jsx)("span",{className:"text-[13px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(u.ChevronUp,{size:10,strokeWidth:4,className:"ml-0.5"})]}),(0,t.jsxs)("button",{onClick:()=>a("format",{fontSize:Math.max(1,z-2)}),className:"p-1 hover:bg-white hover:text-blue-600 rounded-md text-slate-500 transition-all active:scale-95 flex items-center justify-center",title:"Decrease font size",children:[(0,t.jsx)("span",{className:"text-[11px] font-black leading-none translate-y-[1px]",children:"A"}),(0,t.jsx)(u.ChevronDown,{size:10,strokeWidth:4,className:"ml-0.5"})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 border-t border-slate-100 pt-2.5 flex-nowrap",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!(s!=null&&s.isBold)}),className:B("p-1 rounded-[3px] transition-all",s!=null&&s.isBold?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Bold",children:(0,t.jsx)(u.Bold,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{isItalic:!(s!=null&&s.isItalic)}),className:B("p-1 rounded-[3px] transition-all",s!=null&&s.isItalic?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Italic",children:(0,t.jsx)(u.Italic,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{isUnderline:!(s!=null&&s.isUnderline)}),className:B("p-1 rounded-[3px] transition-all",s!=null&&s.isUnderline?"text-blue-600 bg-blue-50 shadow-sm":"text-slate-200 hover:bg-slate-50 hover:text-slate-500"),title:"Underline",children:(0,t.jsx)(u.Underline,{size:14,strokeWidth:2.5})}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>q(!ne),className:B("flex items-center gap-1 px-1.5 py-0.5 rounded-[3px] transition-all text-xs font-bold whitespace-nowrap",ne?"bg-blue-50 text-blue-600 border-blue-100":"text-slate-500 hover:bg-blue-50 hover:text-blue-600"),children:[(0,t.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 469 469",fill:"none",xmlns:"http://www.w3.org/2000/svg",shapeRendering:"geometricPrecision",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[(0,t.jsx)("path",{d:"M237.092 62.3004L266.754 71.4198C267.156 71.5285 267.51 71.765 267.765 72.0934C268.02 72.4218 268.161 72.8243 268.166 73.2399C268.172 73.6555 268.042 74.0616 267.796 74.3967C267.55 74.7318 267.201 74.9777 266.803 75.097L237.141 84.3145C236.84 84.4058 236.566 84.5699 236.344 84.7922C236.121 85.0146 235.957 85.2883 235.866 85.5893L226.747 115.252C226.638 115.653 226.401 116.008 226.073 116.263C225.745 116.517 225.342 116.658 224.926 116.664C224.511 116.669 224.105 116.539 223.77 116.293C223.435 116.047 223.189 115.699 223.069 115.301L213.852 85.6383C213.761 85.3374 213.597 85.0636 213.374 84.8412C213.152 84.6189 212.878 84.4548 212.577 84.3635L182.914 75.2441C182.513 75.1354 182.158 74.8989 181.904 74.5705C181.649 74.2421 181.508 73.8396 181.503 73.424C181.497 73.0084 181.627 72.6023 181.873 72.2672C182.119 71.9321 182.467 71.6863 182.865 71.5669L212.528 62.3494C212.829 62.2582 213.103 62.0941 213.325 61.8717C213.547 61.6494 213.712 61.3756 213.803 61.0747L222.922 31.4121C223.031 31.0109 223.267 30.656 223.596 30.4013C223.924 30.1465 224.327 30.0057 224.742 30.0002C225.158 29.9946 225.564 30.1247 225.899 30.3706C226.234 30.6165 226.48 30.9649 226.599 31.363L235.817 61.0257C235.908 61.3266 236.072 61.6003 236.295 61.8227C236.517 62.0451 236.791 62.2091 237.092 62.3004Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M155.948 155.848L202.771 168.939C203.449 169.131 204.045 169.539 204.47 170.101C204.895 170.663 205.125 171.348 205.125 172.052C205.125 172.757 204.895 173.442 204.47 174.004C204.045 174.566 203.449 174.974 202.771 175.166L155.899 188.06C155.361 188.209 154.87 188.496 154.475 188.891C154.079 189.286 153.793 189.777 153.644 190.316L140.553 237.138C140.361 237.816 139.953 238.413 139.391 238.838C138.829 239.262 138.144 239.492 137.44 239.492C136.735 239.492 136.05 239.262 135.488 238.838C134.927 238.413 134.519 237.816 134.327 237.138L121.432 190.267C121.283 189.728 120.997 189.237 120.601 188.842C120.206 188.446 119.715 188.16 119.177 188.011L72.3537 174.92C71.676 174.728 71.0795 174.32 70.6547 173.759C70.2299 173.197 70 172.512 70 171.807C70 171.103 70.2299 170.418 70.6547 169.856C71.0795 169.294 71.676 168.886 72.3537 168.694L119.226 155.799C119.764 155.65 120.255 155.364 120.65 154.969C121.046 154.573 121.332 154.082 121.481 153.544L134.572 106.721C134.764 106.043 135.172 105.447 135.734 105.022C136.295 104.597 136.981 104.367 137.685 104.367C138.389 104.367 139.075 104.597 139.637 105.022C140.198 105.447 140.606 106.043 140.798 106.721L153.693 153.593C153.842 154.131 154.128 154.622 154.524 155.018C154.919 155.413 155.41 155.699 155.948 155.848Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M386.827 289.992C404.33 292.149 403.84 305.828 386.876 307.299C346.623 310.829 298.869 316.271 282.199 360.005C274.844 379.192 269.942 403.2 267.49 432.029C267.427 432.846 267.211 433.626 266.856 434.319C266.501 435.012 266.015 435.602 265.431 436.05C254.988 444.041 251.212 434.186 250.183 425.606C239.2 332.353 214.588 316.909 124.668 306.122C123.892 306.031 123.151 305.767 122.504 305.35C121.857 304.933 121.322 304.375 120.942 303.72C116.399 295.679 119.324 291.038 129.718 289.796C224.688 278.47 236.062 262.83 250.183 169.331C252.177 156.355 257.259 154.083 265.431 162.516C266.51 163.593 267.202 165.099 267.392 166.782C279.257 258.564 293.328 278.617 386.827 289.992Z",fill:"currentColor"})]}),(0,t.jsx)("span",{children:"Ask AI"}),(0,t.jsx)(u.ChevronDown,{size:10,className:"opacity-50"})]}),ne&&(0,t.jsxs)("div",{className:B("absolute left-0 w-80 bg-white border border-slate-200 rounded-xl shadow-2xl z-[1000] animate-in fade-in zoom-in-95 duration-200 overflow-hidden text-left flex flex-col max-h-[300px]",J?"bottom-full mb-2 origin-bottom-left":"top-full mt-2 origin-top-left"),children:[V&&r&&Ee[r]?(0,t.jsxs)("div",{className:"px-3 py-2.5 bg-blue-50/50 border-b border-blue-100 flex items-center gap-2",children:[(0,t.jsx)("div",{className:B("shrink-0",Ee[r].color),children:se.default.createElement(Ee[r].icon,{size:14})}),(0,t.jsx)("span",{className:B("text-xs font-bold uppercase tracking-wider",Ee[r].color.replace("500","700")),children:Ee[r].label})]}):(0,t.jsxs)("div",{className:"px-3 py-2.5 bg-white border-b border-slate-100 flex items-center gap-2",children:[(0,t.jsx)("div",{className:"text-blue-500 shrink-0",children:(0,t.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 469 469",fill:"none",xmlns:"http://www.w3.org/2000/svg",shapeRendering:"geometricPrecision",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[(0,t.jsx)("path",{d:"M237.092 62.3004L266.754 71.4198C267.156 71.5285 267.51 71.765 267.765 72.0934C268.02 72.4218 268.161 72.8243 268.166 73.2399C268.172 73.6555 268.042 74.0616 267.796 74.3967C267.55 74.7318 267.201 74.9777 266.803 75.097L237.141 84.3145C236.84 84.4058 236.566 84.5699 236.344 84.7922C236.121 85.0146 235.957 85.2883 235.866 85.5893L226.747 115.252C226.638 115.653 226.401 116.008 226.073 116.263C225.745 116.517 225.342 116.658 224.926 116.664C224.511 116.669 224.105 116.539 223.77 116.293C223.435 116.047 223.189 115.699 223.069 115.301L213.852 85.6383C213.761 85.3374 213.597 85.0636 213.374 84.8412C213.152 84.6189 212.878 84.4548 212.577 84.3635L182.914 75.2441C182.513 75.1354 182.158 74.8989 181.904 74.5705C181.649 74.2421 181.508 73.8396 181.503 73.424C181.497 73.0084 181.627 72.6023 181.873 72.2672C182.119 71.9321 182.467 71.6863 182.865 71.5669L212.528 62.3494C212.829 62.2582 213.103 62.0941 213.325 61.8717C213.547 61.6494 213.712 61.3756 213.803 61.0747L222.922 31.4121C223.031 31.0109 223.267 30.656 223.596 30.4013C223.924 30.1465 224.327 30.0057 224.742 30.0002C225.158 29.9946 225.564 30.1247 225.899 30.3706C226.234 30.6165 226.48 30.9649 226.599 31.363L235.817 61.0257C235.908 61.3266 236.072 61.6003 236.295 61.8227C236.517 62.0451 236.791 62.2091 237.092 62.3004Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M155.948 155.848L202.771 168.939C203.449 169.131 204.045 169.539 204.47 170.101C204.895 170.663 205.125 171.348 205.125 172.052C205.125 172.757 204.895 173.442 204.47 174.004C204.045 174.566 203.449 174.974 202.771 175.166L155.899 188.06C155.361 188.209 154.87 188.496 154.475 188.891C154.079 189.286 153.793 189.777 153.644 190.316L140.553 237.138C140.361 237.816 139.953 238.413 139.391 238.838C138.829 239.262 138.144 239.492 137.44 239.492C136.735 239.492 136.05 239.262 135.488 238.838C134.927 238.413 134.519 237.816 134.327 237.138L121.432 190.267C121.283 189.728 120.997 189.237 120.601 188.842C120.206 188.446 119.715 188.16 119.177 188.011L72.3537 174.92C71.676 174.728 71.0795 174.32 70.6547 173.759C70.2299 173.197 70 172.512 70 171.807C70 171.103 70.2299 170.418 70.6547 169.856C71.0795 169.294 71.676 168.886 72.3537 168.694L119.226 155.799C119.764 155.65 120.255 155.364 120.65 154.969C121.046 154.573 121.332 154.082 121.481 153.544L134.572 106.721C134.764 106.043 135.172 105.447 135.734 105.022C136.295 104.597 136.981 104.367 137.685 104.367C138.389 104.367 139.075 104.597 139.637 105.022C140.198 105.447 140.606 106.043 140.798 106.721L153.693 153.593C153.842 154.131 154.128 154.622 154.524 155.018C154.919 155.413 155.41 155.699 155.948 155.848Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M386.827 289.992C404.33 292.149 403.84 305.828 386.876 307.299C346.623 310.829 298.869 316.271 282.199 360.005C274.844 379.192 269.942 403.2 267.49 432.029C267.427 432.846 267.211 433.626 266.856 434.319C266.501 435.012 266.015 435.602 265.431 436.05C254.988 444.041 251.212 434.186 250.183 425.606C239.2 332.353 214.588 316.909 124.668 306.122C123.892 306.031 123.151 305.767 122.504 305.35C121.857 304.933 121.322 304.375 120.942 303.72C116.399 295.679 119.324 291.038 129.718 289.796C224.688 278.47 236.062 262.83 250.183 169.331C252.177 156.355 257.259 154.083 265.431 162.516C266.51 163.593 267.202 165.099 267.392 166.782C279.257 258.564 293.328 278.617 386.827 289.992Z",fill:"currentColor"})]})}),(0,t.jsx)("input",{type:"text",value:L,onChange:M=>ee(M.target.value),onKeyDown:M=>{M.key==="Enter"&&L.trim()&&a("ai-custom-edit",L)},placeholder:"Ask AI to edit selected text...",className:"flex-1 text-xs text-slate-700 placeholder:text-slate-400 outline-none bg-transparent",autoFocus:!V}),(0,t.jsx)("button",{onClick:()=>{L.trim()&&a("ai-custom-edit",L)},className:"p-1.5 rounded-full bg-blue-600 text-white hover:bg-blue-700 transition-colors shrink-0 flex items-center justify-center shadow-sm disabled:opacity-50 disabled:cursor-not-allowed",disabled:!L.trim(),children:(0,t.jsx)(u.ArrowUp,{className:"h-4 w-4"})})]}),D?(0,t.jsxs)("div",{className:"p-8 flex flex-col items-center justify-center gap-3 text-slate-400",children:[(0,t.jsx)(u.RefreshCw,{size:24,className:"animate-spin text-purple-500"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:"AI is thinking..."})]}):V?(0,t.jsxs)("div",{className:"flex flex-col overflow-y-auto max-h-[200px]",children:[(0,t.jsx)("div",{className:"p-4 bg-slate-50/50 text-sm text-slate-700 leading-relaxed border-b border-slate-100",children:V}),(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{R==null||R("replace"),q(!1)},className:"flex items-center gap-2 px-1 py-1 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Check,{size:14,className:"text-slate-400"}),(0,t.jsx)("span",{children:"Replace selection"})]}),(0,t.jsxs)("button",{onClick:()=>{R==null||R("addBelow"),q(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.ArrowRightFromLine,{size:14,className:"text-slate-400 rotate-90"}),(0,t.jsx)("span",{children:"Insert below"})]}),(0,t.jsxs)("button",{onClick:()=>{R==null||R("regenerate"),q(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.RefreshCw,{size:14}),(0,t.jsx)("span",{children:"Try again"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsxs)("button",{onClick:()=>{R==null||R("discard"),q(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Trash2,{size:14}),(0,t.jsx)("span",{children:"Discard"})]})]})]}):(0,t.jsxs)("div",{className:"p-1.5 flex flex-col gap-0.5 overflow-y-auto max-h-[200px]",children:[(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Edit Selection"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","rewrite")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.RefreshCcwDot,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Improve writing"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","grammar")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.CheckCheck,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Fix grammar"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","shorten")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.ArrowDownWideNarrow,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Make shorter"})]}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","lengthen")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.WrapText,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Make longer"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Generate"}),(0,t.jsxs)("button",{onClick:()=>{a("generate-image"),q(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.Image,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Generate Image"})]}),(0,t.jsxs)("button",{onClick:()=>{a("generate-infographic"),q(!1)},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.BarChart2,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Generate Infographic"})]}),(0,t.jsx)("div",{className:"h-[1px] bg-slate-100 my-1"}),(0,t.jsx)("div",{className:"px-2 py-1 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"More"}),(0,t.jsxs)("button",{onClick:()=>{a("ai-text-edit","continue")},className:"flex items-center gap-2 px-2 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors text-left",children:[(0,t.jsx)(u.StepForward,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{children:"Continue writing"})]})]})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isBulleted:!(s!=null&&s.isBulleted),isNumbered:!1,listType:s!=null&&s.isBulleted?"none":"bullet-disc"}),className:B("p-1 rounded-l-[3px] transition-all",s!=null&&s.isBulleted?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Bullets",children:(0,t.jsx)(u.List,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>Y(!oe),className:B("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",oe?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(u.ChevronDown,{size:10,className:"text-slate-400"})}),oe&&(0,t.jsxs)("div",{className:"absolute top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!1,listType:"none"}),Y(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-disc"}),Y(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-circle"}),Y(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 rounded-full border border-black bg-transparent"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-square"}),Y(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("div",{className:"w-1 h-1 bg-black"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isBulleted:!0,isNumbered:!1,listType:"bullet-check"}),Y(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"\u2713"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsxs)("div",{className:"relative text-black flex items-center rounded-md transition-all",children:[(0,t.jsx)("button",{onClick:()=>a("format",{isNumbered:!(s!=null&&s.isNumbered),isBulleted:!1,listType:s!=null&&s.isNumbered?"none":"number-decimal"}),className:B("p-1 rounded-l-[3px] transition-all",s!=null&&s.isNumbered?"text-blue-600 bg-blue-50":"text-slate-500 hover:bg-slate-50"),title:"Numbering",children:(0,t.jsx)(u.ListOrdered,{size:14,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>A(!_),className:B("p-0.5 rounded-r-md border-l border-transparent hover:border-slate-200 transition-all",_?"bg-slate-100":"hover:bg-slate-50"),children:(0,t.jsx)(u.ChevronDown,{size:10,className:"text-slate-400"})}),_&&(0,t.jsxs)("div",{className:"absolute text-black top-full left-0 mt-1 bg-white border border-slate-200 rounded-lg shadow-xl p-2 z-[100] animate-in fade-in zoom-in-95 duration-150 w-64 grid grid-cols-4 gap-2",children:[(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!1,listType:"none"}),A(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1",children:(0,t.jsx)("span",{className:"text-[10px] text-slate-500",children:"None"})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal"}),A(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-decimal-paren"}),A(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"1)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"2)"}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})}),(0,t.jsx)("button",{onClick:()=>{a("format",{isNumbered:!0,isBulleted:!1,listType:"number-roman-lower"}),A(!1)},className:"col-span-1 aspect-square flex flex-col items-center justify-center hover:bg-slate-50 border border-slate-200 rounded p-1 gap-1",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1 items-start w-full px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"i."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[6px]",children:"ii."}),(0,t.jsx)("div",{className:"w-6 h-[1px] bg-slate-300"})]})]})})]})]}),(0,t.jsx)("div",{className:"w-[1px] h-4 bg-slate-100 mx-1.5"}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Font Color",children:[(0,t.jsx)("span",{className:"text-[13px] font-black text-slate-800 leading-none",children:"A"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.color)||"#000000"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.color)||"#000000",onChange:M=>a("format",{color:M.target.value})})]}),(0,t.jsx)(u.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsxs)("div",{className:"relative flex items-center",children:[(0,t.jsxs)("button",{className:"w-7 h-[22px] flex flex-col items-center justify-center rounded-[3px] hover:bg-slate-100 transition-all relative",title:"Highlight Color",children:[(0,t.jsx)(u.Highlighter,{size:14,strokeWidth:2.5,className:s!=null&&s.highlightColor?"text-slate-900":"text-slate-500"}),(0,t.jsx)("div",{className:"w-4 h-[2.5px] rounded-sm mt-0.5",style:{backgroundColor:(s==null?void 0:s.highlightColor)||"transparent"}}),(0,t.jsx)("input",{type:"color",className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full",value:(s==null?void 0:s.highlightColor)||"#ffff00",onChange:M=>a("format",{highlightColor:M.target.value})})]}),(0,t.jsx)(u.ChevronDown,{size:8,className:"text-slate-400 -ml-0.5"})]}),(0,t.jsx)("button",{onClick:()=>a("format",{isBold:!1,isItalic:!1,isUnderline:!1,highlightColor:"",color:"#000000"}),className:"p-1 rounded-[3px] text-slate-400 hover:bg-slate-50 hover:text-slate-600 transition-all",title:"Clear Formatting",children:(0,t.jsx)(u.Eraser,{size:14,strokeWidth:2.5})}),(0,t.jsxs)("div",{className:"gap-0.5 ml-auto",children:[(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"left"}),className:B("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="left"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignLeft,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"center"}),className:B("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="center"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignCenter,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"right"}),className:B("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="right"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignRight,{size:12,strokeWidth:2.5})}),(0,t.jsx)("button",{onClick:()=>a("format",{textAlign:"justify"}),className:B("p-1 rounded-[3px] transition-all",(s==null?void 0:s.textAlign)==="justify"?"bg-blue-100 text-blue-600":"hover:bg-slate-100 text-slate-500"),children:(0,t.jsx)(u.AlignJustify,{size:12,strokeWidth:2.5})})]})]})]})}let c=Math.max(10,Math.min(l.x,window.innerWidth-300)),k=Math.max(10,Math.min(l.y,window.innerHeight-450));return(0,t.jsxs)("div",{className:"fixed z-[9999] w-72 bg-white rounded-xl shadow-2xl border border-slate-200 overflow-hidden flex flex-col animate-in fade-in zoom-in duration-200",style:{left:`${c}px`,top:`${k}px`,maxHeight:"400px"},onClick:n=>n.stopPropagation(),children:[(0,t.jsxs)("div",{className:"p-3 border-b border-slate-100 flex items-center gap-2 bg-slate-50/50",children:[(0,t.jsx)(u.Search,{size:14,className:"text-slate-400"}),(0,t.jsx)("input",{autoFocus:!0,type:"text",placeholder:"Type a command...",className:"bg-transparent border-none outline-none text-sm w-full font-medium text-slate-700 placeholder:text-slate-400",value:T,onChange:n=>b(n.target.value)})]}),(0,t.jsx)("div",{ref:H,className:"overflow-y-auto py-2 px-1 custom-scrollbar",children:S.length>0?S.map((n,z)=>{let N=z===I,K=z===0||S[z-1].category!==n.category;return(0,t.jsxs)(se.default.Fragment,{children:[K&&(0,t.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider font-bold text-slate-400",children:n.category}),(0,t.jsxs)("button",{className:B("w-full flex items-center gap-3 px-3 py-2 text-left transition-all duration-150 rounded-lg group",N?"bg-slate-100":"hover:bg-slate-50"),onClick:()=>n.action(),onMouseEnter:()=>w(z),children:[(0,t.jsx)("div",{className:B("p-1.5 rounded-md transition-colors flex items-center justify-center relative",N?"bg-white shadow-sm text-blue-600":"bg-slate-100 text-slate-500 group-hover:text-slate-700"),children:(0,t.jsx)(n.icon,{size:16})}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:B("text-sm font-semibold truncate",N?"text-slate-900":"text-slate-700"),children:n.label}),n.description&&(0,t.jsx)("span",{className:"text-[11px] text-slate-400 truncate leading-tight",children:n.description})]}),N&&(0,t.jsx)("div",{className:"ml-auto text-[10px] font-mono font-bold text-slate-400 flex items-center gap-1 border border-slate-200 rounded px-1 bg-white",children:(0,t.jsx)("span",{children:"\u21B5"})})]})]},n.id)}):(0,t.jsxs)("div",{className:"px-3 py-8 text-center flex flex-col items-center gap-2",children:[(0,t.jsx)("div",{className:"p-3 bg-slate-50 rounded-full",children:(0,t.jsx)(u.Search,{size:20,className:"text-slate-300"})}),(0,t.jsxs)("span",{className:"text-sm text-slate-400 font-medium whitespace-nowrap",children:['No commands found for "',T,'"']})]})}),(0,t.jsxs)("div",{className:"px-3 py-2 border-t border-slate-100 bg-slate-50/50 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"\u2191\u2193"}),(0,t.jsx)("span",{children:"to navigate"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] font-medium text-slate-400",children:[(0,t.jsx)("span",{className:"border border-slate-200 rounded px-1 bg-white",children:"Esc"}),(0,t.jsx)("span",{children:"to close"})]})]})]})};var X=require("lucide-react");var ua=require("react"),je=require("lucide-react");var Be=require("react/jsx-runtime"),ma=({message:m,type:a="info",isOpen:l,onClose:h,autoHideDuration:x=4e3})=>{if((0,ua.useEffect)(()=>{if(l&&x>0){let D=setTimeout(()=>{h()},x);return()=>clearTimeout(D)}},[l,x,h]),!l)return null;let s={error:(0,Be.jsx)(je.AlertCircle,{size:20,className:"text-white"}),success:(0,Be.jsx)(je.CheckCircle,{size:20,className:"text-white"}),info:(0,Be.jsx)(je.Info,{size:20,className:"text-white"})};return(0,Be.jsxs)("div",{className:B("fixed bottom-6 right-6 z-[10000] flex items-center gap-3 px-4 py-2 rounded-md shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300 min-w-[280px] max-w-[400px]",{error:"bg-red-500",success:"bg-emerald-500",info:"bg-slate-800"}[a]),children:[s[a],(0,Be.jsx)("span",{className:"text-white text-sm font-medium flex-1",children:m}),(0,Be.jsx)("button",{onClick:h,className:"p-1 hover:bg-white/20 rounded-full transition-colors ml-1",children:(0,Be.jsx)(je.X,{size:14,className:"text-white"})})]})};var i=require("react/jsx-runtime"),Xa=({initialPresentation:m,url:a,appName:l="My Studio",onChange:h,geminiApiKey:x="AIzaSyCwtvKFmvTEvvPB9kNTFL-22dKtHvwZHtY",width:s,height:V,appBgColor:D="#B7472A",showHomeOnEmpty:R=!1,initialSource:r,onSourceChange:T,proxyUrl:b,onGenerateImage:I,onGenerateInfographic:w,onAiRewrite:H,onAiGrammar:C,onAiShorten:f,onAiLengthen:O,onAiContinue:G,isTwoStepInfographicGeneration:oe,onRefineInfographicPrompt:Y,onRefineShorten:_,onRefineReframe:A,onRefineLengthen:ne,onAiEdit:q})=>{var Kt,Jt;let[L,ee]=(0,j.useState)(m||{slides:[{id:"slide-1",elements:[]}],layout:{width:12192e3,height:6858e3}}),[g,S]=(0,j.useState)([]),[c,k]=(0,j.useState)([]),[n,z]=(0,j.useState)(0),[N,K]=(0,j.useState)(null),[pe,he]=(0,j.useState)(!1),[be,J]=(0,j.useState)(null),[M,W]=(0,j.useState)(null),[re,fe]=(0,j.useState)(!1),[xe,Re]=(0,j.useState)(r||(a?"url":null)),[Q,et]=(0,j.useState)(R&&!m&&!a&&!r),[We,It]=(0,j.useState)(""),[U,le]=(0,j.useState)({visible:!1,position:{x:0,y:0},mode:"default"}),[Ce,ve]=(0,j.useState)(!1),[tt,Mt]=(0,j.useState)(""),[At,Bt]=(0,j.useState)(!1),[ze,at]=(0,j.useState)(null),[pt,Pt]=(0,j.useState)(!1),[rt,De]=(0,j.useState)(!1),[ba,st]=(0,j.useState)(!1),[gt,Tt]=(0,j.useState)(""),[ut,Ht]=(0,j.useState)(!1),[Se,ot]=(0,j.useState)(null),[mt,jt]=(0,j.useState)(!1),[fa,Rt]=(0,j.useState)(!1),[ht,Oe]=(0,j.useState)(null),[xa,Dt]=(0,j.useState)(!1),[bt,Vt]=(0,j.useState)({open:!1,message:"",type:"info"}),Ie=(o,d="info")=>{Vt({open:!0,message:o,type:d})};(0,j.useEffect)(()=>{ze&&(Pt(!1),De(!0))},[ze]),(0,j.useEffect)(()=>{Se&&(jt(!1),De(!0))},[Se]),(0,j.useEffect)(()=>{a&<(a)},[a]);let[ft,Me]=(0,j.useState)(!1),[Ne,Ve]=(0,j.useState)(null);(0,j.useEffect)(()=>{J(null),W(null),Ve(null),Me(!1)},[N]);let it=(0,j.useMemo)(()=>{let o=typeof s=="number"?s:parseInt(String(s));return isNaN(o)?1:Math.min(Math.max(o/1600,.7),1)},[s]),Le=L.slides[n],Fe=(0,j.useMemo)(()=>Le.elements.find(o=>o.id===N)||null,[Le,N]),qe=(0,j.useCallback)(o=>{S(d=>[...d.slice(-19),L]),k([]),ee(o),h==null||h(o)},[h,L]),Ft=()=>{if(g.length===0)return;let o=g[g.length-1];k(d=>[...d,L]),S(d=>d.slice(0,-1)),ee(o)},xt=()=>{if(c.length===0)return;let o=c[c.length-1];S(d=>[...d,L]),k(d=>d.slice(0,-1)),ee(o)},Ae=(0,j.useCallback)(o=>{ee(d=>{let p=[...d.slides];p[n]=P(P({},p[n]),o);let y=F(P({},d),{slides:p});return S(Z=>[...Z.slice(-19),d]),k([]),h==null||h(y),y})},[n,h]),Pe=(0,j.useCallback)((o,d)=>{ee(p=>{let y=p.slides[n],Z=y.elements.map(ae=>ae.id===o?P(P({},ae),d):ae),de=[...p.slides];de[n]=F(P({},y),{elements:Z});let ie=F(P({},p),{slides:de});return h==null||h(ie),ie})},[n,h]),$t=o=>{if(!N)return;if(Le.elements.find(p=>p.id===N)){Pe(N,o);let p=L.slides[n],y=p.elements.map(de=>de.id===N?P(P({},de),o):de),Z=[...L.slides];Z[n]=F(P({},p),{elements:y}),qe(F(P({},L),{slides:Z}))}},Xe=(0,j.useCallback)(()=>{if(!N)return;let d=L.slides[n].elements.filter(p=>p.id!==N);Ae({elements:d}),K(null)},[N,n,L,Ae]),Ut=()=>{let o={id:`text-${Date.now()}`,type:"text",content:"New Text",x:100,y:100,width:400,height:100,fontSize:48,fontFamily:"Arial",color:"#000000",zIndex:Le.elements.length};Ae({elements:[...Le.elements,o]})},_e=(0,j.useCallback)(async o=>{let d="";typeof o=="string"?d=o:d=await new Promise(de=>{let ie=new FileReader;ie.onload=ae=>{var ke;return de((ke=ae.target)==null?void 0:ke.result)},ie.readAsDataURL(o)});let p=`img-${Date.now()}`,y={id:p,type:"image",src:d,x:100,y:100,width:400,height:400,zIndex:Le.elements.length},Z=new Image;Z.onload=()=>{let ie=Z.width,ae=Z.height;if(ie>800||ae>800){let ke=ie/ae;ie>ae?(ie=800,ae=800/ke):(ae=800,ie=800*ke)}Pe(p,{width:ie,height:ae})},Z.src=d,Ae({elements:[...Le.elements,y]}),K(p)},[Le.elements,Ae,Pe,K]),Zt=o=>{let d={id:`shape-${Date.now()}`,type:"shape",shapeType:o,fill:"#B7472A",x:300,y:300,width:200,height:200,zIndex:Le.elements.length};Ae({elements:[...Le.elements,d]})},Gt=()=>{let o={id:`slide-${Date.now()}`,elements:[]};qe(F(P({},L),{slides:[...L.slides,o]})),z(L.slides.length)},va=o=>{if(L.slides.length<=1)return;let d=L.slides.filter((p,y)=>y!==o);qe(F(P({},L),{slides:d})),o<=n&&z(Math.max(0,n-1))},wa=o=>{let d=L.slides[o],p=F(P({},d),{id:`slide-${Date.now()}`,elements:d.elements.map(Z=>F(P({},Z),{id:`${Z.type}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}))}),y=[...L.slides];y.splice(o+1,0,p),qe(F(P({},L),{slides:y})),z(o+1)},ya=(o,d)=>{if(o===d)return;let p=[...L.slides],[y]=p.splice(o,1);p.splice(d,0,y),qe(F(P({},L),{slides:p})),n===o?z(d):n>o&&n<=d?z(n-1):n<o&&n>=d&&z(n+1)},Na=o=>{let d=[],p=Date.now();o==="title"?d=[{id:`text-title-${p}`,type:"text",content:"Presentation Title",x:100,y:200,width:1e3,height:150,fontSize:80,fontFamily:"Inter",color:"#000000",textAlign:"center",isBold:!0,zIndex:0},{id:`text-sub-${p}`,type:"text",content:"Subtitle goes here",x:200,y:380,width:800,height:80,fontSize:36,fontFamily:"Inter",color:"#64748b",textAlign:"center",zIndex:1}]:o==="content"?d=[{id:`text-title-${p}`,type:"text",content:"Slide Title",x:60,y:40,width:800,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,zIndex:0},{id:`text-body-${p}`,type:"text",content:`\u2022 Add your points here
|
|
5
5
|
\u2022 Press Enter for new line
|
|
6
|
-
\u2022 Use the toolbar to format`,x:60,y:150,width:1080,height:480,fontSize:28,fontFamily:"Inter",color:"#334155",zIndex:1,isBulleted:!0}]:o==="split"&&(
|
|
6
|
+
\u2022 Use the toolbar to format`,x:60,y:150,width:1080,height:480,fontSize:28,fontFamily:"Inter",color:"#334155",zIndex:1,isBulleted:!0}]:o==="split"&&(d=[{id:`text-title-${p}`,type:"text",content:"Comparison Layout",x:60,y:40,width:1080,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,textAlign:"center",zIndex:0},{id:`text-left-${p}`,type:"text",content:"Left column content goes here.",x:60,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:1},{id:`text-right-${p}`,type:"text",content:"Right column content goes here.",x:620,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:2}]),Ae({elements:d})},Ye=async(o,d)=>{let y=L.slides[n].elements.find(Z=>Z.id===o);if(!(!y||y.type!=="text")){Me(!0),W(null),Ve({id:o,action:d});try{let Z="";if(d==="shorten"&&_?Z=await _(y.content):d==="reframe"&&A?Z=await A(y.content):d==="lengthen"&&ne&&(Z=await ne(y.content)),!Z){if(!x){Ie("Gemini API key is missing and no custom AI route provided.","error"),Me(!1);return}let ie=new dt.GoogleGenerativeAI(x).getGenerativeModel({model:"gemini-flash-latest",systemInstruction:`You are a professional presentation assistant. Your task is to transform slide text according to specific user requests (shorten, reframe, or lengthen).
|
|
7
7
|
|
|
8
8
|
CRITICAL RULES:
|
|
9
9
|
1. Return ONLY the transformed text.
|
|
@@ -11,11 +11,15 @@ CRITICAL RULES:
|
|
|
11
11
|
3. Do NOT use markdown formatting (like bolding or headers) unless specifically needed for bullet points.
|
|
12
12
|
4. If the input text is a title/headline, the output should be a professional title/headline.
|
|
13
13
|
5. If the input text is a bulleted list, the output MUST be a bulleted list using the same bullet style (e.g., '\u2022').
|
|
14
|
-
6. Maintain the professional tone of the original presentation.`}),
|
|
15
|
-
Text Role: ${
|
|
16
|
-
Original Text: "${
|
|
14
|
+
6. Maintain the professional tone of the original presentation.`}),ae=y.fontSize>32?"Title/Headline":"Body Text/List",ke=`Action: ${d.toUpperCase()}
|
|
15
|
+
Text Role: ${ae}
|
|
16
|
+
Original Text: "${y.content}"
|
|
17
17
|
|
|
18
|
-
Transformed Text
|
|
18
|
+
Transformed Text:`;Z=(await(await ie.generateContent(ke)).response).text().trim()}W(Z)}catch(Z){console.error("Gemini AI Error:",Z),Ie("Error generating response. Please check your API key or connection.","error")}finally{Me(!1)}}},ka=async o=>{let p=L.slides[n].elements.find(y=>y.id===N);if(!(!p||p.type!=="text")){Me(!0),J(null),Ve({id:N,action:"rewrite"});try{let y="";if(q&&(y=await q(p.content,o)),!y){if(!x){Ie("Gemini API key is missing and no custom AI route provided.","error"),Me(!1);return}let de=new dt.GoogleGenerativeAI(x).getGenerativeModel({model:"gemini-flash-latest"}),ie="You are a professional editor. Follow the user's instruction to edit the text. Return ONLY the edited text. No explanations.",ae=`Target Text: "${p.content}"
|
|
19
19
|
|
|
20
|
-
${ce}`)).response.text().trim()}oe(z)}catch(z){console.error("AI Text Edit Error:",z),Me("AI editing failed. Please check configuration.","error")}finally{Re(!1)}}},Ft=o=>{if(!D||!ze)return;if(o==="regenerate"){Ut(ze.action);return}let p=N.slides[n],d=p.elements.find(z=>z.id===ze.id);if(!(!d||d.type!=="text")){if(o==="replace")Ue(ze.id,{content:D});else if(o==="addBelow"){let z=j(I({},d),{id:`text-ai-${Date.now()}`,content:D,y:d.y+d.height+20,zIndex:p.elements.length});Se({elements:[...p.elements,z]})}oe(null),We(null),He(z=>j(I({},z),{visible:!1}))}},xa=o=>{if(!ie||!ze)return;if(o==="discard"){Z(null);return}if(o==="regenerate"){rt(ze.id,ze.action);return}let p=N.slides[n],d=p.elements.find(z=>z.id===ze.id);if(!(!d||d.type!=="text")){if(o==="replace")Ue(ze.id,{content:ie});else if(o==="addBelow"){let z=j(I({},d),{id:`text-refine-${Date.now()}`,content:ie,y:d.y+d.height+20,zIndex:p.elements.length});Se({elements:[...p.elements,z]})}Z(null),We(null)}},va=async()=>{await new Ke().export(N)},Oa=()=>{F(!0);let o=document.documentElement;o.requestFullscreen&&o.requestFullscreen()},$t=()=>{F(!1),document.fullscreenElement&&document.exitFullscreen()};(0,A.useEffect)(()=>{let o=()=>{document.fullscreenElement||F(!1)};return document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o)},[]),(0,A.useEffect)(()=>{let o=p=>{if(p.key==="Delete"||p.key==="Backspace"){let d=document.activeElement;if((d==null?void 0:d.tagName)==="INPUT"||(d==null?void 0:d.tagName)==="TEXTAREA"||d!=null&&d.isContentEditable)return;Xe()}p.key==="Escape"&&(h(null),He(d=>j(I({},d),{visible:!1}))),(p.ctrlKey||p.metaKey)&&(p.key==="z"&&(p.preventDefault(),p.shiftKey?bt():Ht()),p.key==="y"&&(p.preventDefault(),bt()))};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[Xe,Ht,bt]);let ht=(o,p)=>{Y(o),H==null||H(o,p)},Zt=()=>{L({slides:[{id:`slide-${Date.now()}`,elements:[]}],layout:{width:12192e3,height:6858e3}}),x(0),h(null),ht("scratch")},st=async o=>{ae(!0);try{let p=new Je,d=o;if(typeof o=="string"){let J=o.trim();d=g?`${g}${g.includes("?")?"&":"?"}url=${encodeURIComponent(J)}`:J,ht("url",J)}else ht("uploaded");let z=await p.parse(d);L(z),X([]),te([]),x(0),h(null)}catch(p){console.error("Failed to load PPTX",p),Me("Failed to load presentation. Please ensure it is a valid .pptx.","error")}finally{ae(!1)}},wa=(o,p)=>{switch(o!=="ai-text-edit"&&He(d=>j(I({},d),{visible:!1})),o){case"add-text":Rt();break;case"add-image":wt();break;case"add-shape":Dt(p);break;case"new-slide":Vt();break;case"ai-action":rt(l||"",p);break;case"ai-text-edit":Ut(p);break;case"generate-image":je(!0);break;case"generate-infographic":vt();break;case"format":jt(p);break;case"delete":Xe();break}},ya=async()=>{if(U.trim()){ke(!0);try{let o="";if(S)o=await S(U);else throw v?new Error("Internal image generation requires onGenerateImage prop or specific endpoint configuration."):new Error("No image generation function or Gemini API key provided.");Qe(o),je(!1),de("")}catch(o){console.error("Image generation failed:",o),Me("Image generation failed: "+(o instanceof Error?o.message:"Unknown error"),"error")}finally{ke(!1)}}},ft=o=>{if(o==="insert"&&Ce)_e(Ce);else if(o==="replace"&&Ce&&l){let p=N.slides[n].elements.find(d=>d.id===l);p&&p.type==="image"?Ue(l,{src:Ce}):_e(Ce)}Qe(null)},Gt=async o=>{let p=o||ct;if(p.trim()){Mt(!0),Pt(!1),tt(null);try{let d="";if(y)d=await y(p);else throw v?new Error("Internal infographic generation requires onGenerateInfographic prop or specific endpoint configuration."):new Error("No infographic generation function or Gemini API key provided.");tt(d);let z=new Image;z.src=g?`${g}${encodeURIComponent(d)}`:d,await new Promise((J,pe)=>{z.onload=J,z.onerror=()=>{console.log("Image preload failed, proceeding to preview"),J(null)}}),Pt(!0),et(!1),It("")}catch(d){console.error("Infographic generation failed:",d),Me("Infographic generation failed: "+(d instanceof Error?d.message:"Unknown error"),"error")}finally{Mt(!1)}}},xt=o=>{if(o==="insert"&&Le)_e(Le);else if(o==="replace"&&Le&&l){let p=N.slides[n].elements.find(d=>d.id===l);p&&p.type==="image"?Ue(l,{src:Le}):_e(Le)}tt(null)},vt=async()=>{if(E&&ee){let o=(Ve==null?void 0:Ve.type)==="text"?Ve.content:"";if(o){Bt(!0);try{let p=await ee(o);Oe(p)}catch(p){console.error("Prompt refinement failed:",p),Me("Failed to refine infographic prompt.","error")}finally{Bt(!1)}return}}et(!0)},wt=()=>{let o=document.createElement("input");o.type="file",o.accept="image/*",o.onchange=async p=>{var z;let d=(z=p.target.files)==null?void 0:z[0];if(d){let J=await new Promise(pe=>{let ye=new FileReader;ye.onload=ce=>{var ot;return pe((ot=ce.target)==null?void 0:ot.result)},ye.readAsDataURL(d)});Qe(J)}},o.click()},Ot=(0,A.useCallback)(o=>!g||!o||o.startsWith("data:")||o.includes("localhost")||o.includes("127.0.0.1")?o:`${g}?url=${encodeURIComponent(o)}`,[g]);return!s||!R?(0,i.jsx)("div",{className:"flex items-center justify-center bg-red-50 text-red-600 p-8 rounded-xl border-2 border-red-200 font-bold",children:"Error: width and height props are compulsory for PptEditor."}):(0,i.jsxs)("div",{className:"flex flex-col bg-white relative",style:{width:typeof s=="number"?`${s}px`:s,height:typeof R=="number"?`${R}px`:R,fontSize:`${16*at}px`},children:[le&&(0,i.jsx)("div",{className:"absolute inset-0 z-[2000] bg-white flex flex-col items-center justify-center p-6 md:p-12 overflow-y-auto",children:(0,i.jsxs)("div",{className:"max-w-2xl w-full text-center space-y-6 md:space-y-8 animate-in fade-in zoom-in-95 duration-500 my-auto",children:[(0,i.jsx)("div",{className:"flex justify-center"}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("h2",{className:"text-4xl font-black tracking-tight text-slate-800",children:c}),(0,i.jsx)("p",{className:"text-slate-500 font-medium",children:"Create stunning presentations in seconds."})]}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,i.jsxs)("button",{onClick:()=>{Zt(),Ne(!1)},className:"flex flex-col items-center justify-center gap-4 p-10 border-2 border-slate-100 rounded-[2.5rem] hover:border-slate-300 hover:bg-slate-50 transition-all group shadow-sm hover:shadow-md active:scale-[0.98]",children:[(0,i.jsx)("div",{className:"p-5 bg-slate-100 rounded-2xl group-hover:bg-blue-50 transition-colors",children:(0,i.jsx)("svg",{className:"w-10 h-10 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M12 4v16m8-8H4"})})}),(0,i.jsx)("span",{className:"text-sm font-black uppercase tracking-[0.15em] text-slate-600 group-hover:text-slate-900 transition-colors",children:"Start New Deck"})]}),(0,i.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 p-10 border-2 border-slate-100 rounded-[2.5rem] hover:border-slate-300 hover:bg-slate-50 transition-all group shadow-sm hover:shadow-md active:scale-[0.98] cursor-pointer",children:[(0,i.jsx)("div",{className:"p-5 bg-slate-100 rounded-2xl group-hover:bg-emerald-50 transition-colors",children:(0,i.jsx)("svg",{className:"w-10 h-10 text-emerald-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M4 16v1a2 2 0 002 2h12a2 2 0 002-2v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}),(0,i.jsx)("span",{className:"text-sm font-black uppercase tracking-[0.15em] text-slate-600 group-hover:text-slate-900 transition-colors",children:"Upload PPTX"}),(0,i.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:o=>{var d;let p=(d=o.target.files)==null?void 0:d[0];p&&(st(p),Ne(!1))}})]})]}),(0,i.jsxs)("div",{className:"space-y-4 pt-8 border-t border-slate-100",children:[(0,i.jsxs)("div",{className:"flex gap-3 items-stretch",children:[(0,i.jsx)("div",{className:"flex-1 relative group",children:(0,i.jsx)("input",{type:"text",placeholder:"Paste presentation URL...",value:be,onChange:o=>Te(o.target.value),className:"text-black w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-5 py-4 focus:outline-none focus:border-slate-400 focus:ring-4 focus:ring-slate-400/5 text-base transition-all h-full"})}),(0,i.jsx)("button",{onClick:()=>{be.trim()&&(st(be.trim()),Ne(!1))},disabled:!be.trim()||he,style:{cursor:"pointer"},className:"bg-slate-900 hover:bg-black disabled:bg-slate-100 disabled:text-slate-400 text-white font-black px-10 rounded-2xl transition-all shadow-sm text-sm shrink-0 whitespace-nowrap h-full min-h-[56px] flex items-center justify-center uppercase tracking-widest",children:he?(0,i.jsxs)("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):"Load"})]}),(0,i.jsx)("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-[0.2em]",children:"Supports S3, public links, and versioned assets"})]})]})}),C&&(0,i.jsx)(kt,{presentation:N,initialSlideIndex:n,onClose:$t}),(0,i.jsx)(Et,{onAddText:Rt,onAddImage:_e,onAddShape:Dt,onAddSlide:Vt,onExport:va,onFormatText:jt,onDeleteElement:Xe,onGenerateImageClick:()=>je(!0),onGenerateInfographicClick:vt,onUploadImageClick:wt,onApplyLayout:fa,onPlay:()=>F(!0),onAiAction:rt,onAiResponseAction:Ft,onNewPresentation:Zt,onLoadPresentation:st,aiResponse:D,isAiLoading:mt,selectedElement:Ve,refineResponse:ie,onRefineAction:rt,appName:c,appBgColor:T,uiScale:at,source:_}),(0,i.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,i.jsx)(aa,{slides:N.slides,currentSlideIndex:n,onSelectSlide:x,onDeleteSlide:ma,onDuplicateSlide:ba,onReorderSlides:ha,uiScale:at,appBgColor:T}),(0,i.jsx)("div",{className:"flex-1 flex items-center justify-center p-12 overflow-auto bg-white",children:(0,i.jsx)(lt,{slide:we,onElementUpdate:Ue,onSelect:h,uiScale:at,onSlashCommand:(o,p,d)=>He({visible:o.x!==0,position:o,mode:p||"default",context:d}),selectedElementId:l,onAiGenerateClick:()=>je(!0),onAiGenerateInfographicClick:vt,onUploadImageClick:wt,onDeleteElement:Xe})})]}),W.visible&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9998]",onClick:()=>He(o=>j(I({},o),{visible:!1})),children:(0,i.jsx)(la,{position:W.position,onClose:()=>He(o=>j(I({},o),{visible:!1})),onAction:wa,canUseAi:!!v||!!g,mode:W.mode,context:W.context,aiResult:D,isAiLoading:mt,onAiResponseAction:Ft})}),ie&&Ve&&(0,i.jsx)(ia,{result:ie,isLoading:mt,onAction:xa,onClose:()=>Z(null)}),zt&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[500px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(q.Sparkles,{className:"text-blue-600",size:20}),"Generate Image"]}),(0,i.jsx)("button",{onClick:()=>je(!1),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(q.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"Describe the image you want to create for this slide."}),(0,i.jsx)("textarea",{autoFocus:!0,placeholder:"A futuristic city in the style of cyberpunk with neon lights...",className:"text-black w-full h-32 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none",value:U,onChange:o=>de(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,i.jsx)("button",{onClick:()=>je(!1),className:"flex-1 px-5 py-3 cursor-pointer text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors flex items-center justify-center",children:"Cancel"}),(0,i.jsx)("button",{onClick:ya,disabled:ve||!U.trim(),className:"flex-1 px-6 py-3 cursor-pointer text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-lg shadow-lg shadow-blue-500/20 transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 flex items-center justify-center gap-2",children:ve?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.RefreshCw,{className:"animate-spin",size:16}),"Generating..."]}):"Generate"})]})]})}),Ce&&(0,i.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60 backdrop-blur-md animate-in fade-in duration-300",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-3xl max-w-[90vw] max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-300 border border-slate-200",children:[(0,i.jsxs)("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-white",children:[(0,i.jsx)("h3",{className:"text-lg font-bold text-slate-800",children:"Preview Image"}),(0,i.jsx)("button",{onClick:()=>Qe(null),className:"p-2 hover:bg-slate-100 rounded-full text-slate-400 transition-colors",children:(0,i.jsx)(q.Plus,{className:"rotate-45",size:20})})]}),(0,i.jsxs)("div",{className:"p-8 bg-slate-100 flex items-center justify-center overflow-auto min-h-[300px] relative",children:[Ee&&!nt&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-100/50 z-10",children:(0,i.jsx)(q.RefreshCw,{className:"animate-spin text-slate-400",size:32})}),(0,i.jsx)("img",{src:Ot(Ce),alt:"Generated",className:M("max-w-full max-h-[60vh] rounded-lg shadow-2xl ring-4 ring-white transition-opacity duration-300",nt||Ee?"opacity-0":"opacity-100"),onLoad:()=>De(!1),onError:()=>{St(!0),De(!1)}}),nt&&(0,i.jsxs)("div",{className:"flex flex-col items-center gap-4 text-slate-400 p-12 text-center animate-in fade-in duration-500",children:[(0,i.jsx)("div",{className:"p-4 bg-slate-200/50 rounded-full",children:(0,i.jsx)(q.Image,{size:48,className:"opacity-40"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-bold text-slate-600",children:"Failed to load preview"}),(0,i.jsx)("p",{className:"text-xs max-w-[300px] mt-1",children:"The URL might be invalid or restricted. Ensure it's a valid image format."})]}),(0,i.jsx)("code",{className:"text-[10px] bg-slate-200/50 px-2 py-1 rounded break-all max-w-[400px]",children:Ce})]})]}),(0,i.jsxs)("div",{className:"p-6 bg-white border-t border-slate-100 flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,i.jsxs)("button",{onClick:()=>ft("insert"),className:"flex-1 px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-bold shadow-lg shadow-blue-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.Check,{size:18}),"Insert image"]}),l&&((Wt=N.slides[n].elements.find(o=>o.id===l))==null?void 0:Wt.type)==="image"&&(0,i.jsxs)("button",{onClick:()=>ft("replace"),className:"flex-1 px-6 py-3 bg-emerald-600 hover:bg-emerald-700 text-black rounded-xl font-bold shadow-lg shadow-emerald-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.RefreshCw,{size:18}),"Replace existing"]})]}),(0,i.jsxs)("button",{onClick:()=>ft("discard"),className:"w-full px-6 py-3 bg-red-50 hover:bg-red-100 text-red-600 rounded-xl font-bold transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.Trash2,{size:18}),"Discard"]})]})]})}),pa&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[500px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(q.PieChart,{className:"text-blue-600",size:20}),"Generate Infographic"]}),(0,i.jsx)("button",{onClick:()=>et(!1),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(q.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"Describe the infographic you want to create for this slide."}),(0,i.jsx)("textarea",{autoFocus:!0,placeholder:"A pie chart showing market share distribution...",className:"text-black w-full h-32 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none",value:ct,onChange:o=>It(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,i.jsx)("button",{onClick:()=>et(!1),className:"flex-1 px-5 py-3 cursor-pointer text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors flex items-center justify-center",children:"Cancel"}),(0,i.jsx)("button",{onClick:()=>Gt(),disabled:dt||!ct.trim(),className:"flex-1 px-6 py-3 cursor-pointer text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-lg shadow-lg shadow-blue-500/20 transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 flex items-center justify-center gap-2",children:dt?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.RefreshCw,{className:"animate-spin",size:16}),"Generating..."]}):"Generate"})]})]})}),dt&&(0,i.jsx)("div",{className:"fixed inset-0 z-[11000] flex items-center justify-center bg-black/20 backdrop-blur-[2px] animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsx)(q.RefreshCw,{className:"animate-spin text-blue-600",size:32}),(0,i.jsx)("p",{className:"text-sm font-bold text-slate-600",children:"Generating Infographic..."})]})}),ga&&(0,i.jsx)("div",{className:"fixed inset-0 z-[11000] flex items-center justify-center bg-black/20 backdrop-blur-[2px] animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsx)(q.RefreshCw,{className:"animate-spin text-blue-600",size:32}),(0,i.jsx)("p",{className:"text-sm font-bold text-slate-600",children:"Polishing your prompt with AI..."})]})}),gt!==null&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[600px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(q.Sparkles,{className:"text-blue-600",size:20}),"Step 1: AI Refinement"]}),(0,i.jsx)("button",{onClick:()=>Oe(null),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(q.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"The AI has refined your selected text into a visual prompt. You can adjust it below."}),(0,i.jsx)("textarea",{autoFocus:!0,className:"text-black w-full h-48 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none shadow-inner",value:gt,onChange:o=>Oe(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3 mt-2",children:[(0,i.jsx)("button",{onClick:()=>Oe(null),className:"flex-1 flex items-center justify-center px-5 py-3 text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors",children:"Discard"}),(0,i.jsxs)("button",{onClick:()=>{let o=gt;Oe(null),Gt(o)},className:"px-6 py-3 text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-xl shadow-lg shadow-blue-500/20 transition-all active:scale-95 flex-1 flex items-center justify-center gap-2 uppercase tracking-wide",children:[(0,i.jsx)(q.PieChart,{size:18}),"Generate Infographic"]})]})]})}),ua&&Le&&(0,i.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60 backdrop-blur-md animate-in fade-in duration-300",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-3xl max-w-[90vw] max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-300 border border-slate-200",children:[(0,i.jsxs)("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-white",children:[(0,i.jsx)("h3",{className:"text-lg font-bold text-slate-800",children:"Preview Infographic"}),(0,i.jsx)("button",{onClick:()=>tt(null),className:"p-2 hover:bg-slate-100 rounded-full text-slate-400 transition-colors",children:(0,i.jsx)(q.Plus,{className:"rotate-45",size:20})})]}),(0,i.jsxs)("div",{className:"p-8 bg-slate-100 flex items-center justify-center overflow-auto min-h-[300px] relative",children:[Ee&&!pt&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-100/50 z-10",children:(0,i.jsx)(q.RefreshCw,{className:"animate-spin text-slate-400",size:32})}),(0,i.jsx)("img",{src:Ot(Le),alt:"Generated Infographic",className:M("max-w-full max-h-[60vh] rounded-lg shadow-2xl ring-4 ring-white transition-opacity duration-300",pt||Ee?"opacity-0":"opacity-100"),onLoad:()=>De(!1),onError:()=>{At(!0),De(!1)}}),pt&&(0,i.jsxs)("div",{className:"flex flex-col items-center gap-4 text-slate-400 p-12 text-center animate-in fade-in duration-500",children:[(0,i.jsx)("div",{className:"p-4 bg-slate-200/50 rounded-full",children:(0,i.jsx)(q.PieChart,{size:48,className:"opacity-40"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-bold text-slate-600",children:"Failed to load preview"}),(0,i.jsx)("p",{className:"text-xs max-w-[300px] mt-1",children:"The URL might be invalid or restricted. Ensure it's a valid image format."})]}),(0,i.jsx)("code",{className:"text-[10px] bg-slate-200/50 px-2 py-1 rounded break-all max-w-[400px]",children:Le})]})]}),(0,i.jsxs)("div",{className:"p-6 bg-white border-t border-slate-100 flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,i.jsxs)("button",{onClick:()=>xt("insert"),className:"flex-1 px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-bold shadow-lg shadow-blue-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.Check,{size:18}),"Insert infographic"]}),l&&((qt=N.slides[n].elements.find(o=>o.id===l))==null?void 0:qt.type)==="image"&&(0,i.jsxs)("button",{onClick:()=>xt("replace"),className:"flex-1 px-6 py-3 bg-emerald-600 hover:bg-emerald-700 text-black rounded-xl font-bold shadow-lg shadow-emerald-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.RefreshCw,{size:18}),"Replace existing"]})]}),(0,i.jsxs)("button",{onClick:()=>xt("discard"),className:"w-full px-6 py-3 bg-red-50 hover:bg-red-100 text-red-600 rounded-xl font-bold transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(q.Trash2,{size:18}),"Discard"]})]})]})}),C&&(0,i.jsx)(kt,{presentation:N,initialSlideIndex:n,onClose:$t}),(0,i.jsx)(ca,{isOpen:ut.open,message:ut.message,type:ut.type,onClose:()=>Tt(o=>j(I({},o),{open:!1}))})]})};var da=Fe(require("pptxgenjs"));var Lt=class{async exportToBlob(a){var H,g;let c=new da.default,m=((H=a.layout)==null?void 0:H.width)||12192e3,v=((g=a.layout)==null?void 0:g.height)||6858e3,s=1200,R=675,T=S=>S/s*(m/914400),P=S=>S/R*(v/914400);return a.slides.forEach(S=>{let y=c.addSlide();[...S.elements].sort((k,f)=>k.zIndex-f.zIndex).forEach(k=>{var $,E;let f=k.opacity!==void 0?(1-k.opacity)*100:0,G={x:T(k.x),y:P(k.y),w:T(k.width),h:P(k.height)};if(k.type==="text")y.addText(k.content,j(I({},G),{fontSize:(k.fontSize||18)/2,color:(($=k.color)==null?void 0:$.replace("#",""))||"000000",fontFace:k.fontFamily||"Arial"}));else if(k.type==="image")y.addImage(j(I({},G),{path:k.src,transparency:f}));else if(k.type==="shape"){let ee=k.shapeType==="ellipse"?c.ShapeType.ellipse:c.ShapeType.rect;y.addShape(ee,j(I({},G),{fill:{color:((E=k.fill)==null?void 0:E.replace("#",""))||"CCCCCC",transparency:f>0?Math.min(f+10,100):0}}))}})}),await c.write({outputType:"blob"})}};0&&(module.exports={PptEditor,PptxBlobExporter,PptxExporter,PptxParser});
|
|
20
|
+
Instruction: ${o}`;y=(await de.generateContent(`${ie}
|
|
21
|
+
|
|
22
|
+
${ae}`)).response.text().trim()}J(y)}catch(y){console.error("AI Custom Edit Error:",y),Ie("AI editing failed. Please check configuration.","error")}finally{Me(!1)}}},Wt=async o=>{let p=L.slides[n].elements.find(y=>y.id===N);if(!(!p||p.type!=="text")){Me(!0),J(null),Ve({id:N,action:o});try{let y="";if(o==="rewrite"&&H?y=await H(p.content):o==="grammar"&&C?y=await C(p.content):o==="shorten"&&f?y=await f(p.content):o==="lengthen"&&O?y=await O(p.content):o==="continue"&&G&&(y=await G(p.content)),!y){if(!x){Ie("Gemini API key is missing and no custom AI route provided.","error"),Me(!1);return}let de=new dt.GoogleGenerativeAI(x).getGenerativeModel({model:"gemini-flash-latest"}),ie="You are a professional editor. Return ONLY the edited text. No explanations.",ae=`original text: "${p.content}"`;switch(o){case"rewrite":ae=`Improve the writing of: "${p.content}"`;break;case"grammar":ae=`Fix grammar in: "${p.content}"`;break;case"shorten":ae=`Make this shorter: "${p.content}"`;break;case"lengthen":ae=`Make this longer: "${p.content}"`;break;case"continue":ae=`Continue writing from: "${p.content}"`;break}y=(await de.generateContent(`${ie}
|
|
23
|
+
|
|
24
|
+
${ae}`)).response.text().trim()}J(y)}catch(y){console.error("AI Text Edit Error:",y),Ie("AI editing failed. Please check configuration.","error")}finally{Me(!1)}}},Ot=o=>{if(!be||!Ne)return;if(o==="regenerate"){Wt(Ne.action);return}let d=L.slides[n],p=d.elements.find(y=>y.id===Ne.id);if(!(!p||p.type!=="text")){if(o==="replace")Pe(Ne.id,{content:be});else if(o==="addBelow"){let y=F(P({},p),{id:`text-ai-${Date.now()}`,content:be,y:p.y+p.height+20,zIndex:d.elements.length});Ae({elements:[...d.elements,y]})}J(null),Ve(null),le(y=>F(P({},y),{visible:!1}))}},Ca=o=>{if(!M||!Ne)return;if(o==="discard"){W(null);return}if(o==="regenerate"){let y=Ne.action;(y==="shorten"||y==="lengthen"||y==="reframe")&&Ye(Ne.id,y);return}let d=L.slides[n],p=d.elements.find(y=>y.id===Ne.id);if(!(!p||p.type!=="text")){if(o==="replace")Pe(Ne.id,{content:M});else if(o==="addBelow"){let y=F(P({},p),{id:`text-refine-${Date.now()}`,content:M,y:p.y+p.height+20,zIndex:d.elements.length});Ae({elements:[...d.elements,y]})}W(null),Ve(null)}},La=async()=>{await new Je().export(L)},Ya=()=>{he(!0);let o=document.documentElement;o.requestFullscreen&&o.requestFullscreen()},qt=()=>{he(!1),document.fullscreenElement&&document.exitFullscreen()};(0,j.useEffect)(()=>{let o=()=>{document.fullscreenElement||he(!1)};return document.addEventListener("fullscreenchange",o),()=>document.removeEventListener("fullscreenchange",o)},[]),(0,j.useEffect)(()=>{let o=d=>{if(d.key==="Delete"||d.key==="Backspace"){let p=document.activeElement;if((p==null?void 0:p.tagName)==="INPUT"||(p==null?void 0:p.tagName)==="TEXTAREA"||p!=null&&p.isContentEditable)return;Xe()}d.key==="Escape"&&(K(null),le(p=>F(P({},p),{visible:!1}))),(d.ctrlKey||d.metaKey)&&(d.key==="z"&&(d.preventDefault(),d.shiftKey?xt():Ft()),d.key==="y"&&(d.preventDefault(),xt()))};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[Xe,Ft,xt]);let vt=(o,d)=>{Re(o),T==null||T(o,d)},Xt=()=>{ee({slides:[{id:`slide-${Date.now()}`,elements:[]}],layout:{width:12192e3,height:6858e3}}),z(0),K(null),vt("scratch")},lt=async o=>{fe(!0);try{let d=new Qe,p=o;if(typeof o=="string"){let Z=o.trim();p=b?`${b}${b.includes("?")?"&":"?"}url=${encodeURIComponent(Z)}`:Z,vt("url",Z)}else vt("uploaded");let y=await d.parse(p);ee(y),S([]),k([]),z(0),K(null)}catch(d){console.error("Failed to load PPTX",d),Ie("Failed to load presentation. Please ensure it is a valid .pptx.","error")}finally{fe(!1)}},za=(o,d)=>{switch(o!=="ai-text-edit"&&le(p=>F(P({},p),{visible:!1})),o){case"add-text":Ut();break;case"add-image":kt();break;case"add-shape":Zt(d);break;case"new-slide":Gt();break;case"ai-action":Ye(N||"",d);break;case"ai-action":Ye(N||"",d);break;case"ai-text-edit":Wt(d);break;case"ai-custom-edit":ka(d);break;case"generate-image":ve(!0);break;case"generate-infographic":Nt();break;case"format":$t(d);break;case"delete":Xe();break}},Sa=async()=>{if(tt.trim()){Bt(!0);try{let o="";if(I)o=await I(tt);else throw x?new Error("Internal image generation requires onGenerateImage prop or specific endpoint configuration."):new Error("No image generation function or Gemini API key provided.");at(o),ve(!1),Mt("")}catch(o){console.error("Image generation failed:",o),Ie("Image generation failed: "+(o instanceof Error?o.message:"Unknown error"),"error")}finally{Bt(!1)}}},wt=o=>{if(o==="insert"&&ze)_e(ze);else if(o==="replace"&&ze&&N){let d=L.slides[n].elements.find(p=>p.id===N);d&&d.type==="image"?Pe(N,{src:ze}):_e(ze)}at(null)},_t=async o=>{let d=o||gt;if(d.trim()){Ht(!0),Dt(!1),ot(null);try{let p="";if(w)p=await w(d);else throw x?new Error("Internal infographic generation requires onGenerateInfographic prop or specific endpoint configuration."):new Error("No infographic generation function or Gemini API key provided.");ot(p);let y=new Image;y.src=b?`${b}${encodeURIComponent(p)}`:p,await new Promise((Z,de)=>{y.onload=Z,y.onerror=()=>{console.log("Image preload failed, proceeding to preview"),Z(null)}}),Dt(!0),st(!1),Tt("")}catch(p){console.error("Infographic generation failed:",p),Ie("Infographic generation failed: "+(p instanceof Error?p.message:"Unknown error"),"error")}finally{Ht(!1)}}},yt=o=>{if(o==="insert"&&Se)_e(Se);else if(o==="replace"&&Se&&N){let d=L.slides[n].elements.find(p=>p.id===N);d&&d.type==="image"?Pe(N,{src:Se}):_e(Se)}ot(null)},Nt=async()=>{if(oe&&Y){let o=(Fe==null?void 0:Fe.type)==="text"?Fe.content:"";if(o){Rt(!0);try{let d=await Y(o);Oe(d)}catch(d){console.error("Prompt refinement failed:",d),Ie("Failed to refine infographic prompt.","error")}finally{Rt(!1)}return}}st(!0)},kt=()=>{let o=document.createElement("input");o.type="file",o.accept="image/*",o.onchange=async d=>{var y;let p=(y=d.target.files)==null?void 0:y[0];if(p){let Z=await new Promise(de=>{let ie=new FileReader;ie.onload=ae=>{var ke;return de((ke=ae.target)==null?void 0:ke.result)},ie.readAsDataURL(p)});at(Z)}},o.click()},Yt=(0,j.useCallback)(o=>!b||!o||o.startsWith("data:")||o.includes("localhost")||o.includes("127.0.0.1")?o:`${b}?url=${encodeURIComponent(o)}`,[b]);return!s||!V?(0,i.jsx)("div",{className:"flex items-center justify-center bg-red-50 text-red-600 p-8 rounded-xl border-2 border-red-200 font-bold",children:"Error: width and height props are compulsory for PptEditor."}):(0,i.jsxs)("div",{className:"flex flex-col bg-white relative",style:{width:typeof s=="number"?`${s}px`:s,height:typeof V=="number"?`${V}px`:V,fontSize:`${16*it}px`},children:[Q&&(0,i.jsx)("div",{className:"absolute inset-0 z-[2000] bg-white flex flex-col items-center justify-center p-6 md:p-12 overflow-y-auto",children:(0,i.jsxs)("div",{className:"max-w-2xl w-full text-center space-y-6 md:space-y-8 animate-in fade-in zoom-in-95 duration-500 my-auto",children:[(0,i.jsx)("div",{className:"flex justify-center"}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("h2",{className:"text-4xl font-black tracking-tight text-slate-800",children:l}),(0,i.jsx)("p",{className:"text-slate-500 font-medium",children:"Create stunning presentations in seconds."})]}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,i.jsxs)("button",{onClick:()=>{Xt(),et(!1)},className:"flex flex-col items-center justify-center gap-4 p-10 border-2 border-slate-100 rounded-[2.5rem] hover:border-slate-300 hover:bg-slate-50 transition-all group shadow-sm hover:shadow-md active:scale-[0.98]",children:[(0,i.jsx)("div",{className:"p-5 bg-slate-100 rounded-2xl group-hover:bg-blue-50 transition-colors",children:(0,i.jsx)("svg",{className:"w-10 h-10 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M12 4v16m8-8H4"})})}),(0,i.jsx)("span",{className:"text-sm font-black uppercase tracking-[0.15em] text-slate-600 group-hover:text-slate-900 transition-colors",children:"Start New Deck"})]}),(0,i.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 p-10 border-2 border-slate-100 rounded-[2.5rem] hover:border-slate-300 hover:bg-slate-50 transition-all group shadow-sm hover:shadow-md active:scale-[0.98] cursor-pointer",children:[(0,i.jsx)("div",{className:"p-5 bg-slate-100 rounded-2xl group-hover:bg-emerald-50 transition-colors",children:(0,i.jsx)("svg",{className:"w-10 h-10 text-emerald-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M4 16v1a2 2 0 002 2h12a2 2 0 002-2v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}),(0,i.jsx)("span",{className:"text-sm font-black uppercase tracking-[0.15em] text-slate-600 group-hover:text-slate-900 transition-colors",children:"Upload PPTX"}),(0,i.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:o=>{var p;let d=(p=o.target.files)==null?void 0:p[0];d&&(lt(d),et(!1))}})]})]}),(0,i.jsxs)("div",{className:"space-y-4 pt-8 border-t border-slate-100",children:[(0,i.jsxs)("div",{className:"flex gap-3 items-stretch",children:[(0,i.jsx)("div",{className:"flex-1 relative group",children:(0,i.jsx)("input",{type:"text",placeholder:"Paste presentation URL...",value:We,onChange:o=>It(o.target.value),className:"text-black w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-5 py-4 focus:outline-none focus:border-slate-400 focus:ring-4 focus:ring-slate-400/5 text-base transition-all h-full"})}),(0,i.jsx)("button",{onClick:()=>{We.trim()&&(lt(We.trim()),et(!1))},disabled:!We.trim()||re,style:{cursor:"pointer"},className:"bg-slate-900 hover:bg-black disabled:bg-slate-100 disabled:text-slate-400 text-white font-black px-10 rounded-2xl transition-all shadow-sm text-sm shrink-0 whitespace-nowrap h-full min-h-[56px] flex items-center justify-center uppercase tracking-widest",children:re?(0,i.jsxs)("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):"Load"})]}),(0,i.jsx)("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-[0.2em]",children:"Supports S3, public links, and versioned assets"})]})]})}),pe&&(0,i.jsx)(zt,{presentation:L,initialSlideIndex:n,onClose:qt}),(0,i.jsx)(sa,{onAddText:Ut,onAddImage:_e,onAddShape:Zt,onAddSlide:Gt,onExport:La,onFormatText:$t,onDeleteElement:Xe,onGenerateImageClick:()=>ve(!0),onGenerateInfographicClick:Nt,onUploadImageClick:kt,onApplyLayout:Na,onPlay:()=>he(!0),onAiAction:Ye,onAiResponseAction:Ot,onNewPresentation:Xt,onLoadPresentation:lt,aiResponse:be,isAiLoading:ft,selectedElement:Fe,refineResponse:M,onRefineAction:Ye,appName:l,appBgColor:D,uiScale:it,source:xe}),(0,i.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,i.jsx)(la,{slides:L.slides,currentSlideIndex:n,onSelectSlide:z,onDeleteSlide:va,onDuplicateSlide:wa,onReorderSlides:ya,uiScale:it,appBgColor:D}),(0,i.jsx)("div",{className:"flex-1 flex items-center justify-center p-12 overflow-auto bg-white",children:(0,i.jsx)(ct,{slide:Le,onElementUpdate:Pe,onSelect:K,uiScale:it,onSlashCommand:(o,d,p)=>le({visible:o.x!==0,position:o,mode:d||"default",context:p}),selectedElementId:N,onAiGenerateClick:()=>ve(!0),onAiGenerateInfographicClick:Nt,onUploadImageClick:kt,onDeleteElement:Xe})})]}),U.visible&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9998]",onClick:()=>le(o=>F(P({},o),{visible:!1})),children:(0,i.jsx)(ga,{position:U.position,onClose:()=>le(o=>F(P({},o),{visible:!1})),onAction:za,canUseAi:!!x||!!b,mode:U.mode,context:U.context,aiResult:be,isAiLoading:ft,onAiResponseAction:Ot,lastAiAction:Ne==null?void 0:Ne.action})}),M&&Fe&&(0,i.jsx)(pa,{result:M,isLoading:ft,onAction:Ca,onClose:()=>W(null)}),Ce&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[500px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(X.Sparkles,{className:"text-blue-600",size:20}),"Generate Image"]}),(0,i.jsx)("button",{onClick:()=>ve(!1),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(X.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"Describe the image you want to create for this slide."}),(0,i.jsx)("textarea",{autoFocus:!0,placeholder:"A futuristic city in the style of cyberpunk with neon lights...",className:"text-black w-full h-32 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none",value:tt,onChange:o=>Mt(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,i.jsx)("button",{onClick:()=>ve(!1),className:"flex-1 px-5 py-3 cursor-pointer text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors flex items-center justify-center",children:"Cancel"}),(0,i.jsx)("button",{onClick:Sa,disabled:At||!tt.trim(),className:"flex-1 px-6 py-3 cursor-pointer text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-lg shadow-lg shadow-blue-500/20 transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 flex items-center justify-center gap-2",children:At?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(X.RefreshCw,{className:"animate-spin",size:16}),"Generating..."]}):"Generate"})]})]})}),ze&&(0,i.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60 backdrop-blur-md animate-in fade-in duration-300",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-3xl max-w-[90vw] max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-300 border border-slate-200",children:[(0,i.jsxs)("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-white",children:[(0,i.jsx)("h3",{className:"text-lg font-bold text-slate-800",children:"Preview Image"}),(0,i.jsx)("button",{onClick:()=>at(null),className:"p-2 hover:bg-slate-100 rounded-full text-slate-400 transition-colors",children:(0,i.jsx)(X.Plus,{className:"rotate-45",size:20})})]}),(0,i.jsxs)("div",{className:"p-8 bg-slate-100 flex items-center justify-center overflow-auto min-h-[300px] relative",children:[rt&&!pt&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-100/50 z-10",children:(0,i.jsx)(X.RefreshCw,{className:"animate-spin text-slate-400",size:32})}),(0,i.jsx)("img",{src:Yt(ze),alt:"Generated",className:B("max-w-full max-h-[60vh] rounded-lg shadow-2xl ring-4 ring-white transition-opacity duration-300",pt||rt?"opacity-0":"opacity-100"),onLoad:()=>De(!1),onError:()=>{Pt(!0),De(!1)}}),pt&&(0,i.jsxs)("div",{className:"flex flex-col items-center gap-4 text-slate-400 p-12 text-center animate-in fade-in duration-500",children:[(0,i.jsx)("div",{className:"p-4 bg-slate-200/50 rounded-full",children:(0,i.jsx)(X.Image,{size:48,className:"opacity-40"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-bold text-slate-600",children:"Failed to load preview"}),(0,i.jsx)("p",{className:"text-xs max-w-[300px] mt-1",children:"The URL might be invalid or restricted. Ensure it's a valid image format."})]}),(0,i.jsx)("code",{className:"text-[10px] bg-slate-200/50 px-2 py-1 rounded break-all max-w-[400px]",children:ze})]})]}),(0,i.jsxs)("div",{className:"p-6 bg-white border-t border-slate-100 flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,i.jsxs)("button",{onClick:()=>wt("insert"),className:"flex-1 px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-bold shadow-lg shadow-blue-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.Check,{size:18}),"Insert image"]}),N&&((Kt=L.slides[n].elements.find(o=>o.id===N))==null?void 0:Kt.type)==="image"&&(0,i.jsxs)("button",{onClick:()=>wt("replace"),className:"flex-1 px-6 py-3 bg-emerald-600 hover:bg-emerald-700 text-black rounded-xl font-bold shadow-lg shadow-emerald-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.RefreshCw,{size:18}),"Replace existing"]})]}),(0,i.jsxs)("button",{onClick:()=>wt("discard"),className:"w-full px-6 py-3 bg-red-50 hover:bg-red-100 text-red-600 rounded-xl font-bold transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.Trash2,{size:18}),"Discard"]})]})]})}),ba&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[500px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(X.PieChart,{className:"text-blue-600",size:20}),"Generate Infographic"]}),(0,i.jsx)("button",{onClick:()=>st(!1),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(X.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"Describe the infographic you want to create for this slide."}),(0,i.jsx)("textarea",{autoFocus:!0,placeholder:"A pie chart showing market share distribution...",className:"text-black w-full h-32 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none",value:gt,onChange:o=>Tt(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,i.jsx)("button",{onClick:()=>st(!1),className:"flex-1 px-5 py-3 cursor-pointer text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors flex items-center justify-center",children:"Cancel"}),(0,i.jsx)("button",{onClick:()=>_t(),disabled:ut||!gt.trim(),className:"flex-1 px-6 py-3 cursor-pointer text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-lg shadow-lg shadow-blue-500/20 transition-all active:scale-95 disabled:opacity-50 disabled:active:scale-100 flex items-center justify-center gap-2",children:ut?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(X.RefreshCw,{className:"animate-spin",size:16}),"Generating..."]}):"Generate"})]})]})}),ut&&(0,i.jsx)("div",{className:"fixed inset-0 z-[11000] flex items-center justify-center bg-black/20 backdrop-blur-[2px] animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsx)(X.RefreshCw,{className:"animate-spin text-blue-600",size:32}),(0,i.jsx)("p",{className:"text-sm font-bold text-slate-600",children:"Generating Infographic..."})]})}),fa&&(0,i.jsx)("div",{className:"fixed inset-0 z-[11000] flex items-center justify-center bg-black/20 backdrop-blur-[2px] animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 flex flex-col items-center gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsx)(X.RefreshCw,{className:"animate-spin text-blue-600",size:32}),(0,i.jsx)("p",{className:"text-sm font-bold text-slate-600",children:"Polishing your prompt with AI..."})]})}),ht!==null&&(0,i.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/40 backdrop-blur-sm animate-in fade-in duration-200",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-[600px] p-6 flex flex-col gap-4 animate-in zoom-in-95 duration-200",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsxs)("h3",{className:"text-xl font-bold text-slate-800 flex items-center gap-2",children:[(0,i.jsx)(X.Sparkles,{className:"text-blue-600",size:20}),"Step 1: AI Refinement"]}),(0,i.jsx)("button",{onClick:()=>Oe(null),className:"text-slate-400 hover:text-slate-600",children:(0,i.jsx)(X.Plus,{className:"rotate-45",size:24})})]}),(0,i.jsx)("p",{className:"text-sm text-slate-500",children:"The AI has refined your selected text into a visual prompt. You can adjust it below."}),(0,i.jsx)("textarea",{autoFocus:!0,className:"text-black w-full h-48 p-4 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-sm font-medium resize-none shadow-inner",value:ht,onChange:o=>Oe(o.target.value)}),(0,i.jsxs)("div",{className:"flex justify-end gap-3 mt-2",children:[(0,i.jsx)("button",{onClick:()=>Oe(null),className:"flex-1 flex items-center justify-center px-5 py-3 text-sm font-bold text-slate-600 hover:bg-slate-100 rounded-lg transition-colors",children:"Discard"}),(0,i.jsxs)("button",{onClick:()=>{let o=ht;Oe(null),_t(o)},className:"px-6 py-3 text-sm font-bold text-white bg-blue-600 hover:bg-blue-700 rounded-xl shadow-lg shadow-blue-500/20 transition-all active:scale-95 flex-1 flex items-center justify-center gap-2 uppercase tracking-wide",children:[(0,i.jsx)(X.PieChart,{size:18}),"Generate Infographic"]})]})]})}),xa&&Se&&(0,i.jsx)("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60 backdrop-blur-md animate-in fade-in duration-300",children:(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-3xl max-w-[90vw] max-h-[90vh] overflow-hidden flex flex-col animate-in zoom-in-95 duration-300 border border-slate-200",children:[(0,i.jsxs)("div",{className:"p-4 border-b border-slate-100 flex items-center justify-between bg-white",children:[(0,i.jsx)("h3",{className:"text-lg font-bold text-slate-800",children:"Preview Infographic"}),(0,i.jsx)("button",{onClick:()=>ot(null),className:"p-2 hover:bg-slate-100 rounded-full text-slate-400 transition-colors",children:(0,i.jsx)(X.Plus,{className:"rotate-45",size:20})})]}),(0,i.jsxs)("div",{className:"p-8 bg-slate-100 flex items-center justify-center overflow-auto min-h-[300px] relative",children:[rt&&!mt&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-100/50 z-10",children:(0,i.jsx)(X.RefreshCw,{className:"animate-spin text-slate-400",size:32})}),(0,i.jsx)("img",{src:Yt(Se),alt:"Generated Infographic",className:B("max-w-full max-h-[60vh] rounded-lg shadow-2xl ring-4 ring-white transition-opacity duration-300",mt||rt?"opacity-0":"opacity-100"),onLoad:()=>De(!1),onError:()=>{jt(!0),De(!1)}}),mt&&(0,i.jsxs)("div",{className:"flex flex-col items-center gap-4 text-slate-400 p-12 text-center animate-in fade-in duration-500",children:[(0,i.jsx)("div",{className:"p-4 bg-slate-200/50 rounded-full",children:(0,i.jsx)(X.PieChart,{size:48,className:"opacity-40"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"font-bold text-slate-600",children:"Failed to load preview"}),(0,i.jsx)("p",{className:"text-xs max-w-[300px] mt-1",children:"The URL might be invalid or restricted. Ensure it's a valid image format."})]}),(0,i.jsx)("code",{className:"text-[10px] bg-slate-200/50 px-2 py-1 rounded break-all max-w-[400px]",children:Se})]})]}),(0,i.jsxs)("div",{className:"p-6 bg-white border-t border-slate-100 flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,i.jsxs)("button",{onClick:()=>yt("insert"),className:"flex-1 px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-bold shadow-lg shadow-blue-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.Check,{size:18}),"Insert infographic"]}),N&&((Jt=L.slides[n].elements.find(o=>o.id===N))==null?void 0:Jt.type)==="image"&&(0,i.jsxs)("button",{onClick:()=>yt("replace"),className:"flex-1 px-6 py-3 bg-emerald-600 hover:bg-emerald-700 text-black rounded-xl font-bold shadow-lg shadow-emerald-500/20 transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.RefreshCw,{size:18}),"Replace existing"]})]}),(0,i.jsxs)("button",{onClick:()=>yt("discard"),className:"w-full px-6 py-3 bg-red-50 hover:bg-red-100 text-red-600 rounded-xl font-bold transition-all flex items-center justify-center gap-2",children:[(0,i.jsx)(X.Trash2,{size:18}),"Discard"]})]})]})}),pe&&(0,i.jsx)(zt,{presentation:L,initialSlideIndex:n,onClose:qt}),(0,i.jsx)(ma,{isOpen:bt.open,message:bt.message,type:bt.type,onClose:()=>Vt(o=>F(P({},o),{open:!1}))})]})};var ha=$e(require("pptxgenjs"));var St=class{async exportToBlob(a){var T,b;let l=new ha.default,h=((T=a.layout)==null?void 0:T.width)||12192e3,x=((b=a.layout)==null?void 0:b.height)||6858e3,s=1200,V=675,D=I=>I/s*(h/914400),R=I=>I/V*(x/914400);return a.slides.forEach(I=>{let w=l.addSlide();[...I.elements].sort((C,f)=>C.zIndex-f.zIndex).forEach(C=>{var G,oe;let f=C.opacity!==void 0?(1-C.opacity)*100:0,O={x:D(C.x),y:R(C.y),w:D(C.width),h:R(C.height)};if(C.type==="text")w.addText(C.content,F(P({},O),{fontSize:(C.fontSize||18)/2,color:((G=C.color)==null?void 0:G.replace("#",""))||"000000",fontFace:C.fontFamily||"Arial"}));else if(C.type==="image")w.addImage(F(P({},O),{path:C.src,transparency:f}));else if(C.type==="shape"){let Y=C.shapeType==="ellipse"?l.ShapeType.ellipse:l.ShapeType.rect;w.addShape(Y,F(P({},O),{fill:{color:((oe=C.fill)==null?void 0:oe.replace("#",""))||"CCCCCC",transparency:f>0?Math.min(f+10,100):0}}))}})}),await l.write({outputType:"blob"})}};0&&(module.exports={PptEditor,PptxBlobExporter,PptxExporter,PptxParser});
|
|
21
25
|
//# sourceMappingURL=index.js.map
|