reactjs-tiptap-editor 1.0.21 → 1.0.22
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/lib/{ActionMenuButton-Cpla3oSm.js → ActionMenuButton-B1067mIC.js} +1 -1
- package/lib/{ActionMenuButton-BVaZBdL3.cjs → ActionMenuButton-BBDqKvKg.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +2 -2
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +1 -1
- package/lib/{Callout-mb31jDcR.js → Callout-V2mO6s2Y.js} +2 -2
- package/lib/{Callout-JL3mm4GU.cjs → Callout-lBlBlK_w.cjs} +1 -1
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +2 -2
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +1 -1
- package/lib/{Drawer-94nAoli4.cjs → Drawer-BeYo9jAG.cjs} +1 -1
- package/lib/{Drawer-d9e69c7G.js → Drawer-Cyv27orn.js} +2 -2
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +3 -3
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +4 -4
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +4 -4
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +1 -1
- package/lib/{Iframe-qCivhCR5.cjs → Iframe-Bx-VDxSB.cjs} +1 -1
- package/lib/{Iframe-CkUClxtI.js → Iframe-D9JVKzO0.js} +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +2 -2
- package/lib/{Indent-BTzj50Sf.js → Indent-B5tQ5Wfg.js} +1 -1
- package/lib/{Indent-DtgugDpq.cjs → Indent-CCLO0KpG.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +1 -1
- package/lib/{Katex-RcbH2O5p.cjs → Katex-rtfVV2pl.cjs} +1 -1
- package/lib/{Katex-BuFwL_MA.js → Katex-w_c6vAMd.js} +3 -3
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +1 -1
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +3 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +1 -1
- package/lib/{LinkEditBlock-DYOmu7jQ.js → LinkEditBlock-CTlU8YnO.js} +3 -3
- package/lib/{LinkEditBlock-CSKh_5n7.cjs → LinkEditBlock-_41zgSyl.cjs} +1 -1
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +3 -3
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +1 -1
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +3 -3
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +3 -3
- package/lib/{SlashCommandNodeView-CYdYVjeb.cjs → SlashCommandNodeView-CVKjpS6r.cjs} +1 -1
- package/lib/{SlashCommandNodeView-CT_-28t6.js → SlashCommandNodeView-DNkpJuM3.js} +2 -2
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +1 -1
- package/lib/{Table-DOl6C6To.cjs → Table-BFiU40iW.cjs} +1 -1
- package/lib/{Table-CEHV8gmO.js → Table-yZtD5Qo1.js} +3 -3
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +1 -1
- package/lib/{Twitter-DDuJwWdF.cjs → Twitter-BJjt8vv_.cjs} +1 -1
- package/lib/{Twitter-DxqKzo3U.js → Twitter-CKm0M53B.js} +3 -3
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +2 -2
- package/lib/bubble.cjs +2 -2
- package/lib/bubble.js +25 -17
- package/lib/{dropdown-menu-BYbds8yQ.js → dropdown-menu-AhMKS9PQ.js} +1 -1
- package/lib/{dropdown-menu-CoZZaqv5.cjs → dropdown-menu-Dre693DD.cjs} +1 -1
- package/lib/{index-DirFiHQ6.cjs → index-83hp1lZH.cjs} +1 -1
- package/lib/{index-B1SzsIsE.js → index-BfHAqkoX.js} +1 -1
- package/lib/index-C4aGVY2E.cjs +1 -0
- package/lib/{index-BlXGgvT-.js → index-DtVRewGA.js} +26 -14
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +2 -0
- package/lib/locales/fi.d.ts +2 -0
- package/lib/locales/hu.d.ts +2 -0
- package/lib/locales/index.d.ts +12 -0
- package/lib/locales/pt-br.d.ts +2 -0
- package/lib/locales/vi.d.ts +2 -0
- package/lib/locales/zh-cn.d.ts +2 -0
- package/lib/{popover-CK54Ip2N.js → popover-B1ptDngu.js} +1 -1
- package/lib/{popover-BaAurWOZ.cjs → popover-D7w_FVSV.cjs} +1 -1
- package/lib/{separator-XZA3-egy.js → separator-CDoF4Z4Z.js} +3 -3
- package/lib/{separator-ByK1SKWn.cjs → separator-C_7KkuoG.cjs} +1 -1
- package/lib/{textarea-mwHtiXJV.cjs → textarea-CEtXap1b.cjs} +1 -1
- package/lib/{textarea--IMIy9VF.js → textarea-CNzZnjjW.js} +1 -1
- package/package.json +1 -1
- package/lib/index-BqL4vAWE.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),x=require("react"),$e=require("./index-NsYff_Ni.cjs");require("./theme.cjs");const Ft=require("@radix-ui/react-dialog"),u=require("lucide-react"),le=require("./clsx-DSAWW32g.cjs"),oe=require("./index-C4WLt4NA.cjs"),F=require("./index-BqL4vAWE.cjs"),ht=require("@radix-ui/react-slot"),$t=require("@radix-ui/react-tooltip"),Wt=require("@radix-ui/react-toggle"),je=require("@radix-ui/react-icons"),Gt=require("@radix-ui/react-tabs"),Xt=require("react-image-crop"),qt=require("@radix-ui/react-checkbox"),Yt=require("@radix-ui/react-label");function ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const U=ee(x),$=ee(Ft),be=ee($t),ft=ee(Wt),te=ee(Gt),Oe=ee(qt),mt=ee(Yt),We="-",Zt=e=>{const t=Qt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(We);return a[0]===""&&a.length!==1&&a.shift(),gt(a,t)||Kt(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},gt=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?gt(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(We);return(l=t.validators.find(({validator:a})=>a(s)))==null?void 0:l.classGroupId},ot=/^\[(.+)\]$/,Kt=e=>{if(ot.test(e)){const t=ot.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Qt=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return er(Object.entries(e.classGroups),r).forEach(([s,l])=>{Ue(l,n,s,t)}),n},Ue=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:st(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Jt(o)){Ue(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,l])=>{Ue(l,st(t,s),r,n)})})},st=(e,t)=>{let r=e;return t.split(We).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Jt=e=>e.isThemeGetter,er=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,a])=>[t+l,a])):s);return[r,o]}):e,tr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,l)=>{r.set(s,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let l=r.get(s);if(l!==void 0)return l;if((l=n.get(s))!==void 0)return o(s,l),l},set(s,l){r.has(s)?r.set(s,l):o(s,l)}}},xt="!",rr=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,l=a=>{const c=[];let d=0,p=0,b;for(let m=0;m<a.length;m++){let v=a[m];if(d===0){if(v===o&&(n||a.slice(m,m+s)===t)){c.push(a.slice(p,m)),p=m+s;continue}if(v==="/"){b=m;continue}}v==="["?d++:v==="]"&&d--}const h=c.length===0?a:a.substring(p),k=h.startsWith(xt),w=k?h.substring(1):h,M=b&&b>p?b-p:void 0;return{modifiers:c,hasImportantModifier:k,baseClassName:w,maybePostfixModifierPosition:M}};return r?a=>r({className:a,parseClassName:l}):l},ir=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},nr=e=>({cache:tr(e.cacheSize),parseClassName:rr(e),...Zt(e)}),or=/\s+/,sr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],l=e.trim().split(or);let a="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{modifiers:p,hasImportantModifier:b,baseClassName:h,maybePostfixModifierPosition:k}=r(d);let w=!!k,M=n(w?h.substring(0,k):h);if(!M){if(!w){a=d+(a.length>0?" "+a:a);continue}if(M=n(h),!M){a=d+(a.length>0?" "+a:a);continue}w=!1}const m=ir(p).join(":"),v=b?m+xt:m,f=v+M;if(s.includes(f))continue;s.push(f);const z=o(M,w);for(let g=0;g<z.length;++g){const V=z[g];s.push(v+V)}a=d+(a.length>0?" "+a:a)}return a};function ar(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=pt(t))&&(n&&(n+=" "),n+=r);return n}const pt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=pt(e[n]))&&(r&&(r+=" "),r+=t);return r};function lr(e,...t){let r,n,o,s=l;function l(c){const d=t.reduce((p,b)=>b(p),e());return r=nr(d),n=r.cache.get,o=r.cache.set,s=a,a(c)}function a(c){const d=n(c);if(d)return d;const p=sr(c,r);return o(c,p),p}return function(){return s(ar.apply(null,arguments))}}const R=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},bt=/^\[(?:([a-z-]+):)?(.+)\]$/i,cr=/^\d+\/\d+$/,dr=new Set(["px","full","screen"]),ur=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,X=e=>se(e)||dr.has(e)||cr.test(e),K=e=>de(e,"length",Cr),se=e=>!!e&&!Number.isNaN(Number(e)),Re=e=>de(e,"number",se),he=e=>!!e&&Number.isInteger(Number(e)),xr=e=>e.endsWith("%")&&se(e.slice(0,-1)),T=e=>bt.test(e),Q=e=>ur.test(e),pr=new Set(["length","size","percentage"]),br=e=>de(e,pr,vt),vr=e=>de(e,"position",vt),wr=new Set(["image","url"]),yr=e=>de(e,wr,Sr),jr=e=>de(e,"",kr),fe=()=>!0,de=(e,t,r)=>{const n=bt.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Cr=e=>hr.test(e)&&!fr.test(e),vt=()=>!1,kr=e=>mr.test(e),Sr=e=>gr.test(e),Mr=()=>{const e=R("colors"),t=R("spacing"),r=R("blur"),n=R("brightness"),o=R("borderColor"),s=R("borderRadius"),l=R("borderSpacing"),a=R("borderWidth"),c=R("contrast"),d=R("grayscale"),p=R("hueRotate"),b=R("invert"),h=R("gap"),k=R("gradientColorStops"),w=R("gradientColorStopPositions"),M=R("inset"),m=R("margin"),v=R("opacity"),f=R("padding"),z=R("saturate"),g=R("scale"),V=R("sepia"),y=R("skew"),E=R("space"),L=R("translate"),_=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",T,t],j=()=>[T,t],C=()=>["",X,K],I=()=>["auto",se,T],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",T],ye=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[se,T];return{cacheSize:500,separator:":",theme:{colors:[fe],spacing:[X,K],blur:["none","",Q,T],brightness:W(),borderColor:[e],borderRadius:["none","","full",Q,T],borderSpacing:j(),borderWidth:C(),contrast:W(),grayscale:G(),hueRotate:W(),invert:G(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[xr,K],inset:S(),margin:S(),opacity:W(),padding:j(),saturate:W(),scale:W(),sepia:G(),skew:W(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",T]}],container:["container"],columns:[{columns:[Q]}],"break-after":[{"break-after":ye()}],"break-before":[{"break-before":ye()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),T]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[M]}],"inset-x":[{"inset-x":[M]}],"inset-y":[{"inset-y":[M]}],start:[{start:[M]}],end:[{end:[M]}],top:[{top:[M]}],right:[{right:[M]}],bottom:[{bottom:[M]}],left:[{left:[M]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",he,T]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",T]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",he,T]}],"grid-cols":[{"grid-cols":[fe]}],"col-start-end":[{col:["auto",{span:["full",he,T]},T]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[fe]}],"row-start-end":[{row:["auto",{span:[he,T]},T]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",T]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",T]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",T,t]}],"min-w":[{"min-w":[T,t,"min","max","fit"]}],"max-w":[{"max-w":[T,t,"none","full","min","max","fit","prose",{screen:[Q]},Q]}],h:[{h:[T,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[T,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Q,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Re]}],"font-family":[{font:[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",T]}],"line-clamp":[{"line-clamp":["none",se,Re]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",X,T]}],"list-image":[{"list-image":["none",T]}],"list-style-type":[{list:["none","disc","decimal",T]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",X,K]}],"underline-offset":[{"underline-offset":["auto",X,T]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",T]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),vr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",br]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:A()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[X,T]}],"outline-w":[{outline:[X,K]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[X,K]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Q,jr]}],"shadow-color":[{shadow:[fe]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Q,T]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[b]}],saturate:[{saturate:[z]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",T]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",T]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",T]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[he,T]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",T]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",T]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[X,K,Re]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Tr=lr(Mr);function O(...e){return Tr(le.clsx(e))}let Ve;function De(){return Ve===void 0&&(Ve=navigator.platform.includes("Mac")),Ve}function wt(e){return`${e}`.toLowerCase()==="mod"?De()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?De()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?De()?"⇧":"Shift":e}function yt(e){return e.map(wt).join(" ")}const Ge=x.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:o=!1,customClass:s="",loading:l=void 0,shortcutKeys:a=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0,children:b,asChild:h=!1,upload:k=!1,initialDisplayedColor:w=void 0,dataState:M=!1,...m}=e,v=Xe[r],f=h?ht.Slot:Ye,z=g=>{if(o){g.preventDefault();return}d==null||d(g)};return i.jsxs(St,{children:[i.jsx(Mt,{asChild:!0,children:i.jsxs(f,{className:O("richtext-h-[32px] richtext-w-[32px]",s),"data-state":M?"on":"off",disabled:o,onClick:z,ref:t,size:"sm",...m,children:[v&&i.jsx(v,{className:"richtext-size-4"}),b]})}),n&&i.jsx(Ze,{...c,className:"richtext-tooltip",children:i.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i.jsx("div",{children:n}),!!(a!=null&&a.length)&&i.jsx("span",{children:yt(a)})]})})]})});function Ir(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function zr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function Lr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Ar(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Nr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function ae(e){const t=Xe[e.name];return t?i.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-h-4 richtext-w-4 ${(e==null?void 0:e.className)||""}`}):null}function Er(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function jt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:i.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Rr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Vr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Dr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Pr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6l1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6l-1.4-1.4z"})})}function _r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Hr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Or(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Ur(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function Ct(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[i.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),i.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function kt(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[i.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),i.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Br(){return i.jsx("svg",{height:"1em",viewBox:"0 0 15 15",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2.5 10.5H2v.5h.5zm2 0v.5H5v-.5zm9-7h.5v-.207l-.146-.147zm-3-3l.354-.354L10.707 0H10.5zM2 6v4.5h1V6zm.5 5h2v-1h-2zm2.5-.5v-2H4v2zM3 7h2V6H3zM2 5V1.5H1V5zm11-1.5V5h1V3.5zM2.5 1h8V0h-8zm7.646-.146l3 3l.708-.708l-3-3zM2 1.5a.5.5 0 0 1 .5-.5V0A1.5 1.5 0 0 0 1 1.5zM1 12v1.5h1V12zm1.5 3h10v-1h-10zM14 13.5V12h-1v1.5zM12.5 15a1.5 1.5 0 0 0 1.5-1.5h-1a.5.5 0 0 1-.5.5zM1 13.5A1.5 1.5 0 0 0 2.5 15v-1a.5.5 0 0 1-.5-.5zM6 7h3V6H6zm0 4h3v-1H6zm1-4.5v4h1v-4zm3.5.5H13V6h-2.5zM10 6v5h1V6zm.5 3H12V8h-1.5z",fill:"currentColor"})})}function Fr(){return i.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),i.jsx("path",{d:"M5 12V5a2 2 0 0 1 2-2h7l5 5v4M2 21v-6m3 0v6m-3-3h3m15-3v6h2m-9 0v-6l2 3l2-3v6m-9.5-6h3M9 15v6"})]})})}function $r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Wr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[i.jsx("circle",{cx:"10",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"10",r:"4"}),i.jsx("circle",{cx:"38",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"38",r:"4"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function Gr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function Xr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function qr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const Xe={Bold:u.Bold,LoaderCircle:u.LoaderCircle,Italic:u.Italic,Underline:u.Underline,Quote:u.Quote,TextQuote:zr,Strikethrough:u.Strikethrough,Minus:u.Minus,Eraser:u.Eraser,PaintRoller:u.PaintRoller,Redo2:u.Redo2,Undo2:u.Undo2,AlignCenter:je.TextAlignCenterIcon,AlignJustify:je.TextAlignJustifyIcon,AlignLeft:je.TextAlignLeftIcon,AlignRight:je.TextAlignRightIcon,ChevronDown:u.ChevronDown,Subscript:u.Subscript,Superscript:u.Superscript,Code:u.Code,Code2:u.CodeXml,Type:u.Type,IndentIncrease:u.IndentIncrease,IndentDecrease:u.IndentDecrease,List:u.List,ListOrdered:u.ListOrdered,ListTodo:u.ListTodo,Link:u.Link,ImageUp:u.ImageUp,Video:u.Video,Maximize:u.Maximize,Minimize:u.Minimize,Table:u.Table,Sparkles:u.Sparkles,Pencil:u.Pencil,Unlink:u.Unlink,BetweenHorizonalEnd:u.BetweenHorizonalEnd,BetweenHorizonalStart:u.BetweenHorizonalStart,BetweenVerticalStart:u.BetweenVerticalStart,BetweenVerticalEnd:u.BetweenVerticalEnd,TableCellsMerge:u.TableCellsMerge,TableCellsSplit:u.TableCellsSplit,Trash2:u.Trash2,Trash:u.Trash,Replace:u.Replace,ChevronsUpDown:u.ChevronsUpDown,LineHeight:Er,Word:Nr,HeadingParagraph:u.Pilcrow,Heading1:u.Heading1,Heading2:u.Heading2,Heading3:u.Heading3,Heading4:u.Heading4,Heading5:u.Heading5,Heading6:u.Heading6,Columns2:u.Columns2,Columns3:u.Columns3,Columns4:u.Columns4,Plus:u.Plus,Grip:u.GripVertical,Copy:u.Copy,Clipboard:u.Clipboard,PanelLeft:u.PanelLeft,PanelRight:u.PanelRight,Columns:u.Columns2,Iframe:u.Frame,MenuDown:jt,SizeS:Dr,SizeM:Vr,SizeL:Rr,AspectRatio:Ir,Emoji:u.SmilePlus,DeleteColumn:Lr,DeleteRow:Ar,SearchAndReplace:u.Replace,EmojiIcon:u.SmilePlusIcon,KatexIcon:u.Sigma,ExportPdf:Ct,ExportWord:kt,ImportWord:qr,ColumnAddLeft:_r,ColumnAddRight:Hr,BookMarked:u.BookMarked,Excalidraw:Ur,ZoomIn:u.ZoomIn,ZoomOut:u.ZoomOut,Settings:u.Settings,Eye:u.Eye,TextDirection:Or,LeftToRight:$r,RightToLeft:Gr,Attachment:u.Paperclip,GifIcon:Br,ChevronUp:u.ChevronUp,Crop:u.CropIcon,Mermaid:Wr,Twitter:Xr,CodeView:Pr,FlipX:u.FlipVertical,FlipY:u.FlipHorizontal,PencilRuler:u.PencilRuler,WrapText:u.WrapText,Loader:u.Loader2,X:u.X,Html:Fr,ExternalLink:u.ExternalLink,Callout:u.NotebookPen},at=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lt=le.clsx,qe=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return lt(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],b=s==null?void 0:s[d];if(p===null)return null;const h=at(p)||at(b);return o[d][h]}),a=r&&Object.entries(r).reduce((d,p)=>{let[b,h]=p;return h===void 0||(d[b]=h),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:b,className:h,...k}=p;return Object.entries(k).every(w=>{let[M,m]=w;return Array.isArray(m)?m.includes({...s,...a}[M]):{...s,...a}[M]===m})?[...d,b,h]:d},[]);return lt(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Yr=qe("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background richtext-text-foreground hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-size-10"}},defaultVariants:{variant:"default",size:"default"}}),B=U.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const l=n?ht.Slot:"button";return i.jsx(l,{className:O(Yr({variant:t,size:r,className:e})),ref:s,...o})});B.displayName="Button";const J=U.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{ref:n,type:t,className:O("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),...r}));J.displayName="Input";const Zr=qe("richtext-text-sm richtext-font-medium richtext-leading-none richtext-text-foreground peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),ce=U.forwardRef(({className:e,...t},r)=>i.jsx(mt.Root,{className:O(Zr(),e),ref:r,...t}));ce.displayName=mt.Root.displayName;const ze=te.Root,ve=U.forwardRef(({className:e,...t},r)=>i.jsx(te.List,{ref:r,className:O("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));ve.displayName=te.List.displayName;const q=U.forwardRef(({className:e,...t},r)=>i.jsx(te.Trigger,{ref:r,className:O("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));q.displayName=te.Trigger.displayName;const Y=U.forwardRef(({className:e,...t},r)=>i.jsx(te.Content,{ref:r,className:O("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1",e),...t}));Y.displayName=te.Content.displayName;const Kr=qe("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Ye=U.forwardRef(({className:e,variant:t,size:r,...n},o)=>i.jsx(ft.Root,{ref:o,className:O(Kr({variant:t,size:r,className:e})),...n}));Ye.displayName=ft.Root.displayName;const Qr=be.Provider,St=be.Root,Mt=be.Trigger,Ze=U.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(be.Content,{"data-richtext-portal":!0,ref:n,sideOffset:t,className:O("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border-none richtext-bg-primary richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-primary-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));Ze.displayName=be.Content.displayName;const Jr=1,ei=1e6;let Pe=0;function ti(){return Pe=(Pe+1)%Number.MAX_SAFE_INTEGER,Pe.toString()}const _e=new Map;function ct(e){if(_e.has(e))return;const t=setTimeout(()=>{_e.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},ei);_e.set(e,t)}function ri(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Jr)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?ct(r):e.toasts.forEach(n=>{ct(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const ke=[];let Se={toasts:[]};function ge(e){Se=ri(Se,e),ke.forEach(t=>{t(Se)})}function ii({...e}){const t=ti(),r=o=>ge({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Le(){const[e,t]=U.useState(Se);return U.useEffect(()=>(ke.push(t),()=>{const r=ke.indexOf(t);r>-1&&ke.splice(r,1)}),[e]),{...e,toast:ii,dismiss:r=>ge({type:"DISMISS_TOAST",toastId:r})}}const Ae=U.forwardRef(({className:e,...t},r)=>i.jsx(Oe.Root,{ref:r,className:O("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-p-0 !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-1 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:i.jsx(Oe.Indicator,{className:O("!richtext-flex !richtext-items-center !richtext-justify-center !richtext-p-0 !richtext-text-current"),children:i.jsx(u.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Ae.displayName=Oe.Root.displayName;function ni(e){return e=e||new Map,{all:e,on(t,r){const n=e.get(t);n?n.push(r):e.set(t,[r])},off(t,r){const n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit(t,r){let n=e.get(t);n&&n.slice().map(o=>{o(r)}),n=e.get("*"),n&&n.slice().map(o=>{o(t,r)})}}}const Ke=ni(),Tt=x.createContext(Ke),oi=()=>x.useContext(Tt);function Qe(e,t){const r=oi();x.useEffect(()=>(t.map(n=>r.on(n,e)),()=>{t.map(n=>r.off(n,e))}),[r,t,e])}const si=Ke.emit;function ai({children:e}){return i.jsx(Tt.Provider,{value:Ke,children:e})}const ue=$.Root,Ne=$.Trigger,li=$.Portal,It=U.forwardRef(({className:e,...t},r)=>i.jsx($.Overlay,{ref:r,className:O("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));It.displayName=$.Overlay.displayName;const re=U.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(li,{"data-richtext-portal":!0,children:[i.jsx(It,{}),i.jsxs($.Content,{"data-richtext-portal":!0,ref:n,className:O("richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border !richtext-border-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,i.jsxs($.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[i.jsx(u.X,{className:"richtext-size-4 richtext-text-accent-foreground"}),i.jsx("span",{className:"richtext-sr-only richtext-text-accent-foreground",children:"Close"})]})]})]}));re.displayName=$.Content.displayName;function zt({className:e,...t}){return i.jsx("div",{className:O("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}zt.displayName="DialogHeader";function Je({className:e,...t}){return i.jsx("div",{className:O("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}Je.displayName="DialogFooter";const ie=U.forwardRef(({className:e,...t},r)=>i.jsx($.Title,{ref:r,className:O("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight richtext-text-foreground",e),...t}));ie.displayName=$.Title.displayName;const ci=U.forwardRef(({className:e,...t},r)=>i.jsx($.Description,{className:O("richtext-text-sm richtext-text-muted-foreground",e),ref:r,...t}));ci.displayName=$.Description.displayName;var di=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ui=oe.Node3.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",oe.mergeAttributes(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,r,n,o,s,l;const a=(r=(t=e.attrs)==null?void 0:t.src)!=null?r:"",c=(o=(n=e.attrs)==null?void 0:n.alt)!=null?o:"",d=(l=(s=e.attrs)==null?void 0:s.title)!=null?l:"";return d?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:l,editor:a})=>{const c=document.createElement("img");Object.entries(l).forEach(([b,h])=>{if(h!=null)switch(b){case"width":case"height":break;default:c.setAttribute(b,h);break}}),c.src=l.src;const d=new oe.ResizableNodeView({element:c,editor:a,node:o,getPos:s,onResize:(b,h)=>{c.style.width=`${b}px`,c.style.height=`${h}px`},onCommit:(b,h)=>{const k=s();k!==void 0&&this.editor.chain().setNodeSelection(k).updateAttributes(this.name,{width:b,height:h}).run()},onUpdate:(b,h,k)=>b.type===o.type,options:{directions:e,min:{width:t,height:r},preserveAspectRatio:n===!0}}),p=d.dom;return p.style.visibility="hidden",p.style.pointerEvents="none",c.onload=()=>{p.style.visibility="",p.style.pointerEvents=""},d}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[oe.nodeInputRule({find:di,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Lt=ui,hi=typeof global=="object"&&global&&global.Object===Object&&global,fi=typeof self=="object"&&self&&self.Object===Object&&self,At=hi||fi||Function("return this")(),Me=At.Symbol,Nt=Object.prototype,mi=Nt.hasOwnProperty,gi=Nt.toString,me=Me?Me.toStringTag:void 0;function xi(e){var t=mi.call(e,me),r=e[me];try{e[me]=void 0;var n=!0}catch{}var o=gi.call(e);return n&&(t?e[me]=r:delete e[me]),o}var pi=Object.prototype,bi=pi.toString;function vi(e){return bi.call(e)}var wi="[object Null]",yi="[object Undefined]",dt=Me?Me.toStringTag:void 0;function Et(e){return e==null?e===void 0?yi:wi:dt&&dt in Object(e)?xi(e):vi(e)}function Rt(e){return e!=null&&typeof e=="object"}var ji="[object Symbol]";function Ci(e){return typeof e=="symbol"||Rt(e)&&Et(e)==ji}var ki=/\s/;function Si(e){for(var t=e.length;t--&&ki.test(e.charAt(t)););return t}var Mi=/^\s+/;function Ti(e){return e&&e.slice(0,Si(e)+1).replace(Mi,"")}function Te(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ut=NaN,Ii=/^[-+]0x[0-9a-f]+$/i,zi=/^0b[01]+$/i,Li=/^0o[0-7]+$/i,Ai=parseInt;function xe(e){if(typeof e=="number")return e;if(Ci(e))return ut;if(Te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ti(e);var r=zi.test(e);return r||Li.test(e)?Ai(e.slice(2),r?2:8):Ii.test(e)?ut:+e}function Ni(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Vt(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=xe(r),r=r===r?r:0),t!==void 0&&(t=xe(t),t=t===t?t:0),Ni(xe(e),t,r)}var He=function(){return At.Date.now()},Ei="Expected a function",Ri=Math.max,Vi=Math.min;function Dt(e,t,r){var n,o,s,l,a,c,d=0,p=!1,b=!1,h=!0;if(typeof e!="function")throw new TypeError(Ei);t=xe(t)||0,Te(r)&&(p=!!r.leading,b="maxWait"in r,s=b?Ri(xe(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function k(y){var E=n,L=o;return n=o=void 0,d=y,l=e.apply(L,E),l}function w(y){return d=y,a=setTimeout(v,t),p?k(y):l}function M(y){var E=y-c,L=y-d,_=t-E;return b?Vi(_,s-L):_}function m(y){var E=y-c,L=y-d;return c===void 0||E>=t||E<0||b&&L>=s}function v(){var y=He();if(m(y))return f(y);a=setTimeout(v,M(y))}function f(y){return a=void 0,h&&n?k(y):(n=o=void 0,l)}function z(){a!==void 0&&clearTimeout(a),d=0,n=c=o=a=void 0}function g(){return a===void 0?l:f(He())}function V(){var y=He(),E=m(y);if(n=arguments,o=this,c=y,E){if(a===void 0)return w(c);if(b)return clearTimeout(a),a=setTimeout(v,t),k(c)}return a===void 0&&(a=setTimeout(v,t)),l}return V.cancel=z,V.flush=g,V}var Di="[object Number]";function Be(e){return typeof e=="number"||Rt(e)&&Et(e)==Di}var Pi="Expected a function";function Fe(e,t,r){var n=!0,o=!0;if(typeof e!="function")throw new TypeError(Pi);return Te(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Dt(e,t,{leading:n,maxWait:t,trailing:o})}const Ce={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function _i(e){var L,_,D;const[t,r]=x.useState({width:F.IMAGE_MAX_SIZE,height:F.IMAGE_MAX_SIZE}),[n,o]=x.useState({width:0,height:0}),[s]=x.useState([Ce.TOP_LEFT,Ce.TOP_RIGHT,Ce.BOTTOM_LEFT,Ce.BOTTOM_RIGHT]),[l,a]=x.useState(!1),[c,d]=x.useState({x:0,y:0,w:0,h:0,dir:""}),{align:p,inline:b}=(L=e==null?void 0:e.node)==null?void 0:L.attrs,h=b&&(p==="left"||p==="right"),k=x.useMemo(()=>{var nt;const{src:S,alt:j,width:C,height:I,flipX:N,flipY:A}=(nt=e==null?void 0:e.node)==null?void 0:nt.attrs,H=Be(C)?`${C}px`:C,P=Be(I)?`${I}px`:I,G=[];N&&G.push("rotateX(180deg)"),A&&G.push("rotateY(180deg)");const ye=G.join(" ");return{src:S||void 0,alt:j||void 0,style:{width:H||void 0,height:P||void 0,transform:ye||"none",...h?{float:p}:{}}}},[(_=e==null?void 0:e.node)==null?void 0:_.attrs]),w=x.useMemo(()=>{const{style:{width:S}}=k;return{width:S==="100%"?S:void 0}},[k]);function M(S){o({width:S.target.width,height:S.target.height})}function m(){const{editor:S,getPos:j}=e;S.commands.setNodeSelection(j())}const v=x.useCallback(Fe(()=>{const{editor:S}=e,{width:j}=getComputedStyle(S.view.dom);r(C=>({...C,width:Number.parseInt(j,10)}))},F.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function f(S,j){S.preventDefault(),S.stopPropagation();const C=n.width,I=n.height,N=C/I;let A=Number(e.node.attrs.width),H=Number(e.node.attrs.height);const P=t.width;A&&!H?(A=A>P?P:A,H=Math.round(A/N)):H&&!A?(A=Math.round(H*N),A=A>P?P:A):!A&&!H?(A=C>P?P:C,H=Math.round(A/N)):A=A>P?P:A,a(!0),d({x:S.clientX,y:S.clientY,w:A,h:H,dir:j})}const z=x.useCallback(Fe(S=>{if(S.preventDefault(),S.stopPropagation(),!l)return;const{x:j,w:C,dir:I}=c,N=(S.clientX-j)*(/l/.test(I)?-1:1),A=Vt(C+N,F.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:A,height:null})},F.IMAGE_THROTTLE_WAIT_TIME),[l,c,t,e.updateAttributes]),g=x.useCallback(S=>{S.preventDefault(),S.stopPropagation(),l&&(d({x:0,y:0,w:0,h:0,dir:""}),a(!1),m())},[l,m]),V=x.useCallback(()=>{document==null||document.addEventListener("mousemove",z,!0),document==null||document.addEventListener("mouseup",g,!0)},[z,g]),y=x.useCallback(()=>{document==null||document.removeEventListener("mousemove",z,!0),document==null||document.removeEventListener("mouseup",g,!0)},[z,g]);x.useEffect(()=>(l?V():y(),()=>{y()}),[l,V,y]);const E=x.useMemo(()=>new ResizeObserver(()=>v()),[v]);return x.useEffect(()=>(E.observe(e.editor.view.dom),()=>{E.disconnect()}),[e.editor.view.dom,E]),i.jsx(le.NodeViewWrapper,{as:b?"span":"div",className:"image-view",style:{float:h?p:void 0,margin:h?p==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:b?"inline":"block",textAlign:h?void 0:p,width:((D=k.style)==null?void 0:D.width)??"auto",...h?{}:w},children:i.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:w,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${l?"image-view__body--resizing":""}`,children:[i.jsx("img",{alt:k.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:M,src:k.src,style:k.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||l)&&i.jsx("div",{className:"image-resizer",children:s==null?void 0:s.map(S=>i.jsx("span",{className:`image-resizer__handler image-resizer__handler--${S}`,onMouseDown:j=>f(j,S)},`image-dir-${S}`))})]})})}function Hi(e){const{editor:t}=le.useCurrentEditor(),r=U.useMemo(()=>t,[e,t]);return le.useEditorState({editor:r,selector(o){return o.editor?{editor:o.editor,editorState:o.editor.state,canCommand:o.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}function Z(){return Hi().editor}const Pt=$e.y(!1);function et(){return $e.b(Pt)}function Oi(){return $e.S(Pt)}const _t=()=>!1;function Ui(e=_t){const t=et(),[r,n]=x.useState(()=>{const a=e();return typeof a=="boolean"?!a:a}),o=Z();x.useEffect(()=>{if(!o||!e)return;const a=()=>{const c=e();n(typeof c=="boolean"?!c:c)};return a(),o.on("selectionUpdate",a),o.on("transaction",a),()=>{o.off("selectionUpdate",a),o.off("transaction",a)}},[o,e]);const s=x.useMemo(()=>!t||!o?!0:typeof r=="boolean"?r:!1,[t,o,r]),l=x.useMemo(()=>!t||!o,[t,o]);return{disabled:s,dataState:r,editorDisabled:l}}function we(e=_t){const t=et(),[r,n]=x.useState({}),[o,s]=x.useState(e()),l=Z();x.useEffect(()=>{if(!l||!e)return;const d=()=>{s(e())};return d(),l.on("selectionUpdate",d),()=>{l.off("selectionUpdate",d)}},[r,l,e]);const a=x.useMemo(()=>!t||!l,[t,l]),c=x.useMemo(()=>!t||!l,[t,l]);return{disabled:a,dataState:o,editorDisabled:c,update:()=>n({})}}function ne(e){const t=Z();return x.useMemo(()=>t?t.extensionManager.extensions.find(n=>n.name===e):null,[t,e])}function Bi(e,t,r){return e<t?t:e>r?r:e}const Fi=e=>typeof e=="number",$i=e=>typeof e=="string",Wi=e=>typeof e=="function";function Gi(e,t="px"){if(!e)return e;const r=Fi(e)?String(e):e,n=Number.parseFloat(r),o=r.match(/[%a-z]+$/i),s=o?o[0]:t;return Number.isNaN(n)?e:n+s}function Xi(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(o=>o.name===t)}function qi(e){return e.map(t=>$i(t)?{value:t,name:t}:t)}function tt(e){const t=Z(),r=ne(e),{t:n}=F.useLocale();return x.useMemo(()=>{if(!t||!r||!n)return null;const{button:o}=r.options;return!o||!Wi(o)?null:o({editor:t,extension:r,t:n})},[t,r,n])}function Yi(e,t){const r=e.type,n=e.name.toLowerCase(),o=n.split(".").pop();if(!o)return!1;const l=r||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[o];return t.some(a=>{if(a.startsWith("."))return n.endsWith(a);if(a.endsWith("/*")){const c=a.split("/")[0];return l==null?void 0:l.startsWith(c+"/")}return l===a})}function rt(e,t){const{acceptMimes:r,maxSize:n,t:o,toast:s}=t,l=[];return(Array.isArray(e)?e:Object.values(e)).forEach(c=>{if(!Yi(c,r)){t.onError?t.onError({type:"type",message:o("editor.upload.fileTypeNotSupported",{fileName:c.name}),file:c}):s({variant:"default",title:o("editor.upload.fileTypeNotSupported",{fileName:c.name})});return}if(c.size>n){const d=(n/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d}),file:c}):s({variant:"default",title:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d})});return}l.push(c)}),l}function Zi(){const{t:e}=F.useLocale(),{toast:t}=Le(),r=Z(),n=tt(pe.name),{icon:o,tooltip:s}=(n==null?void 0:n.componentProps)??{},{editorDisabled:l}=we(),[a,c]=x.useState(!1),[d,p]=x.useState(!1),b=ne(pe.name),[h,k]=x.useState(""),[w,M]=x.useState(""),m=x.useRef(null),v=(b==null?void 0:b.options.defaultInline)||!1,[f,z]=x.useState(v),g=x.useMemo(()=>(b==null?void 0:b.options)||Ee,[b]);async function V(L){var S;const _=(S=L==null?void 0:L.target)==null?void 0:S.files;if(!r||r.isDestroyed||_.length===0||d){L.target.value="";return}const D=rt(_,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t:e,toast:t,onError:g.onError});if(D.length<=0){L.target.value="";return}p(!0);try{if(g!=null&&g.multiple){const j=D.map(async I=>{let N="";return g.upload?N=await g.upload(I):N=URL.createObjectURL(I),N});(await Promise.all(j)).forEach(I=>{r.chain().focus().setImageInline({src:I,inline:f,alt:w}).run()})}else{const j=D[0];let C="";g.upload?C=await g.upload(j):C=URL.createObjectURL(j),r.chain().focus().setImageInline({src:C,inline:f,alt:w}).run()}c(!1),M(""),z(v)}catch(j){console.error("Error uploading image",j),g.onError?g.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{p(!1),L.target.value=""}}function y(L){L.preventDefault(),L.stopPropagation(),r.chain().focus().setImageInline({src:h,inline:f,alt:w}).run(),c(!1),z(v),k(""),M("")}function E(L){var _;L.preventDefault(),(_=m.current)==null||_.click()}return n?i.jsxs(ue,{onOpenChange:c,open:a,children:[i.jsx(Ne,{asChild:!0,children:i.jsx(Ge,{disabled:l,icon:o,tooltip:s,action:()=>{l||c(!0)}})}),i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.image.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:g.resourceImage==="both"||g.resourceImage==="upload"?"upload":"link",children:[g.resourceImage==="both"&&i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(q,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(q,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(Ae,{checked:f,onCheckedChange:L=>{z(L)}}),i.jsx(ce,{children:e("editor.link.dialog.inline")})]}),g.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(ce,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(J,{onChange:L=>M(L.target.value),required:!0,type:"text",value:w})]}),i.jsxs(Y,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:d,onClick:E,size:"sm",children:d?i.jsxs(i.Fragment,{children:[e("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),i.jsx(Ot,{alt:w,disabled:d,editor:r,imageInline:f,onClose:()=>{M("")}})]}),i.jsx("input",{accept:g.acceptMimes.join(",")||"image/*",multiple:g.multiple,onChange:V,ref:m,style:{display:"none"},type:"file"})]}),i.jsx(Y,{value:"link",children:i.jsx("form",{onSubmit:y,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,onChange:L=>k(L.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:h}),i.jsx(B,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})]}):i.jsx(i.Fragment,{})}const Ee={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},pe=Lt.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...Ee,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var o,s;return{componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((s=(o=t.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip")}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return le.ReactNodeViewRenderer(_i)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:o}=e,s=o&&(n==="left"||n==="right"),l=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",a=s?"":`text-align: ${n};`,p=`${s?`float: ${n};`:""}${s?n==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${l}`;return[o?"span":"div",{style:a,class:"image"},["img",oe.mergeAttributes({height:"auto",style:p},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var s;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,o=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((s=t==null?void 0:t.style)==null?void 0:s.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,o=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:'img[src]:not([src^="data:"])'}]}});function Ki(e){return e.replace(/^.*\/|\..+$/g,"")}function Qi(e){return e.split(".").pop()}function Ji(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function en(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function tn(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function Ht(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=atob(r[r.length-1]);let s=o.length;const l=new Uint8Array(s);for(;s--;)l[s]=o.charCodeAt(s);return new File([l],t,{type:n})}function Ot({editor:e,imageInline:t,onClose:r,disabled:n,alt:o}){var S,j;const{t:s}=F.useLocale(),{toast:l}=Le(),[a,c]=x.useState(!1),[d,p]=x.useState(!1),b=x.useRef(null),[h,k]=x.useState(),[w,M]=x.useState(""),m=x.useRef(null),[v,f]=x.useState({src:"",file:null}),z=ne(pe.name),g=x.useMemo(()=>(z==null?void 0:z.options)??{},[z]);function V(C){if(b.current&&C.width&&C.height){const I=y(b.current,C);M(I)}}function y(C,I){const N=document.createElement("canvas"),A=C.naturalWidth/C.width,H=C.naturalHeight/C.height;N.width=I.width*A,N.height=I.height*H;const P=N.getContext("2d");return P&&(P.imageSmoothingEnabled=!1,P.drawImage(C,I.x*A,I.y*H,I.width*A,I.height*H,0,0,I.width*A,I.height*H)),N.toDataURL("image/png",1)}const E=x.useCallback(async()=>{var C;if(!d){p(!0);try{const I=Ht(w,((C=v==null?void 0:v.file)==null?void 0:C.name)||"image.png");let N="";g.upload?N=await g.upload(I):N=URL.createObjectURL(I),e.chain().focus().setImageInline({src:N,inline:t,alt:o}).run(),c(!1),f({src:"",file:null}),D(),r()}catch(I){console.error("Error cropping image",I)}finally{p(!1)}}},[w,e,t,d,r,(S=v==null?void 0:v.file)==null?void 0:S.name,g]);function L(C){var I;C.preventDefault(),(I=m.current)==null||I.click()}const _=async C=>{var P;const I=(P=C==null?void 0:C.target)==null?void 0:P.files;if(!e||e.isDestroyed||I.length===0){C.target.value="";return}const N=rt(I,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t:s,toast:l,onError:g.onError});if(N.length<=0){C.target.value="";return}const A=N[0],H=await tn(A);c(!0),f({src:H.src,file:A})},D=()=>{m.current&&(m.current.value="")};return i.jsxs(i.Fragment,{children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:n,onClick:L,size:"sm",children:s("editor.image.dialog.tab.uploadCrop")}),i.jsxs(ue,{open:a,onOpenChange:C=>{c(C),C||(f({src:"",file:null}),D())},children:[i.jsx(Ne,{}),i.jsxs(re,{children:[i.jsx(ie,{children:s("editor.image.dialog.tab.uploadCrop")}),i.jsx("div",{children:v.src&&i.jsx(Xt,{className:"richtext-w-full",crop:h,onChange:C=>k(C),onComplete:C=>V(C),children:i.jsx("img",{alt:"Crop me",ref:b,src:v.src})})}),i.jsxs(Je,{children:[i.jsxs(B,{disabled:d,onClick:()=>{c(!1),f({src:"",file:null}),D()},children:[s("editor.imageUpload.cancel"),i.jsx(ae,{className:"richtext-ml-1",name:"Trash2"})]}),i.jsx(B,{className:"richtext-w-fit",disabled:d||!h,onClick:E,children:d?i.jsxs(i.Fragment,{children:[s("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):i.jsxs(i.Fragment,{children:[s("editor.imageUpload.crop"),i.jsx(ae,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),i.jsx("input",{accept:((j=g==null?void 0:g.acceptMimes)==null?void 0:j.join(","))||"image/*",multiple:!1,onChange:_,ref:m,style:{display:"none"},type:"file"})]})}const it={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EXCALIDRAW:e=>`EXCALIDRAW-${e}`};function rn(){const{t:e}=F.useLocale(),{toast:t}=Le(),r=Z(),{editorDisabled:n}=we(),[o,s]=x.useState(!1),l=it.UPLOAD_IMAGE(r.id);Qe(s,[l]);const[a,c]=x.useState(!1),d=ne(pe.name),[p,b]=x.useState(""),[h,k]=x.useState(""),w=x.useRef(null),M=(d==null?void 0:d.options.defaultInline)||!1,[m,v]=x.useState(M),f=x.useMemo(()=>(d==null?void 0:d.options)||Ee,[d]);async function z(y){var _;const E=(_=y==null?void 0:y.target)==null?void 0:_.files;if(!r||r.isDestroyed||E.length===0||a){y.target.value="";return}const L=rt(E,{acceptMimes:f==null?void 0:f.acceptMimes,maxSize:f==null?void 0:f.maxSize,t:e,toast:t,onError:f.onError});if(L.length<=0){y.target.value="";return}c(!0);try{if(f!=null&&f.multiple){const D=L.map(async j=>{let C="";return f.upload?C=await f.upload(j):C=URL.createObjectURL(j),C});(await Promise.all(D)).forEach(j=>{r.chain().focus().setImageInline({src:j,inline:m,alt:h}).run()})}else{const D=L[0];let S="";f.upload?S=await f.upload(D):S=URL.createObjectURL(D),r.chain().focus().setImageInline({src:S,inline:m,alt:h}).run()}s(!1),k(""),v(M)}catch(D){console.error("Error uploading image",D),f.onError?f.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{c(!1),y.target.value=""}}function g(y){y.preventDefault(),y.stopPropagation(),r.chain().focus().setImageInline({src:p,inline:m,alt:h}).run(),s(!1),v(M),b(""),k("")}function V(y){var E;y.preventDefault(),(E=w.current)==null||E.click()}return n?i.jsx(i.Fragment,{}):i.jsx(ue,{onOpenChange:s,open:o,children:i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.image.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:f.resourceImage==="both"||f.resourceImage==="upload"?"upload":"link",children:[f.resourceImage==="both"&&i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(q,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(q,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(Ae,{checked:m,onCheckedChange:y=>{v(y)}}),i.jsx(ce,{children:e("editor.link.dialog.inline")})]}),f.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(ce,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(J,{onChange:y=>k(y.target.value),required:!0,type:"text",value:h})]}),i.jsxs(Y,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:a,onClick:V,size:"sm",children:a?i.jsxs(i.Fragment,{children:[e("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),i.jsx(Ot,{alt:h,disabled:a,editor:r,imageInline:m,onClose:()=>{k("")}})]}),i.jsx("input",{accept:f.acceptMimes.join(",")||"image/*",multiple:f.multiple,onChange:z,ref:w,style:{display:"none"},type:"file"})]}),i.jsx(Y,{value:"link",children:i.jsx("form",{onSubmit:g,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,onChange:y=>b(y.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:p}),i.jsx(B,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})})}function Ut(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const o=n.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${o}$`).test(r.hostname)}return r.hostname.includes(n)})}function nn(){const{t:e}=F.useLocale(),t=Z(),r=tt(Ie.name),{icon:n,tooltip:o}=(r==null?void 0:r.componentProps)??{},{editorDisabled:s}=we(),[l,a]=x.useState(""),c=x.useRef(null),[d,p]=x.useState(""),[b,h]=x.useState(!1),k=ne(Ie.name),w=x.useMemo(()=>(k==null?void 0:k.options)??{},[k]);async function M(f){var y;const z=(y=f==null?void 0:f.target)==null?void 0:y.files;if(!t||t.isDestroyed||z.length===0)return;const g=z[0];let V="";w.upload?V=await w.upload(g):V=URL.createObjectURL(g),t.chain().focus().setVideo({src:V,width:"100%"}).run(),h(!1)}function m(f){f.preventDefault(),f.stopPropagation(),l&&(t.chain().focus().setVideo({src:l,width:"100%"}).run(),h(!1),a(""))}function v(f){var z;f.preventDefault(),(z=c.current)==null||z.click()}return i.jsxs(ue,{onOpenChange:h,open:b,children:[i.jsx(Ne,{asChild:!0,children:i.jsx(Ge,{disabled:s,icon:n,tooltip:o,action:()=>{s||h(!0)}})}),i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.video.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:(w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="upload")&&i.jsx(q,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="link")&&i.jsx(q,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Y,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(B,{className:"richtext-mt-1 richtext-w-full",onClick:v,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:M,ref:c,type:"file",style:{display:"none"}})]}),i.jsxs(Y,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:l,onBlur:f=>{const z=f.target.value,g=w.videoProviders||["."];z&&!Ut(z,g)?p("Invalid video URL"):p("")},onChange:f=>{a(f.target.value)}}),i.jsx(B,{onClick:m,type:"button",children:e("editor.video.dialog.button.apply")})]})}),d&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:d})]})]})]})]})}function on(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const r=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(r){const o=r[1],s=r[2];s?e=`https://player.vimeo.com/video/${o}?h=${s}`:e=`https://player.vimeo.com/video/${o}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Ie=oe.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:F.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var r,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?on(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:Gi(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:r="center"}=e??{},n={...e,width:"100%",height:"100%"},o=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,s=`flex: 1;padding-bottom: ${9/16*100}%;`,p=["div",{style:`display: flex; justify-content: ${r};`},["div",{style:o},["div",{style:s}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},p]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});function sn(){const{t:e}=F.useLocale(),t=Z(),{editorDisabled:r}=we(),[n,o]=x.useState(""),s=x.useRef(null),[l,a]=x.useState(""),[c,d]=x.useState(!1),p=ne(Ie.name),b=it.UPLOAD_VIDEO(t.id);Qe(d,[b]);const h=x.useMemo(()=>(p==null?void 0:p.options)??{},[p]);async function k(m){var g;const v=(g=m==null?void 0:m.target)==null?void 0:g.files;if(!t||t.isDestroyed||v.length===0)return;const f=v[0];let z="";h.upload?z=await h.upload(f):z=URL.createObjectURL(f),t.chain().focus().setVideo({src:z,width:"100%"}).run(),d(!1)}function w(m){m.preventDefault(),m.stopPropagation(),n&&(t.chain().focus().setVideo({src:n,width:"100%"}).run(),d(!1),o(""))}function M(m){var v;m.preventDefault(),(v=s.current)==null||v.click()}return r?i.jsx(i.Fragment,{}):i.jsx(ue,{onOpenChange:d,open:c,children:i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.video.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:(h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload")&&i.jsx(q,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="link")&&i.jsx(q,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Y,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(B,{className:"richtext-mt-1 richtext-w-full",onClick:M,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:k,ref:s,type:"file",style:{display:"none"}})]}),i.jsxs(Y,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:n,onBlur:m=>{const v=m.target.value,f=h.videoProviders||["."];v&&!Ut(v,f)?a("Invalid video URL"):a("")},onChange:m=>{o(m.target.value)}}),i.jsx(B,{onClick:w,type:"button",children:e("editor.video.dialog.button.apply")})]})}),l&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:l})]})]})]})})}function Bt(){return i.jsxs(i.Fragment,{children:[i.jsx(rn,{}),i.jsx(sn,{})]})}process.env.NODE_ENV!=="production"&&(Bt.displayName="SlashDialogTrigger");exports.ActionButton=Ge;exports.Button=B;exports.Checkbox=Ae;exports.DEFAULT_OPTIONS=Ee;exports.Dialog=ue;exports.DialogContent=re;exports.DialogFooter=Je;exports.DialogHeader=zt;exports.DialogTitle=ie;exports.DialogTrigger=Ne;exports.EVENTS=it;exports.ExportPdf=Ct;exports.ExportWord=kt;exports.IconComponent=ae;exports.Image=pe;exports.Input=J;exports.Label=ce;exports.MenuDown=jt;exports.ReactBusProvider=ai;exports.RichTextImage=Zi;exports.RichTextVideo=nn;exports.SlashDialogTrigger=Bt;exports.Toggle=Ye;exports.Tooltip=St;exports.TooltipContent=Ze;exports.TooltipProvider=Qr;exports.TooltipTrigger=Mt;exports.Video=Ie;exports.clamp=Bi;exports.clamp$1=Vt;exports.cn=O;exports.dataURLtoFile=Ht;exports.debounce=Dt;exports.emit=si;exports.ensureNameValueOptions=qi;exports.extractFileExtension=Qi;exports.extractFilename=Ki;exports.getShortcutKey=wt;exports.getShortcutKeys=yt;exports.hasExtension=Xi;exports.icons=Xe;exports.index_default=Lt;exports.isNumber=Be;exports.normalizeFileSize=Ji;exports.normalizeFileType=en;exports.throttle=Fe;exports.useActive=Ui;exports.useButtonProps=tt;exports.useEditableEditor=et;exports.useEditorInstance=Z;exports.useExtension=ne;exports.useListener=Qe;exports.useStoreEditableEditor=Oi;exports.useToast=Le;exports.useToggleActive=we;
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),x=require("react"),$e=require("./index-NsYff_Ni.cjs");require("./theme.cjs");const Ft=require("@radix-ui/react-dialog"),u=require("lucide-react"),le=require("./clsx-DSAWW32g.cjs"),oe=require("./index-C4WLt4NA.cjs"),F=require("./index-C4aGVY2E.cjs"),ht=require("@radix-ui/react-slot"),$t=require("@radix-ui/react-tooltip"),Wt=require("@radix-ui/react-toggle"),je=require("@radix-ui/react-icons"),Gt=require("@radix-ui/react-tabs"),Xt=require("react-image-crop"),qt=require("@radix-ui/react-checkbox"),Yt=require("@radix-ui/react-label");function ee(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const U=ee(x),$=ee(Ft),be=ee($t),ft=ee(Wt),te=ee(Gt),Oe=ee(qt),mt=ee(Yt),We="-",Zt=e=>{const t=Qt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(We);return a[0]===""&&a.length!==1&&a.shift(),gt(a,t)||Kt(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},gt=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?gt(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(We);return(l=t.validators.find(({validator:a})=>a(s)))==null?void 0:l.classGroupId},ot=/^\[(.+)\]$/,Kt=e=>{if(ot.test(e)){const t=ot.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Qt=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return er(Object.entries(e.classGroups),r).forEach(([s,l])=>{Ue(l,n,s,t)}),n},Ue=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:st(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Jt(o)){Ue(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,l])=>{Ue(l,st(t,s),r,n)})})},st=(e,t)=>{let r=e;return t.split(We).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Jt=e=>e.isThemeGetter,er=(e,t)=>t?e.map(([r,n])=>{const o=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,a])=>[t+l,a])):s);return[r,o]}):e,tr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,l)=>{r.set(s,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let l=r.get(s);if(l!==void 0)return l;if((l=n.get(s))!==void 0)return o(s,l),l},set(s,l){r.has(s)?r.set(s,l):o(s,l)}}},xt="!",rr=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],s=t.length,l=a=>{const c=[];let d=0,p=0,b;for(let m=0;m<a.length;m++){let v=a[m];if(d===0){if(v===o&&(n||a.slice(m,m+s)===t)){c.push(a.slice(p,m)),p=m+s;continue}if(v==="/"){b=m;continue}}v==="["?d++:v==="]"&&d--}const h=c.length===0?a:a.substring(p),k=h.startsWith(xt),w=k?h.substring(1):h,M=b&&b>p?b-p:void 0;return{modifiers:c,hasImportantModifier:k,baseClassName:w,maybePostfixModifierPosition:M}};return r?a=>r({className:a,parseClassName:l}):l},ir=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},nr=e=>({cache:tr(e.cacheSize),parseClassName:rr(e),...Zt(e)}),or=/\s+/,sr=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,s=[],l=e.trim().split(or);let a="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{modifiers:p,hasImportantModifier:b,baseClassName:h,maybePostfixModifierPosition:k}=r(d);let w=!!k,M=n(w?h.substring(0,k):h);if(!M){if(!w){a=d+(a.length>0?" "+a:a);continue}if(M=n(h),!M){a=d+(a.length>0?" "+a:a);continue}w=!1}const m=ir(p).join(":"),v=b?m+xt:m,f=v+M;if(s.includes(f))continue;s.push(f);const z=o(M,w);for(let g=0;g<z.length;++g){const V=z[g];s.push(v+V)}a=d+(a.length>0?" "+a:a)}return a};function ar(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=pt(t))&&(n&&(n+=" "),n+=r);return n}const pt=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=pt(e[n]))&&(r&&(r+=" "),r+=t);return r};function lr(e,...t){let r,n,o,s=l;function l(c){const d=t.reduce((p,b)=>b(p),e());return r=nr(d),n=r.cache.get,o=r.cache.set,s=a,a(c)}function a(c){const d=n(c);if(d)return d;const p=sr(c,r);return o(c,p),p}return function(){return s(ar.apply(null,arguments))}}const R=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},bt=/^\[(?:([a-z-]+):)?(.+)\]$/i,cr=/^\d+\/\d+$/,dr=new Set(["px","full","screen"]),ur=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,X=e=>se(e)||dr.has(e)||cr.test(e),K=e=>de(e,"length",Cr),se=e=>!!e&&!Number.isNaN(Number(e)),Re=e=>de(e,"number",se),he=e=>!!e&&Number.isInteger(Number(e)),xr=e=>e.endsWith("%")&&se(e.slice(0,-1)),T=e=>bt.test(e),Q=e=>ur.test(e),pr=new Set(["length","size","percentage"]),br=e=>de(e,pr,vt),vr=e=>de(e,"position",vt),wr=new Set(["image","url"]),yr=e=>de(e,wr,Sr),jr=e=>de(e,"",kr),fe=()=>!0,de=(e,t,r)=>{const n=bt.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Cr=e=>hr.test(e)&&!fr.test(e),vt=()=>!1,kr=e=>mr.test(e),Sr=e=>gr.test(e),Mr=()=>{const e=R("colors"),t=R("spacing"),r=R("blur"),n=R("brightness"),o=R("borderColor"),s=R("borderRadius"),l=R("borderSpacing"),a=R("borderWidth"),c=R("contrast"),d=R("grayscale"),p=R("hueRotate"),b=R("invert"),h=R("gap"),k=R("gradientColorStops"),w=R("gradientColorStopPositions"),M=R("inset"),m=R("margin"),v=R("opacity"),f=R("padding"),z=R("saturate"),g=R("scale"),V=R("sepia"),y=R("skew"),E=R("space"),L=R("translate"),_=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",T,t],j=()=>[T,t],C=()=>["",X,K],I=()=>["auto",se,T],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",T],ye=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[se,T];return{cacheSize:500,separator:":",theme:{colors:[fe],spacing:[X,K],blur:["none","",Q,T],brightness:W(),borderColor:[e],borderRadius:["none","","full",Q,T],borderSpacing:j(),borderWidth:C(),contrast:W(),grayscale:G(),hueRotate:W(),invert:G(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[xr,K],inset:S(),margin:S(),opacity:W(),padding:j(),saturate:W(),scale:W(),sepia:G(),skew:W(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",T]}],container:["container"],columns:[{columns:[Q]}],"break-after":[{"break-after":ye()}],"break-before":[{"break-before":ye()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),T]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[M]}],"inset-x":[{"inset-x":[M]}],"inset-y":[{"inset-y":[M]}],start:[{start:[M]}],end:[{end:[M]}],top:[{top:[M]}],right:[{right:[M]}],bottom:[{bottom:[M]}],left:[{left:[M]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",he,T]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",T]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",he,T]}],"grid-cols":[{"grid-cols":[fe]}],"col-start-end":[{col:["auto",{span:["full",he,T]},T]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[fe]}],"row-start-end":[{row:["auto",{span:[he,T]},T]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",T]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",T]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",T,t]}],"min-w":[{"min-w":[T,t,"min","max","fit"]}],"max-w":[{"max-w":[T,t,"none","full","min","max","fit","prose",{screen:[Q]},Q]}],h:[{h:[T,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[T,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[T,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Q,K]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Re]}],"font-family":[{font:[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",T]}],"line-clamp":[{"line-clamp":["none",se,Re]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",X,T]}],"list-image":[{"list-image":["none",T]}],"list-style-type":[{list:["none","disc","decimal",T]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",X,K]}],"underline-offset":[{"underline-offset":["auto",X,T]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",T]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),vr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",br]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-to":[{to:[k]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:A()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[X,T]}],"outline-w":[{outline:[X,K]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:C()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[X,K]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Q,jr]}],"shadow-color":[{shadow:[fe]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Q,T]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[b]}],saturate:[{saturate:[z]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",T]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",T]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",T]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[he,T]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",T]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",T]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[X,K,Re]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Tr=lr(Mr);function O(...e){return Tr(le.clsx(e))}let Ve;function De(){return Ve===void 0&&(Ve=navigator.platform.includes("Mac")),Ve}function wt(e){return`${e}`.toLowerCase()==="mod"?De()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?De()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?De()?"⇧":"Shift":e}function yt(e){return e.map(wt).join(" ")}const Ge=x.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:o=!1,customClass:s="",loading:l=void 0,shortcutKeys:a=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0,children:b,asChild:h=!1,upload:k=!1,initialDisplayedColor:w=void 0,dataState:M=!1,...m}=e,v=Xe[r],f=h?ht.Slot:Ye,z=g=>{if(o){g.preventDefault();return}d==null||d(g)};return i.jsxs(St,{children:[i.jsx(Mt,{asChild:!0,children:i.jsxs(f,{className:O("richtext-h-[32px] richtext-w-[32px]",s),"data-state":M?"on":"off",disabled:o,onClick:z,ref:t,size:"sm",...m,children:[v&&i.jsx(v,{className:"richtext-size-4"}),b]})}),n&&i.jsx(Ze,{...c,className:"richtext-tooltip",children:i.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i.jsx("div",{children:n}),!!(a!=null&&a.length)&&i.jsx("span",{children:yt(a)})]})})]})});function Ir(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function zr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function Lr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Ar(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-h-4 richtext-w-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Nr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function ae(e){const t=Xe[e.name];return t?i.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-h-4 richtext-w-4 ${(e==null?void 0:e.className)||""}`}):null}function Er(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function jt(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:i.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Rr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function Vr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Dr(e){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Pr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6l1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6l-1.4-1.4z"})})}function _r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Hr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function Or(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Ur(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function Ct(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[i.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),i.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function kt(){return i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[i.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),i.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Br(){return i.jsx("svg",{height:"1em",viewBox:"0 0 15 15",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M2.5 10.5H2v.5h.5zm2 0v.5H5v-.5zm9-7h.5v-.207l-.146-.147zm-3-3l.354-.354L10.707 0H10.5zM2 6v4.5h1V6zm.5 5h2v-1h-2zm2.5-.5v-2H4v2zM3 7h2V6H3zM2 5V1.5H1V5zm11-1.5V5h1V3.5zM2.5 1h8V0h-8zm7.646-.146l3 3l.708-.708l-3-3zM2 1.5a.5.5 0 0 1 .5-.5V0A1.5 1.5 0 0 0 1 1.5zM1 12v1.5h1V12zm1.5 3h10v-1h-10zM14 13.5V12h-1v1.5zM12.5 15a1.5 1.5 0 0 0 1.5-1.5h-1a.5.5 0 0 1-.5.5zM1 13.5A1.5 1.5 0 0 0 2.5 15v-1a.5.5 0 0 1-.5-.5zM6 7h3V6H6zm0 4h3v-1H6zm1-4.5v4h1v-4zm3.5.5H13V6h-2.5zM10 6v5h1V6zm.5 3H12V8h-1.5z",fill:"currentColor"})})}function Fr(){return i.jsx("svg",{height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),i.jsx("path",{d:"M5 12V5a2 2 0 0 1 2-2h7l5 5v4M2 21v-6m3 0v6m-3-3h3m15-3v6h2m-9 0v-6l2 3l2-3v6m-9.5-6h3M9 15v6"})]})})}function $r(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Wr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[i.jsx("circle",{cx:"10",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"10",r:"4"}),i.jsx("circle",{cx:"38",cy:"24",r:"4"}),i.jsx("circle",{cx:"38",cy:"38",r:"4"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function Gr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:i.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function Xr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function qr(){return i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:i.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const Xe={Bold:u.Bold,LoaderCircle:u.LoaderCircle,Italic:u.Italic,Underline:u.Underline,Quote:u.Quote,TextQuote:zr,Strikethrough:u.Strikethrough,Minus:u.Minus,Eraser:u.Eraser,PaintRoller:u.PaintRoller,Redo2:u.Redo2,Undo2:u.Undo2,AlignCenter:je.TextAlignCenterIcon,AlignJustify:je.TextAlignJustifyIcon,AlignLeft:je.TextAlignLeftIcon,AlignRight:je.TextAlignRightIcon,ChevronDown:u.ChevronDown,Subscript:u.Subscript,Superscript:u.Superscript,Code:u.Code,Code2:u.CodeXml,Type:u.Type,IndentIncrease:u.IndentIncrease,IndentDecrease:u.IndentDecrease,List:u.List,ListOrdered:u.ListOrdered,ListTodo:u.ListTodo,Link:u.Link,ImageUp:u.ImageUp,Video:u.Video,Maximize:u.Maximize,Minimize:u.Minimize,Table:u.Table,Sparkles:u.Sparkles,Pencil:u.Pencil,Unlink:u.Unlink,BetweenHorizonalEnd:u.BetweenHorizonalEnd,BetweenHorizonalStart:u.BetweenHorizonalStart,BetweenVerticalStart:u.BetweenVerticalStart,BetweenVerticalEnd:u.BetweenVerticalEnd,TableCellsMerge:u.TableCellsMerge,TableCellsSplit:u.TableCellsSplit,Trash2:u.Trash2,Trash:u.Trash,Replace:u.Replace,ChevronsUpDown:u.ChevronsUpDown,LineHeight:Er,Word:Nr,HeadingParagraph:u.Pilcrow,Heading1:u.Heading1,Heading2:u.Heading2,Heading3:u.Heading3,Heading4:u.Heading4,Heading5:u.Heading5,Heading6:u.Heading6,Columns2:u.Columns2,Columns3:u.Columns3,Columns4:u.Columns4,Plus:u.Plus,Grip:u.GripVertical,Copy:u.Copy,Clipboard:u.Clipboard,PanelLeft:u.PanelLeft,PanelRight:u.PanelRight,Columns:u.Columns2,Iframe:u.Frame,MenuDown:jt,SizeS:Dr,SizeM:Vr,SizeL:Rr,AspectRatio:Ir,Emoji:u.SmilePlus,DeleteColumn:Lr,DeleteRow:Ar,SearchAndReplace:u.Replace,EmojiIcon:u.SmilePlusIcon,KatexIcon:u.Sigma,ExportPdf:Ct,ExportWord:kt,ImportWord:qr,ColumnAddLeft:_r,ColumnAddRight:Hr,BookMarked:u.BookMarked,Excalidraw:Ur,ZoomIn:u.ZoomIn,ZoomOut:u.ZoomOut,Settings:u.Settings,Eye:u.Eye,TextDirection:Or,LeftToRight:$r,RightToLeft:Gr,Attachment:u.Paperclip,GifIcon:Br,ChevronUp:u.ChevronUp,Crop:u.CropIcon,Mermaid:Wr,Twitter:Xr,CodeView:Pr,FlipX:u.FlipVertical,FlipY:u.FlipHorizontal,PencilRuler:u.PencilRuler,WrapText:u.WrapText,Loader:u.Loader2,X:u.X,Html:Fr,ExternalLink:u.ExternalLink,Callout:u.NotebookPen},at=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lt=le.clsx,qe=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return lt(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(d=>{const p=r==null?void 0:r[d],b=s==null?void 0:s[d];if(p===null)return null;const h=at(p)||at(b);return o[d][h]}),a=r&&Object.entries(r).reduce((d,p)=>{let[b,h]=p;return h===void 0||(d[b]=h),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:b,className:h,...k}=p;return Object.entries(k).every(w=>{let[M,m]=w;return Array.isArray(m)?m.includes({...s,...a}[M]):{...s,...a}[M]===m})?[...d,b,h]:d},[]);return lt(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Yr=qe("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background richtext-text-foreground hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-size-10"}},defaultVariants:{variant:"default",size:"default"}}),B=U.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},s)=>{const l=n?ht.Slot:"button";return i.jsx(l,{className:O(Yr({variant:t,size:r,className:e})),ref:s,...o})});B.displayName="Button";const J=U.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{ref:n,type:t,className:O("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),...r}));J.displayName="Input";const Zr=qe("richtext-text-sm richtext-font-medium richtext-leading-none richtext-text-foreground peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),ce=U.forwardRef(({className:e,...t},r)=>i.jsx(mt.Root,{className:O(Zr(),e),ref:r,...t}));ce.displayName=mt.Root.displayName;const ze=te.Root,ve=U.forwardRef(({className:e,...t},r)=>i.jsx(te.List,{ref:r,className:O("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));ve.displayName=te.List.displayName;const q=U.forwardRef(({className:e,...t},r)=>i.jsx(te.Trigger,{ref:r,className:O("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));q.displayName=te.Trigger.displayName;const Y=U.forwardRef(({className:e,...t},r)=>i.jsx(te.Content,{ref:r,className:O("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1",e),...t}));Y.displayName=te.Content.displayName;const Kr=qe("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Ye=U.forwardRef(({className:e,variant:t,size:r,...n},o)=>i.jsx(ft.Root,{ref:o,className:O(Kr({variant:t,size:r,className:e})),...n}));Ye.displayName=ft.Root.displayName;const Qr=be.Provider,St=be.Root,Mt=be.Trigger,Ze=U.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(be.Content,{"data-richtext-portal":!0,ref:n,sideOffset:t,className:O("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border-none richtext-bg-primary richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-primary-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));Ze.displayName=be.Content.displayName;const Jr=1,ei=1e6;let Pe=0;function ti(){return Pe=(Pe+1)%Number.MAX_SAFE_INTEGER,Pe.toString()}const _e=new Map;function ct(e){if(_e.has(e))return;const t=setTimeout(()=>{_e.delete(e),ge({type:"REMOVE_TOAST",toastId:e})},ei);_e.set(e,t)}function ri(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Jr)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?ct(r):e.toasts.forEach(n=>{ct(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const ke=[];let Se={toasts:[]};function ge(e){Se=ri(Se,e),ke.forEach(t=>{t(Se)})}function ii({...e}){const t=ti(),r=o=>ge({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>ge({type:"DISMISS_TOAST",toastId:t});return ge({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Le(){const[e,t]=U.useState(Se);return U.useEffect(()=>(ke.push(t),()=>{const r=ke.indexOf(t);r>-1&&ke.splice(r,1)}),[e]),{...e,toast:ii,dismiss:r=>ge({type:"DISMISS_TOAST",toastId:r})}}const Ae=U.forwardRef(({className:e,...t},r)=>i.jsx(Oe.Root,{ref:r,className:O("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-p-0 !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-1 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:i.jsx(Oe.Indicator,{className:O("!richtext-flex !richtext-items-center !richtext-justify-center !richtext-p-0 !richtext-text-current"),children:i.jsx(u.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Ae.displayName=Oe.Root.displayName;function ni(e){return e=e||new Map,{all:e,on(t,r){const n=e.get(t);n?n.push(r):e.set(t,[r])},off(t,r){const n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit(t,r){let n=e.get(t);n&&n.slice().map(o=>{o(r)}),n=e.get("*"),n&&n.slice().map(o=>{o(t,r)})}}}const Ke=ni(),Tt=x.createContext(Ke),oi=()=>x.useContext(Tt);function Qe(e,t){const r=oi();x.useEffect(()=>(t.map(n=>r.on(n,e)),()=>{t.map(n=>r.off(n,e))}),[r,t,e])}const si=Ke.emit;function ai({children:e}){return i.jsx(Tt.Provider,{value:Ke,children:e})}const ue=$.Root,Ne=$.Trigger,li=$.Portal,It=U.forwardRef(({className:e,...t},r)=>i.jsx($.Overlay,{ref:r,className:O("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));It.displayName=$.Overlay.displayName;const re=U.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(li,{"data-richtext-portal":!0,children:[i.jsx(It,{}),i.jsxs($.Content,{"data-richtext-portal":!0,ref:n,className:O("richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border !richtext-border-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,i.jsxs($.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[i.jsx(u.X,{className:"richtext-size-4 richtext-text-accent-foreground"}),i.jsx("span",{className:"richtext-sr-only richtext-text-accent-foreground",children:"Close"})]})]})]}));re.displayName=$.Content.displayName;function zt({className:e,...t}){return i.jsx("div",{className:O("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}zt.displayName="DialogHeader";function Je({className:e,...t}){return i.jsx("div",{className:O("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}Je.displayName="DialogFooter";const ie=U.forwardRef(({className:e,...t},r)=>i.jsx($.Title,{ref:r,className:O("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight richtext-text-foreground",e),...t}));ie.displayName=$.Title.displayName;const ci=U.forwardRef(({className:e,...t},r)=>i.jsx($.Description,{className:O("richtext-text-sm richtext-text-muted-foreground",e),ref:r,...t}));ci.displayName=$.Description.displayName;var di=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ui=oe.Node3.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",oe.mergeAttributes(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,r,n,o,s,l;const a=(r=(t=e.attrs)==null?void 0:t.src)!=null?r:"",c=(o=(n=e.attrs)==null?void 0:n.alt)!=null?o:"",d=(l=(s=e.attrs)==null?void 0:s.title)!=null?l:"";return d?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:r,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:o,getPos:s,HTMLAttributes:l,editor:a})=>{const c=document.createElement("img");Object.entries(l).forEach(([b,h])=>{if(h!=null)switch(b){case"width":case"height":break;default:c.setAttribute(b,h);break}}),c.src=l.src;const d=new oe.ResizableNodeView({element:c,editor:a,node:o,getPos:s,onResize:(b,h)=>{c.style.width=`${b}px`,c.style.height=`${h}px`},onCommit:(b,h)=>{const k=s();k!==void 0&&this.editor.chain().setNodeSelection(k).updateAttributes(this.name,{width:b,height:h}).run()},onUpdate:(b,h,k)=>b.type===o.type,options:{directions:e,min:{width:t,height:r},preserveAspectRatio:n===!0}}),p=d.dom;return p.style.visibility="hidden",p.style.pointerEvents="none",c.onload=()=>{p.style.visibility="",p.style.pointerEvents=""},d}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[oe.nodeInputRule({find:di,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Lt=ui,hi=typeof global=="object"&&global&&global.Object===Object&&global,fi=typeof self=="object"&&self&&self.Object===Object&&self,At=hi||fi||Function("return this")(),Me=At.Symbol,Nt=Object.prototype,mi=Nt.hasOwnProperty,gi=Nt.toString,me=Me?Me.toStringTag:void 0;function xi(e){var t=mi.call(e,me),r=e[me];try{e[me]=void 0;var n=!0}catch{}var o=gi.call(e);return n&&(t?e[me]=r:delete e[me]),o}var pi=Object.prototype,bi=pi.toString;function vi(e){return bi.call(e)}var wi="[object Null]",yi="[object Undefined]",dt=Me?Me.toStringTag:void 0;function Et(e){return e==null?e===void 0?yi:wi:dt&&dt in Object(e)?xi(e):vi(e)}function Rt(e){return e!=null&&typeof e=="object"}var ji="[object Symbol]";function Ci(e){return typeof e=="symbol"||Rt(e)&&Et(e)==ji}var ki=/\s/;function Si(e){for(var t=e.length;t--&&ki.test(e.charAt(t)););return t}var Mi=/^\s+/;function Ti(e){return e&&e.slice(0,Si(e)+1).replace(Mi,"")}function Te(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ut=NaN,Ii=/^[-+]0x[0-9a-f]+$/i,zi=/^0b[01]+$/i,Li=/^0o[0-7]+$/i,Ai=parseInt;function xe(e){if(typeof e=="number")return e;if(Ci(e))return ut;if(Te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ti(e);var r=zi.test(e);return r||Li.test(e)?Ai(e.slice(2),r?2:8):Ii.test(e)?ut:+e}function Ni(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Vt(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=xe(r),r=r===r?r:0),t!==void 0&&(t=xe(t),t=t===t?t:0),Ni(xe(e),t,r)}var He=function(){return At.Date.now()},Ei="Expected a function",Ri=Math.max,Vi=Math.min;function Dt(e,t,r){var n,o,s,l,a,c,d=0,p=!1,b=!1,h=!0;if(typeof e!="function")throw new TypeError(Ei);t=xe(t)||0,Te(r)&&(p=!!r.leading,b="maxWait"in r,s=b?Ri(xe(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function k(y){var E=n,L=o;return n=o=void 0,d=y,l=e.apply(L,E),l}function w(y){return d=y,a=setTimeout(v,t),p?k(y):l}function M(y){var E=y-c,L=y-d,_=t-E;return b?Vi(_,s-L):_}function m(y){var E=y-c,L=y-d;return c===void 0||E>=t||E<0||b&&L>=s}function v(){var y=He();if(m(y))return f(y);a=setTimeout(v,M(y))}function f(y){return a=void 0,h&&n?k(y):(n=o=void 0,l)}function z(){a!==void 0&&clearTimeout(a),d=0,n=c=o=a=void 0}function g(){return a===void 0?l:f(He())}function V(){var y=He(),E=m(y);if(n=arguments,o=this,c=y,E){if(a===void 0)return w(c);if(b)return clearTimeout(a),a=setTimeout(v,t),k(c)}return a===void 0&&(a=setTimeout(v,t)),l}return V.cancel=z,V.flush=g,V}var Di="[object Number]";function Be(e){return typeof e=="number"||Rt(e)&&Et(e)==Di}var Pi="Expected a function";function Fe(e,t,r){var n=!0,o=!0;if(typeof e!="function")throw new TypeError(Pi);return Te(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),Dt(e,t,{leading:n,maxWait:t,trailing:o})}const Ce={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function _i(e){var L,_,D;const[t,r]=x.useState({width:F.IMAGE_MAX_SIZE,height:F.IMAGE_MAX_SIZE}),[n,o]=x.useState({width:0,height:0}),[s]=x.useState([Ce.TOP_LEFT,Ce.TOP_RIGHT,Ce.BOTTOM_LEFT,Ce.BOTTOM_RIGHT]),[l,a]=x.useState(!1),[c,d]=x.useState({x:0,y:0,w:0,h:0,dir:""}),{align:p,inline:b}=(L=e==null?void 0:e.node)==null?void 0:L.attrs,h=b&&(p==="left"||p==="right"),k=x.useMemo(()=>{var nt;const{src:S,alt:j,width:C,height:I,flipX:N,flipY:A}=(nt=e==null?void 0:e.node)==null?void 0:nt.attrs,H=Be(C)?`${C}px`:C,P=Be(I)?`${I}px`:I,G=[];N&&G.push("rotateX(180deg)"),A&&G.push("rotateY(180deg)");const ye=G.join(" ");return{src:S||void 0,alt:j||void 0,style:{width:H||void 0,height:P||void 0,transform:ye||"none",...h?{float:p}:{}}}},[(_=e==null?void 0:e.node)==null?void 0:_.attrs]),w=x.useMemo(()=>{const{style:{width:S}}=k;return{width:S==="100%"?S:void 0}},[k]);function M(S){o({width:S.target.width,height:S.target.height})}function m(){const{editor:S,getPos:j}=e;S.commands.setNodeSelection(j())}const v=x.useCallback(Fe(()=>{const{editor:S}=e,{width:j}=getComputedStyle(S.view.dom);r(C=>({...C,width:Number.parseInt(j,10)}))},F.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function f(S,j){S.preventDefault(),S.stopPropagation();const C=n.width,I=n.height,N=C/I;let A=Number(e.node.attrs.width),H=Number(e.node.attrs.height);const P=t.width;A&&!H?(A=A>P?P:A,H=Math.round(A/N)):H&&!A?(A=Math.round(H*N),A=A>P?P:A):!A&&!H?(A=C>P?P:C,H=Math.round(A/N)):A=A>P?P:A,a(!0),d({x:S.clientX,y:S.clientY,w:A,h:H,dir:j})}const z=x.useCallback(Fe(S=>{if(S.preventDefault(),S.stopPropagation(),!l)return;const{x:j,w:C,dir:I}=c,N=(S.clientX-j)*(/l/.test(I)?-1:1),A=Vt(C+N,F.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:A,height:null})},F.IMAGE_THROTTLE_WAIT_TIME),[l,c,t,e.updateAttributes]),g=x.useCallback(S=>{S.preventDefault(),S.stopPropagation(),l&&(d({x:0,y:0,w:0,h:0,dir:""}),a(!1),m())},[l,m]),V=x.useCallback(()=>{document==null||document.addEventListener("mousemove",z,!0),document==null||document.addEventListener("mouseup",g,!0)},[z,g]),y=x.useCallback(()=>{document==null||document.removeEventListener("mousemove",z,!0),document==null||document.removeEventListener("mouseup",g,!0)},[z,g]);x.useEffect(()=>(l?V():y(),()=>{y()}),[l,V,y]);const E=x.useMemo(()=>new ResizeObserver(()=>v()),[v]);return x.useEffect(()=>(E.observe(e.editor.view.dom),()=>{E.disconnect()}),[e.editor.view.dom,E]),i.jsx(le.NodeViewWrapper,{as:b?"span":"div",className:"image-view",style:{float:h?p:void 0,margin:h?p==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:b?"inline":"block",textAlign:h?void 0:p,width:((D=k.style)==null?void 0:D.width)??"auto",...h?{}:w},children:i.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:w,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${l?"image-view__body--resizing":""}`,children:[i.jsx("img",{alt:k.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:M,src:k.src,style:k.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||l)&&i.jsx("div",{className:"image-resizer",children:s==null?void 0:s.map(S=>i.jsx("span",{className:`image-resizer__handler image-resizer__handler--${S}`,onMouseDown:j=>f(j,S)},`image-dir-${S}`))})]})})}function Hi(e){const{editor:t}=le.useCurrentEditor(),r=U.useMemo(()=>t,[e,t]);return le.useEditorState({editor:r,selector(o){return o.editor?{editor:o.editor,editorState:o.editor.state,canCommand:o.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}function Z(){return Hi().editor}const Pt=$e.y(!1);function et(){return $e.b(Pt)}function Oi(){return $e.S(Pt)}const _t=()=>!1;function Ui(e=_t){const t=et(),[r,n]=x.useState(()=>{const a=e();return typeof a=="boolean"?!a:a}),o=Z();x.useEffect(()=>{if(!o||!e)return;const a=()=>{const c=e();n(typeof c=="boolean"?!c:c)};return a(),o.on("selectionUpdate",a),o.on("transaction",a),()=>{o.off("selectionUpdate",a),o.off("transaction",a)}},[o,e]);const s=x.useMemo(()=>!t||!o?!0:typeof r=="boolean"?r:!1,[t,o,r]),l=x.useMemo(()=>!t||!o,[t,o]);return{disabled:s,dataState:r,editorDisabled:l}}function we(e=_t){const t=et(),[r,n]=x.useState({}),[o,s]=x.useState(e()),l=Z();x.useEffect(()=>{if(!l||!e)return;const d=()=>{s(e())};return d(),l.on("selectionUpdate",d),()=>{l.off("selectionUpdate",d)}},[r,l,e]);const a=x.useMemo(()=>!t||!l,[t,l]),c=x.useMemo(()=>!t||!l,[t,l]);return{disabled:a,dataState:o,editorDisabled:c,update:()=>n({})}}function ne(e){const t=Z();return x.useMemo(()=>t?t.extensionManager.extensions.find(n=>n.name===e):null,[t,e])}function Bi(e,t,r){return e<t?t:e>r?r:e}const Fi=e=>typeof e=="number",$i=e=>typeof e=="string",Wi=e=>typeof e=="function";function Gi(e,t="px"){if(!e)return e;const r=Fi(e)?String(e):e,n=Number.parseFloat(r),o=r.match(/[%a-z]+$/i),s=o?o[0]:t;return Number.isNaN(n)?e:n+s}function Xi(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(o=>o.name===t)}function qi(e){return e.map(t=>$i(t)?{value:t,name:t}:t)}function tt(e){const t=Z(),r=ne(e),{t:n}=F.useLocale();return x.useMemo(()=>{if(!t||!r||!n)return null;const{button:o}=r.options;return!o||!Wi(o)?null:o({editor:t,extension:r,t:n})},[t,r,n])}function Yi(e,t){const r=e.type,n=e.name.toLowerCase(),o=n.split(".").pop();if(!o)return!1;const l=r||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[o];return t.some(a=>{if(a.startsWith("."))return n.endsWith(a);if(a.endsWith("/*")){const c=a.split("/")[0];return l==null?void 0:l.startsWith(c+"/")}return l===a})}function rt(e,t){const{acceptMimes:r,maxSize:n,t:o,toast:s}=t,l=[];return(Array.isArray(e)?e:Object.values(e)).forEach(c=>{if(!Yi(c,r)){t.onError?t.onError({type:"type",message:o("editor.upload.fileTypeNotSupported",{fileName:c.name}),file:c}):s({variant:"default",title:o("editor.upload.fileTypeNotSupported",{fileName:c.name})});return}if(c.size>n){const d=(n/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d}),file:c}):s({variant:"default",title:o("editor.upload.fileSizeTooBig",{fileName:c.name,size:d})});return}l.push(c)}),l}function Zi(){const{t:e}=F.useLocale(),{toast:t}=Le(),r=Z(),n=tt(pe.name),{icon:o,tooltip:s}=(n==null?void 0:n.componentProps)??{},{editorDisabled:l}=we(),[a,c]=x.useState(!1),[d,p]=x.useState(!1),b=ne(pe.name),[h,k]=x.useState(""),[w,M]=x.useState(""),m=x.useRef(null),v=(b==null?void 0:b.options.defaultInline)||!1,[f,z]=x.useState(v),g=x.useMemo(()=>(b==null?void 0:b.options)||Ee,[b]);async function V(L){var S;const _=(S=L==null?void 0:L.target)==null?void 0:S.files;if(!r||r.isDestroyed||_.length===0||d){L.target.value="";return}const D=rt(_,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t:e,toast:t,onError:g.onError});if(D.length<=0){L.target.value="";return}p(!0);try{if(g!=null&&g.multiple){const j=D.map(async I=>{let N="";return g.upload?N=await g.upload(I):N=URL.createObjectURL(I),N});(await Promise.all(j)).forEach(I=>{r.chain().focus().setImageInline({src:I,inline:f,alt:w}).run()})}else{const j=D[0];let C="";g.upload?C=await g.upload(j):C=URL.createObjectURL(j),r.chain().focus().setImageInline({src:C,inline:f,alt:w}).run()}c(!1),M(""),z(v)}catch(j){console.error("Error uploading image",j),g.onError?g.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{p(!1),L.target.value=""}}function y(L){L.preventDefault(),L.stopPropagation(),r.chain().focus().setImageInline({src:h,inline:f,alt:w}).run(),c(!1),z(v),k(""),M("")}function E(L){var _;L.preventDefault(),(_=m.current)==null||_.click()}return n?i.jsxs(ue,{onOpenChange:c,open:a,children:[i.jsx(Ne,{asChild:!0,children:i.jsx(Ge,{disabled:l,icon:o,tooltip:s,action:()=>{l||c(!0)}})}),i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.image.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:g.resourceImage==="both"||g.resourceImage==="upload"?"upload":"link",children:[g.resourceImage==="both"&&i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(q,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(q,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(Ae,{checked:f,onCheckedChange:L=>{z(L)}}),i.jsx(ce,{children:e("editor.link.dialog.inline")})]}),g.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(ce,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(J,{onChange:L=>M(L.target.value),required:!0,type:"text",value:w})]}),i.jsxs(Y,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:d,onClick:E,size:"sm",children:d?i.jsxs(i.Fragment,{children:[e("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),i.jsx(Ot,{alt:w,disabled:d,editor:r,imageInline:f,onClose:()=>{M("")}})]}),i.jsx("input",{accept:g.acceptMimes.join(",")||"image/*",multiple:g.multiple,onChange:V,ref:m,style:{display:"none"},type:"file"})]}),i.jsx(Y,{value:"link",children:i.jsx("form",{onSubmit:y,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,onChange:L=>k(L.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:h}),i.jsx(B,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})]}):i.jsx(i.Fragment,{})}const Ee={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},pe=Lt.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...Ee,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var o,s;return{componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((s=(o=t.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip")}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return le.ReactNodeViewRenderer(_i)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:o}=e,s=o&&(n==="left"||n==="right"),l=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",a=s?"":`text-align: ${n};`,p=`${s?`float: ${n};`:""}${s?n==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${l}`;return[o?"span":"div",{style:a,class:"image"},["img",oe.mergeAttributes({height:"auto",style:p},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var s;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,o=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((s=t==null?void 0:t.style)==null?void 0:s.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,o=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:o==="true"}}},{tag:'img[src]:not([src^="data:"])'}]}});function Ki(e){return e.replace(/^.*\/|\..+$/g,"")}function Qi(e){return e.split(".").pop()}function Ji(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function en(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function tn(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function Ht(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],o=atob(r[r.length-1]);let s=o.length;const l=new Uint8Array(s);for(;s--;)l[s]=o.charCodeAt(s);return new File([l],t,{type:n})}function Ot({editor:e,imageInline:t,onClose:r,disabled:n,alt:o}){var S,j;const{t:s}=F.useLocale(),{toast:l}=Le(),[a,c]=x.useState(!1),[d,p]=x.useState(!1),b=x.useRef(null),[h,k]=x.useState(),[w,M]=x.useState(""),m=x.useRef(null),[v,f]=x.useState({src:"",file:null}),z=ne(pe.name),g=x.useMemo(()=>(z==null?void 0:z.options)??{},[z]);function V(C){if(b.current&&C.width&&C.height){const I=y(b.current,C);M(I)}}function y(C,I){const N=document.createElement("canvas"),A=C.naturalWidth/C.width,H=C.naturalHeight/C.height;N.width=I.width*A,N.height=I.height*H;const P=N.getContext("2d");return P&&(P.imageSmoothingEnabled=!1,P.drawImage(C,I.x*A,I.y*H,I.width*A,I.height*H,0,0,I.width*A,I.height*H)),N.toDataURL("image/png",1)}const E=x.useCallback(async()=>{var C;if(!d){p(!0);try{const I=Ht(w,((C=v==null?void 0:v.file)==null?void 0:C.name)||"image.png");let N="";g.upload?N=await g.upload(I):N=URL.createObjectURL(I),e.chain().focus().setImageInline({src:N,inline:t,alt:o}).run(),c(!1),f({src:"",file:null}),D(),r()}catch(I){console.error("Error cropping image",I)}finally{p(!1)}}},[w,e,t,d,r,(S=v==null?void 0:v.file)==null?void 0:S.name,g]);function L(C){var I;C.preventDefault(),(I=m.current)==null||I.click()}const _=async C=>{var P;const I=(P=C==null?void 0:C.target)==null?void 0:P.files;if(!e||e.isDestroyed||I.length===0){C.target.value="";return}const N=rt(I,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t:s,toast:l,onError:g.onError});if(N.length<=0){C.target.value="";return}const A=N[0],H=await tn(A);c(!0),f({src:H.src,file:A})},D=()=>{m.current&&(m.current.value="")};return i.jsxs(i.Fragment,{children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:n,onClick:L,size:"sm",children:s("editor.image.dialog.tab.uploadCrop")}),i.jsxs(ue,{open:a,onOpenChange:C=>{c(C),C||(f({src:"",file:null}),D())},children:[i.jsx(Ne,{}),i.jsxs(re,{children:[i.jsx(ie,{children:s("editor.image.dialog.tab.uploadCrop")}),i.jsx("div",{children:v.src&&i.jsx(Xt,{className:"richtext-w-full",crop:h,onChange:C=>k(C),onComplete:C=>V(C),children:i.jsx("img",{alt:"Crop me",ref:b,src:v.src})})}),i.jsxs(Je,{children:[i.jsxs(B,{disabled:d,onClick:()=>{c(!1),f({src:"",file:null}),D()},children:[s("editor.imageUpload.cancel"),i.jsx(ae,{className:"richtext-ml-1",name:"Trash2"})]}),i.jsx(B,{className:"richtext-w-fit",disabled:d||!h,onClick:E,children:d?i.jsxs(i.Fragment,{children:[s("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):i.jsxs(i.Fragment,{children:[s("editor.imageUpload.crop"),i.jsx(ae,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),i.jsx("input",{accept:((j=g==null?void 0:g.acceptMimes)==null?void 0:j.join(","))||"image/*",multiple:!1,onChange:_,ref:m,style:{display:"none"},type:"file"})]})}const it={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EXCALIDRAW:e=>`EXCALIDRAW-${e}`};function rn(){const{t:e}=F.useLocale(),{toast:t}=Le(),r=Z(),{editorDisabled:n}=we(),[o,s]=x.useState(!1),l=it.UPLOAD_IMAGE(r.id);Qe(s,[l]);const[a,c]=x.useState(!1),d=ne(pe.name),[p,b]=x.useState(""),[h,k]=x.useState(""),w=x.useRef(null),M=(d==null?void 0:d.options.defaultInline)||!1,[m,v]=x.useState(M),f=x.useMemo(()=>(d==null?void 0:d.options)||Ee,[d]);async function z(y){var _;const E=(_=y==null?void 0:y.target)==null?void 0:_.files;if(!r||r.isDestroyed||E.length===0||a){y.target.value="";return}const L=rt(E,{acceptMimes:f==null?void 0:f.acceptMimes,maxSize:f==null?void 0:f.maxSize,t:e,toast:t,onError:f.onError});if(L.length<=0){y.target.value="";return}c(!0);try{if(f!=null&&f.multiple){const D=L.map(async j=>{let C="";return f.upload?C=await f.upload(j):C=URL.createObjectURL(j),C});(await Promise.all(D)).forEach(j=>{r.chain().focus().setImageInline({src:j,inline:m,alt:h}).run()})}else{const D=L[0];let S="";f.upload?S=await f.upload(D):S=URL.createObjectURL(D),r.chain().focus().setImageInline({src:S,inline:m,alt:h}).run()}s(!1),k(""),v(M)}catch(D){console.error("Error uploading image",D),f.onError?f.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{c(!1),y.target.value=""}}function g(y){y.preventDefault(),y.stopPropagation(),r.chain().focus().setImageInline({src:p,inline:m,alt:h}).run(),s(!1),v(M),b(""),k("")}function V(y){var E;y.preventDefault(),(E=w.current)==null||E.click()}return n?i.jsx(i.Fragment,{}):i.jsx(ue,{onOpenChange:s,open:o,children:i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.image.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:f.resourceImage==="both"||f.resourceImage==="upload"?"upload":"link",children:[f.resourceImage==="both"&&i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[i.jsx(q,{value:"upload",children:e("editor.image.dialog.tab.upload")}),i.jsx(q,{value:"link",children:e("editor.image.dialog.tab.url")})]}),i.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[i.jsx(Ae,{checked:m,onCheckedChange:y=>{v(y)}}),i.jsx(ce,{children:e("editor.link.dialog.inline")})]}),f.enableAlt&&i.jsxs("div",{className:"richtext-my-[10px]",children:[i.jsx(ce,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),i.jsx(J,{onChange:y=>k(y.target.value),required:!0,type:"text",value:h})]}),i.jsxs(Y,{value:"upload",children:[i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(B,{className:"richtext-mt-1 richtext-w-full",disabled:a,onClick:V,size:"sm",children:a?i.jsxs(i.Fragment,{children:[e("editor.imageUpload.uploading"),i.jsx(ae,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),i.jsx(Ot,{alt:h,disabled:a,editor:r,imageInline:m,onClose:()=>{k("")}})]}),i.jsx("input",{accept:f.acceptMimes.join(",")||"image/*",multiple:f.multiple,onChange:z,ref:w,style:{display:"none"},type:"file"})]}),i.jsx(Y,{value:"link",children:i.jsx("form",{onSubmit:g,children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,onChange:y=>b(y.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:p}),i.jsx(B,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})})}function Ut(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const o=n.replace(/\./g,String.raw`\.`).replace(/\*/g,".*");return new RegExp(`^${o}$`).test(r.hostname)}return r.hostname.includes(n)})}function nn(){const{t:e}=F.useLocale(),t=Z(),r=tt(Ie.name),{icon:n,tooltip:o}=(r==null?void 0:r.componentProps)??{},{editorDisabled:s}=we(),[l,a]=x.useState(""),c=x.useRef(null),[d,p]=x.useState(""),[b,h]=x.useState(!1),k=ne(Ie.name),w=x.useMemo(()=>(k==null?void 0:k.options)??{},[k]);async function M(f){var y;const z=(y=f==null?void 0:f.target)==null?void 0:y.files;if(!t||t.isDestroyed||z.length===0)return;const g=z[0];let V="";w.upload?V=await w.upload(g):V=URL.createObjectURL(g),t.chain().focus().setVideo({src:V,width:"100%"}).run(),h(!1)}function m(f){f.preventDefault(),f.stopPropagation(),l&&(t.chain().focus().setVideo({src:l,width:"100%"}).run(),h(!1),a(""))}function v(f){var z;f.preventDefault(),(z=c.current)==null||z.click()}return i.jsxs(ue,{onOpenChange:h,open:b,children:[i.jsx(Ne,{asChild:!0,children:i.jsx(Ge,{disabled:s,icon:n,tooltip:o,action:()=>{s||h(!0)}})}),i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.video.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:(w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="upload")&&i.jsx(q,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((w==null?void 0:w.resourceVideo)==="both"||(w==null?void 0:w.resourceVideo)==="link")&&i.jsx(q,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Y,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(B,{className:"richtext-mt-1 richtext-w-full",onClick:v,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:M,ref:c,type:"file",style:{display:"none"}})]}),i.jsxs(Y,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:l,onBlur:f=>{const z=f.target.value,g=w.videoProviders||["."];z&&!Ut(z,g)?p("Invalid video URL"):p("")},onChange:f=>{a(f.target.value)}}),i.jsx(B,{onClick:m,type:"button",children:e("editor.video.dialog.button.apply")})]})}),d&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:d})]})]})]})]})}function on(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const r=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(r){const o=r[1],s=r[2];s?e=`https://player.vimeo.com/video/${o}?h=${s}`:e=`https://player.vimeo.com/video/${o}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Ie=oe.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:F.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var r,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?on(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:Gi(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:r="center"}=e??{},n={...e,width:"100%",height:"100%"},o=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,s=`flex: 1;padding-bottom: ${9/16*100}%;`,p=["div",{style:`display: flex; justify-content: ${r};`},["div",{style:o},["div",{style:s}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},p]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});function sn(){const{t:e}=F.useLocale(),t=Z(),{editorDisabled:r}=we(),[n,o]=x.useState(""),s=x.useRef(null),[l,a]=x.useState(""),[c,d]=x.useState(!1),p=ne(Ie.name),b=it.UPLOAD_VIDEO(t.id);Qe(d,[b]);const h=x.useMemo(()=>(p==null?void 0:p.options)??{},[p]);async function k(m){var g;const v=(g=m==null?void 0:m.target)==null?void 0:g.files;if(!t||t.isDestroyed||v.length===0)return;const f=v[0];let z="";h.upload?z=await h.upload(f):z=URL.createObjectURL(f),t.chain().focus().setVideo({src:z,width:"100%"}).run(),d(!1)}function w(m){m.preventDefault(),m.stopPropagation(),n&&(t.chain().focus().setVideo({src:n,width:"100%"}).run(),d(!1),o(""))}function M(m){var v;m.preventDefault(),(v=s.current)==null||v.click()}return r?i.jsx(i.Fragment,{}):i.jsx(ue,{onOpenChange:d,open:c,children:i.jsxs(re,{children:[i.jsx(ie,{children:e("editor.video.dialog.title")}),i.jsxs(ze,{activationMode:"manual",defaultValue:(h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload"?"upload":"link",children:[i.jsxs(ve,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="upload")&&i.jsx(q,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((h==null?void 0:h.resourceVideo)==="both"||(h==null?void 0:h.resourceVideo)==="link")&&i.jsx(q,{value:"link",children:e("editor.video.dialog.link")})]}),i.jsxs(Y,{value:"upload",children:[i.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:i.jsx(B,{className:"richtext-mt-1 richtext-w-full",onClick:M,size:"sm",children:e("editor.video.dialog.tab.upload")})}),i.jsx("input",{accept:"video/*",multiple:!0,onChange:k,ref:s,type:"file",style:{display:"none"}})]}),i.jsxs(Y,{value:"link",children:[i.jsx("div",{children:i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[i.jsx(J,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:n,onBlur:m=>{const v=m.target.value,f=h.videoProviders||["."];v&&!Ut(v,f)?a("Invalid video URL"):a("")},onChange:m=>{o(m.target.value)}}),i.jsx(B,{onClick:w,type:"button",children:e("editor.video.dialog.button.apply")})]})}),l&&i.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:l})]})]})]})})}function Bt(){return i.jsxs(i.Fragment,{children:[i.jsx(rn,{}),i.jsx(sn,{})]})}process.env.NODE_ENV!=="production"&&(Bt.displayName="SlashDialogTrigger");exports.ActionButton=Ge;exports.Button=B;exports.Checkbox=Ae;exports.DEFAULT_OPTIONS=Ee;exports.Dialog=ue;exports.DialogContent=re;exports.DialogFooter=Je;exports.DialogHeader=zt;exports.DialogTitle=ie;exports.DialogTrigger=Ne;exports.EVENTS=it;exports.ExportPdf=Ct;exports.ExportWord=kt;exports.IconComponent=ae;exports.Image=pe;exports.Input=J;exports.Label=ce;exports.MenuDown=jt;exports.ReactBusProvider=ai;exports.RichTextImage=Zi;exports.RichTextVideo=nn;exports.SlashDialogTrigger=Bt;exports.Toggle=Ye;exports.Tooltip=St;exports.TooltipContent=Ze;exports.TooltipProvider=Qr;exports.TooltipTrigger=Mt;exports.Video=Ie;exports.clamp=Bi;exports.clamp$1=Vt;exports.cn=O;exports.dataURLtoFile=Ht;exports.debounce=Dt;exports.emit=si;exports.ensureNameValueOptions=qi;exports.extractFileExtension=Qi;exports.extractFilename=Ki;exports.getShortcutKey=wt;exports.getShortcutKeys=yt;exports.hasExtension=Xi;exports.icons=Xe;exports.index_default=Lt;exports.isNumber=Be;exports.normalizeFileSize=Ji;exports.normalizeFileType=en;exports.throttle=Fe;exports.useActive=Ui;exports.useButtonProps=tt;exports.useEditableEditor=et;exports.useEditorInstance=Z;exports.useExtension=ne;exports.useListener=Qe;exports.useStoreEditableEditor=Oi;exports.useToast=Le;exports.useToggleActive=we;
|
|
@@ -7,7 +7,7 @@ import * as F from "@radix-ui/react-dialog";
|
|
|
7
7
|
import { NotebookPen as Bt, ExternalLink as $t, X as lt, Loader2 as Ft, WrapText as Wt, PencilRuler as Gt, FlipHorizontal as Xt, FlipVertical as Yt, CropIcon as qt, ChevronUp as Zt, Paperclip as Kt, Eye as Jt, Settings as Qt, ZoomOut as er, ZoomIn as tr, BookMarked as rr, Sigma as ir, SmilePlusIcon as nr, Replace as qe, SmilePlus as or, Frame as ar, Columns2 as Ze, PanelRight as sr, PanelLeft as lr, Clipboard as cr, Copy as dr, GripVertical as ur, Plus as hr, Columns4 as fr, Columns3 as mr, Heading6 as gr, Heading5 as pr, Heading4 as xr, Heading3 as br, Heading2 as vr, Heading1 as wr, Pilcrow as yr, ChevronsUpDown as Cr, Trash as kr, Trash2 as Mr, TableCellsSplit as zr, TableCellsMerge as Tr, BetweenVerticalEnd as Ir, BetweenVerticalStart as Sr, BetweenHorizonalStart as Nr, BetweenHorizonalEnd as Ar, Unlink as Lr, Pencil as Er, Sparkles as Rr, Table as Vr, Minimize as Dr, Maximize as Hr, Video as Or, ImageUp as Pr, Link as jr, ListTodo as _r, ListOrdered as Ur, List as Br, IndentDecrease as $r, IndentIncrease as Fr, Type as Wr, CodeXml as Gr, Code as Xr, Superscript as Yr, Subscript as qr, ChevronDown as Zr, Undo2 as Kr, Redo2 as Jr, PaintRoller as Qr, Eraser as ei, Minus as ti, Strikethrough as ri, Quote as ii, Underline as ni, Italic as oi, LoaderCircle as ai, Bold as si, Check as li } from "lucide-react";
|
|
8
8
|
import { c as ct, N as ci, u as di, b as ui, a as hi } from "./clsx-Bg-2aTKh.js";
|
|
9
9
|
import { N as dt, n as fi, a7 as mi, m as ut } from "./index-D0EmqTpe.js";
|
|
10
|
-
import { I as Ke, i as Je, j as gi, u as ne, V as pi } from "./index-
|
|
10
|
+
import { I as Ke, i as Je, j as gi, u as ne, V as pi } from "./index-DtVRewGA.js";
|
|
11
11
|
import { Slot as ht } from "@radix-ui/react-slot";
|
|
12
12
|
import * as be from "@radix-ui/react-tooltip";
|
|
13
13
|
import * as ft from "@radix-ui/react-toggle";
|