@abduljebar/text-editor 1.1.3 → 1.1.5
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/dist/App.d.ts.map +1 -1
- package/dist/components/TextEditor.d.ts +2 -0
- package/dist/components/TextEditor.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts +2 -0
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4441 -1984
- package/dist/index.umd.cjs +26 -59
- package/dist/store/editor.store.d.ts +1 -0
- package/dist/store/editor.store.d.ts.map +1 -1
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/editor.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(F,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],y):(F=typeof globalThis<"u"?globalThis:F||self,y(F.TextEditor={},F.React,F.LucideReact))})(this,(function(F,y,O){"use strict";var Ue=document.createElement("style");Ue.textContent=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@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-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-600:oklch(64.6% .222 41.116);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-6xl:72rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--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{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.flex{display:flex}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\\[500px\\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.animate-pulse{animation:var(--animate-pulse)}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-0{border-top-style:var(--tw-border-style);border-top-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-blue-300{border-color:var(--color-blue-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-red-200{border-color:var(--color-red-200)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-600{background-color:var(--color-green-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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)}.text-blue-600{color:var(--color-blue-600)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-orange-600{color:var(--color-orange-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-500::-moz-placeholder{color:var(--color-gray-500)}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\\:bg-red-700:hover{background-color:var(--color-red-700)}}.focus\\:bg-gray-50:focus{background-color:var(--color-gray-50)}.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)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(te,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],A):(te=typeof globalThis<"u"?globalThis:te||self,A(te.TextEditor={},te.React,te.LucideReact))})(this,(function(te,A,V){"use strict";var pt=document.createElement("style");pt.textContent=`/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-space-y-reverse:0}}}@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-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-600:oklch(64.6% .222 41.116);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-6xl:72rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--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-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--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{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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{vertical-align:baseline;font-size:75%;line-height:0;position:relative}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{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}: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}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{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{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-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]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[500px\\]{min-height:500px}.w-9{width:calc(var(--spacing)*9)}.w-full{width:100%}.w-px{width:1px}.max-w-6xl{max-width:var(--container-6xl)}.max-w-none{max-width:none}.resize-none{resize:none}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-6{gap:calc(var(--spacing)*6)}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-blue-300{border-color:var(--color-blue-300)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-green-600{background-color:var(--color-green-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.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)}.text-blue-600{color:var(--color-blue-600)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-orange-600{color:var(--color-orange-600)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.italic{font-style:italic}.underline{text-decoration-line:underline}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.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))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\\:bg-red-700:hover{background-color:var(--color-red-700)}}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-blue-300:disabled{background-color:var(--color-blue-300)}@media (min-width:40rem){.sm\\:mt-0{margin-top:calc(var(--spacing)*0)}}.animate-fadeIn{animation:.3s ease-in-out fadeIn}}.editor-content h1{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4)}.editor-content a{color:var(--color-blue-600);text-decoration-line:underline}@keyframes fadeIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.editor-content h1{margin-top:calc(var(--spacing)*6);margin-bottom:calc(var(--spacing)*4);border-bottom-style:var(--tw-border-style);padding-bottom:calc(var(--spacing)*2);font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800);border-bottom-width:1px}.editor-content h2{margin-top:calc(var(--spacing)*5);margin-bottom:calc(var(--spacing)*3);font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content h3{margin-top:calc(var(--spacing)*4);margin-bottom:calc(var(--spacing)*2);font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold);color:var(--color-gray-800)}.editor-content p{margin-bottom:calc(var(--spacing)*4);--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);color:var(--color-gray-700)}.editor-content ul{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:disc;list-style-position:inside}:where(.editor-content ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content ol{margin-bottom:calc(var(--spacing)*4);margin-left:calc(var(--spacing)*4);list-style-type:decimal;list-style-position:inside}:where(.editor-content ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.editor-content li{margin-bottom:calc(var(--spacing)*1)}.editor-content a{color:var(--color-blue-600);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));text-decoration-line:underline}@media (hover:hover){.editor-content a:hover{color:var(--color-blue-800)}}.editor-content blockquote{margin-block:calc(var(--spacing)*4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--color-blue-500);padding-left:calc(var(--spacing)*4);color:var(--color-gray-600);font-style:italic}.editor-content code{background-color:var(--color-gray-100);padding-inline:calc(var(--spacing)*2);padding-block:calc(var(--spacing)*1);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:.25rem}.editor-content pre{margin-block:calc(var(--spacing)*4);border-radius:var(--radius-lg);background-color:var(--color-gray-800);padding:calc(var(--spacing)*4);color:var(--color-gray-100);overflow-x:auto}.editor-content pre code{padding:calc(var(--spacing)*0);color:inherit;background-color:#0000}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(pt);var $e={exports:{}},ve={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var mt;function zr(){if(mt)return ve;mt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,n,i){var a=null;if(i!==void 0&&(a=""+i),n.key!==void 0&&(a=""+n.key),"key"in n){i={};for(var s in n)s!=="key"&&(i[s]=n[s])}else i=n;return n=i.ref,{$$typeof:e,type:o,key:a,ref:n!==void 0?n:null,props:i}}return ve.Fragment=t,ve.jsx=r,ve.jsxs=r,ve}var we={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.development.js
|
|
13
13
|
*
|
|
@@ -15,36 +15,37 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var ft;function Er(){return ft||(ft=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Ve?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case N:return"Fragment";case U:return"Profiler";case D:return"StrictMode";case J:return"Suspense";case $:return"SuspenseList";case H:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case I:return"Portal";case R:return u.displayName||"Context";case M:return(u._context.displayName||"Context")+".Consumer";case F:var x=u.render;return u=u.displayName,u||(u=x.displayName||x.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case b:return x=u.displayName||null,x!==null?x:e(u.type)||"Memo";case G:x=u._payload,u=u._init;try{return e(u(x))}catch{}}return null}function t(u){return""+u}function r(u){try{t(u);var x=!1}catch{x=!0}if(x){x=console;var E=x.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return E.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),t(u)}}function o(u){if(u===N)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===G)return"<...>";try{var x=e(u);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var u=ne.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function a(u){if(ze.call(u,"key")){var x=Object.getOwnPropertyDescriptor(u,"key").get;if(x&&x.isReactWarning)return!1}return u.key!==void 0}function s(u,x){function E(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}E.isReactWarning=!0,Object.defineProperty(u,"key",{get:E,configurable:!0})}function c(){var u=e(this.type);return K[u]||(K[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function d(u,x,E,C,Q,ge){var Z=E.ref;return u={$$typeof:w,type:u,key:x,props:E,_owner:C},(Z!==void 0?Z:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function p(u,x,E,C,Q,ge){var Z=x.children;if(Z!==void 0)if(C)if(Ee(Z)){for(C=0;C<Z.length;C++)_(Z[C]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(Z);if(ze.call(x,"key")){Z=e(u);var ee=Object.keys(x).filter(function(be){return be!=="key"});C=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Ce[Z+C]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
19
19
|
let props = %s;
|
|
20
20
|
<%s {...props} />
|
|
21
21
|
React keys must be passed directly to JSX without using spread:
|
|
22
22
|
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,I,A,X,A),Wt[A+I]=!0)}if(A=null,S!==void 0&&(r(S),A=""+S),a(b)&&(r(b.key),A=""+b.key),"key"in b){S={};for(var De in b)De!=="key"&&(S[De]=b[De])}else S=b;return A&&s(S,typeof u=="function"?u.displayName||u.name||"Unknown":u),l(u,A,S,o(),ve,Re)}function h(u){m(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===ne&&(u._payload.status==="fulfilled"?m(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function m(u){return typeof u=="object"&&u!==null&&u.$$typeof===C}var v=y,C=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),z=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),Pe=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),q=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,ga=Array.isArray,Ne=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(u){return u()}};var Ft,Lt={},Mt=v.react_stack_bottom_frame.bind(v,i)(),Vt=Ne(n(i)),Wt={};Q.Fragment=P,Q.jsx=function(u,b,S){var I=1e4>q.recentlyCreatedOwnerStacks++;return f(u,b,S,!1,I?Error("react-stack-top-frame"):Mt,I?Ne(n(u)):Vt)},Q.jsxs=function(u,b,S){var I=1e4>q.recentlyCreatedOwnerStacks++;return f(u,b,S,!0,I?Error("react-stack-top-frame"):Mt,I?Ne(n(u)):Vt)}})()),Q}var Me;function Ht(){return Me||(Me=1,process.env.NODE_ENV==="production"?oe.exports=Bt():oe.exports=Yt()),oe.exports}var g=Ht();const Ve=e=>{let t;const r=new Set,n=(l,f)=>{const h=typeof l=="function"?l(t):l;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(v=>v(t,m))}},o=()=>t,s={setState:n,getState:o,getInitialState:()=>d,subscribe:l=>(r.add(l),()=>r.delete(l))},d=t=e(n,o,s);return s},Jt=(e=>e?Ve(e):Ve),Gt=e=>e;function qt(e,t=Gt){const r=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(r),r}const Xt=e=>{const t=Jt(e),r=n=>qt(t,n);return Object.assign(r,t),r},Kt=(e=>Xt);function Qt(e,t){let r;try{r=e()}catch{return}return{getItem:o=>{var i;const a=d=>d===null?null:JSON.parse(d,void 0),s=(i=r.getItem(o))!=null?i:null;return s instanceof Promise?s.then(a):a(s)},setItem:(o,i)=>r.setItem(o,JSON.stringify(i,void 0)),removeItem:o=>r.removeItem(o)}}const be=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return be(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return be(n)(r)}}}},er=(e,t)=>(r,n,o)=>{let i={storage:Qt(()=>localStorage),partialize:_=>_,version:0,merge:(_,P)=>({...P,..._}),...t},a=!1;const s=new Set,d=new Set;let l=i.storage;if(!l)return e((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),r(..._)},n,o);const f=()=>{const _=i.partialize({...n()});return l.setItem(i.name,{state:_,version:i.version})},h=o.setState;o.setState=(_,P)=>(h(_,P),f());const m=e((..._)=>(r(..._),f()),n,o);o.getInitialState=()=>m;let v;const C=()=>{var _,P;if(!l)return;a=!1,s.forEach(k=>{var E;return k((E=n())!=null?E:m)});const U=((P=i.onRehydrateStorage)==null?void 0:P.call(i,(_=n())!=null?_:m))||void 0;return be(l.getItem.bind(l))(i.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==i.version){if(i.migrate){const E=i.migrate(k.state,k.version);return E instanceof Promise?E.then(z=>[!0,z]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var E;const[z,D]=k;if(v=i.merge(D,(E=n())!=null?E:m),r(v,!0),z)return f()}).then(()=>{U?.(v,void 0),v=n(),a=!0,d.forEach(k=>k(v))}).catch(k=>{U?.(void 0,k)})};return o.persist={setOptions:_=>{i={...i,..._},_.storage&&(l=_.storage)},clearStorage:()=>{l?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>C(),hasHydrated:()=>a,onHydrate:_=>(s.add(_),()=>{s.delete(_)}),onFinishHydration:_=>(d.add(_),()=>{d.delete(_)})},i.skipHydration||C(),v||m};function c(e,t,r){function n(s,d){var l;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(l=s._zod).traits??(l.traits=new Set),s._zod.traits.add(e),t(s,d);for(const f in a.prototype)f in s||Object.defineProperty(s,f,{value:a.prototype[f].bind(s)});s._zod.constr=a,s._zod.def=d}const o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var d;const l=r?.Parent?new i:this;n(l,s),(d=l._zod).deferred??(d.deferred=[]);for(const f of l._zod.deferred)f();return l}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class J extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class We extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Be={};function W(e){return Be}function tr(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function _e(e,t){return typeof t=="bigint"?t.toString():t}function we(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ke(e){return e==null}function ye(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function rr(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const d=n.match(/\d?e-(\d?)/);d?.[1]&&(o=Number.parseInt(d[1]))}const i=r>o?r:o,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const Ye=Symbol("evaluating");function w(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ye)return n===void 0&&(n=Ye,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function B(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Y(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function He(e){return JSON.stringify(e)}const Je="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const nr=we(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ee(e){if(ie(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(ie(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ge(e){return ee(e)?{...e}:Array.isArray(e)?[...e]:e}const or=new Set(["string","number","symbol"]);function ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function p(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ir(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ar={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sr(e,t){const r=e._zod.def,n=Y(e._zod.def,{get shape(){const o={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(o[i]=r.shape[i])}return B(this,"shape",o),o},checks:[]});return M(e,n)}function cr(e,t){const r=e._zod.def,n=Y(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete o[i]}return B(this,"shape",o),o},checks:[]});return M(e,n)}function ur(e,t){if(!ee(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Y(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return B(this,"shape",i),i},checks:[]});return M(e,o)}function lr(e,t){if(!ee(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return B(this,"shape",n),n},checks:e._zod.def.checks};return M(e,r)}function dr(e,t){const r=Y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return B(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return M(e,r)}function fr(e,t,r){const n=Y(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:o[a]}):o[a])}else for(const a in o)i[a]=e?new e({type:"optional",innerType:o[a]}):o[a];return B(this,"shape",i),i},checks:[]});return M(t,n)}function hr(e,t,r){const n=Y(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return B(this,"shape",i),i},checks:[]});return M(t,n)}function G(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function qe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function se(e){return typeof e=="string"?e:e?.message}function H(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const o=se(e.inst?._zod.def?.error?.(e))??se(t?.error?.(e))??se(r.customError?.(e))??se(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function xe(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function te(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Xe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,_e,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=c("$ZodError",Xe),Qe=c("$ZodError",Xe,{Parent:Error});function pr(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function mr(e,t){const r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)n._errors.push(r(a));else{let s=n,d=0;for(;d<a.path.length;){const l=a.path[d];d===a.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(a))):s[l]=s[l]||{_errors:[]},s=s[l],d++}}};return o(e),n}const ze=e=>(t,r,n,o)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new J;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(d=>H(d,i,W())));throw Je(s,o?.callee),s}return a.value},$e=e=>async(t,r,n,o)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(o?.Err??e)(a.issues.map(d=>H(d,i,W())));throw Je(s,o?.callee),s}return a.value},ce=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new J;return i.issues.length?{success:!1,error:new(e??Ke)(i.issues.map(a=>H(a,o,W())))}:{success:!0,data:i.value}},gr=ce(Qe),ue=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>H(a,o,W())))}:{success:!0,data:i.value}},vr=ue(Qe),br=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ze(e)(t,r,o)},_r=e=>(t,r,n)=>ze(e)(t,r,n),wr=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return $e(e)(t,r,o)},kr=e=>async(t,r,n)=>$e(e)(t,r,n),yr=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ce(e)(t,r,o)},xr=e=>(t,r,n)=>ce(e)(t,r,n),zr=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ue(e)(t,r,o)},$r=e=>async(t,r,n)=>ue(e)(t,r,n),Er=/^[cC][^\s-]{8,}$/,Zr=/^[0-9a-z]+$/,Sr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tr=/^[0-9a-vA-V]{20}$/,Cr=/^[A-Za-z0-9]{27}$/,jr=/^[a-zA-Z0-9_-]{21}$/,Ir=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ar=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,et=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Or=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Pr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Nr(){return new RegExp(Pr,"u")}const Rr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Dr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ur=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Fr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tt=/^[A-Za-z0-9_-]*$/,Mr=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Vr=/^\+(?:[0-9]){6,14}[0-9]$/,rt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Wr=new RegExp(`^${rt}$`);function nt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Br(e){return new RegExp(`^${nt(e)}$`)}function Yr(e){const t=nt({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${rt}T(?:${n})$`)}const Hr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Jr=/^-?\d+$/,Gr=/^-?\d+(?:\.\d+)?/,qr=/^(?:true|false)$/i,Xr=/^[^A-Z]*$/,Kr=/^[^a-z]*$/,N=c("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ot={number:"number",bigint:"bigint",object:"date"},it=c("$ZodCheckLessThan",(e,t)=>{N.init(e,t);const r=ot[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),at=c("$ZodCheckGreaterThan",(e,t)=>{N.init(e,t);const r=ot[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qr=c("$ZodCheckMultipleOf",(e,t)=>{N.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):rr(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),en=c("$ZodCheckNumberFormat",(e,t)=>{N.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[o,i]=ar[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,r&&(s.pattern=Jr)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),tn=c("$ZodCheckMaxLength",(e,t)=>{var r;N.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ke(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=xe(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),rn=c("$ZodCheckMinLength",(e,t)=>{var r;N.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ke(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=xe(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),nn=c("$ZodCheckLengthEquals",(e,t)=>{var r;N.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!ke(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,i=o.length;if(i===t.length)return;const a=xe(o),s=i>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),le=c("$ZodCheckStringFormat",(e,t)=>{var r,n;N.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),on=c("$ZodCheckRegex",(e,t)=>{le.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),an=c("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Xr),le.init(e,t)}),sn=c("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Kr),le.init(e,t)}),cn=c("$ZodCheckIncludes",(e,t)=>{N.init(e,t);const r=ae(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),un=c("$ZodCheckStartsWith",(e,t)=>{N.init(e,t);const r=new RegExp(`^${ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ln=c("$ZodCheckEndsWith",(e,t)=>{N.init(e,t);const r=new RegExp(`.*${ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),dn=c("$ZodCheckOverwrite",(e,t)=>{N.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class fn{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
24
|
-
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,o.join(`
|
|
25
|
-
`)
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
<%s key={someKey} {...props} />`,C,Z,ee,Z),Ce[Z+C]=!0)}if(Z=null,E!==void 0&&(r(E),Z=""+E),a(x)&&(r(x.key),Z=""+x.key),"key"in x){E={};for(var ie in x)ie!=="key"&&(E[ie]=x[ie])}else E=x;return Z&&s(E,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,Z,E,n(),Q,ge)}function _(u){k(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===G&&(u._payload.status==="fulfilled"?k(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function k(u){return typeof u=="object"&&u!==null&&u.$$typeof===w}var m=A,w=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Ve=Symbol.for("react.client.reference"),ne=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ze=Object.prototype.hasOwnProperty,Ee=Array.isArray,X=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(u){return u()}};var Y,K={},v=m.react_stack_bottom_frame.bind(m,i)(),Ze=X(o(i)),Ce={};we.Fragment=N,we.jsx=function(u,x,E){var C=1e4>ne.recentlyCreatedOwnerStacks++;return p(u,x,E,!1,C?Error("react-stack-top-frame"):v,C?X(o(u)):Ze)},we.jsxs=function(u,x,E){var C=1e4>ne.recentlyCreatedOwnerStacks++;return p(u,x,E,!0,C?Error("react-stack-top-frame"):v,C?X(o(u)):Ze)}})()),we}var ht;function Zr(){return ht||(ht=1,process.env.NODE_ENV==="production"?$e.exports=zr():$e.exports=Er()),$e.exports}var y=Zr();const Cr=({onCommand:e,onSave:t,onExport:r,onClear:o,showButtons:n=!1,hasUnsavedChanges:i})=>{const[a,s]=A.useState([]),[c,d]=A.useState("p"),p=()=>{const m=[];let w="p";document.queryCommandState("bold")&&m.push("bold"),document.queryCommandState("italic")&&m.push("italic"),document.queryCommandState("underline")&&m.push("underline"),document.queryCommandState("strikeThrough")&&m.push("strikeThrough"),document.queryCommandState("insertUnorderedList")&&m.push("insertUnorderedList"),document.queryCommandState("insertOrderedList")&&m.push("insertOrderedList"),document.queryCommandState("justifyLeft")&&m.push("justifyLeft"),document.queryCommandState("justifyCenter")&&m.push("justifyCenter"),document.queryCommandState("justifyRight")&&m.push("justifyRight");const I=window.getSelection();if(I&&I.rangeCount>0){let N=I.getRangeAt(0).commonAncestorContainer;for(;N&&N.nodeType===Node.ELEMENT_NODE;){const D=N,U=D.tagName.toLowerCase();if(["h1","h2","p","div"].includes(U)){U==="h1"||U==="h2"?(w=U,m.push(`formatBlock:${U}`)):(U==="p"||U==="div"&&!w)&&(w="p");break}N=D.parentNode}}d(w),s(m)};A.useEffect(()=>{const m=()=>{p()},w=()=>{setTimeout(p,10)};return document.addEventListener("selectionchange",m),document.addEventListener("click",w),document.addEventListener("keyup",w),()=>{document.removeEventListener("selectionchange",m),document.removeEventListener("click",w),document.removeEventListener("keyup",w)}},[]);const _=()=>{const m=prompt("Enter URL:");m&&e("createLink",m)},k=[{id:"bold",command:"bold",icon:y.jsx(V.Bold,{size:18}),title:"Bold"},{id:"italic",command:"italic",icon:y.jsx(V.Italic,{size:18}),title:"Italic"},{id:"underline",command:"underline",icon:y.jsx(V.Underline,{size:18}),title:"Underline"},{id:"strikeThrough",command:"strikeThrough",icon:y.jsx(V.Strikethrough,{size:18}),title:"Strikethrough"},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:y.jsx(V.List,{size:18}),title:"Bullet List"},{id:"ordered-list",command:"insertOrderedList",icon:y.jsx(V.ListOrdered,{size:18}),title:"Numbered List"},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:y.jsx(V.Heading1,{size:18}),title:"Heading 1",isActive:c==="h1"},{id:"heading-2",command:"formatBlock",value:"h2",icon:y.jsx(V.Heading2,{size:18}),title:"Heading 2",isActive:c==="h2"},{id:"paragraph",command:"formatBlock",value:"p",icon:y.jsx(V.Type,{size:18}),title:"Paragraph",isActive:c==="p"},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:y.jsx(V.AlignLeft,{size:18}),title:"Align Left"},{id:"align-center",command:"justifyCenter",icon:y.jsx(V.AlignCenter,{size:18}),title:"Center"},{id:"align-right",command:"justifyRight",icon:y.jsx(V.AlignRight,{size:18}),title:"Align Right"},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:y.jsx(V.Link,{size:18}),title:"Insert Link",onClick:_}];return y.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[y.jsx("div",{className:"flex flex-wrap items-center gap-1",children:k.map(m=>{if("separator"in m)return y.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},m.id);const w=m.isActive!==void 0?m.isActive:a.includes(m.command);return y.jsx("button",{onClick:()=>m.onClick?m.onClick():e(m.command,m.value),title:m.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
|
|
24
|
+
${w?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:m.icon},m.id)})}),n&&y.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[y.jsxs("button",{onClick:t,disabled:!i,title:"Save Document",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",children:[y.jsx(V.Save,{size:16}),y.jsx("span",{children:"Save"})]}),y.jsxs("button",{onClick:r,title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",children:[y.jsx(V.FileDown,{size:16}),y.jsx("span",{children:"Export"})]}),y.jsxs("button",{onClick:o,title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",children:[y.jsx(V.Trash2,{size:16}),y.jsx("span",{children:"Clear"})]})]})]})},$r=({wordCount:e,characterCount:t,hasUnsavedChanges:r})=>y.jsx("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:y.jsxs("div",{className:"flex items-center gap-6",children:[y.jsxs("div",{children:["Words: ",y.jsx("strong",{className:"text-gray-800",children:e})]}),y.jsxs("div",{children:["Characters: ",y.jsx("strong",{className:"text-gray-800",children:t})]}),y.jsxs("div",{children:["Status: ",y.jsx("strong",{className:r?"text-orange-600":"text-green-600",children:r?"Unsaved Changes":"Saved"})]})]})});function l(e,t,r){function o(s,c){var d;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(d=s._zod).traits??(d.traits=new Set),s._zod.traits.add(e),t(s,c);for(const p in a.prototype)p in s||Object.defineProperty(s,p,{value:a.prototype[p].bind(s)});s._zod.constr=a,s._zod.def=c}const n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;const d=r?.Parent?new i:this;o(d,s),(c=d._zod).deferred??(c.deferred=[]);for(const p of d._zod.deferred)p();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class de extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const bt={};function ae(e){return bt}function Tr(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function We(e,t){return typeof t=="bigint"?t.toString():t}function Be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ye(e){return e==null}function Je(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ar(e,t){const r=(e.toString().split(".")[1]||"").length,o=t.toString();let n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){const c=o.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}const i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const vt=Symbol("evaluating");function T(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==vt)return o===void 0&&(o=vt,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ce(...e){const t={};for(const r of e){const o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function wt(e){return JSON.stringify(e)}const kt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Sr=Be(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ke(e){if(Te(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Te(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yt(e){return ke(e)?{...e}:Array.isArray(e)?[...e]:e}const Ir=new Set(["string","number","symbol"]);function Ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function re(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Pr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Rr(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Or(e,t){const r=e._zod.def,o=ce(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return se(this,"shape",n),n},checks:[]});return re(e,o)}function Nr(e,t){if(!ke(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const n=ce(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return se(this,"shape",i),i},checks:[]});return re(e,n)}function Lr(e,t){if(!ke(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return se(this,"shape",o),o},checks:e._zod.def.checks};return re(e,r)}function Mr(e,t){const r=ce(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return se(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return re(e,r)}function Ur(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=e?new e({type:"optional",innerType:n[a]}):n[a])}else for(const a in n)i[a]=e?new e({type:"optional",innerType:n[a]}):n[a];return se(this,"shape",i),i},checks:[]});return re(t,o)}function Dr(e,t,r){const o=ce(t._zod.def,{get shape(){const n=t._zod.def.shape,i={...n};if(r)for(const a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(const a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return se(this,"shape",i),i},checks:[]});return re(t,o)}function pe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function _t(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Se(e){return typeof e=="string"?e:e?.message}function le(e,t,r){const o={...e,path:e.path??[]};if(!e.message){const n=Se(e.inst?._zod.def?.error?.(e))??Se(t?.error?.(e))??Se(r.customError?.(e))??Se(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function He(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ye(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const xt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,We,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zt=l("$ZodError",xt),Et=l("$ZodError",xt,{Parent:Error});function Fr(e,t=r=>r.message){const r={},o=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Vr(e,t=r=>r.message){const r={_errors:[]},o=n=>{for(const i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){const c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return o(e),r}const Xe=e=>(t,r,o,n)=>{const i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new de;if(a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ke=e=>async(t,r,o,n)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(n?.Err??e)(a.issues.map(c=>le(c,i,ae())));throw kt(s,n?.callee),s}return a.value},Ie=e=>(t,r,o)=>{const n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new de;return i.issues.length?{success:!1,error:new(e??zt)(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Gr=Ie(Et),je=e=>async(t,r,o)=>{const n=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>le(a,n,ae())))}:{success:!0,data:i.value}},Wr=je(Et),Br=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,r,n)},Yr=e=>(t,r,o)=>Xe(e)(t,r,o),Jr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,r,n)},Hr=e=>async(t,r,o)=>Ke(e)(t,r,o),Xr=e=>(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ie(e)(t,r,n)},Kr=e=>(t,r,o)=>Ie(e)(t,r,o),qr=e=>async(t,r,o)=>{const n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return je(e)(t,r,n)},Qr=e=>async(t,r,o)=>je(e)(t,r,o),eo=/^[cC][^\s-]{8,}$/,to=/^[0-9a-z]+$/,ro=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oo=/^[0-9a-vA-V]{20}$/,no=/^[A-Za-z0-9]{27}$/,io=/^[a-zA-Z0-9_-]{21}$/,ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,so=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,co=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uo(){return new RegExp(lo,"u")}const po=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ho=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,go=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ct=/^[A-Za-z0-9_-]*$/,bo=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,vo=/^\+(?:[0-9]){6,14}[0-9]$/,$t="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",wo=new RegExp(`^${$t}$`);function Tt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ko(e){return new RegExp(`^${Tt(e)}$`)}function yo(e){const t=Tt({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${$t}T(?:${o})$`)}const _o=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xo=/^-?\d+$/,zo=/^-?\d+(?:\.\d+)?/,Eo=/^(?:true|false)$/i,Zo=/^[^A-Z]*$/,Co=/^[^a-z]*$/,W=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),At={number:"number",bigint:"bigint",object:"date"},St=l("$ZodCheckLessThan",(e,t)=>{W.init(e,t);const r=At[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),It=l("$ZodCheckGreaterThan",(e,t)=>{W.init(e,t);const r=At[typeof t.value];e._zod.onattach.push(o=>{const n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$o=l("$ZodCheckMultipleOf",(e,t)=>{W.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ar(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),To=l("$ZodCheckNumberFormat",(e,t)=>{W.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Pr[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=xo)}),e._zod.check=a=>{const s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),Ao=l("$ZodCheckMaxLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const n=o.value;if(n.length<=t.maximum)return;const a=He(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),So=l("$ZodCheckMinLength",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const n=o.value;if(n.length>=t.minimum)return;const a=He(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Io=l("$ZodCheckLengthEquals",(e,t)=>{var r;W.init(e,t),(r=e._zod.def).when??(r.when=o=>{const n=o.value;return!Ye(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{const n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{const n=o.value,i=n.length;if(i===t.length)return;const a=He(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Pe=l("$ZodCheckStringFormat",(e,t)=>{var r,o;W.init(e,t),e._zod.onattach.push(n=>{const i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),jo=l("$ZodCheckRegex",(e,t)=>{Pe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Po=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zo),Pe.init(e,t)}),Ro=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Co),Pe.init(e,t)}),Oo=l("$ZodCheckIncludes",(e,t)=>{W.init(e,t);const r=Ae(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{const i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),No=l("$ZodCheckStartsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`^${Ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lo=l("$ZodCheckEndsWith",(e,t)=>{W.init(e,t);const r=new RegExp(`.*${Ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),Mo=l("$ZodCheckOverwrite",(e,t)=>{W.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Uo{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
|
|
25
|
+
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
26
|
+
`))}}const Do={major:4,minor:1,patch:12},P=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Do;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const n of o)for(const i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(a,s,c)=>{let d=pe(a),p;for(const _ of s){if(_._zod.def.when){if(!_._zod.def.when(a))continue}else if(d)continue;const k=a.issues.length,m=_._zod.check(a);if(m instanceof Promise&&c?.async===!1)throw new de;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,a.issues.length!==k&&(d||(d=pe(a,k)))});else{if(a.issues.length===k)continue;d||(d=pe(a,k))}}return p?p.then(()=>a):a},i=(a,s,c)=>{if(pe(a))return a.aborted=!0,a;const d=n(s,o,c);if(d instanceof Promise){if(c.async===!1)throw new de;return d.then(p=>e._zod.parse(p,c))}return e._zod.parse(d,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(p=>i(p,a,s)):i(d,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new de;return c.then(d=>n(d,o,s))}return n(c,o,s)}}e["~standard"]={validate:n=>{try{const i=Gr(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Wr(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),qe=l("$ZodString",(e,t)=>{P.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_o(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),S=l("$ZodStringFormat",(e,t)=>{Pe.init(e,t),qe.init(e,t)}),Fo=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=so),S.init(e,t)}),Vo=l("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zt(o))}else t.pattern??(t.pattern=Zt());S.init(e,t)}),Go=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=co),S.init(e,t)}),Wo=l("$ZodURL",(e,t)=>{S.init(e,t),e._zod.check=r=>{try{const o=r.value.trim(),n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bo.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bo=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uo()),S.init(e,t)}),Yo=l("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=io),S.init(e,t)}),Jo=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eo),S.init(e,t)}),Ho=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=to),S.init(e,t)}),Xo=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ro),S.init(e,t)}),Ko=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oo),S.init(e,t)}),qo=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=no),S.init(e,t)}),Qo=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yo(t)),S.init(e,t)}),en=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wo),S.init(e,t)}),tn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ko(t)),S.init(e,t)}),rn=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ao),S.init(e,t)}),on=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=po),S.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv4"})}),nn=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mo),S.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),an=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fo),S.init(e,t)}),sn=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ho),S.init(e,t),e._zod.check=r=>{const o=r.value.split("/");try{if(o.length!==2)throw new Error;const[n,i]=o;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function jt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const cn=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=go),S.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{jt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ln(e){if(!Ct.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return jt(r)}const un=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ct),S.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{ln(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),dn=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vo),S.init(e,t)});function pn(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const mn=l("$ZodJWT",(e,t)=>{S.init(e,t),e._zod.check=r=>{pn(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Pt=l("$ZodNumber",(e,t)=>{P.init(e,t),e._zod.pattern=e._zod.bag.pattern??zo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),fn=l("$ZodNumber",(e,t)=>{To.init(e,t),Pt.init(e,t)}),hn=l("$ZodBoolean",(e,t)=>{P.init(e,t),e._zod.pattern=Eo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),gn=l("$ZodUnknown",(e,t)=>{P.init(e,t),e._zod.parse=r=>r}),bn=l("$ZodNever",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Rt(e,t,r){e.issues.length&&t.issues.push(..._t(r,e.issues)),t.value[r]=e.value}const vn=l("$ZodArray",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const i=[];for(let a=0;a<n.length;a++){const s=n[a],c=t.element._zod.run({value:s,issues:[]},o);c instanceof Promise?i.push(c.then(d=>Rt(d,r,a))):Rt(c,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Re(e,t,r,o){e.issues.length&&t.issues.push(..._t(r,e.issues)),e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}function Ot(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const r=jr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Nt(e,t,r,o,n,i){const a=[],s=n.keySet,c=n.catchall._zod,d=c.def.type;for(const p of Object.keys(t)){if(s.has(p))continue;if(d==="never"){a.push(p);continue}const _=c.run({value:t[p],issues:[]},o);_ instanceof Promise?e.push(_.then(k=>Re(k,r,p,t))):Re(_,r,p,t)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}const wn=l("$ZodObject",(e,t)=>{if(P.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const o=Be(()=>Ot(t));T(e._zod,"propValues",()=>{const s=t.shape,c={};for(const d in s){const p=s[d]._zod;if(p.values){c[d]??(c[d]=new Set);for(const _ of p.values)c[d].add(_)}}return c});const n=Te,i=t.catchall;let a;e._zod.parse=(s,c)=>{a??(a=o.value);const d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};const p=[],_=a.shape;for(const k of a.keys){const w=_[k]._zod.run({value:d[k],issues:[]},c);w instanceof Promise?p.push(w.then(I=>Re(I,s,k,d))):Re(w,s,k,d)}return i?Nt(p,d,s,c,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),kn=l("$ZodObjectJIT",(e,t)=>{wn.init(e,t);const r=e._zod.parse,o=Be(()=>Ot(t)),n=k=>{const m=new Uo(["shape","payload","ctx"]),w=o.value,I=M=>{const R=wt(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};m.write("const input = payload.value;");const N=Object.create(null);let D=0;for(const M of w.keys)N[M]=`key_${D++}`;m.write("const newResult = {};");for(const M of w.keys){const R=N[M],F=wt(M);m.write(`const ${R} = ${I(M)};`),m.write(`
|
|
27
|
+
if (${R}.issues.length) {
|
|
28
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
28
29
|
...iss,
|
|
29
|
-
path: iss.path ? [${
|
|
30
|
+
path: iss.path ? [${F}, ...iss.path] : [${F}]
|
|
30
31
|
})));
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
if (${
|
|
35
|
-
if (${
|
|
36
|
-
newResult[${
|
|
35
|
+
if (${R}.value === undefined) {
|
|
36
|
+
if (${F} in input) {
|
|
37
|
+
newResult[${F}] = undefined;
|
|
37
38
|
}
|
|
38
39
|
} else {
|
|
39
|
-
newResult[${
|
|
40
|
+
newResult[${F}] = ${R}.value;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
`)}v.write("payload.value = newResult;"),v.write("return payload;");const k=v.compile();return(E,z)=>k(m,E,z)};let i;const a=ie,s=!Be.jitless,l=s&&nr.value,f=t.catchall;let h;e._zod.parse=(m,v)=>{h??(h=n.value);const C=m.value;return a(C)?s&&l&&v?.async===!1&&v.jitless!==!0?(i||(i=o(t.shape)),m=i(m,v),f?dt([],C,m,v,h,e):m):r(m,v):(m.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),m)}});function ft(e,t,r,n){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!G(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>H(a,n,W())))}),t)}const Yn=c("$ZodUnion",(e,t)=>{T.init(e,t),w(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),w(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),w(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),w(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>ye(i.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(r)return n(o,i);let a=!1;const s=[];for(const d of t.options){const l=d._zod.run({value:o.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}return a?Promise.all(s).then(d=>ft(d,o,e,i)):ft(s,o,e,i)}}),Hn=c("$ZodIntersection",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([d,l])=>ht(r,d,l)):ht(r,i,a)}});function Ze(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ee(e)&&ee(t)){const r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};for(const i of n){const a=Ze(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],i=t[n],a=Ze(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ht(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),G(e))return e;const n=Ze(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const Jn=c("$ZodEnum",(e,t)=>{T.init(e,t);const r=tr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>or.has(typeof o)).map(o=>typeof o=="string"?ae(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),Gn=c("$ZodTransform",(e,t)=>{T.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new We(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new J;return r.value=o,r}});function pt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const qn=c("$ZodOptional",(e,t)=>{T.init(e,t),e._zod.optin="optional",e._zod.optout="optional",w(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),w(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ye(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>pt(i,r.value)):pt(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Xn=c("$ZodNullable",(e,t)=>{T.init(e,t),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),w(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${ye(r.source)}|null)$`):void 0}),w(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Kn=c("$ZodDefault",(e,t)=>{T.init(e,t),e._zod.optin="optional",w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>mt(i,t)):mt(o,t)}});function mt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Qn=c("$ZodPrefault",(e,t)=>{T.init(e,t),e._zod.optin="optional",w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),eo=c("$ZodNonOptional",(e,t)=>{T.init(e,t),w(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>gt(i,e)):gt(o,e)}});function gt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const to=c("$ZodCatch",(e,t)=>{T.init(e,t),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),w(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>H(a,n,W()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>H(i,n,W()))},input:r.value}),r.issues=[]),r)}}),ro=c("$ZodPipe",(e,t)=>{T.init(e,t),w(e._zod,"values",()=>t.in._zod.values),w(e._zod,"optin",()=>t.in._zod.optin),w(e._zod,"optout",()=>t.out._zod.optout),w(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>fe(a,t.in,n)):fe(i,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>fe(i,t.out,n)):fe(o,t.out,n)}});function fe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const no=c("$ZodReadonly",(e,t)=>{T.init(e,t),w(e._zod,"propValues",()=>t.innerType._zod.propValues),w(e._zod,"values",()=>t.innerType._zod.values),w(e._zod,"optin",()=>t.innerType._zod.optin),w(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(vt):vt(o)}});function vt(e){return e.value=Object.freeze(e.value),e}const oo=c("$ZodCustom",(e,t)=>{N.init(e,t),T.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>bt(i,r,n,e));bt(o,r,n,e)}});function bt(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(te(o))}}class io{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ao(){return new io}const he=ao();function so(e,t){return new e({type:"string",...p(t)})}function co(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...p(t)})}function _t(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...p(t)})}function uo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...p(t)})}function lo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...p(t)})}function fo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...p(t)})}function ho(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...p(t)})}function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...p(t)})}function mo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...p(t)})}function go(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...p(t)})}function vo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...p(t)})}function bo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...p(t)})}function _o(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...p(t)})}function wo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...p(t)})}function ko(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...p(t)})}function yo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...p(t)})}function xo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...p(t)})}function zo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...p(t)})}function $o(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...p(t)})}function Eo(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...p(t)})}function Zo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...p(t)})}function So(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...p(t)})}function To(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...p(t)})}function Co(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...p(t)})}function jo(e,t){return new e({type:"string",format:"date",check:"string_format",...p(t)})}function Io(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...p(t)})}function Ao(e,t){return new e({type:"string",format:"duration",check:"string_format",...p(t)})}function Oo(e,t){return new e({type:"number",checks:[],...p(t)})}function Po(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...p(t)})}function No(e,t){return new e({type:"boolean",...p(t)})}function Ro(e){return new e({type:"unknown"})}function Do(e,t){return new e({type:"never",...p(t)})}function wt(e,t){return new it({check:"less_than",...p(t),value:e,inclusive:!1})}function Se(e,t){return new it({check:"less_than",...p(t),value:e,inclusive:!0})}function kt(e,t){return new at({check:"greater_than",...p(t),value:e,inclusive:!1})}function Te(e,t){return new at({check:"greater_than",...p(t),value:e,inclusive:!0})}function yt(e,t){return new Qr({check:"multiple_of",...p(t),value:e})}function xt(e,t){return new tn({check:"max_length",...p(t),maximum:e})}function pe(e,t){return new rn({check:"min_length",...p(t),minimum:e})}function zt(e,t){return new nn({check:"length_equals",...p(t),length:e})}function Uo(e,t){return new on({check:"string_format",format:"regex",...p(t),pattern:e})}function Fo(e){return new an({check:"string_format",format:"lowercase",...p(e)})}function Lo(e){return new sn({check:"string_format",format:"uppercase",...p(e)})}function Mo(e,t){return new cn({check:"string_format",format:"includes",...p(t),includes:e})}function Vo(e,t){return new un({check:"string_format",format:"starts_with",...p(t),prefix:e})}function Wo(e,t){return new ln({check:"string_format",format:"ends_with",...p(t),suffix:e})}function re(e){return new dn({check:"overwrite",tx:e})}function Bo(e){return re(t=>t.normalize(e))}function Yo(){return re(e=>e.trim())}function Ho(){return re(e=>e.toLowerCase())}function Jo(){return re(e=>e.toUpperCase())}function Go(e,t,r){return new e({type:"array",element:t,...p(r)})}function qo(e,t,r){return new e({type:"custom",check:"custom",fn:t,...p(r)})}function Xo(e){const t=Ko(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(te(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(te(o))}},e(r.value,r)));return t}function Ko(e,t){const r=new N({check:"custom",...p(t)});return r._zod.check=e,r}const Qo=c("ZodISODateTime",(e,t)=>{$n.init(e,t),$.init(e,t)});function ei(e){return Co(Qo,e)}const ti=c("ZodISODate",(e,t)=>{En.init(e,t),$.init(e,t)});function ri(e){return jo(ti,e)}const ni=c("ZodISOTime",(e,t)=>{Zn.init(e,t),$.init(e,t)});function oi(e){return Io(ni,e)}const ii=c("ZodISODuration",(e,t)=>{Sn.init(e,t),$.init(e,t)});function ai(e){return Ao(ii,e)}const R=c("ZodError",(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>mr(e,r)},flatten:{value:r=>pr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,_e,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,_e,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),si=ze(R),ci=$e(R),ui=ce(R),li=ue(R),di=br(R),fi=_r(R),hi=wr(R),pi=kr(R),mi=yr(R),gi=xr(R),vi=zr(R),bi=$r(R),j=c("ZodType",(e,t)=>(T.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Y(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>M(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>si(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ui(e,r,n),e.parseAsync=async(r,n)=>ci(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>li(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>di(e,r,n),e.decode=(r,n)=>fi(e,r,n),e.encodeAsync=async(r,n)=>hi(e,r,n),e.decodeAsync=async(r,n)=>pi(e,r,n),e.safeEncode=(r,n)=>mi(e,r,n),e.safeDecode=(r,n)=>gi(e,r,n),e.safeEncodeAsync=async(r,n)=>vi(e,r,n),e.safeDecodeAsync=async(r,n)=>bi(e,r,n),e.refine=(r,n)=>e.check(ua(r,n)),e.superRefine=r=>e.check(la(r)),e.overwrite=r=>e.check(re(r)),e.optional=()=>At(e),e.nullable=()=>Ot(e),e.nullish=()=>At(Ot(e)),e.nonoptional=r=>ra(e,r),e.array=()=>Vi(e),e.or=r=>Yi([e,r]),e.and=r=>Ji(e,r),e.transform=r=>Nt(e,qi(r)),e.default=r=>Qi(e,r),e.prefault=r=>ta(e,r),e.catch=r=>oa(e,r),e.pipe=r=>Nt(e,r),e.readonly=()=>sa(e),e.describe=r=>{const n=e.clone();return he.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return he.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return he.get(e);const n=e.clone();return he.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),$t=c("_ZodString",(e,t)=>{Ee.init(e,t),j.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Uo(...n)),e.includes=(...n)=>e.check(Mo(...n)),e.startsWith=(...n)=>e.check(Vo(...n)),e.endsWith=(...n)=>e.check(Wo(...n)),e.min=(...n)=>e.check(pe(...n)),e.max=(...n)=>e.check(xt(...n)),e.length=(...n)=>e.check(zt(...n)),e.nonempty=(...n)=>e.check(pe(1,...n)),e.lowercase=n=>e.check(Fo(n)),e.uppercase=n=>e.check(Lo(n)),e.trim=()=>e.check(Yo()),e.normalize=(...n)=>e.check(Bo(...n)),e.toLowerCase=()=>e.check(Ho()),e.toUpperCase=()=>e.check(Jo())}),_i=c("ZodString",(e,t)=>{Ee.init(e,t),$t.init(e,t),e.email=r=>e.check(co(wi,r)),e.url=r=>e.check(po(ki,r)),e.jwt=r=>e.check(To(Ni,r)),e.emoji=r=>e.check(mo(yi,r)),e.guid=r=>e.check(_t(Et,r)),e.uuid=r=>e.check(uo(ge,r)),e.uuidv4=r=>e.check(lo(ge,r)),e.uuidv6=r=>e.check(fo(ge,r)),e.uuidv7=r=>e.check(ho(ge,r)),e.nanoid=r=>e.check(go(xi,r)),e.guid=r=>e.check(_t(Et,r)),e.cuid=r=>e.check(vo(zi,r)),e.cuid2=r=>e.check(bo($i,r)),e.ulid=r=>e.check(_o(Ei,r)),e.base64=r=>e.check(Eo(Ai,r)),e.base64url=r=>e.check(Zo(Oi,r)),e.xid=r=>e.check(wo(Zi,r)),e.ksuid=r=>e.check(ko(Si,r)),e.ipv4=r=>e.check(yo(Ti,r)),e.ipv6=r=>e.check(xo(Ci,r)),e.cidrv4=r=>e.check(zo(ji,r)),e.cidrv6=r=>e.check($o(Ii,r)),e.e164=r=>e.check(So(Pi,r)),e.datetime=r=>e.check(ei(r)),e.date=r=>e.check(ri(r)),e.time=r=>e.check(oi(r)),e.duration=r=>e.check(ai(r))});function me(e){return so(_i,e)}const $=c("ZodStringFormat",(e,t)=>{x.init(e,t),$t.init(e,t)}),wi=c("ZodEmail",(e,t)=>{gn.init(e,t),$.init(e,t)}),Et=c("ZodGUID",(e,t)=>{pn.init(e,t),$.init(e,t)}),ge=c("ZodUUID",(e,t)=>{mn.init(e,t),$.init(e,t)}),ki=c("ZodURL",(e,t)=>{vn.init(e,t),$.init(e,t)}),yi=c("ZodEmoji",(e,t)=>{bn.init(e,t),$.init(e,t)}),xi=c("ZodNanoID",(e,t)=>{_n.init(e,t),$.init(e,t)}),zi=c("ZodCUID",(e,t)=>{wn.init(e,t),$.init(e,t)}),$i=c("ZodCUID2",(e,t)=>{kn.init(e,t),$.init(e,t)}),Ei=c("ZodULID",(e,t)=>{yn.init(e,t),$.init(e,t)}),Zi=c("ZodXID",(e,t)=>{xn.init(e,t),$.init(e,t)}),Si=c("ZodKSUID",(e,t)=>{zn.init(e,t),$.init(e,t)}),Ti=c("ZodIPv4",(e,t)=>{Tn.init(e,t),$.init(e,t)}),Ci=c("ZodIPv6",(e,t)=>{Cn.init(e,t),$.init(e,t)}),ji=c("ZodCIDRv4",(e,t)=>{jn.init(e,t),$.init(e,t)}),Ii=c("ZodCIDRv6",(e,t)=>{In.init(e,t),$.init(e,t)}),Ai=c("ZodBase64",(e,t)=>{An.init(e,t),$.init(e,t)}),Oi=c("ZodBase64URL",(e,t)=>{Pn.init(e,t),$.init(e,t)}),Pi=c("ZodE164",(e,t)=>{Nn.init(e,t),$.init(e,t)}),Ni=c("ZodJWT",(e,t)=>{Dn.init(e,t),$.init(e,t)}),Zt=c("ZodNumber",(e,t)=>{ct.init(e,t),j.init(e,t),e.gt=(n,o)=>e.check(kt(n,o)),e.gte=(n,o)=>e.check(Te(n,o)),e.min=(n,o)=>e.check(Te(n,o)),e.lt=(n,o)=>e.check(wt(n,o)),e.lte=(n,o)=>e.check(Se(n,o)),e.max=(n,o)=>e.check(Se(n,o)),e.int=n=>e.check(Tt(n)),e.safe=n=>e.check(Tt(n)),e.positive=n=>e.check(kt(0,n)),e.nonnegative=n=>e.check(Te(0,n)),e.negative=n=>e.check(wt(0,n)),e.nonpositive=n=>e.check(Se(0,n)),e.multipleOf=(n,o)=>e.check(yt(n,o)),e.step=(n,o)=>e.check(yt(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function St(e){return Oo(Zt,e)}const Ri=c("ZodNumberFormat",(e,t)=>{Un.init(e,t),Zt.init(e,t)});function Tt(e){return Po(Ri,e)}const Di=c("ZodBoolean",(e,t)=>{Fn.init(e,t),j.init(e,t)});function Ct(e){return No(Di,e)}const Ui=c("ZodUnknown",(e,t)=>{Ln.init(e,t),j.init(e,t)});function jt(){return Ro(Ui)}const Fi=c("ZodNever",(e,t)=>{Mn.init(e,t),j.init(e,t)});function Li(e){return Do(Fi,e)}const Mi=c("ZodArray",(e,t)=>{Vn.init(e,t),j.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(pe(r,n)),e.nonempty=r=>e.check(pe(1,r)),e.max=(r,n)=>e.check(xt(r,n)),e.length=(r,n)=>e.check(zt(r,n)),e.unwrap=()=>e.element});function Vi(e,t){return Go(Mi,e,t)}const Wi=c("ZodObject",(e,t)=>{Bn.init(e,t),j.init(e,t),w(e,"shape",()=>t.shape),e.keyof=()=>Ie(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:jt()}),e.loose=()=>e.clone({...e._zod.def,catchall:jt()}),e.strict=()=>e.clone({...e._zod.def,catchall:Li()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ur(e,r),e.safeExtend=r=>lr(e,r),e.merge=r=>dr(e,r),e.pick=r=>sr(e,r),e.omit=r=>cr(e,r),e.partial=(...r)=>fr(It,e,r[0]),e.required=(...r)=>hr(Pt,e,r[0])});function Ce(e,t){const r={type:"object",shape:e??{},...p(t)};return new Wi(r)}const Bi=c("ZodUnion",(e,t)=>{Yn.init(e,t),j.init(e,t),e.options=t.options});function Yi(e,t){return new Bi({type:"union",options:e,...p(t)})}const Hi=c("ZodIntersection",(e,t)=>{Hn.init(e,t),j.init(e,t)});function Ji(e,t){return new Hi({type:"intersection",left:e,right:t})}const je=c("ZodEnum",(e,t)=>{Jn.init(e,t),j.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const i={};for(const a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...p(o),entries:i})},e.exclude=(n,o)=>{const i={...t.entries};for(const a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new je({...t,checks:[],...p(o),entries:i})}});function Ie(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new je({type:"enum",entries:r,...p(t)})}const Gi=c("ZodTransform",(e,t)=>{Gn.init(e,t),j.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new We(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(te(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(te(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function qi(e){return new Gi({type:"transform",transform:e})}const It=c("ZodOptional",(e,t)=>{qn.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function At(e){return new It({type:"optional",innerType:e})}const Xi=c("ZodNullable",(e,t)=>{Xn.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ot(e){return new Xi({type:"nullable",innerType:e})}const Ki=c("ZodDefault",(e,t)=>{Kn.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qi(e,t){return new Ki({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ge(t)}})}const ea=c("ZodPrefault",(e,t)=>{Qn.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ta(e,t){return new ea({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ge(t)}})}const Pt=c("ZodNonOptional",(e,t)=>{eo.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ra(e,t){return new Pt({type:"nonoptional",innerType:e,...p(t)})}const na=c("ZodCatch",(e,t)=>{to.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oa(e,t){return new na({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ia=c("ZodPipe",(e,t)=>{ro.init(e,t),j.init(e,t),e.in=t.in,e.out=t.out});function Nt(e,t){return new ia({type:"pipe",in:e,out:t})}const aa=c("ZodReadonly",(e,t)=>{no.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sa(e){return new aa({type:"readonly",innerType:e})}const ca=c("ZodCustom",(e,t)=>{oo.init(e,t),j.init(e,t)});function ua(e,t={}){return qo(ca,e,t)}function la(e){return Xo(e)}const Rt=Ce({title:me().min(1,"Title is required").max(200,"Title too long"),content:me().min(1,"Content is required"),format:Ie(["html","markdown"]).default("html"),metadata:Ce({createdAt:me().datetime(),updatedAt:me().datetime(),wordCount:St().min(0),characterCount:St().min(0)}).optional()});Ce({includeStyles:Ct().default(!0),includeMeta:Ct().default(!0),format:Ie(["html","txt"]).default("html")});const Dt={content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1,activeFormats:[]},da=e=>({wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length}),Ut=Kt()(er((e,t)=>({...Dt,updateContent:r=>{const n=da(r);e({content:r,...n,hasUnsavedChanges:!0})},updateTitle:r=>{e({title:r,hasUnsavedChanges:!0})},setActiveFormats:r=>{e({activeFormats:r})},clearEditor:()=>{e({...Dt,content:"",title:"Untitled Document"})},setHasUnsavedChanges:r=>{e({hasUnsavedChanges:r})},executeCommand:(r,n)=>{document.execCommand(r,!1,n);const o=document.querySelector('[contenteditable="true"]');o&&o.focus(),setTimeout(()=>{t().updateActiveFormats()},10)},updateActiveFormats:()=>{const r=["bold","italic","underline","strikeThrough","justifyLeft","justifyCenter","justifyRight"],n=[];r.forEach(o=>{document.queryCommandState(o)&&n.push(o)}),e({activeFormats:n})},getValidationResult:()=>{const r=t();try{return{success:!0,data:Rt.parse({title:r.title,content:r.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:r.wordCount,characterCount:r.characterCount}})}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Validation failed"}}},exportToHTML:(r={includeStyles:!0,includeMeta:!0})=>{const o=t().getValidationResult();if(!o.success)throw new Error(o.error);const{data:i}=o;let a=`<!DOCTYPE html>
|
|
43
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");const U=m.compile();return(M,R)=>U(k,M,R)};let i;const a=Te,s=!bt.jitless,d=s&&Sr.value,p=t.catchall;let _;e._zod.parse=(k,m)=>{_??(_=o.value);const w=k.value;return a(w)?s&&d&&m?.async===!1&&m.jitless!==!0?(i||(i=n(t.shape)),k=i(k,m),p?Nt([],w,k,m,_,e):k):r(k,m):(k.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),k)}});function Lt(e,t,r,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const n=e.filter(i=>!pe(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>le(a,o,ae())))}),t)}const yn=l("$ZodUnion",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),T(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),T(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),T(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Je(i.source)).join("|")})$`)}});const r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let a=!1;const s=[];for(const c of t.options){const d=c._zod.run({value:n.value,issues:[]},i);if(d instanceof Promise)s.push(d),a=!0;else{if(d.issues.length===0)return d;s.push(d)}}return a?Promise.all(s).then(c=>Lt(c,n,e,i)):Lt(s,n,e,i)}}),_n=l("$ZodIntersection",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{const n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,d])=>Mt(r,c,d)):Mt(r,i,a)}});function Qe(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ke(e)&&ke(t)){const r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(const i of o){const a=Qe(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const n=e[o],i=t[o],a=Qe(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Mt(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),pe(e))return e;const o=Qe(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const xn=l("$ZodEnum",(e,t)=>{P.init(e,t);const r=Tr(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ir.has(typeof n)).map(n=>typeof n=="string"?Ae(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),zn=l("$ZodTransform",(e,t)=>{P.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);const n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new de;return r.value=n,r}});function Ut(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const En=l("$ZodOptional",(e,t)=>{P.init(e,t),e._zod.optin="optional",e._zod.optout="optional",T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ut(i,r.value)):Ut(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Zn=l("$ZodNullable",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)}|null)$`):void 0}),T(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Cn=l("$ZodDefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Dt(i,t)):Dt(n,t)}});function Dt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $n=l("$ZodPrefault",(e,t)=>{P.init(e,t),e._zod.optin="optional",T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),Tn=l("$ZodNonOptional",(e,t)=>{P.init(e,t),T(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Ft(i,e)):Ft(n,e)}});function Ft(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const An=l("$ZodCatch",(e,t)=>{P.init(e,t),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),T(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>le(a,o,ae()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>le(i,o,ae()))},input:r.value}),r.issues=[]),r)}}),Sn=l("$ZodPipe",(e,t)=>{P.init(e,t),T(e._zod,"values",()=>t.in._zod.values),T(e._zod,"optin",()=>t.in._zod.optin),T(e._zod,"optout",()=>t.out._zod.optout),T(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Oe(a,t.in,o)):Oe(i,t.in,o)}const n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Oe(i,t.out,o)):Oe(n,t.out,o)}});function Oe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const In=l("$ZodReadonly",(e,t)=>{P.init(e,t),T(e._zod,"propValues",()=>t.innerType._zod.propValues),T(e._zod,"values",()=>t.innerType._zod.values),T(e._zod,"optin",()=>t.innerType._zod.optin),T(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);const n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Vt):Vt(n)}});function Vt(e){return e.value=Object.freeze(e.value),e}const jn=l("$ZodCustom",(e,t)=>{W.init(e,t),P.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Gt(i,r,o,e));Gt(n,r,o,e)}});function Gt(e,t,r,o){if(!e){const n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(ye(n))}}class Pn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const o=r[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};delete o.id;const n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Rn(){return new Pn}const Ne=Rn();function On(e,t){return new e({type:"string",...g(t)})}function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Wt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Ln(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Mn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Un(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Dn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Fn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Vn(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Gn(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Wn(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Bn(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Yn(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Jn(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Hn(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Xn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Kn(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function qn(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Qn(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function ii(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function ai(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function si(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function ci(e,t){return new e({type:"number",checks:[],...g(t)})}function li(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function ui(e,t){return new e({type:"boolean",...g(t)})}function di(e){return new e({type:"unknown"})}function pi(e,t){return new e({type:"never",...g(t)})}function Bt(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!1})}function et(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!0})}function Yt(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!1})}function tt(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!0})}function Jt(e,t){return new $o({check:"multiple_of",...g(t),value:e})}function Ht(e,t){return new Ao({check:"max_length",...g(t),maximum:e})}function Le(e,t){return new So({check:"min_length",...g(t),minimum:e})}function Xt(e,t){return new Io({check:"length_equals",...g(t),length:e})}function mi(e,t){return new jo({check:"string_format",format:"regex",...g(t),pattern:e})}function fi(e){return new Po({check:"string_format",format:"lowercase",...g(e)})}function hi(e){return new Ro({check:"string_format",format:"uppercase",...g(e)})}function gi(e,t){return new Oo({check:"string_format",format:"includes",...g(t),includes:e})}function bi(e,t){return new No({check:"string_format",format:"starts_with",...g(t),prefix:e})}function vi(e,t){return new Lo({check:"string_format",format:"ends_with",...g(t),suffix:e})}function _e(e){return new Mo({check:"overwrite",tx:e})}function wi(e){return _e(t=>t.normalize(e))}function ki(){return _e(e=>e.trim())}function yi(){return _e(e=>e.toLowerCase())}function _i(){return _e(e=>e.toUpperCase())}function xi(e,t,r){return new e({type:"array",element:t,...g(r)})}function zi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function Ei(e){const t=Zi(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(ye(o,r.value,t._zod.def));else{const n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(ye(n))}},e(r.value,r)));return t}function Zi(e,t){const r=new W({check:"custom",...g(t)});return r._zod.check=e,r}const Ci=l("ZodISODateTime",(e,t)=>{Qo.init(e,t),j.init(e,t)});function $i(e){return ni(Ci,e)}const Ti=l("ZodISODate",(e,t)=>{en.init(e,t),j.init(e,t)});function Ai(e){return ii(Ti,e)}const Si=l("ZodISOTime",(e,t)=>{tn.init(e,t),j.init(e,t)});function Ii(e){return ai(Si,e)}const ji=l("ZodISODuration",(e,t)=>{rn.init(e,t),j.init(e,t)});function Pi(e){return si(ji,e)}const B=l("ZodError",(e,t)=>{zt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Vr(e,r)},flatten:{value:r=>Fr(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,We,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,We,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ri=Xe(B),Oi=Ke(B),Ni=Ie(B),Li=je(B),Mi=Br(B),Ui=Yr(B),Di=Jr(B),Fi=Hr(B),Vi=Xr(B),Gi=Kr(B),Wi=qr(B),Bi=Qr(B),O=l("ZodType",(e,t)=>(P.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ce(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(r,o)=>re(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ri(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Ni(e,r,o),e.parseAsync=async(r,o)=>Oi(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Li(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Mi(e,r,o),e.decode=(r,o)=>Ui(e,r,o),e.encodeAsync=async(r,o)=>Di(e,r,o),e.decodeAsync=async(r,o)=>Fi(e,r,o),e.safeEncode=(r,o)=>Vi(e,r,o),e.safeDecode=(r,o)=>Gi(e,r,o),e.safeEncodeAsync=async(r,o)=>Wi(e,r,o),e.safeDecodeAsync=async(r,o)=>Bi(e,r,o),e.refine=(r,o)=>e.check(Na(r,o)),e.superRefine=r=>e.check(La(r)),e.overwrite=r=>e.check(_e(r)),e.optional=()=>ir(e),e.nullable=()=>ar(e),e.nullish=()=>ir(ar(e)),e.nonoptional=r=>Aa(e,r),e.array=()=>ba(e),e.or=r=>ka([e,r]),e.and=r=>_a(e,r),e.transform=r=>cr(e,za(r)),e.default=r=>Ca(e,r),e.prefault=r=>Ta(e,r),e.catch=r=>Ia(e,r),e.pipe=r=>cr(e,r),e.readonly=()=>Ra(e),e.describe=r=>{const o=e.clone();return Ne.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ne.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ne.get(e);const o=e.clone();return Ne.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Kt=l("_ZodString",(e,t)=>{qe.init(e,t),O.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(mi(...o)),e.includes=(...o)=>e.check(gi(...o)),e.startsWith=(...o)=>e.check(bi(...o)),e.endsWith=(...o)=>e.check(vi(...o)),e.min=(...o)=>e.check(Le(...o)),e.max=(...o)=>e.check(Ht(...o)),e.length=(...o)=>e.check(Xt(...o)),e.nonempty=(...o)=>e.check(Le(1,...o)),e.lowercase=o=>e.check(fi(o)),e.uppercase=o=>e.check(hi(o)),e.trim=()=>e.check(ki()),e.normalize=(...o)=>e.check(wi(...o)),e.toLowerCase=()=>e.check(yi()),e.toUpperCase=()=>e.check(_i())}),Yi=l("ZodString",(e,t)=>{qe.init(e,t),Kt.init(e,t),e.email=r=>e.check(Nn(Ji,r)),e.url=r=>e.check(Fn(Hi,r)),e.jwt=r=>e.check(oi(ua,r)),e.emoji=r=>e.check(Vn(Xi,r)),e.guid=r=>e.check(Wt(qt,r)),e.uuid=r=>e.check(Ln(Ue,r)),e.uuidv4=r=>e.check(Mn(Ue,r)),e.uuidv6=r=>e.check(Un(Ue,r)),e.uuidv7=r=>e.check(Dn(Ue,r)),e.nanoid=r=>e.check(Gn(Ki,r)),e.guid=r=>e.check(Wt(qt,r)),e.cuid=r=>e.check(Wn(qi,r)),e.cuid2=r=>e.check(Bn(Qi,r)),e.ulid=r=>e.check(Yn(ea,r)),e.base64=r=>e.check(ei(sa,r)),e.base64url=r=>e.check(ti(ca,r)),e.xid=r=>e.check(Jn(ta,r)),e.ksuid=r=>e.check(Hn(ra,r)),e.ipv4=r=>e.check(Xn(oa,r)),e.ipv6=r=>e.check(Kn(na,r)),e.cidrv4=r=>e.check(qn(ia,r)),e.cidrv6=r=>e.check(Qn(aa,r)),e.e164=r=>e.check(ri(la,r)),e.datetime=r=>e.check($i(r)),e.date=r=>e.check(Ai(r)),e.time=r=>e.check(Ii(r)),e.duration=r=>e.check(Pi(r))});function Me(e){return On(Yi,e)}const j=l("ZodStringFormat",(e,t)=>{S.init(e,t),Kt.init(e,t)}),Ji=l("ZodEmail",(e,t)=>{Go.init(e,t),j.init(e,t)}),qt=l("ZodGUID",(e,t)=>{Fo.init(e,t),j.init(e,t)}),Ue=l("ZodUUID",(e,t)=>{Vo.init(e,t),j.init(e,t)}),Hi=l("ZodURL",(e,t)=>{Wo.init(e,t),j.init(e,t)}),Xi=l("ZodEmoji",(e,t)=>{Bo.init(e,t),j.init(e,t)}),Ki=l("ZodNanoID",(e,t)=>{Yo.init(e,t),j.init(e,t)}),qi=l("ZodCUID",(e,t)=>{Jo.init(e,t),j.init(e,t)}),Qi=l("ZodCUID2",(e,t)=>{Ho.init(e,t),j.init(e,t)}),ea=l("ZodULID",(e,t)=>{Xo.init(e,t),j.init(e,t)}),ta=l("ZodXID",(e,t)=>{Ko.init(e,t),j.init(e,t)}),ra=l("ZodKSUID",(e,t)=>{qo.init(e,t),j.init(e,t)}),oa=l("ZodIPv4",(e,t)=>{on.init(e,t),j.init(e,t)}),na=l("ZodIPv6",(e,t)=>{nn.init(e,t),j.init(e,t)}),ia=l("ZodCIDRv4",(e,t)=>{an.init(e,t),j.init(e,t)}),aa=l("ZodCIDRv6",(e,t)=>{sn.init(e,t),j.init(e,t)}),sa=l("ZodBase64",(e,t)=>{cn.init(e,t),j.init(e,t)}),ca=l("ZodBase64URL",(e,t)=>{un.init(e,t),j.init(e,t)}),la=l("ZodE164",(e,t)=>{dn.init(e,t),j.init(e,t)}),ua=l("ZodJWT",(e,t)=>{mn.init(e,t),j.init(e,t)}),Qt=l("ZodNumber",(e,t)=>{Pt.init(e,t),O.init(e,t),e.gt=(o,n)=>e.check(Yt(o,n)),e.gte=(o,n)=>e.check(tt(o,n)),e.min=(o,n)=>e.check(tt(o,n)),e.lt=(o,n)=>e.check(Bt(o,n)),e.lte=(o,n)=>e.check(et(o,n)),e.max=(o,n)=>e.check(et(o,n)),e.int=o=>e.check(tr(o)),e.safe=o=>e.check(tr(o)),e.positive=o=>e.check(Yt(0,o)),e.nonnegative=o=>e.check(tt(0,o)),e.negative=o=>e.check(Bt(0,o)),e.nonpositive=o=>e.check(et(0,o)),e.multipleOf=(o,n)=>e.check(Jt(o,n)),e.step=(o,n)=>e.check(Jt(o,n)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function er(e){return ci(Qt,e)}const da=l("ZodNumberFormat",(e,t)=>{fn.init(e,t),Qt.init(e,t)});function tr(e){return li(da,e)}const pa=l("ZodBoolean",(e,t)=>{hn.init(e,t),O.init(e,t)});function rr(e){return ui(pa,e)}const ma=l("ZodUnknown",(e,t)=>{gn.init(e,t),O.init(e,t)});function or(){return di(ma)}const fa=l("ZodNever",(e,t)=>{bn.init(e,t),O.init(e,t)});function ha(e){return pi(fa,e)}const ga=l("ZodArray",(e,t)=>{vn.init(e,t),O.init(e,t),e.element=t.element,e.min=(r,o)=>e.check(Le(r,o)),e.nonempty=r=>e.check(Le(1,r)),e.max=(r,o)=>e.check(Ht(r,o)),e.length=(r,o)=>e.check(Xt(r,o)),e.unwrap=()=>e.element});function ba(e,t){return xi(ga,e,t)}const va=l("ZodObject",(e,t)=>{kn.init(e,t),O.init(e,t),T(e,"shape",()=>t.shape),e.keyof=()=>nt(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:or()}),e.loose=()=>e.clone({...e._zod.def,catchall:or()}),e.strict=()=>e.clone({...e._zod.def,catchall:ha()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Nr(e,r),e.safeExtend=r=>Lr(e,r),e.merge=r=>Mr(e,r),e.pick=r=>Rr(e,r),e.omit=r=>Or(e,r),e.partial=(...r)=>Ur(nr,e,r[0]),e.required=(...r)=>Dr(sr,e,r[0])});function rt(e,t){const r={type:"object",shape:e??{},...g(t)};return new va(r)}const wa=l("ZodUnion",(e,t)=>{yn.init(e,t),O.init(e,t),e.options=t.options});function ka(e,t){return new wa({type:"union",options:e,...g(t)})}const ya=l("ZodIntersection",(e,t)=>{_n.init(e,t),O.init(e,t)});function _a(e,t){return new ya({type:"intersection",left:e,right:t})}const ot=l("ZodEnum",(e,t)=>{xn.init(e,t),O.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{const i={};for(const a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...g(n),entries:i})},e.exclude=(o,n)=>{const i={...t.entries};for(const a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ot({...t,checks:[],...g(n),entries:i})}});function nt(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ot({type:"enum",entries:r,...g(t)})}const xa=l("ZodTransform",(e,t)=>{zn.init(e,t),O.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new gt(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(ye(i,r.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ye(a))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function za(e){return new xa({type:"transform",transform:e})}const nr=l("ZodOptional",(e,t)=>{En.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new nr({type:"optional",innerType:e})}const Ea=l("ZodNullable",(e,t)=>{Zn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ar(e){return new Ea({type:"nullable",innerType:e})}const Za=l("ZodDefault",(e,t)=>{Cn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ca(e,t){return new Za({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const $a=l("ZodPrefault",(e,t)=>{$n.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ta(e,t){return new $a({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():yt(t)}})}const sr=l("ZodNonOptional",(e,t)=>{Tn.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Aa(e,t){return new sr({type:"nonoptional",innerType:e,...g(t)})}const Sa=l("ZodCatch",(e,t)=>{An.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ia(e,t){return new Sa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ja=l("ZodPipe",(e,t)=>{Sn.init(e,t),O.init(e,t),e.in=t.in,e.out=t.out});function cr(e,t){return new ja({type:"pipe",in:e,out:t})}const Pa=l("ZodReadonly",(e,t)=>{In.init(e,t),O.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ra(e){return new Pa({type:"readonly",innerType:e})}const Oa=l("ZodCustom",(e,t)=>{jn.init(e,t),O.init(e,t)});function Na(e,t={}){return zi(Oa,e,t)}function La(e){return Ei(e)}const Ma=rt({title:Me().min(1,"Title is required").max(200,"Title too long"),content:Me().min(1,"Content is required"),format:nt(["html","markdown"]).default("html"),metadata:rt({createdAt:Me().datetime(),updatedAt:Me().datetime(),wordCount:er().min(0),characterCount:er().min(0)}).optional()});rt({includeStyles:rr().default(!0),includeMeta:rr().default(!0),format:nt(["html","txt"]).default("html")});const Ua=(e="")=>{const[t,r]=A.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),o=A.useRef(null);A.useEffect(()=>{o.current&&e!==t.content&&(o.current.innerHTML=e,r(p=>({...p,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length})))},[e]);const n=A.useCallback(p=>{const _=p.trim()?p.trim().split(/\s+/).length:0,k=p.length;r(m=>({...m,content:p,wordCount:_,characterCount:k,hasUnsavedChanges:!0}))},[]),i=A.useCallback(p=>{r(_=>({..._,title:p,hasUnsavedChanges:!0}))},[]),a=A.useCallback((p,_)=>{document.execCommand(p,!1,_),o.current?.focus()},[]),s=A.useCallback(()=>{try{return{success:!0,data:Ma.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(p){return{success:!1,error:p instanceof Error?p.message:"Validation failed"}}},[t]),c=A.useCallback((p={includeStyles:!0,includeMeta:!0})=>{const _=s();if(!_.success)throw new Error(_.error);const{data:k}=_;let m=`<!DOCTYPE html>
|
|
43
44
|
<html>
|
|
44
45
|
<head>
|
|
45
46
|
<meta charset="UTF-8">
|
|
46
47
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
47
|
-
<title>${
|
|
48
|
+
<title>${k?.title}</title>`;return p.includeStyles&&(m+=`
|
|
48
49
|
<style>
|
|
49
50
|
body {
|
|
50
51
|
font-family: Arial, sans-serif;
|
|
@@ -58,52 +59,18 @@ React keys must be passed directly to JSX without using spread:
|
|
|
58
59
|
border-radius: 8px;
|
|
59
60
|
background: white;
|
|
60
61
|
}
|
|
61
|
-
</style>`),
|
|
62
|
+
</style>`),m+=`
|
|
62
63
|
</head>
|
|
63
|
-
<body>`,
|
|
64
|
+
<body>`,p.includeMeta&&(m+=`
|
|
64
65
|
<div class="document-meta">
|
|
65
|
-
<h1>${
|
|
66
|
-
<p><small>Created: ${new Date(
|
|
67
|
-
Words: ${
|
|
68
|
-
Characters: ${
|
|
66
|
+
<h1>${k?.title}</h1>
|
|
67
|
+
<p><small>Created: ${new Date(k?.metadata.createdAt??"").toLocaleString()} |
|
|
68
|
+
Words: ${k?.metadata.wordCount} |
|
|
69
|
+
Characters: ${k?.metadata.characterCount}</small></p>
|
|
69
70
|
<hr>
|
|
70
|
-
</div>`),
|
|
71
|
+
</div>`),m+=`
|
|
71
72
|
<div class="editor-content">
|
|
72
|
-
${
|
|
73
|
+
${k?.content}
|
|
73
74
|
</div>
|
|
74
75
|
</body>
|
|
75
|
-
</html>`,a}}),{name:"editor-storage",partialize:e=>({content:e.content,title:e.title,wordCount:e.wordCount,characterCount:e.characterCount})})),fa=({onSave:e,onExport:t,onClear:r,showButtons:n=!1})=>{const{activeFormats:o,hasUnsavedChanges:i,executeCommand:a,updateActiveFormats:s}=Ut();y.useEffect(()=>{const h=()=>{s()};return document.addEventListener("selectionchange",h),()=>document.removeEventListener("selectionchange",h)},[s]);const d=()=>{const h=prompt("Enter URL:");h&&a("createLink",h)},l=h=>{a("formatBlock",h)},f=[{id:"bold",command:"bold",icon:g.jsx(O.Bold,{size:18}),title:"Bold",onClick:()=>a("bold")},{id:"italic",command:"italic",icon:g.jsx(O.Italic,{size:18}),title:"Italic",onClick:()=>a("italic")},{id:"underline",command:"underline",icon:g.jsx(O.Underline,{size:18}),title:"Underline",onClick:()=>a("underline")},{id:"strikeThrough",command:"strikeThrough",icon:g.jsx(O.Strikethrough,{size:18}),title:"Strikethrough",onClick:()=>a("strikeThrough")},{id:"separator-1",separator:!0},{id:"unordered-list",command:"insertUnorderedList",icon:g.jsx(O.List,{size:18}),title:"Bullet List",onClick:()=>a("insertUnorderedList")},{id:"ordered-list",command:"insertOrderedList",icon:g.jsx(O.ListOrdered,{size:18}),title:"Numbered List",onClick:()=>a("insertOrderedList")},{id:"separator-2",separator:!0},{id:"heading-1",command:"formatBlock",value:"h1",icon:g.jsx(O.Heading1,{size:18}),title:"Heading 1",onClick:()=>l("<h1>")},{id:"heading-2",command:"formatBlock",value:"h2",icon:g.jsx(O.Heading2,{size:18}),title:"Heading 2",onClick:()=>l("<h2>")},{id:"paragraph",command:"formatBlock",value:"p",icon:g.jsx(O.Type,{size:18}),title:"Paragraph",onClick:()=>l("<p>")},{id:"separator-3",separator:!0},{id:"align-left",command:"justifyLeft",icon:g.jsx(O.AlignLeft,{size:18}),title:"Align Left",onClick:()=>a("justifyLeft")},{id:"align-center",command:"justifyCenter",icon:g.jsx(O.AlignCenter,{size:18}),title:"Center",onClick:()=>a("justifyCenter")},{id:"align-right",command:"justifyRight",icon:g.jsx(O.AlignRight,{size:18}),title:"Align Right",onClick:()=>a("justifyRight")},{id:"separator-4",separator:!0},{id:"link",command:"createLink",icon:g.jsx(O.Link,{size:18}),title:"Insert Link",onClick:d}];return g.jsxs("div",{className:"flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200",children:[g.jsx("div",{className:"flex flex-wrap items-center gap-1",children:f.map(h=>{if("separator"in h)return g.jsx("div",{className:"w-px h-6 bg-gray-300 mx-2"},h.id);const m=o.includes(h.command);return g.jsx("button",{onClick:h.onClick,title:h.title,type:"button",className:`w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
|
|
76
|
-
${m?"bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200":"bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,children:h.icon},h.id)})}),n&&g.jsxs("div",{className:"flex items-center gap-2 mt-2 sm:mt-0",children:[g.jsxs("button",{onClick:e,disabled:!i,title:"Save Document",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",children:[g.jsx(O.Save,{size:16}),g.jsx("span",{children:"Save"})]}),g.jsxs("button",{onClick:t,title:"Export as HTML",className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",children:[g.jsx(O.FileDown,{size:16}),g.jsx("span",{children:"Export"})]}),g.jsxs("button",{onClick:r,title:"Clear Editor",className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",children:[g.jsx(O.Trash2,{size:16}),g.jsx("span",{children:"Clear"})]})]})]})},ha=({wordCount:e,characterCount:t,hasUnsavedChanges:r})=>g.jsx("div",{className:"flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600",children:g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsxs("div",{children:["Words: ",g.jsx("strong",{className:"text-gray-800",children:e})]}),g.jsxs("div",{children:["Characters: ",g.jsx("strong",{className:"text-gray-800",children:t})]}),g.jsxs("div",{children:["Status: ",g.jsx("strong",{className:r?"text-orange-600":"text-green-600",children:r?"Unsaved Changes":"Saved"})]})]})}),pa=({initialContent:e="",onSave:t,onExport:r,onChange:n,showButtons:o=!1,showSaveTitle:i=!1,showStatusBar:a=!1})=>{const s=y.useRef(null),[d,l]=y.useState(!1),{content:f,title:h,wordCount:m,characterCount:v,hasUnsavedChanges:C,updateContent:_,updateTitle:P,getValidationResult:U,exportToHTML:k,clearEditor:E,setHasUnsavedChanges:z}=Ut();y.useEffect(()=>{s.current&&e&&e!==f&&(s.current.innerHTML=e,_(e),z(!1))},[e,f,_,z]);const D=y.useCallback(Z=>{if(_(Z),z(!0),n){const L=k();n(Z,L)}},[_,z,n,k]),Ae=y.useCallback(Z=>{if(P(Z),z(!0),n){const L=k();n(f,L,Z)}},[P,z,n,k,f]),Oe=()=>{if(U().success){const L=k();t?.(f,L),z(!1)}else l(!0),setTimeout(()=>l(!1),3e3)},Pe=()=>{try{const Z=k();r?.(Z);const L=new Blob([Z],{type:"text/html"}),q=URL.createObjectURL(L),V=document.createElement("a");V.href=q,V.download=`${h.replace(/\s+/g,"_")}.html`,document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(q)}catch(Z){alert("Export failed: "+(Z instanceof Error?Z.message:"Unknown error"))}},ne=()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&(E(),s.current&&(s.current.innerHTML=""),n&&n("",""))};return g.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden",children:[i&&g.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50 rounded-t-xl",children:[g.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 placeholder-gray-500 outline-none border-none focus:ring-0",value:h,onChange:Z=>Ae(Z.target.value),placeholder:"Document Title"}),d&&g.jsx("div",{className:"mt-2 px-3 py-2 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm animate-pulse",children:"Please add content before saving"})]}),g.jsx(fa,{onSave:Oe,onExport:Pe,onClear:ne,showButtons:o}),g.jsx("div",{ref:s,className:`min-h-[500px] p-8 prose max-w-none border-none outline-none resize-none text-gray-700 leading-relaxed bg-white focus:bg-gray-50 transition-colors duration-200 ${i?"rounded-t-xl":""} ${o?"border-t-0":""}`,contentEditable:!0,onInput:Z=>D(Z.currentTarget.innerHTML),onFocus:Z=>Z.currentTarget.classList.add("bg-gray-50"),onBlur:Z=>Z.currentTarget.classList.remove("bg-gray-50")}),a&&g.jsx(ha,{wordCount:m,characterCount:v,hasUnsavedChanges:C})]})},ma=(e="")=>{const[t,r]=y.useState({content:e,title:"Untitled Document",wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length,hasUnsavedChanges:!1}),n=y.useRef(null);y.useEffect(()=>{n.current&&e!==t.content&&(n.current.innerHTML=e,r(f=>({...f,content:e,wordCount:e.trim()?e.trim().split(/\s+/).length:0,characterCount:e.length})))},[e]);const o=y.useCallback(f=>{const h=f.trim()?f.trim().split(/\s+/).length:0,m=f.length;r(v=>({...v,content:f,wordCount:h,characterCount:m,hasUnsavedChanges:!0}))},[]),i=y.useCallback(f=>{r(h=>({...h,title:f,hasUnsavedChanges:!0}))},[]),a=y.useCallback((f,h)=>{document.execCommand(f,!1,h),n.current?.focus()},[]),s=y.useCallback(()=>{try{return{success:!0,data:Rt.parse({title:t.title,content:t.content,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),wordCount:t.wordCount,characterCount:t.characterCount}})}}catch(f){return{success:!1,error:f instanceof Error?f.message:"Validation failed"}}},[t]),d=y.useCallback((f={includeStyles:!0,includeMeta:!0})=>{const h=s();if(!h.success)throw new Error(h.error);const{data:m}=h;let v=`<!DOCTYPE html>
|
|
77
|
-
<html>
|
|
78
|
-
<head>
|
|
79
|
-
<meta charset="UTF-8">
|
|
80
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
81
|
-
<title>${m?.title}</title>`;return f.includeStyles&&(v+=`
|
|
82
|
-
<style>
|
|
83
|
-
body {
|
|
84
|
-
font-family: Arial, sans-serif;
|
|
85
|
-
line-height: 1.6;
|
|
86
|
-
margin: 40px;
|
|
87
|
-
max-width: 800px;
|
|
88
|
-
}
|
|
89
|
-
.editor-content {
|
|
90
|
-
border: 1px solid #ddd;
|
|
91
|
-
padding: 20px;
|
|
92
|
-
border-radius: 8px;
|
|
93
|
-
background: white;
|
|
94
|
-
}
|
|
95
|
-
</style>`),v+=`
|
|
96
|
-
</head>
|
|
97
|
-
<body>`,f.includeMeta&&(v+=`
|
|
98
|
-
<div class="document-meta">
|
|
99
|
-
<h1>${m?.title}</h1>
|
|
100
|
-
<p><small>Created: ${new Date(m?.metadata.createdAt??"").toLocaleString()} |
|
|
101
|
-
Words: ${m?.metadata.wordCount} |
|
|
102
|
-
Characters: ${m?.metadata.characterCount}</small></p>
|
|
103
|
-
<hr>
|
|
104
|
-
</div>`),v+=`
|
|
105
|
-
<div class="editor-content">
|
|
106
|
-
${m?.content}
|
|
107
|
-
</div>
|
|
108
|
-
</body>
|
|
109
|
-
</html>`,v},[s]),l=y.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),n.current&&(n.current.innerHTML="")},[]);return{editorState:t,editorRef:n,updateContent:o,updateTitle:i,executeCommand:a,getValidationResult:s,exportToHTML:d,clearEditor:l}};F.TextEditor=pa,F.useTextEditor=ma,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}));
|
|
76
|
+
</html>`,m},[s]),d=A.useCallback(()=>{r({content:"",title:"Untitled Document",wordCount:0,characterCount:0,hasUnsavedChanges:!1}),o.current&&(o.current.innerHTML="")},[]);return{editorState:t,editorRef:o,updateContent:n,updateTitle:i,executeCommand:a,getValidationResult:s,exportToHTML:c,clearEditor:d}};function lr(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=lr(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Da(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=lr(e))&&(o&&(o+=" "),o+=t);return o}const it="-",Fa=e=>{const t=Ga(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(it);return s[0]===""&&s.length!==1&&s.shift(),ur(s,t)||Va(a)},getConflictingClassGroupIds:(a,s)=>{const c=r[a]||[];return s&&o[a]?[...c,...o[a]]:c}}},ur=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),n=o?ur(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;const i=e.join(it);return t.validators.find(({validator:a})=>a(i))?.classGroupId},dr=/^\[(.+)\]$/,Va=e=>{if(dr.test(e)){const t=dr.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ga=e=>{const{theme:t,classGroups:r}=e,o={nextPart:new Map,validators:[]};for(const n in r)at(r[n],o,n,t);return o},at=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){const i=n===""?t:pr(t,n);i.classGroupId=r;return}if(typeof n=="function"){if(Wa(n)){at(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([i,a])=>{at(a,pr(t,i),r,o)})})},pr=(e,t)=>{let r=e;return t.split(it).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},Wa=e=>e.isThemeGetter,Ba=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const n=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,o=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return n(i,a),a},set(i,a){r.has(i)?r.set(i,a):n(i,a)}}},st="!",ct=":",Ya=ct.length,Ja=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=n=>{const i=[];let a=0,s=0,c=0,d;for(let w=0;w<n.length;w++){let I=n[w];if(a===0&&s===0){if(I===ct){i.push(n.slice(c,w)),c=w+Ya;continue}if(I==="/"){d=w;continue}}I==="["?a++:I==="]"?a--:I==="("?s++:I===")"&&s--}const p=i.length===0?n:n.substring(c),_=Ha(p),k=_!==p,m=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:k,baseClassName:_,maybePostfixModifierPosition:m}};if(t){const n=t+ct,i=o;o=a=>a.startsWith(n)?i(a.substring(n.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(r){const n=o;o=i=>r({className:i,parseClassName:n})}return o},Ha=e=>e.endsWith(st)?e.substring(0,e.length-1):e.startsWith(st)?e.substring(1):e,Xa=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const n=[];let i=[];return o.forEach(a=>{a[0]==="["||t[a]?(n.push(...i.sort(),a),i=[]):i.push(a)}),n.push(...i.sort()),n}},Ka=e=>({cache:Ba(e.cacheSize),parseClassName:Ja(e),sortModifiers:Xa(e),...Fa(e)}),qa=/\s+/,Qa=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:i}=t,a=[],s=e.trim().split(qa);let c="";for(let d=s.length-1;d>=0;d-=1){const p=s[d],{isExternal:_,modifiers:k,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:I}=r(p);if(_){c=p+(c.length>0?" "+c:c);continue}let N=!!I,D=o(N?w.substring(0,I):w);if(!D){if(!N){c=p+(c.length>0?" "+c:c);continue}if(D=o(w),!D){c=p+(c.length>0?" "+c:c);continue}N=!1}const U=i(k).join(":"),M=m?U+st:U,R=M+D;if(a.includes(R))continue;a.push(R);const F=n(D,N);for(let J=0;J<F.length;++J){const $=F[J];a.push(M+$)}c=p+(c.length>0?" "+c:c)}return c};function es(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=mr(t))&&(o&&(o+=" "),o+=r);return o}const mr=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=mr(e[o]))&&(r&&(r+=" "),r+=t);return r};function ts(e,...t){let r,o,n,i=a;function a(c){const d=t.reduce((p,_)=>_(p),e());return r=Ka(d),o=r.cache.get,n=r.cache.set,i=s,s(c)}function s(c){const d=o(c);if(d)return d;const p=Qa(c,r);return n(c,p),p}return function(){return i(es.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},fr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rs=/^\d+\/\d+$/,os=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ns=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,is=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,as=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ss=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>rs.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),oe=e=>!!e&&Number.isInteger(Number(e)),lt=e=>e.endsWith("%")&&z(e.slice(0,-1)),q=e=>os.test(e),cs=()=>!0,ls=e=>ns.test(e)&&!is.test(e),gr=()=>!1,us=e=>as.test(e),ds=e=>ss.test(e),ps=e=>!f(e)&&!h(e),ms=e=>fe(e,yr,gr),f=e=>fr.test(e),ue=e=>fe(e,_r,ls),ut=e=>fe(e,vs,z),br=e=>fe(e,wr,gr),fs=e=>fe(e,kr,ds),De=e=>fe(e,xr,us),h=e=>hr.test(e),xe=e=>he(e,_r),hs=e=>he(e,ws),vr=e=>he(e,wr),gs=e=>he(e,yr),bs=e=>he(e,kr),Fe=e=>he(e,xr,!0),fe=(e,t,r)=>{const o=fr.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},he=(e,t,r=!1)=>{const o=hr.exec(e);return o?o[1]?t(o[1]):r:!1},wr=e=>e==="position"||e==="percentage",kr=e=>e==="image"||e==="url",yr=e=>e==="length"||e==="size"||e==="bg-size",_r=e=>e==="length",vs=e=>e==="number",ws=e=>e==="family-name",xr=e=>e==="shadow",ks=ts(()=>{const e=L("color"),t=L("font"),r=L("text"),o=L("font-weight"),n=L("tracking"),i=L("leading"),a=L("breakpoint"),s=L("container"),c=L("spacing"),d=L("radius"),p=L("shadow"),_=L("inset-shadow"),k=L("text-shadow"),m=L("drop-shadow"),w=L("blur"),I=L("perspective"),N=L("aspect"),D=L("ease"),U=L("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...R(),h,f],J=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],b=()=>[h,f,c],G=()=>[me,"full","auto",...b()],H=()=>[oe,"none","subgrid",h,f],Ve=()=>["auto",{span:["full",oe,h,f]},oe,h,f],ne=()=>[oe,"auto",h,f],ze=()=>["auto","min","max","fr",h,f],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...b()],K=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],v=()=>[e,h,f],Ze=()=>[...R(),vr,br,{position:[h,f]}],Ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],u=()=>["auto","cover","contain",gs,ms,{size:[h,f]}],x=()=>[lt,xe,ue],E=()=>["","none","full",d,h,f],C=()=>["",z,xe,ue],Q=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[z,lt,vr,br],ee=()=>["","none",w,h,f],ie=()=>["none",z,h,f],be=()=>["none",z,h,f],dt=()=>[z,h,f],Ge=()=>[me,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[q],breakpoint:[q],color:[cs],container:[q],"drop-shadow":[q],ease:["in","out","in-out"],font:[ps],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[q],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[q],shadow:[q],spacing:["px",z],text:[q],"text-shadow":[q],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,f,h,N]}],container:["container"],columns:[{columns:[z,f,h,s]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[oe,"auto",h,f]}],basis:[{basis:[me,"full","auto",s,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[z,me,"auto","initial","none",f]}],grow:[{grow:["",z,h,f]}],shrink:[{shrink:["",z,h,f]}],order:[{order:[oe,"first","last","none",h,f]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:Ve()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:Ve()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ze()}],"auto-rows":[{"auto-rows":ze()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[s,"screen",...K()]}],"min-w":[{"min-w":[s,"screen","none",...K()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",r,xe,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,h,ut]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lt,f]}],"font-family":[{font:[hs,f,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,h,f]}],"line-clamp":[{"line-clamp":[z,"none",h,ut]}],leading:[{leading:[i,...b()]}],"list-image":[{"list-image":["none",h,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",h,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[z,"from-font","auto",h,ue]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[z,"auto",h,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:Ce()}],"bg-size":[{bg:u()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oe,h,f],radial:["",h,f],conic:[oe,h,f]},bs,fs]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:x()}],"gradient-via-pos":[{via:x()}],"gradient-to-pos":[{to:x()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:E()}],"rounded-s":[{"rounded-s":E()}],"rounded-e":[{"rounded-e":E()}],"rounded-t":[{"rounded-t":E()}],"rounded-r":[{"rounded-r":E()}],"rounded-b":[{"rounded-b":E()}],"rounded-l":[{"rounded-l":E()}],"rounded-ss":[{"rounded-ss":E()}],"rounded-se":[{"rounded-se":E()}],"rounded-ee":[{"rounded-ee":E()}],"rounded-es":[{"rounded-es":E()}],"rounded-tl":[{"rounded-tl":E()}],"rounded-tr":[{"rounded-tr":E()}],"rounded-br":[{"rounded-br":E()}],"rounded-bl":[{"rounded-bl":E()}],"border-w":[{border:C()}],"border-w-x":[{"border-x":C()}],"border-w-y":[{"border-y":C()}],"border-w-s":[{"border-s":C()}],"border-w-e":[{"border-e":C()}],"border-w-t":[{"border-t":C()}],"border-w-r":[{"border-r":C()}],"border-w-b":[{"border-b":C()}],"border-w-l":[{"border-l":C()}],"divide-x":[{"divide-x":C()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":C()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[z,h,f]}],"outline-w":[{outline:["",z,xe,ue]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",p,Fe,De]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",_,Fe,De]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[z,ue]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":C()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",k,Fe,De]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[z,h,f]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[h,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:Ce()}],"mask-size":[{mask:u()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",h,f]}],filter:[{filter:["","none",h,f]}],blur:[{blur:ee()}],brightness:[{brightness:[z,h,f]}],contrast:[{contrast:[z,h,f]}],"drop-shadow":[{"drop-shadow":["","none",m,Fe,De]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",z,h,f]}],"hue-rotate":[{"hue-rotate":[z,h,f]}],invert:[{invert:["",z,h,f]}],saturate:[{saturate:[z,h,f]}],sepia:[{sepia:["",z,h,f]}],"backdrop-filter":[{"backdrop-filter":["","none",h,f]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[z,h,f]}],"backdrop-contrast":[{"backdrop-contrast":[z,h,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",z,h,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,h,f]}],"backdrop-invert":[{"backdrop-invert":["",z,h,f]}],"backdrop-opacity":[{"backdrop-opacity":[z,h,f]}],"backdrop-saturate":[{"backdrop-saturate":[z,h,f]}],"backdrop-sepia":[{"backdrop-sepia":["",z,h,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",h,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[z,"initial",h,f]}],ease:[{ease:["linear","initial",D,h,f]}],delay:[{delay:[z,h,f]}],animate:[{animate:["none",U,h,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,h,f]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:dt()}],"skew-x":[{"skew-x":dt()}],"skew-y":[{"skew-y":dt()}],transform:[{transform:[h,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h,f]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[z,xe,ue,ut]}],stroke:[{stroke:["none",...v()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ys(...e){return ks(Da(e))}const _s=({initialContent:e="",onSave:t,onExport:r,onChange:o,showButtons:n=!1,showSaveTitle:i=!1,showStatusBar:a=!1,height:s="500px"})=>{const{editorState:c,editorRef:d,updateContent:p,updateTitle:_,executeCommand:k,getValidationResult:m,exportToHTML:w,clearEditor:I}=Ua(e),[N,D]=A.useState(!1);A.useEffect(()=>{if(o)try{const $=w({includeStyles:!1,includeMeta:!1});o(c.content,$,c.title)}catch{const b=`<!DOCTYPE html><html><body>${c.content}</body></html>`;o(c.content,b,c.title)}},[c.content,c.title,o,w]);const U=A.useCallback(()=>{if(m().success){const b=w();t?.(c.content,b)}else D(!0),setTimeout(()=>D(!1),3e3)},[c.content,m,w,t]),M=A.useCallback(()=>{try{const $=w();r?.($);const b=new Blob([$],{type:"text/html"}),G=URL.createObjectURL(b),H=document.createElement("a");H.href=G,H.download=`${c.title.replace(/\s+/g,"_")||"document"}.html`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(G)}catch($){alert("Export failed: "+($ instanceof Error?$.message:"Unknown error"))}},[w,c.title,r]),R=A.useCallback(()=>{confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.")&&I()},[I]),F=A.useCallback($=>{p($)},[p]),J=A.useCallback($=>{_($)},[_]);return y.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden",children:[i&&y.jsxs("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:[y.jsx("input",{type:"text",className:"w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",value:c.title,onChange:$=>J($.target.value),placeholder:"Document Title"}),N&&y.jsx("div",{className:"text-red-600 text-sm mt-2 animate-fadeIn",children:"Please add content before saving"})]}),y.jsx(Cr,{onCommand:k,onSave:U,onExport:M,showButtons:n,onClear:R,hasUnsavedChanges:c.hasUnsavedChanges}),y.jsx("div",{ref:d,className:ys("editor-content p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",s||"min-h-[500px]"),contentEditable:!0,onInput:$=>F($.currentTarget.innerHTML),onBlur:$=>F($.currentTarget.innerHTML),suppressContentEditableWarning:!0}),a&&y.jsx($r,{wordCount:c.wordCount,characterCount:c.characterCount,hasUnsavedChanges:c.hasUnsavedChanges})]})};te.TextEditor=_s,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));
|