@maily-to/core 0.0.2 → 0.0.3

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- "use strict";var at=Object.create;var I=Object.defineProperty,it=Object.defineProperties,mt=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,dt=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var ie=(t,e,o)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,y=(t,e)=>{for(var o in e||(e={}))Y.call(e,o)&&ie(t,o,e[o]);if(O)for(var o of O(e))me.call(e,o)&&ie(t,o,e[o]);return t},A=(t,e)=>it(t,ct(e));var P=(t,e)=>{var o={};for(var r in t)Y.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&O)for(var r of O(t))e.indexOf(r)<0&&me.call(t,r)&&(o[r]=t[r]);return o};var yt=(t,e)=>{for(var o in e)I(t,o,{get:e[o],enumerable:!0})},ce=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of pt(e))!Y.call(t,s)&&s!==o&&I(t,s,{get:()=>e[s],enumerable:!(r=mt(e,s))||r.enumerable});return t};var u=(t,e,o)=>(o=t!=null?at(dt(t)):{},ce(e||!t||!t.__esModule?I(o,"default",{value:t,enumerable:!0}):o,t)),gt=t=>ce(I({},"__esModule",{value:!0}),t);var Mt={};yt(Mt,{Editor:()=>Nt});module.exports=gt(Mt);function T(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}T(`.mail-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mail-editor .mly-prose h1,.mail-editor .mly-prose h2,.mail-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mail-editor .mly-prose h1{font-size:36px}.mail-editor .mly-prose h2{font-size:30px}.mail-editor .mly-prose h3{font-size:24px}.mail-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mail-editor .mly-prose h1+p,.mail-editor .mly-prose h2+p,.mail-editor .mly-prose h3+p,.mail-editor .mly-prose hr+p{margin-top:0}.mail-editor .mly-prose ol,.mail-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mail-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mail-editor .mly-prose li>p{margin:0}.mail-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mail-editor .mly-prose blockquote{margin-block:26px}.mail-editor .mly-prose hr{margin-block:32px}.mail-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mail-editor .mly-prose .spacer+*{margin-top:0}.mail-editor .mly-prose p+.spacer{margin-top:-20px}.mail-editor .mly-prose h1+.spacer,.mail-editor .mly-prose h2+.spacer,.mail-editor .mly-prose h3+.spacer{margin-top:-12px}.mail-editor .mly-prose ol+.spacer,.mail-editor .mly-prose ul+.spacer{margin-top:-20px}.mail-editor .mly-prose img+.spacer{margin-top:-32px}.mail-editor .mly-prose .node-button+.spacer,.mail-editor .mly-prose footer+.spacer{margin-top:-20px}.mail-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}
3
- `);T(`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
4
- `);T('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-border{border-width:1px}.mly-border-t{border-top-width:1px}.mly-border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\\!mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var J=require("@tiptap/react");var F=require("@tiptap/react"),w=require("lucide-react");var pe=require("@tiptap/core"),de=u(require("@tiptap/extension-image"));var ye=["sm","md","lg"],U=["left","center","right"],ge="left",ue="sm";function ut(t){let e={sm:"40px",md:"48px",lg:"64px"};return`height:${e[t]||e[ue]}`}function ht(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[ge]}var he=de.default.extend({name:"logo",priority:1e3,addAttributes(){var t;return A(y({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:ue,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:ge,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,s=["position:relative","margin-top:0",ut(o),...ht(r)];return t.style=s.join(";"),["img",(0,pe.mergeAttributes)(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var be=u(require("react")),xe=require("@radix-ui/react-slot");var we=require("clsx"),fe=require("tailwind-merge");function h(...t){return(0,fe.twMerge)((0,we.clsx)(t))}var ve=require("react/jsx-runtime"),v=be.forwardRef((i,m)=>{var n=i,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,s=P(n,["className","variant","size","asChild"]);let l=r?xe.Slot:"button",p="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",f={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},b={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},x=h(`${p} ${f[e]} ${b[o]} ${t}`);return(0,ve.jsx)(l,y({className:x,ref:m},s))});v.displayName="BaseButton";var V=require("react/jsx-runtime");function R(t){return(0,V.jsx)(v,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:h("mly-px-2.5"),children:t.icon?(0,V.jsx)(t.icon,{className:h("mly-h-3.5 mly-w-3.5")}):(0,V.jsx)("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}var X=require("react/jsx-runtime");function ke(t){let{editor:e}=t,o=[w.AlignLeftIcon,w.AlignCenterIcon,w.AlignRightIcon],r=U.map((i,n)=>({name:i,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:i}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:i}).run()},icon:o[n]})),s=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:w.BoldIcon},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:w.ItalicIcon},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:w.UnderlineIcon},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:w.StrikethroughIcon},...r,{name:"link",command:()=>{let i=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",i);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:w.LinkIcon}],m=A(y({},t),{shouldShow:({editor:i,state:n,from:l,to:p})=>{let{doc:f,selection:b}=n,{empty:x}=b,k=!f.textBetween(l,p).length&&(0,F.isTextSelection)(n.selection);return!(x||k||!i.isEditable||i.isActive("image")||i.isActive("logo")||i.isActive("spacer")||i.isActive({mailyComponent:"button"}))},tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,X.jsx)(F.BubbleMenu,A(y({},m),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:s.map((i,n)=>(0,X.jsx)(R,y({},i),n))}))}var Z=require("react"),g=require("lucide-react");var D=require("react/jsx-runtime"),Ae=t=>{let{editor:e,config:o}=t,r=(0,Z.useMemo)(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:g.BoldIcon},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:g.ItalicIcon},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:g.UnderlineIcon},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:g.StrikethroughIcon},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:g.EraserIcon},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:g.SeparatorHorizontal},{name:"link",command:()=>{let m=e.getAttributes("link").href,i=window.prompt("URL",m);if(i!==null){if(i===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:g.LinkIcon},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:g.AlignLeft},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:g.AlignCenter},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:g.AlignRight}],[e]),s=(0,Z.useMemo)(()=>r.reduce((m,i)=>(m.includes(i.group)||m.push(i.group),m),[]),[r]);return e?(0,D.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:s.map((m,i)=>(0,D.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===m).map((n,l)=>(0,D.jsx)(R,y({},n),l))},i))}):null};var Ce=require("@tiptap/react"),N=require("lucide-react");var Q=require("react/jsx-runtime");function Le(t){let{editor:e}=t,o=[N.AlignLeftIcon,N.AlignCenterIcon,N.AlignRightIcon],r=U.map((n,l)=>({name:n,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:n}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:n}).run()},icon:o[l]})),s=ye.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),m=[...r,{name:"url",isActive:()=>!1,command:()=>{var k,z,H;let{editor:n}=t,l=(k=n==null?void 0:n.getAttributes("logo"))==null?void 0:k.src,p=window.prompt("Update logo URL",l);if(!p)return;let f=(z=n==null?void 0:n.getAttributes("logo"))==null?void 0:z.size,b=(H=n==null?void 0:n.getAttributes("logo"))==null?void 0:H.alignment,x=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:p,size:f,alignment:b}),n==null||n.commands.setNodeSelection((x==null?void 0:x.from)||0)},icon:N.Link},...s],i=A(y({},t),{shouldShow:({editor:n})=>!!n.isActive("logo"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,Q.jsx)(Ce.BubbleMenu,A(y({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:m.map((n,l)=>(0,Q.jsx)(R,y({},n),l))}))}var Re=require("@tiptap/react");var q=require("@tiptap/core"),ee=["sm","md","lg","xl"],wt="sm";function ft(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[wt]}`}var Be=q.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!ee.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=ft(o),["div",(0,q.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var te=require("react/jsx-runtime");function Ne(t){let{editor:e}=t,o=ee.map(s=>({name:s,isActive:()=>e==null?void 0:e.isActive("spacer",{height:s}),command:()=>{e==null||e.chain().focus().setSpacer({height:s}).run()}})),r=A(y({},t),{shouldShow:({editor:s})=>s.isActive("spacer"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,te.jsx)(Re.BubbleMenu,A(y({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((s,m)=>(0,te.jsx)(R,y({},s),m))}))}var Ye=u(require("@tiptap/starter-kit")),Xe=require("@tiptap/extension-color"),Ze=u(require("@tiptap/extension-link")),Qe=u(require("@tiptap/extension-list-item")),et=u(require("@tiptap/extension-paragraph")),tt=u(require("@tiptap/extension-placeholder")),ot=u(require("@tiptap/extension-text-align")),ae=u(require("@tiptap/extension-text-style")),rt=u(require("@tiptap/extension-heading")),nt=u(require("@tiptap/extension-image"));var Me=require("@tiptap/core"),ze=require("@tiptap/extension-horizontal-rule"),Te=ze.HorizontalRule.extend({addInputRules(){return[new Me.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,s=e.from,m=e.to;r.insert(s-1,this.type.create(o)).delete(r.mapping.map(s),r.mapping.map(m))}})]}});var G=require("@tiptap/core"),Ue=require("@tiptap/react");var Ee=require("@tiptap/react"),S=require("lucide-react"),ne=require("react-color");var Pe=u(require("react"));var Se=require("react/jsx-runtime"),$=Pe.forwardRef((s,r)=>{var m=s,{className:t,type:e}=m,o=P(m,["className","type"]);return(0,Se.jsx)("input",y({type:e,className:h("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50",t),ref:r},o))});$.displayName="Input";var Ie=u(require("react")),L=u(require("@radix-ui/react-popover"));var oe=require("react/jsx-runtime"),K=L.Root,_=L.Trigger,E=Ie.forwardRef((m,s)=>{var i=m,{className:t,align:e="center",sideOffset:o=4}=i,r=P(i,["className","align","sideOffset"]);return(0,oe.jsx)(L.Portal,{children:(0,oe.jsx)(L.Content,y({ref:s,align:e,sideOffset:o,className:h("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950",t)},r))})});E.displayName=L.Content.displayName;var a=require("react/jsx-runtime"),bt={left:S.AlignLeftIcon,center:S.AlignCenterIcon,right:S.AlignRightIcon},re={style(t){return He.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return Oe.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(bt).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function le(t){let{url:e,text:o,alignment:r,variant:s,borderRadius:m,buttonColor:i,textColor:n}=t.node.attrs;return(0,a.jsx)(Ee.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,a.jsxs)(K,{open:t.selected,children:[(0,a.jsx)(_,{asChild:!0,children:(0,a.jsx)("div",{children:(0,a.jsx)("a",{className:h("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":m==="round","!mly-rounded-md":m==="smooth","!mly-rounded-none":m==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:s==="filled"?i:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:i},children:o})})}),(0,a.jsxs)(E,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[(0,a.jsx)($,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),(0,a.jsx)($,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),(0,a.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,a.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,a.jsx)("div",{className:"mly-flex mly-gap-1",children:re.style(t).map((l,p)=>(0,a.jsx)(v,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,children:l.name},p))})]}),(0,a.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,a.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,a.jsx)("div",{className:"mly-flex mly-gap-1",children:re.cornerRadius(t).map((l,p)=>(0,a.jsx)(v,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,children:l.name},p))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,a.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:re.alignment(t).map((l,p)=>(0,a.jsx)(v,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,children:(0,a.jsx)(l.icon,{size:16})},p))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,a.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,a.jsx)(xt,{variant:s,color:i,onChange:l=>{t.updateAttributes({buttonColor:l})}}),(0,a.jsx)(vt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function xt(t){let{color:e,onChange:o,variant:r}=t;return(0,a.jsxs)(K,{children:[(0,a.jsx)(_,{asChild:!0,children:(0,a.jsx)(v,{variant:"ghost",className:"",size:"sm",children:(0,a.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),(0,a.jsx)(E,{className:"mly-w-full !mly-p-0",children:(0,a.jsx)(ne.ChromePicker,{className:"!mly-shadow-md",color:e,onChange:s=>{o(s.hex)}})})]})}function vt(t){let{color:e,onChange:o}=t;return(0,a.jsxs)(K,{children:[(0,a.jsx)(_,{asChild:!0,children:(0,a.jsx)(v,{variant:"ghost",size:"sm",children:(0,a.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,a.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,a.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),(0,a.jsx)(E,{className:"mly-w-full !mly-p-0",children:(0,a.jsx)(ne.ChromePicker,{className:"!mly-shadow-md",color:e,onChange:r=>{o(r.hex)}})})]})}var He=["filled","outline"],Oe=["sharp","smooth","round"],Ve=G.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",(0,G.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,Ue.ReactNodeViewRenderer)(le)}});var W=require("@tiptap/core"),se=W.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",(0,W.mergeAttributes)(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var M=require("react"),Fe=u(require("@tiptap/extension-mention")),De=require("@tiptap/react"),qe=u(require("tippy.js"));var j=require("react/jsx-runtime"),$e=(0,M.forwardRef)((t,e)=>{var m,i;let[o,r]=(0,M.useState)(0),s=n=>{let l=t.items[n];l&&t.command({id:l})};return(0,M.useEffect)(()=>r(0),[t.items]),(0,M.useImperativeHandle)(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(s(o),!0):!1})),(0,j.jsx)("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-1 mly-py-2 mly-shadow-md mly-transition-all",children:(m=t==null?void 0:t.items)!=null&&m.length?(i=t==null?void 0:t.items)==null?void 0:i.map((n,l)=>(0,j.jsx)(v,{variant:"secondary",onClick:()=>s(l),className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:n},l)):(0,j.jsx)(v,{variant:"secondary",className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});$e.displayName="VariableList";var kt={items:({query:t})=>[t.toLowerCase()],render:()=>{let t,e=null;return{onStart:o=>{t=new De.ReactRenderer($e,{props:o,editor:o.editor}),o.clientRect&&(e=(0,qe.default)("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(o){var r;t.updateProps(o),o.clientRect&&((r=e==null?void 0:e[0])==null||r.setProps({getReferenceClientRect:o.clientRect}))},onKeyDown(o){var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(o)},onExit(){e==null||e[0].destroy(),t.destroy()}}}},Ke=Fe.default.extend({name:"variable",parseHTML(){return[{tag:'span[data-type="variable"]'}]}}).configure({suggestion:kt,renderLabel({node:t}){var e;return`${(e=t.attrs.label)!=null?e:t.attrs.id}`},HTMLAttributes:{class:"mly-py-1 mly-px-2 mly-bg-slate-100 mly-border mly-border-blue-300 mly-rounded-md"}});var C=require("react"),_e=require("@tiptap/core"),Ge=require("@tiptap/react"),We=u(require("@tiptap/suggestion")),d=require("lucide-react"),je=u(require("tippy.js"));var c=require("react/jsx-runtime"),At=_e.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[(0,We.default)(y({editor:this.editor},this.options.suggestion))]}}),Ct=({query:t})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,c.jsx)(d.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,c.jsx)(d.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,c.jsx)(d.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,c.jsx)(d.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,c.jsx)(d.List,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,c.jsx)(d.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleOrderedList().run()}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,c.jsx)(d.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Logo URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setLogoImage({src:r}).run())}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,c.jsx)(d.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Image URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setImage({src:r}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,c.jsx)(d.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:(0,c.jsx)(d.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,c.jsx)(d.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setHardBreak().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:(0,c.jsx)(d.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,c.jsx)(d.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().selectParentNode().deleteSelection().run()}}].filter(e=>{if(typeof t=="string"&&t.length>0){let o=t.toLowerCase();return e.title.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.searchTerms&&e.searchTerms.some(r=>r.includes(o))}return!0}),Lt=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,m=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:m>o+t.scrollTop&&(t.scrollTop+=m-o-t.scrollTop+5)},Bt=({items:t,command:e,editor:o,range:r})=>{let[s,m]=(0,C.useState)(0),i=(0,C.useCallback)(l=>{let p=t[l];p&&e(p)},[e,o,t]);(0,C.useEffect)(()=>{let l=["ArrowUp","ArrowDown","Enter"],p=f=>{if(l.includes(f.key))return f.preventDefault(),f.key==="ArrowUp"?(m((s+t.length-1)%t.length),!0):f.key==="ArrowDown"?(m((s+1)%t.length),!0):f.key==="Enter"?(i(s),!0):!1};return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[t,s,m,i]),(0,C.useEffect)(()=>{m(0)},[t]);let n=(0,C.useRef)(null);return(0,C.useLayoutEffect)(()=>{let l=n==null?void 0:n.current,p=l==null?void 0:l.children[s];p&&l&&Lt(l,p)},[s]),t.length>0?(0,c.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,c.jsx)("div",{id:"slash-command",ref:n,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((l,p)=>(0,c.jsxs)("button",{className:h("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",p===s?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(p),children:[(0,c.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:l.icon}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mly-font-medium",children:l.title}),(0,c.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:l.description})]})]},p))}),(0,c.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,c.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,c.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,c.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,c.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,c.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,c.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,c.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null},Rt={items:Ct,render:()=>{let t=null,e=null;return{onStart:o=>{t=new Ge.ReactRenderer(Bt,{props:o,editor:o.editor}),e=(0,je.default)("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:o=>{t==null||t.updateProps(o),e&&e[0].setProps({getReferenceClientRect:o.clientRect})},onKeyDown:o=>{var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(o)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}}},Je=At.configure({suggestion:Rt});var lt=u(require("@tiptap/extension-underline")),st=[Ye.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},horizontalRule:!1}),nt.default,lt.default,he,Xe.Color.configure({types:[ae.default.name,Qe.default.name]}),ae.default.configure(),ot.default.configure({types:[et.default.name,rt.default.name,se.name]}),Te,tt.default.configure({placeholder:({node:t})=>t.type.name==="heading"?`Heading ${t.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),Be,se,Ke,Je,Ze.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),Ve];var B=require("react/jsx-runtime");function Nt(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:s=!0,spellCheck:m=!1,autofocus:i="end"}={},onCreate:n,onUpdate:l,extensions:p,contentHtml:f,contentJson:b}=t,x=null;b?x=(b==null?void 0:b.type)==="doc"?b:{type:"doc",content:b}:f?x=f:x={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:""}]}]};let k=(0,J.useEditor)({editorProps:{attributes:{class:h("mly-prose mly-w-full",o),spellCheck:m?"true":"false"},handleDOMEvents:{keydown:(z,H)=>{if(["ArrowUp","ArrowDown","Enter"].includes(H.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:z})=>{n==null||n(z)},onUpdate:({editor:z})=>{l==null||l(z)},extensions:[...st,...p||[]],content:x,autofocus:i});return k?(0,B.jsxs)("div",{className:h("mail-editor mly-antialiased",e),children:[s&&(0,B.jsx)(Ae,{config:t.config,editor:k}),(0,B.jsxs)("div",{className:h("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,B.jsx)(ke,{editor:k}),(0,B.jsx)(Le,{editor:k}),(0,B.jsx)(Ne,{editor:k}),(0,B.jsx)(J.EditorContent,{editor:k})]})]}):null}0&&(module.exports={Editor});
2
+ "use strict";var st=Object.create;var I=Object.defineProperty,it=Object.defineProperties,mt=Object.getOwnPropertyDescriptor,ct=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,dt=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var ie=(t,e,o)=>e in t?I(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,d=(t,e)=>{for(var o in e||(e={}))Y.call(e,o)&&ie(t,o,e[o]);if(O)for(var o of O(e))me.call(e,o)&&ie(t,o,e[o]);return t},A=(t,e)=>it(t,ct(e));var P=(t,e)=>{var o={};for(var r in t)Y.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&O)for(var r of O(t))e.indexOf(r)<0&&me.call(t,r)&&(o[r]=t[r]);return o};var yt=(t,e)=>{for(var o in e)I(t,o,{get:e[o],enumerable:!0})},ce=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of pt(e))!Y.call(t,a)&&a!==o&&I(t,a,{get:()=>e[a],enumerable:!(r=mt(e,a))||r.enumerable});return t};var u=(t,e,o)=>(o=t!=null?st(dt(t)):{},ce(e||!t||!t.__esModule?I(o,"default",{value:t,enumerable:!0}):o,t)),gt=t=>ce(I({},"__esModule",{value:!0}),t);var Tt={};yt(Tt,{Editor:()=>Nt});module.exports=gt(Tt);function z(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}z(`.mail-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mail-editor .mly-prose h1,.mail-editor .mly-prose h2,.mail-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mail-editor .mly-prose h1{font-size:36px}.mail-editor .mly-prose h2{font-size:30px}.mail-editor .mly-prose h3{font-size:24px}.mail-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mail-editor .mly-prose h1+p,.mail-editor .mly-prose h2+p,.mail-editor .mly-prose h3+p,.mail-editor .mly-prose hr+p{margin-top:0}.mail-editor .mly-prose ol,.mail-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mail-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mail-editor .mly-prose li>p{margin:0}.mail-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mail-editor .mly-prose blockquote{margin-block:26px}.mail-editor .mly-prose hr{margin-block:32px}.mail-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mail-editor .mly-prose .spacer+*{margin-top:0}.mail-editor .mly-prose p+.spacer{margin-top:-20px}.mail-editor .mly-prose h1+.spacer,.mail-editor .mly-prose h2+.spacer,.mail-editor .mly-prose h3+.spacer{margin-top:-12px}.mail-editor .mly-prose ol+.spacer,.mail-editor .mly-prose ul+.spacer{margin-top:-20px}.mail-editor .mly-prose img+.spacer{margin-top:-32px}.mail-editor .mly-prose .node-button+.spacer,.mail-editor .mly-prose footer+.spacer{margin-top:-20px}.mail-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}
3
+ `);z(`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
4
+ `);z('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-border{border-width:1px}.mly-border-t{border-top-width:1px}.mly-border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\\!mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');var J=require("@tiptap/react");var F=require("@tiptap/react"),w=require("lucide-react");var pe=require("@tiptap/core"),de=u(require("@tiptap/extension-image"));var ye=["sm","md","lg"],U=["left","center","right"],ge="left",ue="sm";function ut(t){let e={sm:"40px",md:"48px",lg:"64px"};return`height:${e[t]||e[ue]}`}function ht(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[ge]}var he=de.default.extend({name:"logo",priority:1e3,addAttributes(){var t;return A(d({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:ue,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:ge,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,a=["position:relative","margin-top:0",ut(o),...ht(r)];return t.style=a.join(";"),["img",(0,pe.mergeAttributes)(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});var be=u(require("react")),xe=require("@radix-ui/react-slot");var we=require("clsx"),fe=require("tailwind-merge");function h(...t){return(0,fe.twMerge)((0,we.clsx)(t))}var ve=require("react/jsx-runtime"),x=be.forwardRef((s,m)=>{var n=s,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,a=P(n,["className","variant","size","asChild"]);let l=r?xe.Slot:"button",y="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",v={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},f={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},b=h(`${y} ${v[e]} ${f[o]} ${t}`);return(0,ve.jsx)(l,d({className:b,ref:m},a))});x.displayName="BaseButton";var V=require("react/jsx-runtime");function R(t){return(0,V.jsx)(x,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:h("mly-px-2.5"),type:"button",children:t.icon?(0,V.jsx)(t.icon,{className:h("mly-h-3.5 mly-w-3.5")}):(0,V.jsx)("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}var X=require("react/jsx-runtime");function ke(t){let{editor:e}=t,o=[w.AlignLeftIcon,w.AlignCenterIcon,w.AlignRightIcon],r=U.map((s,n)=>({name:s,isActive:()=>e==null?void 0:e.isActive({textAlign:s}),command:()=>{var l,y,v,f;(l=t==null?void 0:t.editor)!=null&&l.isActive({textAlign:s})?(v=(y=t==null?void 0:t.editor)==null?void 0:y.chain())==null||v.focus().unsetTextAlign().run():(f=t==null?void 0:t.editor)==null||f.chain().focus().setTextAlign(s).run()},icon:o[n]})),a=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:w.BoldIcon},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:w.ItalicIcon},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:w.UnderlineIcon},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:w.StrikethroughIcon},...r,{name:"link",command:()=>{let s=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",s);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:w.LinkIcon}],m=A(d({},t),{shouldShow:({editor:s,state:n,from:l,to:y})=>{let{doc:v,selection:f}=n,{empty:b}=f,k=!v.textBetween(l,y).length&&(0,F.isTextSelection)(n.selection);return!(b||k||!s.isEditable||s.isActive("image")||s.isActive("logo")||s.isActive("spacer")||s.isActive({mailyComponent:"button"}))},tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,X.jsx)(F.BubbleMenu,A(d({},m),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:a.map((s,n)=>(0,X.jsx)(R,d({},s),n))}))}var Z=require("react"),g=require("lucide-react");var D=require("react/jsx-runtime"),Ae=t=>{let{editor:e,config:o}=t,r=(0,Z.useMemo)(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:g.BoldIcon},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:g.ItalicIcon},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:g.UnderlineIcon},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:g.StrikethroughIcon},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:g.EraserIcon},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:g.SeparatorHorizontal},{name:"link",command:()=>{let m=e.getAttributes("link").href,s=window.prompt("URL",m);if(s!==null){if(s===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:s}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:g.LinkIcon},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:g.AlignLeft},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:g.AlignCenter},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:g.AlignRight}],[e]),a=(0,Z.useMemo)(()=>r.reduce((m,s)=>(m.includes(s.group)||m.push(s.group),m),[]),[r]);return e?(0,D.jsx)("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:a.map((m,s)=>(0,D.jsx)("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===m).map((n,l)=>(0,D.jsx)(R,d({},n),l))},s))}):null};var Ce=require("@tiptap/react"),N=require("lucide-react");var Q=require("react/jsx-runtime");function Be(t){let{editor:e}=t,o=[N.AlignLeftIcon,N.AlignCenterIcon,N.AlignRightIcon],r=U.map((n,l)=>({name:n,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:n}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:n}).run()},icon:o[l]})),a=ye.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),m=[...r,{name:"url",isActive:()=>!1,command:()=>{var k,M,H;let{editor:n}=t,l=(k=n==null?void 0:n.getAttributes("logo"))==null?void 0:k.src,y=window.prompt("Update logo URL",l);if(!y)return;let v=(M=n==null?void 0:n.getAttributes("logo"))==null?void 0:M.size,f=(H=n==null?void 0:n.getAttributes("logo"))==null?void 0:H.alignment,b=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:y,size:v,alignment:f}),n==null||n.commands.setNodeSelection((b==null?void 0:b.from)||0)},icon:N.Link},...a],s=A(d({},t),{shouldShow:({editor:n})=>!!n.isActive("logo"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,Q.jsx)(Ce.BubbleMenu,A(d({},s),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:m.map((n,l)=>(0,Q.jsx)(R,d({},n),l))}))}var Re=require("@tiptap/react");var q=require("@tiptap/core"),ee=["sm","md","lg","xl"],wt="sm";function ft(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[wt]}`}var Le=q.Node.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!ee.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=ft(o),["div",(0,q.mergeAttributes)({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});var te=require("react/jsx-runtime");function Ne(t){let{editor:e}=t,o=ee.map(a=>({name:a,isActive:()=>e==null?void 0:e.isActive("spacer",{height:a}),command:()=>{e==null||e.chain().focus().setSpacer({height:a}).run()}})),r=A(d({},t),{shouldShow:({editor:a})=>a.isActive("spacer"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return(0,te.jsx)(Re.BubbleMenu,A(d({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((a,m)=>(0,te.jsx)(R,d({},a),m))}))}var Ye=u(require("@tiptap/starter-kit")),Xe=require("@tiptap/extension-color"),Ze=u(require("@tiptap/extension-link")),Qe=u(require("@tiptap/extension-list-item")),et=u(require("@tiptap/extension-paragraph")),tt=u(require("@tiptap/extension-placeholder")),ot=u(require("@tiptap/extension-text-align")),se=u(require("@tiptap/extension-text-style")),rt=u(require("@tiptap/extension-heading")),nt=u(require("@tiptap/extension-image"));var Te=require("@tiptap/core"),Me=require("@tiptap/extension-horizontal-rule"),ze=Me.HorizontalRule.extend({addInputRules(){return[new Te.InputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,a=e.from,m=e.to;r.insert(a-1,this.type.create(o)).delete(r.mapping.map(a),r.mapping.map(m))}})]}});var G=require("@tiptap/core"),Ue=require("@tiptap/react");var Ee=require("@tiptap/react"),S=require("lucide-react"),ne=require("react-color");var Pe=u(require("react"));var Se=require("react/jsx-runtime"),$=Pe.forwardRef((a,r)=>{var m=a,{className:t,type:e}=m,o=P(m,["className","type"]);return(0,Se.jsx)("input",d({type:e,className:h("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50",t),ref:r},o))});$.displayName="Input";var Ie=u(require("react")),B=u(require("@radix-ui/react-popover"));var oe=require("react/jsx-runtime"),K=B.Root,_=B.Trigger,E=Ie.forwardRef((m,a)=>{var s=m,{className:t,align:e="center",sideOffset:o=4}=s,r=P(s,["className","align","sideOffset"]);return(0,oe.jsx)(B.Portal,{children:(0,oe.jsx)(B.Content,d({ref:a,align:e,sideOffset:o,className:h("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950",t)},r))})});E.displayName=B.Content.displayName;var i=require("react/jsx-runtime"),bt={left:S.AlignLeftIcon,center:S.AlignCenterIcon,right:S.AlignRightIcon},re={style(t){return He.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return Oe.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(bt).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function le(t){let{url:e,text:o,alignment:r,variant:a,borderRadius:m,buttonColor:s,textColor:n}=t.node.attrs;return(0,i.jsx)(Ee.NodeViewWrapper,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:(0,i.jsxs)(K,{open:t.selected,children:[(0,i.jsx)(_,{asChild:!0,children:(0,i.jsx)("div",{children:(0,i.jsx)("a",{className:h("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":m==="round","!mly-rounded-md":m==="smooth","!mly-rounded-none":m==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:a==="filled"?s:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:s},children:o})})}),(0,i.jsxs)(E,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[(0,i.jsx)($,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),(0,i.jsx)($,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),(0,i.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,i.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),(0,i.jsx)("div",{className:"mly-flex mly-gap-1",children:re.style(t).map((l,y)=>(0,i.jsx)(x,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},y))})]}),(0,i.jsxs)("div",{className:"mly-w-full mly-space-y-2",children:[(0,i.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),(0,i.jsx)("div",{className:"mly-flex mly-gap-1",children:re.cornerRadius(t).map((l,y)=>(0,i.jsx)(x,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},y))})]}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),(0,i.jsx)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:re.alignment(t).map((l,y)=>(0,i.jsx)(x,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,type:"button",children:(0,i.jsx)(l.icon,{size:16})},y))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),(0,i.jsxs)("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[(0,i.jsx)(xt,{variant:a,color:s,onChange:l=>{t.updateAttributes({buttonColor:l})}}),(0,i.jsx)(vt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function xt(t){let{color:e,onChange:o,variant:r}=t;return(0,i.jsxs)(K,{children:[(0,i.jsx)(_,{asChild:!0,children:(0,i.jsx)(x,{variant:"ghost",className:"",size:"sm",type:"button",children:(0,i.jsx)("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),(0,i.jsx)(E,{className:"mly-w-full !mly-p-0",children:(0,i.jsx)(ne.ChromePicker,{className:"!mly-shadow-md",color:e,onChange:a=>{o(a.hex)}})})]})}function vt(t){let{color:e,onChange:o}=t;return(0,i.jsxs)(K,{children:[(0,i.jsx)(_,{asChild:!0,children:(0,i.jsx)(x,{variant:"ghost",size:"sm",type:"button",children:(0,i.jsxs)("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[(0,i.jsx)("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),(0,i.jsx)("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),(0,i.jsx)(E,{className:"mly-w-full !mly-p-0",children:(0,i.jsx)(ne.ChromePicker,{className:"!mly-shadow-md",color:e,onChange:r=>{o(r.hex)}})})]})}var He=["filled","outline"],Oe=["sharp","smooth","round"],Ve=G.Node.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",(0,G.mergeAttributes)({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return(0,Ue.ReactNodeViewRenderer)(le)}});var W=require("@tiptap/core"),ae=W.Node.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",(0,W.mergeAttributes)(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});var T=require("react"),Fe=u(require("@tiptap/extension-mention")),De=require("@tiptap/react"),qe=u(require("tippy.js"));var j=require("react/jsx-runtime"),$e=(0,T.forwardRef)((t,e)=>{var m,s;let[o,r]=(0,T.useState)(0),a=n=>{let l=t.items[n];l&&t.command({id:l})};return(0,T.useEffect)(()=>r(0),[t.items]),(0,T.useImperativeHandle)(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(a(o),!0):!1})),(0,j.jsx)("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-1 mly-py-2 mly-shadow-md mly-transition-all",children:(m=t==null?void 0:t.items)!=null&&m.length?(s=t==null?void 0:t.items)==null?void 0:s.map((n,l)=>(0,j.jsx)(x,{variant:"secondary",onClick:()=>a(l),className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:n},l)):(0,j.jsx)(x,{variant:"secondary",className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});$e.displayName="VariableList";var kt={items:({query:t})=>[t.toLowerCase()],render:()=>{let t,e=null;return{onStart:o=>{t=new De.ReactRenderer($e,{props:o,editor:o.editor}),o.clientRect&&(e=(0,qe.default)("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(o){var r;t.updateProps(o),o.clientRect&&((r=e==null?void 0:e[0])==null||r.setProps({getReferenceClientRect:o.clientRect}))},onKeyDown(o){var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(o)},onExit(){e==null||e[0].destroy(),t.destroy()}}}},Ke=Fe.default.extend({name:"variable",parseHTML(){return[{tag:'span[data-type="variable"]'}]}}).configure({suggestion:kt,renderLabel({node:t}){var e;return`${(e=t.attrs.label)!=null?e:t.attrs.id}`},HTMLAttributes:{class:"mly-py-1 mly-px-2 mly-bg-slate-100 mly-border mly-border-blue-300 mly-rounded-md"}});var C=require("react"),_e=require("@tiptap/core"),Ge=require("@tiptap/react"),We=u(require("@tiptap/suggestion")),p=require("lucide-react"),je=u(require("tippy.js"));var c=require("react/jsx-runtime"),At=_e.Extension.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[(0,We.default)(d({editor:this.editor},this.options.suggestion))]}}),Ct=({query:t})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:(0,c.jsx)(p.Text,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:(0,c.jsx)(p.Heading1,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:(0,c.jsx)(p.Heading2,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:(0,c.jsx)(p.Heading3,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:(0,c.jsx)(p.List,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:(0,c.jsx)(p.ListOrdered,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleOrderedList().run()}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:(0,c.jsx)(p.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Logo URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setLogoImage({src:r}).run())}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:(0,c.jsx)(p.ImageIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Image URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setImage({src:r}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:(0,c.jsx)(p.MoveVertical,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:(0,c.jsx)(p.MousePointer,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:(0,c.jsx)(p.DivideIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setHardBreak().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:(0,c.jsx)(p.FootprintsIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:(0,c.jsx)(p.EraserIcon,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().selectParentNode().deleteSelection().run()}}].filter(e=>{if(typeof t=="string"&&t.length>0){let o=t.toLowerCase();return e.title.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.searchTerms&&e.searchTerms.some(r=>r.includes(o))}return!0}),Bt=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,a=e.offsetTop,m=a+r;a<t.scrollTop?t.scrollTop-=t.scrollTop-a+5:m>o+t.scrollTop&&(t.scrollTop+=m-o-t.scrollTop+5)},Lt=({items:t,command:e,editor:o})=>{let[r,a]=(0,C.useState)(0),m=(0,C.useCallback)(n=>{let l=t[n];l&&e(l)},[e,o,t]);(0,C.useEffect)(()=>{let n=["ArrowUp","ArrowDown","Enter"],l=y=>{if(n.includes(y.key))return y.preventDefault(),y.key==="ArrowUp"?(a((r+t.length-1)%t.length),!0):y.key==="ArrowDown"?(a((r+1)%t.length),!0):y.key==="Enter"?(m(r),!0):!1};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t,r,a,m]),(0,C.useEffect)(()=>{a(0)},[t]);let s=(0,C.useRef)(null);return(0,C.useLayoutEffect)(()=>{let n=s==null?void 0:s.current,l=n==null?void 0:n.children[r];l&&n&&Bt(n,l)},[r]),t.length>0?(0,c.jsxs)("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[(0,c.jsx)("div",{id:"slash-command",ref:s,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,l)=>(0,c.jsxs)("button",{className:h("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",l===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>m(l),type:"button",children:[(0,c.jsx)("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"mly-font-medium",children:n.title}),(0,c.jsx)("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},l))}),(0,c.jsx)("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:(0,c.jsxs)("div",{className:"mly-flex mly-items-center",children:[(0,c.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,c.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),(0,c.jsx)("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),(0,c.jsx)("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),(0,c.jsxs)("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[(0,c.jsx)("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null},Rt={items:Ct,render:()=>{let t=null,e=null;return{onStart:o=>{t=new Ge.ReactRenderer(Lt,{props:o,editor:o.editor}),e=(0,je.default)("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:o=>{t==null||t.updateProps(o),e&&e[0].setProps({getReferenceClientRect:o.clientRect})},onKeyDown:o=>{var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(o)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}}},Je=At.configure({suggestion:Rt});var lt=u(require("@tiptap/extension-underline")),at=[Ye.default.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},horizontalRule:!1}),nt.default,lt.default,he,Xe.Color.configure({types:[se.default.name,Qe.default.name]}),se.default.configure(),ot.default.configure({types:[et.default.name,rt.default.name,ae.name]}),ze,tt.default.configure({placeholder:({node:t})=>t.type.name==="heading"?`Heading ${t.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),Le,ae,Ke,Je,Ze.default.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),Ve];var L=require("react/jsx-runtime");function Nt(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:a=!0,spellCheck:m=!1,autofocus:s="end"}={},onCreate:n,onUpdate:l,extensions:y,contentHtml:v,contentJson:f}=t,b=null;f?b=(f==null?void 0:f.type)==="doc"?f:{type:"doc",content:f}:v?b=v:b={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:""}]}]};let k=(0,J.useEditor)({editorProps:{attributes:{class:h("mly-prose mly-w-full",o),spellCheck:m?"true":"false"},handleDOMEvents:{keydown:(M,H)=>{if(["ArrowUp","ArrowDown","Enter"].includes(H.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:M})=>{n==null||n(M)},onUpdate:({editor:M})=>{l==null||l(M)},extensions:[...at,...y||[]],content:b,autofocus:s});return k?(0,L.jsxs)("div",{className:h("mail-editor mly-antialiased",e),children:[a&&(0,L.jsx)(Ae,{config:t.config,editor:k}),(0,L.jsxs)("div",{className:h("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[(0,L.jsx)(ke,{editor:k}),(0,L.jsx)(Be,{editor:k}),(0,L.jsx)(Ne,{editor:k}),(0,L.jsx)(J.EditorContent,{editor:k})]})]}):null}0&&(module.exports={Editor});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var ve=Object.defineProperty,ke=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var q=(t,e,o)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,p=(t,e)=>{for(var o in e||(e={}))$.call(e,o)&&q(t,o,e[o]);if(z)for(var o of z(e))K.call(e,o)&&q(t,o,e[o]);return t},b=(t,e)=>ke(t,Ae(e));var L=(t,e)=>{var o={};for(var r in t)$.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&z)for(var r of z(t))e.indexOf(r)<0&&K.call(t,r)&&(o[r]=t[r]);return o};function C(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}C(`.mail-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mail-editor .mly-prose h1,.mail-editor .mly-prose h2,.mail-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mail-editor .mly-prose h1{font-size:36px}.mail-editor .mly-prose h2{font-size:30px}.mail-editor .mly-prose h3{font-size:24px}.mail-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mail-editor .mly-prose h1+p,.mail-editor .mly-prose h2+p,.mail-editor .mly-prose h3+p,.mail-editor .mly-prose hr+p{margin-top:0}.mail-editor .mly-prose ol,.mail-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mail-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mail-editor .mly-prose li>p{margin:0}.mail-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mail-editor .mly-prose blockquote{margin-block:26px}.mail-editor .mly-prose hr{margin-block:32px}.mail-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mail-editor .mly-prose .spacer+*{margin-top:0}.mail-editor .mly-prose p+.spacer{margin-top:-20px}.mail-editor .mly-prose h1+.spacer,.mail-editor .mly-prose h2+.spacer,.mail-editor .mly-prose h3+.spacer{margin-top:-12px}.mail-editor .mly-prose ol+.spacer,.mail-editor .mly-prose ul+.spacer{margin-top:-20px}.mail-editor .mly-prose img+.spacer{margin-top:-32px}.mail-editor .mly-prose .node-button+.spacer,.mail-editor .mly-prose footer+.spacer{margin-top:-20px}.mail-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}
2
+ var ve=Object.defineProperty,ke=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var q=(t,e,o)=>e in t?ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,c=(t,e)=>{for(var o in e||(e={}))$.call(e,o)&&q(t,o,e[o]);if(M)for(var o of M(e))K.call(e,o)&&q(t,o,e[o]);return t},b=(t,e)=>ke(t,Ae(e));var B=(t,e)=>{var o={};for(var r in t)$.call(t,r)&&e.indexOf(r)<0&&(o[r]=t[r]);if(t!=null&&M)for(var r of M(t))e.indexOf(r)<0&&K.call(t,r)&&(o[r]=t[r]);return o};function C(t,{insertAt:e}={}){if(!t||typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}C(`.mail-editor .mly-prose p:where([class~=text-sm]){font-size:16px}.mail-editor .mly-prose h1,.mail-editor .mly-prose h2,.mail-editor .mly-prose h3{margin-top:0;margin-bottom:12px}.mail-editor .mly-prose h1{font-size:36px}.mail-editor .mly-prose h2{font-size:30px}.mail-editor .mly-prose h3{font-size:24px}.mail-editor .mly-prose p{font-size:15px;margin-bottom:20px}.mail-editor .mly-prose h1+p,.mail-editor .mly-prose h2+p,.mail-editor .mly-prose h3+p,.mail-editor .mly-prose hr+p{margin-top:0}.mail-editor .mly-prose ol,.mail-editor .mly-prose ul{margin-top:0;margin-bottom:20px}.mail-editor .mly-prose li:not(:last-child){margin-bottom:8px}.mail-editor .mly-prose li>p{margin:0}.mail-editor .mly-prose img{margin-top:0;margin-bottom:32px}.mail-editor .mly-prose blockquote{margin-block:26px}.mail-editor .mly-prose hr{margin-block:32px}.mail-editor .mly-prose .footer{display:block;font-size:13px;margin-bottom:20px;color:#64748b}.mail-editor .mly-prose .spacer+*{margin-top:0}.mail-editor .mly-prose p+.spacer{margin-top:-20px}.mail-editor .mly-prose h1+.spacer,.mail-editor .mly-prose h2+.spacer,.mail-editor .mly-prose h3+.spacer{margin-top:-12px}.mail-editor .mly-prose ol+.spacer,.mail-editor .mly-prose ul+.spacer{margin-top:-20px}.mail-editor .mly-prose img+.spacer{margin-top:-32px}.mail-editor .mly-prose .node-button+.spacer,.mail-editor .mly-prose footer+.spacer{margin-top:-20px}.mail-editor .mly-prose .node-button{margin-top:0;margin-bottom:20px}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:"liga" 0}.ProseMirror:focus{outline:none}.ProseMirror .is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror .is-empty:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.ProseMirror-selectednode{outline:3px solid #555}.mly-no-scrollbar::-webkit-scrollbar{display:none}.mly-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}
3
3
  `);C(`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}
4
- `);C('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-border{border-width:1px}.mly-border-t{border-top-width:1px}.mly-border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\\!mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as po,useEditor as yo}from"@tiptap/react";import{BubbleMenu as Pe,isTextSelection as Se}from"@tiptap/react";import{AlignCenterIcon as Ie,AlignLeftIcon as Ee,AlignRightIcon as He,BoldIcon as Oe,ItalicIcon as Ue,LinkIcon as Ve,StrikethroughIcon as Fe,UnderlineIcon as De}from"lucide-react";import{mergeAttributes as Ce}from"@tiptap/core";import Le from"@tiptap/extension-image";var _=["sm","md","lg"],T=["left","center","right"],G="left",W="sm";function Be(t){let e={sm:"40px",md:"48px",lg:"64px"};return`height:${e[t]||e[W]}`}function Re(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[G]}var j=Le.extend({name:"logo",priority:1e3,addAttributes(){var t;return b(p({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:W,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:G,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,s=["position:relative","margin-top:0",Be(o),...Re(r)];return t.style=s.join(";"),["img",Ce(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import*as J from"react";import{Slot as ze}from"@radix-ui/react-slot";import{clsx as Ne}from"clsx";import{twMerge as Me}from"tailwind-merge";function y(...t){return Me(Ne(t))}import{jsx as Te}from"react/jsx-runtime";var w=J.forwardRef((a,i)=>{var n=a,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,s=L(n,["className","variant","size","asChild"]);let l=r?ze:"button",c="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",g={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},u={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},h=y(`${c} ${g[e]} ${u[o]} ${t}`);return Te(l,p({className:h,ref:i},s))});w.displayName="BaseButton";import{jsx as E}from"react/jsx-runtime";function k(t){return E(w,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:y("mly-px-2.5"),children:t.icon?E(t.icon,{className:y("mly-h-3.5 mly-w-3.5")}):E("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}import{jsx as Y}from"react/jsx-runtime";function X(t){let{editor:e}=t,o=[Ee,Ie,He],r=T.map((a,n)=>({name:a,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:a}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:a}).run()},icon:o[n]})),s=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:Oe},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:Ue},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:De},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:Fe},...r,{name:"link",command:()=>{let a=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",a);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:Ve}],i=b(p({},t),{shouldShow:({editor:a,state:n,from:l,to:c})=>{let{doc:g,selection:u}=n,{empty:h}=u,f=!g.textBetween(l,c).length&&Se(n.selection);return!(h||f||!a.isEditable||a.isActive("image")||a.isActive("logo")||a.isActive("spacer")||a.isActive({mailyComponent:"button"}))},tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return Y(Pe,b(p({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:s.map((a,n)=>Y(k,p({},a),n))}))}import{useMemo as Z}from"react";import{AlignCenter as qe,AlignLeft as $e,AlignRight as Ke,BoldIcon as _e,EraserIcon as Ge,ItalicIcon as We,LinkIcon as je,SeparatorHorizontal as Je,StrikethroughIcon as Ye,UnderlineIcon as Xe}from"lucide-react";import{jsx as H}from"react/jsx-runtime";var Q=t=>{let{editor:e,config:o}=t,r=Z(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:_e},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:We},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:Xe},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:Ye},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:Ge},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:Je},{name:"link",command:()=>{let i=e.getAttributes("link").href,a=window.prompt("URL",i);if(a!==null){if(a===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:a}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:je},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:$e},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:qe},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:Ke}],[e]),s=Z(()=>r.reduce((i,a)=>(i.includes(a.group)||i.push(a.group),i),[]),[r]);return e?H("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:s.map((i,a)=>H("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,l)=>H(k,p({},n),l))},a))}):null};import{BubbleMenu as Ze}from"@tiptap/react";import{AlignCenterIcon as Qe,AlignLeftIcon as et,AlignRightIcon as tt,Link as ot}from"lucide-react";import{jsx as ee}from"react/jsx-runtime";function te(t){let{editor:e}=t,o=[et,Qe,tt],r=T.map((n,l)=>({name:n,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:n}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:n}).run()},icon:o[l]})),s=_.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,command:()=>{var f,A,M;let{editor:n}=t,l=(f=n==null?void 0:n.getAttributes("logo"))==null?void 0:f.src,c=window.prompt("Update logo URL",l);if(!c)return;let g=(A=n==null?void 0:n.getAttributes("logo"))==null?void 0:A.size,u=(M=n==null?void 0:n.getAttributes("logo"))==null?void 0:M.alignment,h=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:c,size:g,alignment:u}),n==null||n.commands.setNodeSelection((h==null?void 0:h.from)||0)},icon:ot},...s],a=b(p({},t),{shouldShow:({editor:n})=>!!n.isActive("logo"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return ee(Ze,b(p({},a),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.map((n,l)=>ee(k,p({},n),l))}))}import{BubbleMenu as at}from"@tiptap/react";import{mergeAttributes as rt,Node as nt}from"@tiptap/core";var O=["sm","md","lg","xl"],lt="sm";function st(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[lt]}`}var oe=nt.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!O.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=st(o),["div",rt({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as re}from"react/jsx-runtime";function ne(t){let{editor:e}=t,o=O.map(s=>({name:s,isActive:()=>e==null?void 0:e.isActive("spacer",{height:s}),command:()=>{e==null||e.chain().focus().setSpacer({height:s}).run()}})),r=b(p({},t),{shouldShow:({editor:s})=>s.isActive("spacer"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return re(at,b(p({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((s,i)=>re(k,p({},s),i))}))}import to from"@tiptap/starter-kit";import{Color as oo}from"@tiptap/extension-color";import ro from"@tiptap/extension-link";import no from"@tiptap/extension-list-item";import lo from"@tiptap/extension-paragraph";import so from"@tiptap/extension-placeholder";import ao from"@tiptap/extension-text-align";import fe from"@tiptap/extension-text-style";import io from"@tiptap/extension-heading";import mo from"@tiptap/extension-image";import{InputRule as it}from"@tiptap/core";import{HorizontalRule as mt}from"@tiptap/extension-horizontal-rule";var le=mt.extend({addInputRules(){return[new it({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,s=e.from,i=e.to;r.insert(s-1,this.type.create(o)).delete(r.mapping.map(s),r.mapping.map(i))}})]}});import{mergeAttributes as ft,Node as bt}from"@tiptap/core";import{ReactNodeViewRenderer as xt}from"@tiptap/react";import{NodeViewWrapper as pt}from"@tiptap/react";import{AlignCenterIcon as dt,AlignLeftIcon as yt,AlignRightIcon as gt}from"lucide-react";import{ChromePicker as me}from"react-color";import*as se from"react";import{jsx as ct}from"react/jsx-runtime";var P=se.forwardRef((s,r)=>{var i=s,{className:t,type:e}=i,o=L(i,["className","type"]);return ct("input",p({type:e,className:y("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50",t),ref:r},o))});P.displayName="Input";import*as ie from"react";import*as v from"@radix-ui/react-popover";import{jsx as ae}from"react/jsx-runtime";var S=v.Root,I=v.Trigger,R=ie.forwardRef((i,s)=>{var a=i,{className:t,align:e="center",sideOffset:o=4}=a,r=L(a,["className","align","sideOffset"]);return ae(v.Portal,{children:ae(v.Content,p({ref:s,align:e,sideOffset:o,className:y("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950",t)},r))})});R.displayName=v.Content.displayName;import{jsx as m,jsxs as x}from"react/jsx-runtime";var ut={left:yt,center:dt,right:gt},U={style(t){return ce.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return pe.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(ut).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function V(t){let{url:e,text:o,alignment:r,variant:s,borderRadius:i,buttonColor:a,textColor:n}=t.node.attrs;return m(pt,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:x(S,{open:t.selected,children:[m(I,{asChild:!0,children:m("div",{children:m("a",{className:y("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:s==="filled"?a:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:a},children:o})})}),x(R,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[m(P,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),m(P,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),x("div",{className:"mly-w-full mly-space-y-2",children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),m("div",{className:"mly-flex mly-gap-1",children:U.style(t).map((l,c)=>m(w,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,children:l.name},c))})]}),x("div",{className:"mly-w-full mly-space-y-2",children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),m("div",{className:"mly-flex mly-gap-1",children:U.cornerRadius(t).map((l,c)=>m(w,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,children:l.name},c))})]}),x("div",{className:"flex gap-2",children:[x("div",{children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),m("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:U.alignment(t).map((l,c)=>m(w,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,children:m(l.icon,{size:16})},c))})]}),x("div",{children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),x("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[m(ht,{variant:s,color:a,onChange:l=>{t.updateAttributes({buttonColor:l})}}),m(wt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function ht(t){let{color:e,onChange:o,variant:r}=t;return x(S,{children:[m(I,{asChild:!0,children:m(w,{variant:"ghost",className:"",size:"sm",children:m("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),m(R,{className:"mly-w-full !mly-p-0",children:m(me,{className:"!mly-shadow-md",color:e,onChange:s=>{o(s.hex)}})})]})}function wt(t){let{color:e,onChange:o}=t;return x(S,{children:[m(I,{asChild:!0,children:m(w,{variant:"ghost",size:"sm",children:x("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[m("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),m("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),m(R,{className:"mly-w-full !mly-p-0",children:m(me,{className:"!mly-shadow-md",color:e,onChange:r=>{o(r.hex)}})})]})}var ce=["filled","outline"],pe=["sharp","smooth","round"],de=bt.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",ft({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return xt(V)}});import{mergeAttributes as vt,Node as kt}from"@tiptap/core";var F=kt.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",vt(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as At,useEffect as Ct,useImperativeHandle as Lt,useState as Bt}from"react";import Rt from"@tiptap/extension-mention";import{ReactRenderer as Nt}from"@tiptap/react";import Mt from"tippy.js";import{jsx as D}from"react/jsx-runtime";var ye=At((t,e)=>{var i,a;let[o,r]=Bt(0),s=n=>{let l=t.items[n];l&&t.command({id:l})};return Ct(()=>r(0),[t.items]),Lt(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(s(o),!0):!1})),D("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-1 mly-py-2 mly-shadow-md mly-transition-all",children:(i=t==null?void 0:t.items)!=null&&i.length?(a=t==null?void 0:t.items)==null?void 0:a.map((n,l)=>D(w,{variant:"secondary",onClick:()=>s(l),className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:n},l)):D(w,{variant:"secondary",className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});ye.displayName="VariableList";var zt={items:({query:t})=>[t.toLowerCase()],render:()=>{let t,e=null;return{onStart:o=>{t=new Nt(ye,{props:o,editor:o.editor}),o.clientRect&&(e=Mt("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(o){var r;t.updateProps(o),o.clientRect&&((r=e==null?void 0:e[0])==null||r.setProps({getReferenceClientRect:o.clientRect}))},onKeyDown(o){var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(o)},onExit(){e==null||e[0].destroy(),t.destroy()}}}},ge=Rt.extend({name:"variable",parseHTML(){return[{tag:'span[data-type="variable"]'}]}}).configure({suggestion:zt,renderLabel({node:t}){var e;return`${(e=t.attrs.label)!=null?e:t.attrs.id}`},HTMLAttributes:{class:"mly-py-1 mly-px-2 mly-bg-slate-100 mly-border mly-border-blue-300 mly-rounded-md"}});import{useCallback as Tt,useEffect as ue,useLayoutEffect as Pt,useRef as St,useState as It}from"react";import{Extension as Et}from"@tiptap/core";import{ReactRenderer as Ht}from"@tiptap/react";import Ot from"@tiptap/suggestion";import{DivideIcon as Ut,EraserIcon as Vt,FootprintsIcon as Ft,Heading1 as Dt,Heading2 as qt,Heading3 as $t,ImageIcon as he,List as Kt,ListOrdered as _t,MousePointer as Gt,MoveVertical as Wt,Text as jt}from"lucide-react";import Jt from"tippy.js";import{jsx as d,jsxs as B}from"react/jsx-runtime";var Yt=Et.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Ot(p({editor:this.editor},this.options.suggestion))]}}),Xt=({query:t})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:d(jt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:d(Dt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:d(qt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:d($t,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:d(Kt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:d(_t,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleOrderedList().run()}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:d(he,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Logo URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setLogoImage({src:r}).run())}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:d(he,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Image URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setImage({src:r}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:d(Wt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:d(Gt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:d(Ut,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setHardBreak().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:d(Ft,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:d(Vt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().selectParentNode().deleteSelection().run()}}].filter(e=>{if(typeof t=="string"&&t.length>0){let o=t.toLowerCase();return e.title.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.searchTerms&&e.searchTerms.some(r=>r.includes(o))}return!0}),Zt=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},Qt=({items:t,command:e,editor:o,range:r})=>{let[s,i]=It(0),a=Tt(l=>{let c=t[l];c&&e(c)},[e,o,t]);ue(()=>{let l=["ArrowUp","ArrowDown","Enter"],c=g=>{if(l.includes(g.key))return g.preventDefault(),g.key==="ArrowUp"?(i((s+t.length-1)%t.length),!0):g.key==="ArrowDown"?(i((s+1)%t.length),!0):g.key==="Enter"?(a(s),!0):!1};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[t,s,i,a]),ue(()=>{i(0)},[t]);let n=St(null);return Pt(()=>{let l=n==null?void 0:n.current,c=l==null?void 0:l.children[s];c&&l&&Zt(l,c)},[s]),t.length>0?B("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[d("div",{id:"slash-command",ref:n,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((l,c)=>B("button",{className:y("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",c===s?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>a(c),children:[d("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:l.icon}),B("div",{children:[d("p",{className:"mly-font-medium",children:l.title}),d("p",{className:"mly-text-xs mly-text-gray-400",children:l.description})]})]},c))}),d("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:B("div",{className:"mly-flex mly-items-center",children:[B("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[d("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),d("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),d("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),B("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[d("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null},eo={items:Xt,render:()=>{let t=null,e=null;return{onStart:o=>{t=new Ht(Qt,{props:o,editor:o.editor}),e=Jt("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:o=>{t==null||t.updateProps(o),e&&e[0].setProps({getReferenceClientRect:o.clientRect})},onKeyDown:o=>{var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(o)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}}},we=Yt.configure({suggestion:eo});import co from"@tiptap/extension-underline";var be=[to.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},horizontalRule:!1}),mo,co,j,oo.configure({types:[fe.name,no.name]}),fe.configure(),ao.configure({types:[lo.name,io.name,F.name]}),le,so.configure({placeholder:({node:t})=>t.type.name==="heading"?`Heading ${t.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),oe,F,ge,we,ro.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),de];import{jsx as N,jsxs as xe}from"react/jsx-runtime";function Vn(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:s=!0,spellCheck:i=!1,autofocus:a="end"}={},onCreate:n,onUpdate:l,extensions:c,contentHtml:g,contentJson:u}=t,h=null;u?h=(u==null?void 0:u.type)==="doc"?u:{type:"doc",content:u}:g?h=g:h={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:""}]}]};let f=yo({editorProps:{attributes:{class:y("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(A,M)=>{if(["ArrowUp","ArrowDown","Enter"].includes(M.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:A})=>{n==null||n(A)},onUpdate:({editor:A})=>{l==null||l(A)},extensions:[...be,...c||[]],content:h,autofocus:a});return f?xe("div",{className:y("mail-editor mly-antialiased",e),children:[s&&N(Q,{config:t.config,editor:f}),xe("div",{className:y("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[N(X,{editor:f}),N(te,{editor:f}),N(ne,{editor:f}),N(po,{editor:f})]})]}):null}export{Vn as Editor};
4
+ `);C('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.mly-prose{color:var(--tw-prose-body);max-width:65ch}.mly-prose :where(p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where([class~=lead]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.mly-prose :where(a):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.mly-prose :where(strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.mly-prose :where(a strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol[type=A]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=A s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-alpha}.mly-prose :where(ol[type=a s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-alpha}.mly-prose :where(ol[type=I]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type=I s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:upper-roman}.mly-prose :where(ol[type=i s]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:lower-roman}.mly-prose :where(ol[type="1"]):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:decimal}.mly-prose :where(ul):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *))::marker{color:var(--tw-prose-bullets)}.mly-prose :where(dt):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.mly-prose :where(hr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.mly-prose :where(blockquote):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-left-width:.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:"\\201c""\\201d""\\2018""\\2019";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.mly-prose :where(blockquote p:first-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:open-quote}.mly-prose :where(blockquote p:last-of-type):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:close-quote}.mly-prose :where(h1):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.mly-prose :where(h1 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:900;color:inherit}.mly-prose :where(h2):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.mly-prose :where(h2 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:800;color:inherit}.mly-prose :where(h3):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.mly-prose :where(h3 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(h4):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.mly-prose :where(h4 strong):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:700;color:inherit}.mly-prose :where(img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(picture):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.mly-prose :where(kbd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding:.1875em .375em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:"`"}.mly-prose :where(code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:"`"}.mly-prose :where(a code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h1 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(h2 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.875em}.mly-prose :where(h3 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit;font-size:.9em}.mly-prose :where(h4 code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(blockquote code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(thead th code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:inherit}.mly-prose :where(pre):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding:.8571429em 1.1428571em}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):before{content:none}.mly-prose :where(pre code):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)):after{content:none}.mly-prose :where(table):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.mly-prose :where(thead):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.mly-prose :where(thead th):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-right:.5714286em;padding-bottom:.5714286em;padding-left:.5714286em}.mly-prose :where(tbody tr):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.mly-prose :where(tbody tr:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-bottom-width:0}.mly-prose :where(tbody td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:baseline}.mly-prose :where(tfoot):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.mly-prose :where(tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){vertical-align:top}.mly-prose :where(figure>*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(figcaption):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.mly-prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.mly-prose :where(picture>img):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0;margin-bottom:0}.mly-prose :where(video):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;margin-bottom:.5em}.mly-prose :where(ol>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(ul>li):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:.375em}.mly-prose :where(.mly-prose>ul>li p):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(.mly-prose>ul>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ul>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(.mly-prose>ol>li>*:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em}.mly-prose :where(.mly-prose>ol>li>*:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:1.25em}.mly-prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.75em;margin-bottom:.75em}.mly-prose :where(dl):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.mly-prose :where(dd):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:.5em;padding-left:1.625em}.mly-prose :where(hr+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h2+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h3+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(h4+*):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(thead th:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(thead th:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(tbody td,tfoot td):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding:.5714286em}.mly-prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-left:0}.mly-prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){padding-right:0}.mly-prose :where(figure):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:2em;margin-bottom:2em}.mly-prose :where(.mly-prose>:first-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-top:0}.mly-prose :where(.mly-prose>:last-child):not(:where([class~=mly-not-prose],[class~=mly-not-prose] *)){margin-bottom:0}.mly-z-50{z-index:50}.mly-ml-1{margin-left:.25rem}.mly-mt-2{margin-top:.5rem}.mly-mt-4{margin-top:1rem}.mly-block{display:block}.mly-flex{display:flex}.mly-inline-flex{display:inline-flex}.mly-h-10{height:2.5rem}.mly-h-11{height:2.75rem}.mly-h-3{height:.75rem}.mly-h-3\\.5{height:.875rem}.mly-h-4{height:1rem}.mly-h-6{height:1.5rem}.mly-h-9{height:2.25rem}.mly-h-\\[2px\\]{height:2px}.mly-h-auto{height:auto}.mly-max-h-\\[330px\\]{max-height:330px}.mly-w-10{width:2.5rem}.mly-w-3{width:.75rem}.mly-w-3\\.5{width:.875rem}.mly-w-4{width:1rem}.mly-w-6{width:1.5rem}.mly-w-72{width:18rem}.mly-w-full{width:100%}.mly-shrink-0{flex-shrink:0}.mly-grow{flex-grow:1}.mly-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mly-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mly-flex-col{flex-direction:column}.mly-items-center{align-items:center}.mly-justify-center{justify-content:center}.mly-gap-1{gap:.25rem}.mly-gap-3{gap:.75rem}.mly-gap-\\[1px\\]{gap:1px}.mly-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.mly-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.mly-overflow-y-auto{overflow-y:auto}.mly-scroll-smooth{scroll-behavior:smooth}.\\!mly-rounded-full{border-radius:9999px!important}.\\!mly-rounded-md{border-radius:.375rem!important}.\\!mly-rounded-none{border-radius:0!important}.mly-rounded{border-radius:.25rem}.mly-rounded-md{border-radius:.375rem}.mly-border{border-width:1px}.mly-border-t{border-top-width:1px}.mly-border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity))}.mly-border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.mly-border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.mly-bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.mly-bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.mly-bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.mly-bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.mly-bg-transparent{background-color:transparent}.mly-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.\\!mly-p-0{padding:0!important}.mly-p-1{padding:.25rem}.mly-p-4{padding:1rem}.mly-px-1{padding-left:.25rem;padding-right:.25rem}.mly-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.mly-px-2{padding-left:.5rem;padding-right:.5rem}.mly-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mly-px-3{padding-left:.75rem;padding-right:.75rem}.mly-px-4{padding-left:1rem;padding-right:1rem}.mly-px-8{padding-left:2rem;padding-right:2rem}.mly-px-\\[32px\\]{padding-left:32px;padding-right:32px}.mly-py-1{padding-top:.25rem;padding-bottom:.25rem}.mly-py-2{padding-top:.5rem;padding-bottom:.5rem}.mly-py-3{padding-top:.75rem;padding-bottom:.75rem}.mly-py-\\[20px\\]{padding-top:20px;padding-bottom:20px}.mly-pl-4{padding-left:1rem}.mly-text-left{text-align:left}.mly-text-center{text-align:center}.mly-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.mly-text-\\[13px\\]{font-size:13px}.mly-text-sm{font-size:.875rem;line-height:1.25rem}.mly-text-xs{font-size:.75rem;line-height:1rem}.mly-font-medium{font-weight:500}.mly-font-normal{font-weight:400}.mly-font-semibold{font-weight:600}.mly-capitalize{text-transform:capitalize}.mly-text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.mly-text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}.mly-text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.mly-text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.mly-text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.mly-text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.mly-text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.mly-no-underline{text-decoration-line:none}.mly-underline-offset-4{text-underline-offset:4px}.mly-antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.\\!mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.mly-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mly-outline-none{outline:2px solid transparent;outline-offset:2px}.mly-ring-offset-white{--tw-ring-offset-color: #fff}.mly-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mly-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.mly-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.file\\:mly-border-0::file-selector-button{border-width:0px}.file\\:mly-bg-transparent::file-selector-button{background-color:transparent}.file\\:mly-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:mly-font-medium::file-selector-button{font-weight:500}.placeholder\\:mly-text-gray-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.placeholder\\:mly-text-gray-500::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.hover\\:mly-bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:mly-bg-gray-100\\/80:hover{background-color:#f3f4f6cc}.hover\\:mly-bg-gray-900\\/90:hover{background-color:#111827e6}.hover\\:mly-bg-red-500\\/90:hover{background-color:#ef4444e6}.hover\\:mly-text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.hover\\:mly-underline:hover{text-decoration-line:underline}.focus-visible\\:mly-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:mly-ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:mly-ring-gray-400:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(156 163 175 / var(--tw-ring-opacity))}.focus-visible\\:mly-ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\\:mly-pointer-events-none:disabled{pointer-events:none}.disabled\\:mly-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:mly-opacity-50:disabled{opacity:.5}.data-\\[state\\=true\\]\\:mly-bg-gray-100[data-state=true]{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.data-\\[state\\=true\\]\\:mly-text-gray-900[data-state=true]{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.data-\\[state\\=open\\]\\:mly-animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:mly-fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:mly-fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:mly-zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:mly-zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:mly-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:mly-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:mly-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:mly-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}\n');import{EditorContent as po,useEditor as yo}from"@tiptap/react";import{BubbleMenu as Pe,isTextSelection as Se}from"@tiptap/react";import{AlignCenterIcon as Ie,AlignLeftIcon as Ee,AlignRightIcon as He,BoldIcon as Oe,ItalicIcon as Ue,LinkIcon as Ve,StrikethroughIcon as Fe,UnderlineIcon as De}from"lucide-react";import{mergeAttributes as Ce}from"@tiptap/core";import Be from"@tiptap/extension-image";var _=["sm","md","lg"],z=["left","center","right"],G="left",W="sm";function Le(t){let e={sm:"40px",md:"48px",lg:"64px"};return`height:${e[t]||e[W]}`}function Re(t){let e={left:["margin-right:auto","margin-left:0"],center:["margin-right:auto","margin-left:auto"],right:["margin-right:0","margin-left:auto"]};return e[t]||e[G]}var j=Be.extend({name:"logo",priority:1e3,addAttributes(){var t;return b(c({},(t=this.parent)==null?void 0:t.call(this)),{"maily-component":{default:"logo",renderHTML:e=>({"data-maily-component":e["maily-component"]}),parseHTML:e=>e.getAttribute("data-maily-component")},size:{default:W,parseHTML:e=>e.getAttribute("data-size"),renderHTML:e=>({"data-size":e.size})},alignment:{default:G,parseHTML:e=>e.getAttribute("data-alignment"),renderHTML:e=>({"data-alignment":e.alignment})}})},addCommands(){return{setLogoImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),setLogoAttributes:t=>({commands:e})=>e.updateAttributes("logo",t)}},renderHTML({HTMLAttributes:t,node:e}){let{size:o,alignment:r}=e.attrs,s=["position:relative","margin-top:0",Le(o),...Re(r)];return t.style=s.join(";"),["img",Ce(this.options.HTMLAttributes,t)]},parseHTML(){return[{tag:`img[data-maily-component="${this.name}"]`}]}});import*as J from"react";import{Slot as Me}from"@radix-ui/react-slot";import{clsx as Ne}from"clsx";import{twMerge as Te}from"tailwind-merge";function y(...t){return Te(Ne(t))}import{jsx as ze}from"react/jsx-runtime";var h=J.forwardRef((a,i)=>{var n=a,{className:t,variant:e="default",size:o="default",asChild:r=!1}=n,s=B(n,["className","variant","size","asChild"]);let l=r?Me:"button",p="mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-pointer-events-none disabled:mly-opacity-50",w={default:"mly-bg-gray-900 mly-text-gray-50 hover:mly-bg-gray-900/90",destructive:"mly-bg-red-500 mly-text-gray-50 hover:mly-bg-red-500/90",outline:"mly-border mly-border-gray-200 mly-bg-white hover:mly-bg-gray-100 hover:mly-text-gray-900",secondary:"mly-bg-gray-100 mly-text-gray-900 hover:mly-bg-gray-100/80",ghost:"hover:mly-bg-gray-100 bg-transparent hover:mly-text-gray-900 data-[state=true]:mly-bg-gray-100 data-[state=true]:mly-text-gray-900",link:"mly-text-gray-900 mly-underline-offset-4 hover:mly-underline"},g={default:"mly-h-10 mly-px-4 mly-py-2",sm:"mly-h-9 mly-rounded-md mly-px-3",lg:"mly-h-11 mly-rounded-md mly-px-8",icon:"mly-h-10 mly-w-10"},u=y(`${p} ${w[e]} ${g[o]} ${t}`);return ze(l,c({className:u,ref:i},s))});h.displayName="BaseButton";import{jsx as E}from"react/jsx-runtime";function k(t){return E(h,{variant:"ghost",size:"sm",onClick:t.command,"data-state":t.isActive(),className:y("mly-px-2.5"),type:"button",children:t.icon?E(t.icon,{className:y("mly-h-3.5 mly-w-3.5")}):E("span",{className:"mly-text-sm mly-font-medium mly-text-slate-600",children:t.name})})}import{jsx as Y}from"react/jsx-runtime";function X(t){let{editor:e}=t,o=[Ee,Ie,He],r=z.map((a,n)=>({name:a,isActive:()=>e==null?void 0:e.isActive({textAlign:a}),command:()=>{var l,p,w,g;(l=t==null?void 0:t.editor)!=null&&l.isActive({textAlign:a})?(w=(p=t==null?void 0:t.editor)==null?void 0:p.chain())==null||w.focus().unsetTextAlign().run():(g=t==null?void 0:t.editor)==null||g.chain().focus().setTextAlign(a).run()},icon:o[n]})),s=[{name:"bold",isActive:()=>e==null?void 0:e.isActive("bold"),command:()=>e==null?void 0:e.chain().focus().toggleBold().run(),icon:Oe},{name:"italic",isActive:()=>e==null?void 0:e.isActive("italic"),command:()=>e==null?void 0:e.chain().focus().toggleItalic().run(),icon:Ue},{name:"underline",isActive:()=>e==null?void 0:e.isActive("underline"),command:()=>e==null?void 0:e.chain().focus().toggleUnderline().run(),icon:De},{name:"strike",isActive:()=>e==null?void 0:e.isActive("strike"),command:()=>e==null?void 0:e.chain().focus().toggleStrike().run(),icon:Fe},...r,{name:"link",command:()=>{let a=e==null?void 0:e.getAttributes("link").href,n=window.prompt("URL",a);if(n!==null){if(n===""){e==null||e.chain().focus().extendMarkRange("link").unsetLink().run();return}e==null||e.chain().focus().extendMarkRange("link").setLink({href:n}).run()}},isActive:()=>e==null?void 0:e.isActive("link"),icon:Ve}],i=b(c({},t),{shouldShow:({editor:a,state:n,from:l,to:p})=>{let{doc:w,selection:g}=n,{empty:u}=g,f=!w.textBetween(l,p).length&&Se(n.selection);return!(u||f||!a.isEditable||a.isActive("image")||a.isActive("logo")||a.isActive("spacer")||a.isActive({mailyComponent:"button"}))},tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return Y(Pe,b(c({},i),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:s.map((a,n)=>Y(k,c({},a),n))}))}import{useMemo as Z}from"react";import{AlignCenter as qe,AlignLeft as $e,AlignRight as Ke,BoldIcon as _e,EraserIcon as Ge,ItalicIcon as We,LinkIcon as je,SeparatorHorizontal as Je,StrikethroughIcon as Ye,UnderlineIcon as Xe}from"lucide-react";import{jsx as H}from"react/jsx-runtime";var Q=t=>{let{editor:e,config:o}=t,r=Z(()=>[{name:"bold",command:()=>e.chain().focus().toggleBold().run(),isActive:()=>e.isActive("bold"),group:"mark",icon:_e},{name:"italic",command:()=>e.chain().focus().toggleItalic().run(),isActive:()=>e.isActive("italic"),group:"mark",icon:We},{name:"underline",command:()=>e.chain().focus().toggleUnderline().run(),isActive:()=>e.isActive("underline"),group:"mark",icon:Xe},{name:"strike",command:()=>e.chain().focus().toggleStrike().run(),isActive:()=>e.isActive("strike"),group:"mark",icon:Ye},{name:"delete-line",command:()=>e.chain().focus().selectParentNode().deleteSelection().run(),isActive:()=>!1,group:"mark",icon:Ge},{name:"divider",command:()=>e.chain().focus().setHorizontalRule().run(),isActive:()=>e.isActive("horizontalRule"),group:"custom",icon:Je},{name:"link",command:()=>{let i=e.getAttributes("link").href,a=window.prompt("URL",i);if(a!==null){if(a===""){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:a}).run()}},isActive:()=>e.isActive("link"),group:"custom",icon:je},{name:"left",command:()=>e.chain().focus().setTextAlign("left").run(),isActive:()=>e.isActive({textAlign:"left"}),group:"alignment",icon:$e},{name:"center",command:()=>e.chain().focus().setTextAlign("center").run(),isActive:()=>e.isActive({textAlign:"center"}),group:"alignment",icon:qe},{name:"right",command:()=>e.chain().focus().setTextAlign("right").run(),isActive:()=>e.isActive({textAlign:"right"}),group:"alignment",icon:Ke}],[e]),s=Z(()=>r.reduce((i,a)=>(i.includes(a.group)||i.push(a.group),i),[]),[r]);return e?H("div",{className:`mly-flex mly-items-center mly-gap-3 ${o==null?void 0:o.toolbarClassName}`,children:s.map((i,a)=>H("div",{className:"mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-border mly-bg-white mly-p-1",children:r.filter(n=>n.group===i).map((n,l)=>H(k,c({},n),l))},a))}):null};import{BubbleMenu as Ze}from"@tiptap/react";import{AlignCenterIcon as Qe,AlignLeftIcon as et,AlignRightIcon as tt,Link as ot}from"lucide-react";import{jsx as ee}from"react/jsx-runtime";function te(t){let{editor:e}=t,o=[et,Qe,tt],r=z.map((n,l)=>({name:n,isActive:()=>e==null?void 0:e.isActive("logo",{alignment:n}),command:()=>{e==null||e.chain().focus().setLogoAttributes({alignment:n}).run()},icon:o[l]})),s=_.map(n=>({name:n,isActive:()=>{var l;return(l=t==null?void 0:t.editor)==null?void 0:l.isActive("logo",{size:n})},command:()=>{var l;(l=t==null?void 0:t.editor)==null||l.chain().focus().setLogoAttributes({size:n}).run()}})),i=[...r,{name:"url",isActive:()=>!1,command:()=>{var f,A,T;let{editor:n}=t,l=(f=n==null?void 0:n.getAttributes("logo"))==null?void 0:f.src,p=window.prompt("Update logo URL",l);if(!p)return;let w=(A=n==null?void 0:n.getAttributes("logo"))==null?void 0:A.size,g=(T=n==null?void 0:n.getAttributes("logo"))==null?void 0:T.alignment,u=n==null?void 0:n.state.selection;n==null||n.commands.setLogoImage({src:p,size:w,alignment:g}),n==null||n.commands.setNodeSelection((u==null?void 0:u.from)||0)},icon:ot},...s],a=b(c({},t),{shouldShow:({editor:n})=>!!n.isActive("logo"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return ee(Ze,b(c({},a),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:i.map((n,l)=>ee(k,c({},n),l))}))}import{BubbleMenu as st}from"@tiptap/react";import{mergeAttributes as rt,Node as nt}from"@tiptap/core";var O=["sm","md","lg","xl"],lt="sm";function at(t){let e={sm:"8px",md:"16px",lg:"32px",xl:"64px"};return`width: 100%; height: ${e[t]||e[lt]}`}var oe=nt.create({name:"spacer",priority:1e3,group:"block",draggable:!0,addAttributes(){return{height:{default:null,parseHTML:t=>t.getAttribute("data-height"),renderHTML:t=>({"data-height":t.height})}}},addCommands(){return{setSpacer:t=>({commands:e})=>e.insertContent({type:this.name,attrs:{height:t.height}}),setSpacerSize:t=>({commands:e})=>{if(!O.includes(t))throw new Error("Invalid spacer height");return e.updateAttributes("spacer",{height:t})},unsetSpacer:()=>({commands:t})=>t.deleteNode("spacer")}},renderHTML({HTMLAttributes:t,node:e}){let{height:o}=e.attrs;return t.style=at(o),["div",rt({"data-maily-component":this.name},this.options.HTMLAttributes,t,{class:"spacer",contenteditable:!1})]},parseHTML(){return[{tag:`div[data-maily-component="${this.name}"]`}]}});import{jsx as re}from"react/jsx-runtime";function ne(t){let{editor:e}=t,o=O.map(s=>({name:s,isActive:()=>e==null?void 0:e.isActive("spacer",{height:s}),command:()=>{e==null||e.chain().focus().setSpacer({height:s}).run()}})),r=b(c({},t),{shouldShow:({editor:s})=>s.isActive("spacer"),tippyOptions:{moveTransition:"mly-transform 0.15s mly-ease-out"}});return re(st,b(c({},r),{className:"mly-flex mly-gap-1 mly-rounded-md mly-border mly-border-slate-200 mly-bg-white mly-p-1 mly-shadow-md",children:o.map((s,i)=>re(k,c({},s),i))}))}import to from"@tiptap/starter-kit";import{Color as oo}from"@tiptap/extension-color";import ro from"@tiptap/extension-link";import no from"@tiptap/extension-list-item";import lo from"@tiptap/extension-paragraph";import ao from"@tiptap/extension-placeholder";import so from"@tiptap/extension-text-align";import fe from"@tiptap/extension-text-style";import io from"@tiptap/extension-heading";import mo from"@tiptap/extension-image";import{InputRule as it}from"@tiptap/core";import{HorizontalRule as mt}from"@tiptap/extension-horizontal-rule";var le=mt.extend({addInputRules(){return[new it({find:/^(?:---|—-|___\s|\*\*\*\s)$/,handler:({state:t,range:e})=>{let o={},{tr:r}=t,s=e.from,i=e.to;r.insert(s-1,this.type.create(o)).delete(r.mapping.map(s),r.mapping.map(i))}})]}});import{mergeAttributes as ft,Node as bt}from"@tiptap/core";import{ReactNodeViewRenderer as xt}from"@tiptap/react";import{NodeViewWrapper as pt}from"@tiptap/react";import{AlignCenterIcon as dt,AlignLeftIcon as yt,AlignRightIcon as gt}from"lucide-react";import{ChromePicker as me}from"react-color";import*as ae from"react";import{jsx as ct}from"react/jsx-runtime";var P=ae.forwardRef((s,r)=>{var i=s,{className:t,type:e}=i,o=B(i,["className","type"]);return ct("input",c({type:e,className:y("mly-flex mly-h-10 mly-w-full mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-3 mly-py-2 mly-text-sm mly-ring-offset-white file:mly-border-0 file:mly-bg-transparent file:mly-text-sm file:mly-font-medium placeholder:mly-text-gray-500 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2 disabled:mly-cursor-not-allowed disabled:mly-opacity-50",t),ref:r},o))});P.displayName="Input";import*as ie from"react";import*as v from"@radix-ui/react-popover";import{jsx as se}from"react/jsx-runtime";var S=v.Root,I=v.Trigger,R=ie.forwardRef((i,s)=>{var a=i,{className:t,align:e="center",sideOffset:o=4}=a,r=B(a,["className","align","sideOffset"]);return se(v.Portal,{children:se(v.Content,c({ref:s,align:e,sideOffset:o,className:y("mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-p-4 mly-shadow-md mly-outline-none data-[state=open]:mly-animate-in data-[state=closed]:mly-animate-out data-[state=closed]:mly-fade-out-0 data-[state=open]:mly-fade-in-0 data-[state=closed]:mly-zoom-out-95 data-[state=open]:mly-zoom-in-95 data-[side=bottom]:mly-slide-in-from-top-2 data-[side=left]:mly-slide-in-from-right-2 data-[side=right]:mly-slide-in-from-left-2 data-[side=top]:mly-slide-in-from-bottom-2 text-gray-950",t)},r))})});R.displayName=v.Content.displayName;import{jsx as m,jsxs as x}from"react/jsx-runtime";var ut={left:yt,center:dt,right:gt},U={style(t){return ce.map(e=>({name:e,isActive:t.node.attrs.variant===e,onClick:()=>{t.updateAttributes({variant:e})}}))},cornerRadius(t){return pe.map(e=>({name:e,isActive:t.node.attrs.borderRadius===e,onClick:()=>{t.updateAttributes({borderRadius:e})}}))},alignment(t){return Object.entries(ut).map(([e,o])=>({name:e,icon:o,isActive:t.node.attrs.alignment===e,onClick:()=>t.updateAttributes({alignment:e})}))}};function V(t){let{url:e,text:o,alignment:r,variant:s,borderRadius:i,buttonColor:a,textColor:n}=t.node.attrs;return m(pt,{className:`react-component ${t.selected&&"ProseMirror-selectednode"}`,draggable:"true","data-drag-handle":"",style:{textAlign:r},children:x(S,{open:t.selected,children:[m(I,{asChild:!0,children:m("div",{children:m("a",{className:y("mly-inline-flex mly-items-center mly-justify-center mly-rounded-md mly-text-sm mly-font-medium mly-ring-offset-white mly-transition-colors disabled:mly-pointer-events-none disabled:mly-opacity-50","mly-h-10 mly-px-4 mly-py-2","mly-px-[32px] mly-py-[20px] mly-font-semibold mly-no-underline",{"!mly-rounded-full":i==="round","!mly-rounded-md":i==="smooth","!mly-rounded-none":i==="sharp"}),href:e,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,style:{backgroundColor:s==="filled"?a:"transparent",color:n,borderWidth:2,borderStyle:"solid",borderColor:a},children:o})})}),x(R,{align:"end",className:"space-y-2",sideOffset:10,onOpenAutoFocus:l=>l.preventDefault(),onCloseAutoFocus:l=>l.preventDefault(),children:[m(P,{placeholder:"Add text here",value:o,onChange:l=>{t.updateAttributes({text:l.target.value})}}),m(P,{placeholder:"Add link here",value:e,onChange:l=>{t.updateAttributes({url:l.target.value})}}),x("div",{className:"mly-w-full mly-space-y-2",children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Style"}),m("div",{className:"mly-flex mly-gap-1",children:U.style(t).map((l,p)=>m(h,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},p))})]}),x("div",{className:"mly-w-full mly-space-y-2",children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Corner Radius"}),m("div",{className:"mly-flex mly-gap-1",children:U.cornerRadius(t).map((l,p)=>m(h,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow mly-font-normal mly-capitalize",size:"sm",onClick:l.onClick,type:"button",children:l.name},p))})]}),x("div",{className:"flex gap-2",children:[x("div",{children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Alignment"}),m("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:U.alignment(t).map((l,p)=>m(h,{"data-state":l.isActive?"true":"false",variant:"ghost",className:"mly-grow",size:"sm",onClick:l.onClick,type:"button",children:m(l.icon,{size:16})},p))})]}),x("div",{children:[m("p",{className:"mly-text-xs mly-font-normal mly-text-slate-400",children:"Color"}),x("div",{className:"mly-mt-2 mly-flex mly-gap-1",children:[m(ht,{variant:s,color:a,onChange:l=>{t.updateAttributes({buttonColor:l})}}),m(wt,{color:n,onChange:l=>{t.updateAttributes({textColor:l})}})]})]})]})]})]})})}function ht(t){let{color:e,onChange:o,variant:r}=t;return x(S,{children:[m(I,{asChild:!0,children:m(h,{variant:"ghost",className:"",size:"sm",type:"button",children:m("div",{className:"mly-h-4 mly-w-4 mly-rounded",style:{backgroundColor:r==="filled"?e:"transparent",borderStyle:"solid",borderWidth:r==="outline"?2:0,borderColor:e}})})}),m(R,{className:"mly-w-full !mly-p-0",children:m(me,{className:"!mly-shadow-md",color:e,onChange:s=>{o(s.hex)}})})]})}function wt(t){let{color:e,onChange:o}=t;return x(S,{children:[m(I,{asChild:!0,children:m(h,{variant:"ghost",size:"sm",type:"button",children:x("div",{className:"mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]",children:[m("span",{className:"mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700",children:"A"}),m("div",{className:"mly-h-[2px] mly-w-3",style:{backgroundColor:e}})]})})}),m(R,{className:"mly-w-full !mly-p-0",children:m(me,{className:"!mly-shadow-md",color:e,onChange:r=>{o(r.hex)}})})]})}var ce=["filled","outline"],pe=["sharp","smooth","round"],de=bt.create({name:"button",group:"block",atom:!0,draggable:!0,addAttributes(){return{mailyComponent:{default:"button"},text:{default:"Button"},url:{default:""},alignment:{default:"left"},variant:{default:"filled"},borderRadius:{default:"smooth"},buttonColor:{default:"rgb(0, 0, 0)"},textColor:{default:"rgb(255, 255, 255)"}}},parseHTML(){return[{tag:`a[data-maily-component="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["a",ft({"data-maily-component":this.name},t)]},addCommands(){return{setButton:()=>({commands:t})=>t.insertContent({type:this.name,attrs:{mailyComponent:this.name}})}},addNodeView(){return xt(V)}});import{mergeAttributes as vt,Node as kt}from"@tiptap/core";var F=kt.create({name:"footer",group:"block",content:"inline*",addAttributes(){return{"maily-component":{default:"footer",renderHTML:t=>({"data-maily-component":t["maily-component"]}),parseHTML:t=>t==null?void 0:t.getAttribute("data-maily-component")}}},addCommands(){return{setFooter:()=>({commands:t})=>t.setNode(this.name)}},parseHTML(){return[{tag:'small[data-maily-component="footer"]'}]},renderHTML({HTMLAttributes:t}){return["small",vt(this.options.HTMLAttributes,t,{class:"footer mly-block mly-text-[13px] mly-text-slate-500"}),0]}});import{forwardRef as At,useEffect as Ct,useImperativeHandle as Bt,useState as Lt}from"react";import Rt from"@tiptap/extension-mention";import{ReactRenderer as Nt}from"@tiptap/react";import Tt from"tippy.js";import{jsx as D}from"react/jsx-runtime";var ye=At((t,e)=>{var i,a;let[o,r]=Lt(0),s=n=>{let l=t.items[n];l&&t.command({id:l})};return Ct(()=>r(0),[t.items]),Bt(e,()=>({onKeyDown:({event:n})=>n.key==="ArrowUp"?(r((o+t.items.length-1)%t.items.length),!0):n.key==="ArrowDown"?(r((o+1)%t.items.length),!0):n.key==="Enter"?(s(o),!0):!1})),D("div",{className:"mly-z-50 mly-h-auto mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-1 mly-py-2 mly-shadow-md mly-transition-all",children:(i=t==null?void 0:t.items)!=null&&i.length?(a=t==null?void 0:t.items)==null?void 0:a.map((n,l)=>D(h,{variant:"secondary",onClick:()=>s(l),className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:n},l)):D(h,{variant:"secondary",className:"mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100",children:"No result"})})});ye.displayName="VariableList";var Mt={items:({query:t})=>[t.toLowerCase()],render:()=>{let t,e=null;return{onStart:o=>{t=new Nt(ye,{props:o,editor:o.editor}),o.clientRect&&(e=Tt("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(o){var r;t.updateProps(o),o.clientRect&&((r=e==null?void 0:e[0])==null||r.setProps({getReferenceClientRect:o.clientRect}))},onKeyDown(o){var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(o)},onExit(){e==null||e[0].destroy(),t.destroy()}}}},ge=Rt.extend({name:"variable",parseHTML(){return[{tag:'span[data-type="variable"]'}]}}).configure({suggestion:Mt,renderLabel({node:t}){var e;return`${(e=t.attrs.label)!=null?e:t.attrs.id}`},HTMLAttributes:{class:"mly-py-1 mly-px-2 mly-bg-slate-100 mly-border mly-border-blue-300 mly-rounded-md"}});import{useCallback as zt,useEffect as ue,useLayoutEffect as Pt,useRef as St,useState as It}from"react";import{Extension as Et}from"@tiptap/core";import{ReactRenderer as Ht}from"@tiptap/react";import Ot from"@tiptap/suggestion";import{DivideIcon as Ut,EraserIcon as Vt,FootprintsIcon as Ft,Heading1 as Dt,Heading2 as qt,Heading3 as $t,ImageIcon as he,List as Kt,ListOrdered as _t,MousePointer as Gt,MoveVertical as Wt,Text as jt}from"lucide-react";import Jt from"tippy.js";import{jsx as d,jsxs as L}from"react/jsx-runtime";var Yt=Et.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:o})=>{o.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Ot(c({editor:this.editor},this.options.suggestion))]}}),Xt=({query:t})=>[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","paragraph"],icon:d(jt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleNode("paragraph","paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["title","big","large"],icon:d(Dt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["subtitle","medium"],icon:d(qt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["subtitle","small"],icon:d($t,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setNode("heading",{level:3}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["unordered","point"],icon:d(Kt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ordered"],icon:d(_t,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleOrderedList().run()}},{title:"Logo",description:"Add your brand logo",searchTerms:["image","logo"],icon:d(he,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Logo URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setLogoImage({src:r}).run())}},{title:"Image",description:"Full width image",searchTerms:["image"],icon:d(he,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{let r=prompt("Image URL: ")||"";r&&(e.chain().focus().deleteRange(o).run(),e.chain().focus().setImage({src:r}).run())}},{title:"Spacer",description:"Add a spacer to the page. Useful for adding space between sections.",searchTerms:["space","gap","divider"],icon:d(Wt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setSpacer({height:"sm"}).run()}},{title:"Button",description:"Add a call to action button to the page.",searchTerms:["link","button","cta"],icon:d(Gt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setButton().run()}},{title:"Hard Break",description:"Add a break between lines.",searchTerms:["break","line"],icon:d(Ut,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setHardBreak().run()}},{title:"Footer",description:"Add a footer text to the page.",searchTerms:["footer","text"],icon:d(Ft,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setFooter().run()}},{title:"Clear Line",description:"Clear the current line.",searchTerms:["clear","line"],icon:d(Vt,{className:"mly-h-4 mly-w-4"}),command:({editor:e,range:o})=>{e.chain().focus().selectParentNode().deleteSelection().run()}}].filter(e=>{if(typeof t=="string"&&t.length>0){let o=t.toLowerCase();return e.title.toLowerCase().includes(o)||e.description.toLowerCase().includes(o)||e.searchTerms&&e.searchTerms.some(r=>r.includes(o))}return!0}),Zt=(t,e)=>{let o=t.offsetHeight,r=e?e.offsetHeight:0,s=e.offsetTop,i=s+r;s<t.scrollTop?t.scrollTop-=t.scrollTop-s+5:i>o+t.scrollTop&&(t.scrollTop+=i-o-t.scrollTop+5)},Qt=({items:t,command:e,editor:o})=>{let[r,s]=It(0),i=zt(n=>{let l=t[n];l&&e(l)},[e,o,t]);ue(()=>{let n=["ArrowUp","ArrowDown","Enter"],l=p=>{if(n.includes(p.key))return p.preventDefault(),p.key==="ArrowUp"?(s((r+t.length-1)%t.length),!0):p.key==="ArrowDown"?(s((r+1)%t.length),!0):p.key==="Enter"?(i(r),!0):!1};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[t,r,s,i]),ue(()=>{s(0)},[t]);let a=St(null);return Pt(()=>{let n=a==null?void 0:a.current,l=n==null?void 0:n.children[r];l&&n&&Zt(n,l)},[r]),t.length>0?L("div",{className:"mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all",children:[d("div",{id:"slash-command",ref:a,className:"mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-px-1 mly-py-2",children:t.map((n,l)=>L("button",{className:y("mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",l===r?"mly-bg-gray-100 mly-text-gray-900":"mly-bg-transparent"),onClick:()=>i(l),type:"button",children:[d("div",{className:"mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center",children:n.icon}),L("div",{children:[d("p",{className:"mly-font-medium",children:n.title}),d("p",{className:"mly-text-xs mly-text-gray-400",children:n.description})]})]},l))}),d("div",{className:"mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4",children:L("div",{className:"mly-flex mly-items-center",children:[L("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[d("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2191"}),d("kbd",{className:"mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium",children:"\u2193"})," ","to navigate"]}),d("span",{"aria-hidden":"true",className:"mly-select-none mly-px-1",children:"\xB7"}),L("p",{className:"mly-text-center mly-text-xs mly-text-gray-400",children:[d("kbd",{className:"mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium",children:"Enter"})," ","to select"]})]})})]}):null},eo={items:Xt,render:()=>{let t=null,e=null;return{onStart:o=>{t=new Ht(Qt,{props:o,editor:o.editor}),e=Jt("body",{getReferenceClientRect:o.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual"})},onUpdate:o=>{t==null||t.updateProps(o),e&&e[0].setProps({getReferenceClientRect:o.clientRect})},onKeyDown:o=>{var r;return o.event.key==="Escape"?(e==null||e[0].hide(),!0):(r=t==null?void 0:t.ref)==null?void 0:r.onKeyDown(o)},onExit:()=>{e==null||e[0].destroy(),t==null||t.destroy()}}}},we=Yt.configure({suggestion:eo});import co from"@tiptap/extension-underline";var be=[to.configure({heading:{levels:[1,2,3]},dropcursor:{color:"#555",width:3},horizontalRule:!1}),mo,co,j,oo.configure({types:[fe.name,no.name]}),fe.configure(),so.configure({types:[lo.name,io.name,F.name]}),le,ao.configure({placeholder:({node:t})=>t.type.name==="heading"?`Heading ${t.attrs.level}`:"Write something or / to see commands",includeChildren:!0}),oe,F,ge,we,ro.configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow"},openOnClick:!1}),de];import{jsx as N,jsxs as xe}from"react/jsx-runtime";function Un(t){let{config:{wrapClassName:e="",contentClassName:o="",bodyClassName:r="",hasMenuBar:s=!0,spellCheck:i=!1,autofocus:a="end"}={},onCreate:n,onUpdate:l,extensions:p,contentHtml:w,contentJson:g}=t,u=null;g?u=(g==null?void 0:g.type)==="doc"?g:{type:"doc",content:g}:w?u=w:u={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:""}]}]};let f=yo({editorProps:{attributes:{class:y("mly-prose mly-w-full",o),spellCheck:i?"true":"false"},handleDOMEvents:{keydown:(A,T)=>{if(["ArrowUp","ArrowDown","Enter"].includes(T.key)&&document.querySelector("#slash-command"))return!0}}},onCreate:({editor:A})=>{n==null||n(A)},onUpdate:({editor:A})=>{l==null||l(A)},extensions:[...be,...p||[]],content:u,autofocus:a});return f?xe("div",{className:y("mail-editor mly-antialiased",e),children:[s&&N(Q,{config:t.config,editor:f}),xe("div",{className:y("mly-mt-4 mly-rounded mly-border mly-bg-white mly-p-4",r),children:[N(X,{editor:f}),N(te,{editor:f}),N(ne,{editor:f}),N(po,{editor:f})]})]}):null}export{Un as Editor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maily-to/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Powerful editor for creating beautiful, pre-designed, mobile-ready emails.",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",