reactjs-tiptap-editor 1.0.19 → 1.0.20

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.
Files changed (149) hide show
  1. package/lib/{ActionMenuButton-D3b_bcin.cjs → ActionMenuButton-BPgqKDXT.cjs} +1 -1
  2. package/lib/{ActionMenuButton-B1Nfn5Hm.js → ActionMenuButton-CMXWxvWu.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +3 -3
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +2 -2
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +2 -2
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +3 -3
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -2
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +2 -2
  17. package/lib/CodeBlock.cjs +20 -44
  18. package/lib/CodeBlock.js +1385 -4011
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +2 -2
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +3 -3
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +2 -2
  25. package/lib/{Drawer-kEO7KzzC.cjs → Drawer-BivLAzMN.cjs} +1 -1
  26. package/lib/{Drawer-B1-7Y4HB.js → Drawer-BmVmgJsc.js} +3 -3
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +4 -4
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +8 -8
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +3 -3
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +2 -2
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +2 -2
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +4 -4
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +4 -4
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +4 -4
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +3 -3
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +3 -3
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +2 -2
  49. package/lib/{Iframe-XlAb03_r.js → Iframe-CAUrccA0.js} +3 -3
  50. package/lib/{Iframe-Bk5OIlvy.cjs → Iframe-hwg9FxhU.cjs} +1 -1
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +3 -3
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +3 -3
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +4 -4
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +2 -2
  59. package/lib/{Indent-ruPuj5xn.js → Indent-3MoIatX1.js} +2 -2
  60. package/lib/{Indent-XaZNTsOk.cjs → Indent-MuSU0kXz.cjs} +1 -1
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +2 -2
  65. package/lib/Katex-BPQ7_A3w.cjs +4 -0
  66. package/lib/{Katex-DKspCn-p.js → Katex-xS-XZKQc.js} +400 -422
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +3 -3
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +3 -3
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/{LinkEditBlock-DhesHreq.cjs → LinkEditBlock-DLDY-8Ax.cjs} +1 -1
  74. package/lib/{LinkEditBlock-BWm2Ypt2.js → LinkEditBlock-Dhvz7DCA.js} +3 -3
  75. package/lib/MarkdownPaste.cjs +1 -1
  76. package/lib/MarkdownPaste.js +1 -1
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +4 -4
  79. package/lib/Mermaid.cjs +1 -1
  80. package/lib/Mermaid.js +3 -3
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +3 -3
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +2 -2
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +3 -3
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/{SlashCommandNodeView-CojfS61Q.cjs → SlashCommandNodeView-CavaOSwo.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-Hf2DX4km.js → SlashCommandNodeView-RnDRm4Z1.js} +1 -1
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -2
  93. package/lib/{Table-BTkFUATL.js → Table-DN4TuDz1.js} +35 -35
  94. package/lib/{Table-C1_xLqV0.cjs → Table-m32ZhtxF.cjs} +1 -1
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +2 -2
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +3 -3
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +3 -3
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +2 -2
  105. package/lib/{Twitter-D5mUTILj.js → Twitter-B2FDarxE.js} +4 -4
  106. package/lib/{Twitter-Cj-0yyQQ.cjs → Twitter-CJhQLKYS.cjs} +1 -1
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +3 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +2 -2
  111. package/lib/_commonjsHelpers-B4e78b8K.js +28 -0
  112. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  113. package/lib/bubble.cjs +6 -6
  114. package/lib/bubble.js +1796 -1683
  115. package/lib/{clsx-OumA9x-8.js → clsx-Bg-2aTKh.js} +11 -11
  116. package/lib/{clsx-BSBE1eoY.cjs → clsx-DSAWW32g.cjs} +1 -1
  117. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -0
  118. package/lib/components/Bubble/index.d.ts +1 -0
  119. package/lib/{dropdown-menu-CUeq1boX.cjs → dropdown-menu-C0VlKIZC.cjs} +1 -1
  120. package/lib/{dropdown-menu-Bragdu5m.js → dropdown-menu-CWd8VVRO.js} +1 -1
  121. package/lib/extensions/CodeBlock/CodeBlock.d.ts +3 -18
  122. package/lib/{index-CDFAs4RT.js → index-B2a7NqnN.js} +3 -3
  123. package/lib/{index-CnePcUeF.cjs → index-C3dgmjIF.cjs} +1 -1
  124. package/lib/{index-DwSnESy-.cjs → index-C4WLt4NA.cjs} +4 -4
  125. package/lib/{index-BKlbc8Qo.js → index-CbkpBnTX.js} +1 -1
  126. package/lib/{index-CZ1_8JQQ.js → index-CjLxMm5d.js} +1 -1
  127. package/lib/{index-BVRHx_ha.js → index-D0EmqTpe.js} +74 -64
  128. package/lib/{index-cPEuL4Zr.js → index-DXtVL0al.js} +1 -1
  129. package/lib/{index-CMLwKzI0.cjs → index-DlxZt4_j.cjs} +1 -1
  130. package/lib/{index-B-7eHzaO.js → index-P5_MyY0i.js} +1 -1
  131. package/lib/{index-D7wfvzJg.cjs → index-TcJ2UKnv.cjs} +1 -1
  132. package/lib/{index-BLrMslr7.cjs → index-czmcFIW7.cjs} +1 -1
  133. package/lib/{index-COCTP78Y.cjs → index-fbGGohBT.cjs} +1 -1
  134. package/lib/index.cjs +1 -1
  135. package/lib/index.js +2 -2
  136. package/lib/{popover-C2BbhsXH.js → popover-BrSDMb_n.js} +1 -1
  137. package/lib/{popover-DCJpsZx0.cjs → popover-UUKfPWue.cjs} +1 -1
  138. package/lib/{renderNodeView-CmnUEfby.js → renderNodeView-CbxCTni3.js} +2 -2
  139. package/lib/{renderNodeView-DQjWzXDA.cjs → renderNodeView-DFVrJy0l.cjs} +1 -1
  140. package/lib/{separator-BuG1zwKa.cjs → separator-LH5EzF0T.cjs} +1 -1
  141. package/lib/{separator-lkMWuUvf.js → separator-fpWkZkoh.js} +2 -2
  142. package/lib/style.css +1 -1
  143. package/lib/{updatePosition-DYuAiqx-.js → updatePosition-BGD41Hbg.js} +2 -2
  144. package/lib/{updatePosition-D6AScA-1.cjs → updatePosition-CQE1ct18.cjs} +1 -1
  145. package/package.json +4 -2
  146. package/lib/Katex-BFIYLrwm.cjs +0 -4
  147. package/lib/delete-node-CosiBes5.cjs +0 -1
  148. package/lib/delete-node-eQHsyyhR.js +0 -24
  149. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +0 -1
package/lib/ImageGif.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-DwSnESy-.cjs"),f=require("./index-BLrMslr7.cjs"),z=require("./clsx-BSBE1eoY.cjs"),l=require("react/jsx-runtime"),u=require("react"),j=require("./index-BqL4vAWE.cjs");require("./theme.cjs");const L=require("./popover-DCJpsZx0.cjs"),N={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function W(e){var P,k;const[t,r]=u.useState({width:j.IMAGE_MAX_SIZE,height:j.IMAGE_MAX_SIZE}),[o,i]=u.useState({width:0,height:0}),[n]=u.useState([N.TOP_LEFT,N.TOP_RIGHT,N.BOTTOM_LEFT,N.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=(P=e==null?void 0:e.node)==null?void 0:P.attrs,m=u.useMemo(()=>{var x;const{src:c,alt:w,width:v,height:A}=(x=e==null?void 0:e.node)==null?void 0:x.attrs,G=f.isNumber(v)?`${v}px`:v,d=f.isNumber(A)?`${A}px`:A;return{src:c||void 0,alt:w||void 0,style:{width:G||void 0,height:d||void 0}}},[(k=e==null?void 0:e.node)==null?void 0:k.attrs]),_=u.useMemo(()=>{const{style:{width:c}}=m;return{width:c==="100%"?c:void 0}},[m]);function g(c){i({width:c.target.width,height:c.target.height})}function I(){const{editor:c,getPos:w}=e;c.commands.setNodeSelection(w())}const M=u.useCallback(f.throttle(()=>{const{editor:c}=e,{width:w}=getComputedStyle(c.view.dom);r(v=>({...v,width:Number.parseInt(w,10)}))},j.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function q(c,w){c.preventDefault(),c.stopPropagation();const v=o.width,A=o.height,G=v/A;let d=Number(e.node.attrs.width),x=Number(e.node.attrs.height);const y=t.width;d&&!x?(d=d>y?y:d,x=Math.round(d/G)):x&&!d?(d=Math.round(x*G),d=d>y?y:d):!d&&!x?(d=v>y?y:v,x=Math.round(d/G)):d=d>y?y:d,a(!0),b({x:c.clientX,y:c.clientY,w:d,h:x,dir:w})}const E=u.useCallback(f.throttle(c=>{if(c.preventDefault(),c.stopPropagation(),!s)return;const{x:w,w:v,dir:A}=h,G=(c.clientX-w)*(/l/.test(A)?-1:1),d=f.clamp$1(v+G,j.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},j.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),S=u.useCallback(c=>{c.preventDefault(),c.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),I())},[s,I]),$=u.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",S,!0)},[E,S]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",S,!0)},[E,S]);u.useEffect(()=>(s?$():O(),()=>{O()}),[s,$,O]);const R=u.useMemo(()=>new ResizeObserver(()=>M()),[M]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(z.NodeViewWrapper,{className:"image-view",style:{..._,width:"100%",textAlign:T},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:_,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(c=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${c}`,onMouseDown:w=>q(w,c)},`image-dir-${c}`))})]})})}async function p(e){var o;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(o=r==null?void 0:r.data)==null?void 0:o.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function D(e,t){var i;const o=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=o==null?void 0:o.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function F(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,T,m,_,g,I,M;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(_=(m=(T=a==null?void 0:a.media_formats)==null?void 0:T.gif)==null?void 0:m.dims)==null?void 0:_[0],height:(M=(I=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:I.dims)==null?void 0:M[1]}})}async function B(e,t){var i;const o=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=o==null?void 0:o.results)==null?void 0:i.map(n=>{var s,a,h,b,T,m,_,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(T=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:T[0],height:(g=(_=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:_.dims)==null?void 0:g[1]}})}function V(e,t){return{searchTrending:async()=>t?e==="giphy"?p(t):e==="tenor"?F(t):[]:[],searchWord:async i=>t?e==="giphy"?D(i,t):e==="tenor"?B(i,t):[]:[]}}function X({selectImage:e,apiKey:t,provider:r,children:o}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=f.useToggleActive(),b=u.useRef(null),{searchTrending:T,searchWord:m}=V(r,t);u.useEffect(()=>{(async()=>{const g=await T();a(g)})()},[]);const _=u.useCallback(f.debounce(async g=>{if(!g.target.value){const M=await T();a(M);return}const I=await m(g.target.value);a(I)},350),[]);return l.jsxs(L.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(L.PopoverTrigger,{asChild:!0,disabled:h,children:o}),l.jsx(L.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(f.Input,{onChange:_,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),n(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function Y(){const e=f.useButtonProps(C.name),{action:t,icon:r,tooltip:o,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=f.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(X,{apiKey:i,provider:n,selectImage:a,children:l.jsx(f.ActionButton,{disabled:s,icon:r,tooltip:o})})}const C=f.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:o})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:o("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return z.ReactNodeViewRenderer(W)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=C;exports.RichTextImageGif=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./index-C4WLt4NA.cjs"),f=require("./index-czmcFIW7.cjs"),z=require("./clsx-DSAWW32g.cjs"),l=require("react/jsx-runtime"),u=require("react"),j=require("./index-BqL4vAWE.cjs");require("./theme.cjs");const L=require("./popover-UUKfPWue.cjs"),N={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function W(e){var P,k;const[t,r]=u.useState({width:j.IMAGE_MAX_SIZE,height:j.IMAGE_MAX_SIZE}),[o,i]=u.useState({width:0,height:0}),[n]=u.useState([N.TOP_LEFT,N.TOP_RIGHT,N.BOTTOM_LEFT,N.BOTTOM_RIGHT]),[s,a]=u.useState(!1),[h,b]=u.useState({x:0,y:0,w:0,h:0,dir:""}),{align:T}=(P=e==null?void 0:e.node)==null?void 0:P.attrs,m=u.useMemo(()=>{var x;const{src:c,alt:w,width:v,height:A}=(x=e==null?void 0:e.node)==null?void 0:x.attrs,G=f.isNumber(v)?`${v}px`:v,d=f.isNumber(A)?`${A}px`:A;return{src:c||void 0,alt:w||void 0,style:{width:G||void 0,height:d||void 0}}},[(k=e==null?void 0:e.node)==null?void 0:k.attrs]),_=u.useMemo(()=>{const{style:{width:c}}=m;return{width:c==="100%"?c:void 0}},[m]);function g(c){i({width:c.target.width,height:c.target.height})}function I(){const{editor:c,getPos:w}=e;c.commands.setNodeSelection(w())}const M=u.useCallback(f.throttle(()=>{const{editor:c}=e,{width:w}=getComputedStyle(c.view.dom);r(v=>({...v,width:Number.parseInt(w,10)}))},j.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function q(c,w){c.preventDefault(),c.stopPropagation();const v=o.width,A=o.height,G=v/A;let d=Number(e.node.attrs.width),x=Number(e.node.attrs.height);const y=t.width;d&&!x?(d=d>y?y:d,x=Math.round(d/G)):x&&!d?(d=Math.round(x*G),d=d>y?y:d):!d&&!x?(d=v>y?y:v,x=Math.round(d/G)):d=d>y?y:d,a(!0),b({x:c.clientX,y:c.clientY,w:d,h:x,dir:w})}const E=u.useCallback(f.throttle(c=>{if(c.preventDefault(),c.stopPropagation(),!s)return;const{x:w,w:v,dir:A}=h,G=(c.clientX-w)*(/l/.test(A)?-1:1),d=f.clamp$1(v+G,j.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:d,height:null})},j.IMAGE_THROTTLE_WAIT_TIME),[s,h,t,e.updateAttributes]),S=u.useCallback(c=>{c.preventDefault(),c.stopPropagation(),s&&(b({x:0,y:0,w:0,h:0,dir:""}),a(!1),I())},[s,I]),$=u.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",S,!0)},[E,S]),O=u.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",S,!0)},[E,S]);u.useEffect(()=>(s?$():O(),()=>{O()}),[s,$,O]);const R=u.useMemo(()=>new ResizeObserver(()=>M()),[M]);return u.useEffect(()=>(R.observe(e.editor.view.dom),()=>{R.disconnect()}),[e.editor.view.dom,R]),l.jsx(z.NodeViewWrapper,{className:"image-view",style:{..._,width:"100%",textAlign:T},children:l.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:_,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,children:[l.jsx("img",{alt:m.alt,className:"image-view__body__image block",height:"auto",onClick:I,onLoad:g,src:m.src,style:m.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&l.jsx("div",{className:"image-resizer",children:n==null?void 0:n.map(c=>l.jsx("span",{className:`image-resizer__handler image-resizer__handler--${c}`,onMouseDown:w=>q(w,c)},`image-dir-${c}`))})]})})}async function p(e){var o;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(o=r==null?void 0:r.data)==null?void 0:o.map(i=>{var n,s,a;return{id:i==null?void 0:i.id,src:(n=i==null?void 0:i.images.original)==null?void 0:n.url,width:+((s=i==null?void 0:i.images.original)==null?void 0:s.width),height:+((a=i==null?void 0:i.images.original)==null?void 0:a.width)}})}async function D(e,t){var i;const o=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=o==null?void 0:o.data)==null?void 0:i.map(n=>{var s,a,h;return{id:n==null?void 0:n.id,src:(s=n==null?void 0:n.images.original)==null?void 0:s.url,width:+((a=n==null?void 0:n.images.original)==null?void 0:a.width),height:+((h=n==null?void 0:n.images.original)==null?void 0:h.width)}})}async function F(e){var n,s;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(n=r==null?void 0:r.results)==null?void 0:n[0]}&limit=15`)).json();return(s=i==null?void 0:i.results)==null?void 0:s.map(a=>{var h,b,T,m,_,g,I,M;return{id:a==null?void 0:a.id,src:(b=(h=a==null?void 0:a.media_formats)==null?void 0:h.gif)==null?void 0:b.url,width:(_=(m=(T=a==null?void 0:a.media_formats)==null?void 0:T.gif)==null?void 0:m.dims)==null?void 0:_[0],height:(M=(I=(g=a==null?void 0:a.media_formats)==null?void 0:g.gif)==null?void 0:I.dims)==null?void 0:M[1]}})}async function B(e,t){var i;const o=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=o==null?void 0:o.results)==null?void 0:i.map(n=>{var s,a,h,b,T,m,_,g;return{id:n==null?void 0:n.id,src:(a=(s=n==null?void 0:n.media_formats)==null?void 0:s.gif)==null?void 0:a.url,width:(T=(b=(h=n==null?void 0:n.media_formats)==null?void 0:h.gif)==null?void 0:b.dims)==null?void 0:T[0],height:(g=(_=(m=n==null?void 0:n.media_formats)==null?void 0:m.gif)==null?void 0:_.dims)==null?void 0:g[1]}})}function V(e,t){return{searchTrending:async()=>t?e==="giphy"?p(t):e==="tenor"?F(t):[]:[],searchWord:async i=>t?e==="giphy"?D(i,t):e==="tenor"?B(i,t):[]:[]}}function X({selectImage:e,apiKey:t,provider:r,children:o}){const[i,n]=u.useState(!1),[s,a]=u.useState([]),{editorDisabled:h}=f.useToggleActive(),b=u.useRef(null),{searchTrending:T,searchWord:m}=V(r,t);u.useEffect(()=>{(async()=>{const g=await T();a(g)})()},[]);const _=u.useCallback(f.debounce(async g=>{if(!g.target.value){const M=await T();a(M);return}const I=await m(g.target.value);a(I)},350),[]);return l.jsxs(L.Popover,{modal:!0,onOpenChange:n,open:i,children:[l.jsx(L.PopoverTrigger,{asChild:!0,disabled:h,children:o}),l.jsx(L.PopoverContent,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:l.jsx(f.Input,{onChange:_,placeholder:"Search GIF",ref:b,type:"text"})}),l.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:l.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1",children:s!=null&&s.length?s==null?void 0:s.map(g=>l.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",src:g.src,onClick:()=>{e(g.src),n(!1)}},g.id)):l.jsx("p",{children:"No GIFs found"})})})]}):l.jsx("div",{children:l.jsx("p",{children:"Missing Giphy API Key"})})})]})}function Y(){const e=f.useButtonProps(C.name),{action:t,icon:r,tooltip:o,apiKey:i,provider:n}=(e==null?void 0:e.componentProps)??{},{editorDisabled:s}=f.useToggleActive(),a=h=>{s||t&&t(h)};return l.jsx(X,{apiKey:i,provider:n,selectImage:a,children:l.jsx(f.ActionButton,{disabled:s,icon:r,tooltip:o})})}const C=f.index_default.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:o})=>{var s,a;const i=((s=r==null?void 0:r.options)==null?void 0:s.provider)||"",n=((a=r==null?void 0:r.options)==null?void 0:a.API_KEY)||"";return{componentProps:{action:h=>{t.chain().focus().setImageGif({src:h}).run()},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:o("editor.imageGif.tooltip"),apiKey:n,provider:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return z.ReactNodeViewRenderer(W)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",H.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.ImageGif=C;exports.RichTextImageGif=Y;
package/lib/ImageGif.js CHANGED
@@ -1,11 +1,11 @@
1
- import { m as B } from "./index-BVRHx_ha.js";
2
- import { O as k, z as C, P as q, u as V, d as D, A as X, Q as Y, j as Z, H as Q } from "./index-CDFAs4RT.js";
3
- import { N as U, a as J } from "./clsx-OumA9x-8.js";
1
+ import { m as B } from "./index-D0EmqTpe.js";
2
+ import { O as k, z as C, P as q, u as V, d as D, A as X, Q as Y, j as Z, H as Q } from "./index-B2a7NqnN.js";
3
+ import { N as U, a as J } from "./clsx-Bg-2aTKh.js";
4
4
  import { jsx as u, jsxs as L, Fragment as K } from "react/jsx-runtime";
5
5
  import { useState as G, useMemo as z, useCallback as M, useEffect as $, useRef as ee } from "react";
6
6
  import { I as j, i as W, j as te } from "./index-BlXGgvT-.js";
7
7
  import "./theme.js";
8
- import { P as ne, a as re, b as ie } from "./popover-C2BbhsXH.js";
8
+ import { P as ne, a as re, b as ie } from "./popover-BrSDMb_n.js";
9
9
  const O = {
10
10
  TOP_LEFT: "tl",
11
11
  TOP_RIGHT: "tr",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-DwSnESy-.cjs"),u=require("react/jsx-runtime"),H=require("mammoth"),A=require("react"),s=require("./index-BLrMslr7.cjs");require("./theme.cjs");const P=require("./index-BqL4vAWE.cjs");function N(o,t){const a=atob(o.split(",")[1]),l=Array.from({length:a.length});for(let i=0;i<a.length;i++)l[i]=a.charCodeAt(i);const m=new Uint8Array(l);return new Blob([m],{type:t})}function k(o,t){return new File([o],t,{type:o.type})}function z(){const o=s.useEditorInstance(),t=s.useButtonProps(y.name),{icon:a=void 0,tooltip:l=void 0,tooltipOptions:m={},isActive:i=void 0,mammothOptions:w,limit:j,convert:b}=(t==null?void 0:t.componentProps)??{},{editorDisabled:W}=s.useToggleActive(i),p=s.useExtension(y.name),{toast:q}=s.useToast(),{t:S}=P.useLocale(),[C,v]=A.useState(!1),x=A.useRef(null);function O(){var e;(e=x.current)==null||e.click()}function R(e){const n=e.target.files[0];if(n){if(n.size>j){q({variant:"destructive",title:S("editor.importWord.limitSize")});return}E(n)}}async function B(e){const c=new DOMParser().parseFromString(e,"text/html"),f=c.querySelectorAll("img");if(f.length===0)return c.body.innerHTML;if(s.hasExtension(o,s.Image.name)){const g=p==null?void 0:p.options;if(g&&typeof g.upload=="function"){const T=[];for(const h of f){const d=h.getAttribute("src"),r=N(d,"image/jpeg"),L=k(r,"image.jpeg");T.push(L)}const F=await g.upload(T);for(const[h,d]of f.entries()){d.setAttribute("src",F[h].src);const r=d.parentElement;(r==null?void 0:r.tagName)==="P"&&(r.insertAdjacentElement("beforebegin",d),!r.hasChildNodes()&&r.textContent===""&&r.remove())}return c.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),c.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),c.body.innerHTML}async function E(e){v(!0);try{if(b){const n=await b(e);I(n)}else{const n=await e.arrayBuffer(),{value:c}=await H.convertToHtml({arrayBuffer:n},w);I(c)}}finally{v(!1)}}async function I(e){const n=await B(e);o.chain().setContent(n,!0).run()}return t?u.jsxs(u.Fragment,{children:[u.jsx(s.ActionButton,{action:O,disabled:W,icon:a,loading:C,tooltip:l,tooltipOptions:m}),u.jsx("input",{accept:".docx",onChange:R,ref:x,type:"file",style:{display:"none"}})]}):u.jsx(u.Fragment,{})}const y=M.Extension.create({name:"importWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:t,t:a})=>{const{convert:l,limit:m,mammothOptions:i}=t.options;return{componentProps:{convert:l,limit:m,mammothOptions:i,icon:"Word",shortcutKeys:t.options.shortcutKeys??["alt","mod","S"],tooltip:a("editor.importWord.tooltip")}}}}}});exports.ImportWord=y;exports.RichTextImportWord=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./index-C4WLt4NA.cjs"),u=require("react/jsx-runtime"),H=require("mammoth"),A=require("react"),s=require("./index-czmcFIW7.cjs");require("./theme.cjs");const P=require("./index-BqL4vAWE.cjs");function N(o,t){const a=atob(o.split(",")[1]),l=Array.from({length:a.length});for(let i=0;i<a.length;i++)l[i]=a.charCodeAt(i);const m=new Uint8Array(l);return new Blob([m],{type:t})}function k(o,t){return new File([o],t,{type:o.type})}function z(){const o=s.useEditorInstance(),t=s.useButtonProps(y.name),{icon:a=void 0,tooltip:l=void 0,tooltipOptions:m={},isActive:i=void 0,mammothOptions:w,limit:j,convert:b}=(t==null?void 0:t.componentProps)??{},{editorDisabled:W}=s.useToggleActive(i),p=s.useExtension(y.name),{toast:q}=s.useToast(),{t:S}=P.useLocale(),[C,v]=A.useState(!1),x=A.useRef(null);function O(){var e;(e=x.current)==null||e.click()}function R(e){const n=e.target.files[0];if(n){if(n.size>j){q({variant:"destructive",title:S("editor.importWord.limitSize")});return}E(n)}}async function B(e){const c=new DOMParser().parseFromString(e,"text/html"),f=c.querySelectorAll("img");if(f.length===0)return c.body.innerHTML;if(s.hasExtension(o,s.Image.name)){const g=p==null?void 0:p.options;if(g&&typeof g.upload=="function"){const T=[];for(const h of f){const d=h.getAttribute("src"),r=N(d,"image/jpeg"),L=k(r,"image.jpeg");T.push(L)}const F=await g.upload(T);for(const[h,d]of f.entries()){d.setAttribute("src",F[h].src);const r=d.parentElement;(r==null?void 0:r.tagName)==="P"&&(r.insertAdjacentElement("beforebegin",d),!r.hasChildNodes()&&r.textContent===""&&r.remove())}return c.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),c.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),c.body.innerHTML}async function E(e){v(!0);try{if(b){const n=await b(e);I(n)}else{const n=await e.arrayBuffer(),{value:c}=await H.convertToHtml({arrayBuffer:n},w);I(c)}}finally{v(!1)}}async function I(e){const n=await B(e);o.chain().setContent(n,!0).run()}return t?u.jsxs(u.Fragment,{children:[u.jsx(s.ActionButton,{action:O,disabled:W,icon:a,loading:C,tooltip:l,tooltipOptions:m}),u.jsx("input",{accept:".docx",onChange:R,ref:x,type:"file",style:{display:"none"}})]}):u.jsx(u.Fragment,{})}const y=M.Extension.create({name:"importWord",addOptions(){var o;return{...(o=this.parent)==null?void 0:o.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({extension:t,t:a})=>{const{convert:l,limit:m,mammothOptions:i}=t.options;return{componentProps:{convert:l,limit:m,mammothOptions:i,icon:"Word",shortcutKeys:t.options.shortcutKeys??["alt","mod","S"],tooltip:a("editor.importWord.tooltip")}}}}}});exports.ImportWord=y;exports.RichTextImportWord=z;
package/lib/ImportWord.js CHANGED
@@ -1,8 +1,8 @@
1
- import { E as M } from "./index-BVRHx_ha.js";
1
+ import { E as M } from "./index-D0EmqTpe.js";
2
2
  import { jsx as g, Fragment as w, jsxs as P } from "react/jsx-runtime";
3
3
  import R from "mammoth";
4
4
  import { useState as N, useRef as k } from "react";
5
- import { h as z, u as D, d as K, v as U, w as q, A as G, x as J, y as Q } from "./index-CDFAs4RT.js";
5
+ import { h as z, u as D, d as K, v as U, w as q, A as G, x as J, y as Q } from "./index-B2a7NqnN.js";
6
6
  import "./theme.js";
7
7
  import { u as V } from "./index-BlXGgvT-.js";
8
8
  function X(e, t) {
@@ -1,7 +1,7 @@
1
- import { o as y, E as x } from "./index-BVRHx_ha.js";
1
+ import { o as y, E as x } from "./index-D0EmqTpe.js";
2
2
  import { TextSelection as b, AllSelection as I } from "@tiptap/pm/state";
3
3
  import { jsx as d, Fragment as m, jsxs as A } from "react/jsx-runtime";
4
- import { u as T, d as K, A as p } from "./index-CDFAs4RT.js";
4
+ import { u as T, d as K, A as p } from "./index-B2a7NqnN.js";
5
5
  import "react";
6
6
  import "./theme.js";
7
7
  var a = /* @__PURE__ */ ((t) => (t[t.max = 7] = "max", t[t.min = 0] = "min", t[t.more = 1] = "more", t[t.less = -1] = "less", t))(a || {});
@@ -1 +1 @@
1
- "use strict";const p=require("./index-DwSnESy-.cjs"),l=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),u=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function b(t,e,n){return t<e?e:t>n?n:t}function T(t,e,n,o){const{doc:s,selection:i}=t;if(!s||!i||!(i instanceof l.TextSelection||i instanceof l.AllSelection))return t;const{from:r,to:d}=i;return s.nodesBetween(r,d,(m,x)=>{const I=m.type;return n.includes(I.name)?(t=h(t,x,e),!1):!p.isList(m.type.name,o.extensionManager.extensions)}),t}function h(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const r=b((o.attrs.indent||0)+n,0,7);if(r===o.attrs.indent)return t;const d={...o.attrs,indent:r};return t.setNodeMarkup(e,o.type,d,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:s})=>{const{selection:i}=n;let{tr:r}=n;return r=r.setSelection(i),r=T(r,t,e,s),r.docChanged?(o&&o(r),!0):!1}}function A(){const t=u.useButtonProps(y.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=u.useToggleActive(),s=()=>{o||e!=null&&e.action&&(e==null||e.action())},i=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(u.ActionButton,{action:s,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(u.ActionButton,{action:i,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const y=p.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var s,i;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((s=o.options.shortcutKeys)==null?void 0:s[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=y;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=h;
1
+ "use strict";const p=require("./index-C4WLt4NA.cjs"),l=require("@tiptap/pm/state"),c=require("react/jsx-runtime"),u=require("./index-czmcFIW7.cjs");require("react");require("./theme.cjs");var a=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(a||{});function b(t,e,n){return t<e?e:t>n?n:t}function T(t,e,n,o){const{doc:s,selection:i}=t;if(!s||!i||!(i instanceof l.TextSelection||i instanceof l.AllSelection))return t;const{from:r,to:d}=i;return s.nodesBetween(r,d,(m,x)=>{const I=m.type;return n.includes(I.name)?(t=h(t,x,e),!1):!p.isList(m.type.name,o.extensionManager.extensions)}),t}function h(t,e,n){if(!t.doc)return t;const o=t.doc.nodeAt(e);if(!o)return t;const r=b((o.attrs.indent||0)+n,0,7);if(r===o.attrs.indent)return t;const d={...o.attrs,indent:r};return t.setNodeMarkup(e,o.type,d,o.marks)}function f({delta:t,types:e}){return({state:n,dispatch:o,editor:s})=>{const{selection:i}=n;let{tr:r}=n;return r=r.setSelection(i),r=T(r,t,e,s),r.docChanged?(o&&o(r),!0):!1}}function A(){const t=u.useButtonProps(y.name),{indent:e,outdent:n}=(t==null?void 0:t.componentProps)??{},{editorDisabled:o}=u.useToggleActive(),s=()=>{o||e!=null&&e.action&&(e==null||e.action())},i=()=>{o||n!=null&&n.action&&(n==null||n.action())};return t?c.jsxs(c.Fragment,{children:[c.jsx(u.ActionButton,{action:s,disabled:o,icon:e==null?void 0:e.icon,shortcutKeys:e==null?void 0:e.shortcutKeys,tooltip:e==null?void 0:e.tooltip}),c.jsx(u.ActionButton,{action:i,disabled:o,icon:n==null?void 0:n.icon,shortcutKeys:n==null?void 0:n.shortcutKeys,tooltip:n==null?void 0:n.tooltip})]}):c.jsx(c.Fragment,{})}const y=p.Extension.create({name:"richtextIndentOutdent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:a.min,maxIndent:a.max,button({editor:e,t:n,extension:o}){var s,i;return{componentProps:{indent:{action:()=>{e.commands.indent()},shortcutKeys:((s=o.options.shortcutKeys)==null?void 0:s[0])??["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")},outdent:{action:()=>{e.commands.outdent()},shortcutKeys:((i=o.options.shortcutKeys)==null?void 0:i[1])??["Shift","Tab"],icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.dataset.indent;return(e?Number.parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>f({delta:a.more,types:this.options.types}),outdent:()=>f({delta:a.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});exports.Indent=y;exports.IndentProps=a;exports.RichTextIndent=A;exports.setNodeIndentMarkup=h;
package/lib/Indent.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DwSnESy-.cjs");const e=require("./Indent-XaZNTsOk.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-C4WLt4NA.cjs");const e=require("./Indent-MuSU0kXz.cjs");exports.Indent=e.Indent;exports.RichTextIndent=e.RichTextIndent;
package/lib/Indent.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./index-BVRHx_ha.js";
2
- import { I as o, R as r } from "./Indent-ruPuj5xn.js";
1
+ import "./index-D0EmqTpe.js";
2
+ import { I as o, R as r } from "./Indent-3MoIatX1.js";
3
3
  export {
4
4
  o as Indent,
5
5
  r as RichTextIndent
package/lib/Italic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-DwSnESy-.cjs"),s=require("react/jsx-runtime"),a=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,h=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,k=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,v=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:y,type:this.type}),r.markInputRule({find:h,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:I,type:this.type}),r.markPasteRule({find:k,type:this.type})]}}),f=v;function M(){const t=a.useButtonProps(u.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:c={},action:o=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:l,update:p}=a.useToggleActive(d),g=()=>{l||o&&(o(),p())};return t?s.jsx(a.ActionButton,{action:g,dataState:m,disabled:l,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:c}):s.jsx(s.Fragment,{})}const u=f.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;exports.RichTextItalic=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-C4WLt4NA.cjs"),s=require("react/jsx-runtime"),a=require("./index-czmcFIW7.cjs");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,I=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,h=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,k=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,v=r.Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[r.markInputRule({find:y,type:this.type}),r.markInputRule({find:h,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:I,type:this.type}),r.markPasteRule({find:k,type:this.type})]}}),f=v;function M(){const t=a.useButtonProps(u.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:i=void 0,tooltipOptions:c={},action:o=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:m,disabled:l,update:p}=a.useToggleActive(d),g=()=>{l||o&&(o(),p())};return t?s.jsx(a.ActionButton,{action:g,dataState:m,disabled:l,icon:e,shortcutKeys:i,tooltip:n,tooltipOptions:c}):s.jsx(s.Fragment,{})}const u=f.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,t:n,extension:i}){return{componentProps:{action:()=>e.commands.toggleItalic(),isActive:()=>e.isActive("italic")||!1,disabled:!1,shortcutKeys:i.options.shortcutKeys??["mod","I"],icon:"Italic",tooltip:n("editor.italic.tooltip")}}}}}});exports.Italic=u;exports.RichTextItalic=M;
package/lib/Italic.js CHANGED
@@ -1,6 +1,6 @@
1
- import { M as g, f as o, h as i, m as y } from "./index-BVRHx_ha.js";
1
+ import { M as g, f as o, h as i, m as y } from "./index-D0EmqTpe.js";
2
2
  import { jsx as d, Fragment as h } from "react/jsx-runtime";
3
- import { u as f, d as I, A as v } from "./index-CDFAs4RT.js";
3
+ import { u as f, d as I, A as v } from "./index-B2a7NqnN.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  var M = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, k = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, A = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, _ = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, R = g.create({
@@ -0,0 +1,4 @@
1
+ "use strict";const ne=require("./index-C4WLt4NA.cjs"),Ya=require("./clsx-DSAWW32g.cjs"),Y=require("react/jsx-runtime"),Xa=require("katex"),fr=require("react"),tr=require("./index-czmcFIW7.cjs");require("./theme.cjs");const jr=require("./_commonjsHelpers-BTDuMlIz.cjs"),Io=require("./index-BqL4vAWE.cjs");var ae,sn;function Qa(){if(sn)return ae;sn=1;var r=Object.prototype.toString;return ae=function(n){var o=r.call(n),t=o==="[object Arguments]";return t||(t=o!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&r.call(n.callee)==="[object Function]"),t},ae}var oe,ln;function Po(){if(ln)return oe;ln=1;var r;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Qa(),t=Object.prototype.propertyIsEnumerable,f=!t.call({toString:null},"toString"),i=t.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(y){var h=y.constructor;return h&&h.prototype===y},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},v=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!c["$"+y]&&e.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{u(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!v)return u(y);try{return u(y)}catch{return!1}};r=function(h){var S=h!==null&&typeof h=="object",R=n.call(h)==="[object Function]",q=o(h),w=S&&n.call(h)==="[object String]",A=[];if(!S&&!R&&!q)throw new TypeError("Object.keys called on a non-object");var m=i&&R;if(w&&h.length>0&&!e.call(h,0))for(var E=0;E<h.length;++E)A.push(String(E));if(q&&h.length>0)for(var Q=0;Q<h.length;++Q)A.push(String(Q));else for(var H in h)!(m&&H==="prototype")&&e.call(h,H)&&A.push(String(H));if(f)for(var F=p(h),D=0;D<a.length;++D)!(F&&a[D]==="constructor")&&e.call(h,a[D])&&A.push(a[D]);return A}}return oe=r,oe}var ie,cn;function kt(){if(cn)return ie;cn=1;var r=Array.prototype.slice,e=Qa(),n=Object.keys,o=n?function(i){return n(i)}:Po(),t=Object.keys;return o.shim=function(){if(Object.keys){var i=(function(){var a=Object.keys(arguments);return a&&a.length===arguments.length})(1,2);i||(Object.keys=function(u){return e(u)?t(r.call(u)):t(u)})}else Object.keys=o;return Object.keys||o},ie=o,ie}var ue,pn;function Gr(){if(pn)return ue;pn=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return ue=r,ue}var fe,yn;function Lt(){return yn||(yn=1,fe=SyntaxError),fe}var se,vn;function ar(){return vn||(vn=1,se=TypeError),se}var le,gn;function Ro(){return gn||(gn=1,le=Object.getOwnPropertyDescriptor),le}var ce,hn;function wr(){if(hn)return ce;hn=1;var r=Ro();if(r)try{r([],"length")}catch{r=null}return ce=r,ce}var pe,dn;function Ut(){if(dn)return pe;dn=1;var r=Gr(),e=Lt(),n=ar(),o=wr();return pe=function(f,i,a){if(!f||typeof f!="object"&&typeof f!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!o&&o(f,i);if(r)r(f,i,{configurable:v===null&&y?y.configurable:!v,enumerable:u===null&&y?y.enumerable:!u,value:a,writable:c===null&&y?y.writable:!c});else if(p||!u&&!c&&!v)f[i]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},pe}var ye,mn;function Ht(){if(mn)return ye;mn=1;var r=Gr(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},ye=e,ye}var ve,Sn;function Ir(){if(Sn)return ve;Sn=1;var r=kt(),e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",n=Object.prototype.toString,o=Array.prototype.concat,t=Ut(),f=function(c){return typeof c=="function"&&n.call(c)==="[object Function]"},i=Ht()(),a=function(c,v,p,y){if(v in c){if(y===!0){if(c[v]===p)return}else if(!f(y)||!y())return}i?t(c,v,p,!0):t(c,v,p)},u=function(c,v){var p=arguments.length>2?arguments[2]:{},y=r(v);e&&(y=o.call(y,Object.getOwnPropertySymbols(v)));for(var h=0;h<y.length;h+=1)a(c,y[h],v[y[h]],p[y[h]])};return u.supportsDescriptors=!!i,ve=u,ve}var ge={exports:{}},he,bn;function Gt(){return bn||(bn=1,he=Object),he}var de,An;function Za(){return An||(An=1,de=Error),de}var me,On;function $o(){return On||(On=1,me=EvalError),me}var Se,qn;function xo(){return qn||(qn=1,Se=RangeError),Se}var be,wn;function Eo(){return wn||(wn=1,be=ReferenceError),be}var Ae,In;function Bo(){return In||(In=1,Ae=URIError),Ae}var Oe,Pn;function jo(){return Pn||(Pn=1,Oe=Math.abs),Oe}var qe,Rn;function To(){return Rn||(Rn=1,qe=Math.floor),qe}var we,$n;function Mo(){return $n||($n=1,we=Math.max),we}var Ie,xn;function Co(){return xn||(xn=1,Ie=Math.min),Ie}var Pe,En;function Do(){return En||(En=1,Pe=Math.pow),Pe}var Re,Bn;function Fo(){return Bn||(Bn=1,Re=Math.round),Re}var $e,jn;function _o(){return jn||(jn=1,$e=Number.isNaN||function(e){return e!==e}),$e}var xe,Tn;function No(){if(Tn)return xe;Tn=1;var r=_o();return xe=function(n){return r(n)||n===0?n:n<0?-1:1},xe}var Ee,Mn;function zr(){return Mn||(Mn=1,Ee=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var t=42;e[n]=t;for(var f in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,n);if(a.value!==t||a.enumerable!==!0)return!1}return!0}),Ee}var Be,Cn;function zt(){if(Cn)return Be;Cn=1;var r=typeof Symbol<"u"&&Symbol,e=zr();return Be=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Be}var je,Dn;function ro(){return Dn||(Dn=1,je=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),je}var Te,Fn;function eo(){if(Fn)return Te;Fn=1;var r=Gt();return Te=r.getPrototypeOf||null,Te}var Me,_n;function Wo(){if(_n)return Me;_n=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,o="[object Function]",t=function(u,c){for(var v=[],p=0;p<u.length;p+=1)v[p]=u[p];for(var y=0;y<c.length;y+=1)v[y+u.length]=c[y];return v},f=function(u,c){for(var v=[],p=c,y=0;p<u.length;p+=1,y+=1)v[y]=u[p];return v},i=function(a,u){for(var c="",v=0;v<a.length;v+=1)c+=a[v],v+1<a.length&&(c+=u);return c};return Me=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==o)throw new TypeError(r+c);for(var v=f(arguments,1),p,y=function(){if(this instanceof p){var w=c.apply(this,t(v,arguments));return Object(w)===w?w:this}return c.apply(u,t(v,arguments))},h=n(0,c.length-v.length),S=[],R=0;R<h;R++)S[R]="$"+R;if(p=Function("binder","return function ("+i(S,",")+"){ return binder.apply(this,arguments); }")(y),c.prototype){var q=function(){};q.prototype=c.prototype,p.prototype=new q,q.prototype=null}return p},Me}var Ce,Nn;function Fr(){if(Nn)return Ce;Nn=1;var r=Wo();return Ce=Function.prototype.bind||r,Ce}var De,Wn;function Vt(){return Wn||(Wn=1,De=Function.prototype.call),De}var Fe,kn;function Kt(){return kn||(kn=1,Fe=Function.prototype.apply),Fe}var _e,Ln;function ko(){return Ln||(Ln=1,_e=typeof Reflect<"u"&&Reflect&&Reflect.apply),_e}var Ne,Un;function to(){if(Un)return Ne;Un=1;var r=Fr(),e=Kt(),n=Vt(),o=ko();return Ne=o||r.call(n,e),Ne}var We,Hn;function Jt(){if(Hn)return We;Hn=1;var r=Fr(),e=ar(),n=Vt(),o=to();return We=function(f){if(f.length<1||typeof f[0]!="function")throw new e("a function is required");return o(r,n,f)},We}var ke,Gn;function Lo(){if(Gn)return ke;Gn=1;var r=Jt(),e=wr(),n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var o=!!n&&e&&e(Object.prototype,"__proto__"),t=Object,f=t.getPrototypeOf;return ke=o&&typeof o.get=="function"?r([o.get]):typeof f=="function"?function(a){return f(a==null?a:t(a))}:!1,ke}var Le,zn;function Yt(){if(zn)return Le;zn=1;var r=ro(),e=eo(),n=Lo();return Le=r?function(t){return r(t)}:e?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return e(t)}:n?function(t){return n(t)}:null,Le}var Ue,Vn;function Xt(){if(Vn)return Ue;Vn=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=Fr();return Ue=n.call(r,e),Ue}var He,Kn;function vr(){if(Kn)return He;Kn=1;var r,e=Gt(),n=Za(),o=$o(),t=xo(),f=Eo(),i=Lt(),a=ar(),u=Bo(),c=jo(),v=To(),p=Mo(),y=Co(),h=Do(),S=Fo(),R=No(),q=Function,w=function(M){try{return q('"use strict"; return ('+M+").constructor;")()}catch{}},A=wr(),m=Gr(),E=function(){throw new a},Q=A?(function(){try{return arguments.callee,E}catch{try{return A(arguments,"callee").get}catch{return E}}})():E,H=zt()(),F=Yt(),D=eo(),I=ro(),_=Kt(),L=Vt(),N={},U=typeof Uint8Array>"u"||!F?r:F(Uint8Array),V={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":H&&F?F([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":q,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&F?F(F([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!F?r:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":t,"%ReferenceError%":f,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!F?r:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&F?F(""[Symbol.iterator]()):r,"%Symbol%":H?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":Q,"%TypedArray%":U,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":_,"%Object.defineProperty%":m,"%Object.getPrototypeOf%":D,"%Math.abs%":c,"%Math.floor%":v,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":h,"%Math.round%":S,"%Math.sign%":R,"%Reflect.getPrototypeOf%":I};if(F)try{null.error}catch(M){var sr=F(F(M));V["%Error.prototype%"]=sr}var Rr=function M(O){var P;if(O==="%AsyncFunction%")P=w("async function () {}");else if(O==="%GeneratorFunction%")P=w("function* () {}");else if(O==="%AsyncGeneratorFunction%")P=w("async function* () {}");else if(O==="%AsyncGenerator%"){var b=M("%AsyncGeneratorFunction%");b&&(P=b.prototype)}else if(O==="%AsyncIteratorPrototype%"){var B=M("%AsyncGenerator%");B&&F&&(P=F(B.prototype))}return V[O]=P,P},br={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},or=Fr(),G=Xt(),Ar=or.call(L,Array.prototype.concat),$r=or.call(_,Array.prototype.splice),Or=or.call(L,String.prototype.replace),gr=or.call(L,String.prototype.slice),g=or.call(L,RegExp.prototype.exec),d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,$=function(O){var P=gr(O,0,1),b=gr(O,-1);if(P==="%"&&b!=="%")throw new i("invalid intrinsic syntax, expected closing `%`");if(b==="%"&&P!=="%")throw new i("invalid intrinsic syntax, expected opening `%`");var B=[];return Or(O,d,function(z,K,J,X){B[B.length]=J?Or(X,x,"$1"):K||z}),B},T=function(O,P){var b=O,B;if(G(br,b)&&(B=br[b],b="%"+B[0]+"%"),G(V,b)){var z=V[b];if(z===N&&(z=Rr(b)),typeof z>"u"&&!P)throw new a("intrinsic "+O+" exists, but is not available. Please file an issue!");return{alias:B,name:b,value:z}}throw new i("intrinsic "+O+" does not exist!")};return He=function(O,P){if(typeof O!="string"||O.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new a('"allowMissing" argument must be a boolean');if(g(/^%?[^%]*%?$/,O)===null)throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=$(O),B=b.length>0?b[0]:"",z=T("%"+B+"%",P),K=z.name,J=z.value,X=!1,rr=z.alias;rr&&(B=rr[0],$r(b,Ar([0,1],rr)));for(var lr=1,ir=!0;lr<b.length;lr+=1){var er=b[lr],cr=gr(er,0,1),pr=gr(er,-1);if((cr==='"'||cr==="'"||cr==="`"||pr==='"'||pr==="'"||pr==="`")&&cr!==pr)throw new i("property names with quotes must have matching quotes");if((er==="constructor"||!ir)&&(X=!0),B+="."+er,K="%"+B+"%",G(V,K))J=V[K];else if(J!=null){if(!(er in J)){if(!P)throw new a("base intrinsic for "+O+" exists, but the property is not available.");return}if(A&&lr+1>=b.length){var yr=A(J,er);ir=!!yr,ir&&"get"in yr&&!("originalValue"in yr.get)?J=yr.get:J=J[er]}else ir=G(J,er),J=J[er];ir&&!X&&(V[K]=J)}}return J},He}var Ge,Jn;function Uo(){if(Jn)return Ge;Jn=1;var r=vr(),e=Ut(),n=Ht()(),o=wr(),t=ar(),f=r("%Math.floor%");return Ge=function(a,u){if(typeof a!="function")throw new t("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||f(u)!==u)throw new t("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],v=!0,p=!0;if("length"in a&&o){var y=o(a,"length");y&&!y.configurable&&(v=!1),y&&!y.writable&&(p=!1)}return(v||p||!c)&&(n?e(a,"length",u,!0,!0):e(a,"length",u)),a},Ge}var ze,Yn;function Ho(){if(Yn)return ze;Yn=1;var r=Fr(),e=Kt(),n=to();return ze=function(){return n(r,e,arguments)},ze}var Xn;function Tr(){return Xn||(Xn=1,(function(r){var e=Uo(),n=Gr(),o=Jt(),t=Ho();r.exports=function(i){var a=o(arguments),u=i.length-(arguments.length-1);return e(a,1+(u>0?u:0),!0)},n?n(r.exports,"apply",{value:t}):r.exports.apply=t})(ge)),ge.exports}var Ve,Qn;function Z(){if(Qn)return Ve;Qn=1;var r=vr(),e=Jt(),n=e([r("%String.prototype.indexOf%")]);return Ve=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e([i]):i},Ve}var Ke,Zn;function no(){if(Zn)return Ke;Zn=1;var r=kt(),e=zr()(),n=Z(),o=Gt(),t=n("Array.prototype.push"),f=n("Object.prototype.propertyIsEnumerable"),i=e?o.getOwnPropertySymbols:null;return Ke=function(u,c){if(u==null)throw new TypeError("target must be an object");var v=o(u);if(arguments.length===1)return v;for(var p=1;p<arguments.length;++p){var y=o(arguments[p]),h=r(y),S=e&&(o.getOwnPropertySymbols||i);if(S)for(var R=S(y),q=0;q<R.length;++q){var w=R[q];f(y,w)&&t(h,w)}for(var A=0;A<h.length;++A){var m=h[A];if(f(y,m)){var E=y[m];v[m]=E}}}return v},Ke}var Je,ra;function ao(){if(ra)return Je;ra=1;var r=no(),e=function(){if(!Object.assign)return!1;for(var o="abcdefghijklmnopqrst",t=o.split(""),f={},i=0;i<t.length;++i)f[t[i]]=t[i];var a=Object.assign({},f),u="";for(var c in a)u+=c;return o!==u},n=function(){if(!Object.assign||!Object.preventExtensions)return!1;var o=Object.preventExtensions({1:2});try{Object.assign(o,"xy")}catch{return o[1]==="y"}return!1};return Je=function(){return!Object.assign||e()||n()?r:Object.assign},Je}var Ye,ea;function Go(){if(ea)return Ye;ea=1;var r=Ir(),e=ao();return Ye=function(){var o=e();return r(Object,{assign:o},{assign:function(){return Object.assign!==o}}),o},Ye}var Xe,ta;function zo(){if(ta)return Xe;ta=1;var r=Ir(),e=Tr(),n=no(),o=ao(),t=Go(),f=e.apply(o()),i=function(u,c){return f(Object,arguments)};return r(i,{getPolyfill:o,implementation:n,shim:t}),Xe=i,Xe}var Qe,na;function oo(){if(na)return Qe;na=1;var r=vr(),e=Tr(),n=e(r("String.prototype.indexOf"));return Qe=function(t,f){var i=r(t,!!f);return typeof i=="function"&&n(t,".prototype.")>-1?e(i):i},Qe}var Ze,aa;function Vo(){if(aa)return Ze;aa=1;var r=function(){return typeof(function(){}).name=="string"},e=Object.getOwnPropertyDescriptor;if(e)try{e([],"length")}catch{e=null}r.functionsHaveConfigurableNames=function(){if(!r()||!e)return!1;var t=e(function(){},"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;return r.boundFunctionsHaveNames=function(){return r()&&typeof n=="function"&&(function(){}).bind().name!==""},Ze=r,Ze}var rt,oa;function Ko(){if(oa)return rt;oa=1;var r=Ut(),e=Ht()(),n=Vo().functionsHaveConfigurableNames(),o=ar();return rt=function(f,i){if(typeof f!="function")throw new o("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||n)&&(e?r(f,"name",i,!0,!0):r(f,"name",i)),f},rt}var et,ia;function io(){if(ia)return et;ia=1;var r=Ko(),e=ar(),n=Object;return et=r(function(){if(this==null||this!==n(this))throw new e("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0),et}var tt,ua;function uo(){if(ua)return tt;ua=1;var r=io(),e=Ir().supportsDescriptors,n=Object.getOwnPropertyDescriptor;return tt=function(){if(e&&/a/mig.flags==="gim"){var t=n(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var f="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){f+="d"}}),Object.defineProperty(i,"sticky",{get:function(){f+="y"}}),t.get.call(i),f==="dy")return t.get}}return r},tt}var nt,fa;function Jo(){if(fa)return nt;fa=1;var r=Ir().supportsDescriptors,e=uo(),n=wr(),o=Object.defineProperty,t=Za(),f=Yt(),i=/a/;return nt=function(){if(!r||!f)throw new t("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var u=e(),c=f(i),v=n(c,"flags");return(!v||v.get!==u)&&o(c,"flags",{configurable:!0,enumerable:!1,get:u}),u},nt}var at,sa;function Yo(){if(sa)return at;sa=1;var r=Ir(),e=Tr(),n=io(),o=uo(),t=Jo(),f=e(o());return r(f,{getPolyfill:o,implementation:n,shim:t}),at=f,at}var Dr={exports:{}},ot,la;function Pr(){if(la)return ot;la=1;var r=zr();return ot=function(){return r()&&!!Symbol.toStringTag},ot}var it,ca;function fo(){if(ca)return it;ca=1;var r=Pr()(),e=Z(),n=e("Object.prototype.toString"),o=function(a){return r&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},t=function(a){return o(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&"callee"in a&&n(a.callee)==="[object Function]"},f=(function(){return o(arguments)})();return o.isLegacyArguments=t,it=f?o:t,it}const Xo={},Qo=Object.freeze(Object.defineProperty({__proto__:null,default:Xo},Symbol.toStringTag,{value:"Module"})),Zo=jr.getAugmentedNamespace(Qo);var ut,pa;function Vr(){if(pa)return ut;pa=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=r&&e&&typeof e.get=="function"?e.get:null,o=r&&Map.prototype.forEach,t=typeof Set=="function"&&Set.prototype,f=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,i=t&&f&&typeof f.get=="function"?f.get:null,a=t&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,v=typeof WeakSet=="function"&&WeakSet.prototype,p=v?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,h=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,R=Object.prototype.toString,q=Function.prototype.toString,w=String.prototype.match,A=String.prototype.slice,m=String.prototype.replace,E=String.prototype.toUpperCase,Q=String.prototype.toLowerCase,H=RegExp.prototype.test,F=Array.prototype.concat,D=Array.prototype.join,I=Array.prototype.slice,_=Math.floor,L=typeof BigInt=="function"?BigInt.prototype.valueOf:null,N=Object.getOwnPropertySymbols,U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,V=typeof Symbol=="function"&&typeof Symbol.iterator=="object",sr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===V||!0)?Symbol.toStringTag:null,Rr=Object.prototype.propertyIsEnumerable,br=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(s){return s.__proto__}:null);function or(s,l){if(s===1/0||s===-1/0||s!==s||s&&s>-1e3&&s<1e3||H.call(/e/,l))return l;var C=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof s=="number"){var W=s<0?-_(-s):_(s);if(W!==s){var k=String(W),j=A.call(l,k.length+1);return m.call(k,C,"$&_")+"."+m.call(m.call(j,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(l,C,"$&_")}var G=Zo,Ar=G.custom,$r=z(Ar)?Ar:null,Or={__proto__:null,double:'"',single:"'"},gr={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ut=function s(l,C,W,k){var j=C||{};if(X(j,"quoteStyle")&&!X(Or,j.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(X(j,"maxStringLength")&&(typeof j.maxStringLength=="number"?j.maxStringLength<0&&j.maxStringLength!==1/0:j.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var mr=X(j,"customInspect")?j.customInspect:!0;if(typeof mr!="boolean"&&mr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(X(j,"indent")&&j.indent!==null&&j.indent!==" "&&!(parseInt(j.indent,10)===j.indent&&j.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(X(j,"numericSeparator")&&typeof j.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var qr=j.numericSeparator;if(typeof l>"u")return"undefined";if(l===null)return"null";if(typeof l=="boolean")return l?"true":"false";if(typeof l=="string")return xr(l,j);if(typeof l=="number"){if(l===0)return 1/0/l>0?"0":"-0";var nr=String(l);return qr?or(l,nr):nr}if(typeof l=="bigint"){var Sr=String(l)+"n";return qr?or(l,Sr):Sr}var Yr=typeof j.depth>"u"?5:j.depth;if(typeof W>"u"&&(W=0),W>=Yr&&Yr>0&&typeof l=="object")return $(l)?"[Array]":"[Object]";var Er=Oo(j,W);if(typeof k>"u")k=[];else if(ir(k,l)>=0)return"[Circular]";function ur(Br,kr,wo){if(kr&&(k=I.call(k),k.push(kr)),wo){var fn={depth:j.depth};return X(j,"quoteStyle")&&(fn.quoteStyle=j.quoteStyle),s(Br,fn,W+1,k)}return s(Br,j,W+1,k)}if(typeof l=="function"&&!M(l)){var rn=lr(l),en=Nr(l,ur);return"[Function"+(rn?": "+rn:" (anonymous)")+"]"+(en.length>0?" { "+D.call(en,", ")+" }":"")}if(z(l)){var tn=V?m.call(String(l),/^(Symbol\(.*\))_[^)]*$/,"$1"):U.call(l);return typeof l=="object"&&!V?dr(tn):tn}if(hr(l)){for(var Cr="<"+Q.call(String(l.nodeName)),Xr=l.attributes||[],Wr=0;Wr<Xr.length;Wr++)Cr+=" "+Xr[Wr].name+"="+g(d(Xr[Wr].value),"double",j);return Cr+=">",l.childNodes&&l.childNodes.length&&(Cr+="..."),Cr+="</"+Q.call(String(l.nodeName))+">",Cr}if($(l)){if(l.length===0)return"[]";var Qr=Nr(l,ur);return Er&&!Ao(Qr)?"["+Jr(Qr,Er)+"]":"[ "+D.call(Qr,", ")+" ]"}if(O(l)){var Zr=Nr(l,ur);return!("cause"in Error.prototype)&&"cause"in l&&!Rr.call(l,"cause")?"{ ["+String(l)+"] "+D.call(F.call("[cause]: "+ur(l.cause),Zr),", ")+" }":Zr.length===0?"["+String(l)+"]":"{ ["+String(l)+"] "+D.call(Zr,", ")+" }"}if(typeof l=="object"&&mr){if($r&&typeof l[$r]=="function"&&G)return G(l,{depth:Yr-W});if(mr!=="symbol"&&typeof l.inspect=="function")return l.inspect()}if(er(l)){var nn=[];return o&&o.call(l,function(Br,kr){nn.push(ur(kr,l,!0)+" => "+ur(Br,l))}),Zt("Map",n.call(l),nn,Er)}if(yr(l)){var an=[];return a&&a.call(l,function(Br){an.push(ur(Br,l))}),Zt("Set",i.call(l),an,Er)}if(cr(l))return Kr("WeakMap");if(_r(l))return Kr("WeakSet");if(pr(l))return Kr("WeakRef");if(b(l))return dr(ur(Number(l)));if(K(l))return dr(ur(L.call(l)));if(B(l))return dr(S.call(l));if(P(l))return dr(ur(String(l)));if(typeof window<"u"&&l===window)return"{ [object Window] }";if(typeof globalThis<"u"&&l===globalThis||typeof jr.commonjsGlobal<"u"&&l===jr.commonjsGlobal)return"{ [object globalThis] }";if(!T(l)&&!M(l)){var re=Nr(l,ur),on=br?br(l)===Object.prototype:l instanceof Object||l.constructor===Object,ee=l instanceof Object?"":"null prototype",un=!on&&sr&&Object(l)===l&&sr in l?A.call(rr(l),8,-1):ee?"Object":"",qo=on||typeof l.constructor!="function"?"":l.constructor.name?l.constructor.name+" ":"",te=qo+(un||ee?"["+D.call(F.call([],un||[],ee||[]),": ")+"] ":"");return re.length===0?te+"{}":Er?te+"{"+Jr(re,Er)+"}":te+"{ "+D.call(re,", ")+" }"}return String(l)};function g(s,l,C){var W=C.quoteStyle||l,k=Or[W];return k+s+k}function d(s){return m.call(String(s),/"/g,"&quot;")}function x(s){return!sr||!(typeof s=="object"&&(sr in s||typeof s[sr]<"u"))}function $(s){return rr(s)==="[object Array]"&&x(s)}function T(s){return rr(s)==="[object Date]"&&x(s)}function M(s){return rr(s)==="[object RegExp]"&&x(s)}function O(s){return rr(s)==="[object Error]"&&x(s)}function P(s){return rr(s)==="[object String]"&&x(s)}function b(s){return rr(s)==="[object Number]"&&x(s)}function B(s){return rr(s)==="[object Boolean]"&&x(s)}function z(s){if(V)return s&&typeof s=="object"&&s instanceof Symbol;if(typeof s=="symbol")return!0;if(!s||typeof s!="object"||!U)return!1;try{return U.call(s),!0}catch{}return!1}function K(s){if(!s||typeof s!="object"||!L)return!1;try{return L.call(s),!0}catch{}return!1}var J=Object.prototype.hasOwnProperty||function(s){return s in this};function X(s,l){return J.call(s,l)}function rr(s){return R.call(s)}function lr(s){if(s.name)return s.name;var l=w.call(q.call(s),/^function\s*([\w$]+)/);return l?l[1]:null}function ir(s,l){if(s.indexOf)return s.indexOf(l);for(var C=0,W=s.length;C<W;C++)if(s[C]===l)return C;return-1}function er(s){if(!n||!s||typeof s!="object")return!1;try{n.call(s);try{i.call(s)}catch{return!0}return s instanceof Map}catch{}return!1}function cr(s){if(!c||!s||typeof s!="object")return!1;try{c.call(s,c);try{p.call(s,p)}catch{return!0}return s instanceof WeakMap}catch{}return!1}function pr(s){if(!h||!s||typeof s!="object")return!1;try{return h.call(s),!0}catch{}return!1}function yr(s){if(!i||!s||typeof s!="object")return!1;try{i.call(s);try{n.call(s)}catch{return!0}return s instanceof Set}catch{}return!1}function _r(s){if(!p||!s||typeof s!="object")return!1;try{p.call(s,p);try{c.call(s,c)}catch{return!0}return s instanceof WeakSet}catch{}return!1}function hr(s){return!s||typeof s!="object"?!1:typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.nodeName=="string"&&typeof s.getAttribute=="function"}function xr(s,l){if(s.length>l.maxStringLength){var C=s.length-l.maxStringLength,W="... "+C+" more character"+(C>1?"s":"");return xr(A.call(s,0,l.maxStringLength),l)+W}var k=gr[l.quoteStyle||"single"];k.lastIndex=0;var j=m.call(m.call(s,k,"\\$1"),/[\x00-\x1f]/g,Mr);return g(j,"single",l)}function Mr(s){var l=s.charCodeAt(0),C={8:"b",9:"t",10:"n",12:"f",13:"r"}[l];return C?"\\"+C:"\\x"+(l<16?"0":"")+E.call(l.toString(16))}function dr(s){return"Object("+s+")"}function Kr(s){return s+" { ? }"}function Zt(s,l,C,W){var k=W?Jr(C,W):D.call(C,", ");return s+" ("+l+") {"+k+"}"}function Ao(s){for(var l=0;l<s.length;l++)if(ir(s[l],`
2
+ `)>=0)return!1;return!0}function Oo(s,l){var C;if(s.indent===" ")C=" ";else if(typeof s.indent=="number"&&s.indent>0)C=D.call(Array(s.indent+1)," ");else return null;return{base:C,prev:D.call(Array(l+1),C)}}function Jr(s,l){if(s.length===0)return"";var C=`
3
+ `+l.prev+l.base;return C+D.call(s,","+C)+`
4
+ `+l.prev}function Nr(s,l){var C=$(s),W=[];if(C){W.length=s.length;for(var k=0;k<s.length;k++)W[k]=X(s,k)?l(s[k],s):""}var j=typeof N=="function"?N(s):[],mr;if(V){mr={};for(var qr=0;qr<j.length;qr++)mr["$"+j[qr]]=j[qr]}for(var nr in s)X(s,nr)&&(C&&String(Number(nr))===nr&&nr<s.length||V&&mr["$"+nr]instanceof Symbol||(H.call(/[^\w$]/,nr)?W.push(l(nr,s)+": "+l(s[nr],s)):W.push(nr+": "+l(s[nr],s))));if(typeof N=="function")for(var Sr=0;Sr<j.length;Sr++)Rr.call(s,j[Sr])&&W.push("["+l(j[Sr])+"]: "+l(s[j[Sr]],s));return W}return ut}var ft,ya;function ri(){if(ya)return ft;ya=1;var r=Vr(),e=ar(),n=function(a,u,c){for(var v=a,p;(p=v.next)!=null;v=p)if(p.key===u)return v.next=p.next,c||(p.next=a.next,a.next=p),p},o=function(a,u){if(a){var c=n(a,u);return c&&c.value}},t=function(a,u,c){var v=n(a,u);v?v.value=c:a.next={key:u,next:a.next,value:c}},f=function(a,u){return a?!!n(a,u):!1},i=function(a,u){if(a)return n(a,u,!0)};return ft=function(){var u,c={assert:function(v){if(!c.has(v))throw new e("Side channel does not contain "+r(v))},delete:function(v){var p=u&&u.next,y=i(u,v);return y&&p&&p===y&&(u=void 0),!!y},get:function(v){return o(u,v)},has:function(v){return f(u,v)},set:function(v,p){u||(u={next:void 0}),t(u,v,p)}};return c},ft}var st,va;function so(){if(va)return st;va=1;var r=vr(),e=Z(),n=Vr(),o=ar(),t=r("%Map%",!0),f=e("Map.prototype.get",!0),i=e("Map.prototype.set",!0),a=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),c=e("Map.prototype.size",!0);return st=!!t&&function(){var p,y={assert:function(h){if(!y.has(h))throw new o("Side channel does not contain "+n(h))},delete:function(h){if(p){var S=u(p,h);return c(p)===0&&(p=void 0),S}return!1},get:function(h){if(p)return f(p,h)},has:function(h){return p?a(p,h):!1},set:function(h,S){p||(p=new t),i(p,h,S)}};return y},st}var lt,ga;function ei(){if(ga)return lt;ga=1;var r=vr(),e=Z(),n=Vr(),o=so(),t=ar(),f=r("%WeakMap%",!0),i=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("WeakMap.prototype.delete",!0);return lt=f?function(){var p,y,h={assert:function(S){if(!h.has(S))throw new t("Side channel does not contain "+n(S))},delete:function(S){if(f&&S&&(typeof S=="object"||typeof S=="function")){if(p)return c(p,S)}else if(o&&y)return y.delete(S);return!1},get:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?i(p,S):y&&y.get(S)},has:function(S){return f&&S&&(typeof S=="object"||typeof S=="function")&&p?u(p,S):!!y&&y.has(S)},set:function(S,R){f&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new f),a(p,S,R)):o&&(y||(y=o()),y.set(S,R))}};return h}:o,lt}var ct,ha;function lo(){if(ha)return ct;ha=1;var r=ar(),e=Vr(),n=ri(),o=so(),t=ei(),f=t||o||n;return ct=function(){var a,u={assert:function(c){if(!u.has(c))throw new r("Side channel does not contain "+e(c))},delete:function(c){return!!a&&a.delete(c)},get:function(c){return a&&a.get(c)},has:function(c){return!!a&&a.has(c)},set:function(c,v){a||(a=f()),a.set(c,v)}};return u},ct}var pt,da;function ti(){if(da)return pt;da=1;var r=Xt(),e=lo()(),n=ar(),o={assert:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");if(e.assert(t),!o.has(t,f))throw new n("`"+f+"` is not present on `O`")},get:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return i&&i["$"+f]},has:function(t,f){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var i=e.get(t);return!!i&&r(i,"$"+f)},set:function(t,f,i){if(!t||typeof t!="object"&&typeof t!="function")throw new n("`O` is not an object");if(typeof f!="string")throw new n("`slot` must be a string");var a=e.get(t);a||(a={},e.set(t,a)),a["$"+f]=i}};return Object.freeze&&Object.freeze(o),pt=o,pt}var yt,ma;function ni(){if(ma)return yt;ma=1;var r=ti(),e=Lt(),n=typeof StopIteration=="object"?StopIteration:null;return yt=function(t){if(!n)throw new e("this environment lacks StopIteration");r.set(t,"[[Done]]",!1);var f={next:function(){var a=r.get(this,"[[Iterator]]"),u=!!r.get(a,"[[Done]]");try{return{done:u,value:u?void 0:a.next()}}catch(c){if(r.set(a,"[[Done]]",!0),c!==n)throw c;return{done:!0,value:void 0}}}};return r.set(f,"[[Iterator]]",t),f},yt}var vt,Sa;function co(){if(Sa)return vt;Sa=1;var r={}.toString;return vt=Array.isArray||function(e){return r.call(e)=="[object Array]"},vt}var gt,ba;function po(){if(ba)return gt;ba=1;var r=Z(),e=r("String.prototype.valueOf"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object String]",f=Pr()();return gt=function(a){return typeof a=="string"?!0:!a||typeof a!="object"?!1:f?n(a):o(a)===t},gt}var ht,Aa;function yo(){if(Aa)return ht;Aa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;r||(n=function(i){return!1});var o=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!o&&(n=function(i){return!1}),ht=n||function(i){if(!i||typeof i!="object")return!1;try{if(o.call(i),t)try{t.call(i)}catch{return!0}return i instanceof r}catch{}return!1},ht}var dt,Oa;function vo(){if(Oa)return dt;Oa=1;var r=typeof Map=="function"&&Map.prototype?Map:null,e=typeof Set=="function"&&Set.prototype?Set:null,n;e||(n=function(i){return!1});var o=r?Map.prototype.has:null,t=e?Set.prototype.has:null;return!n&&!t&&(n=function(i){return!1}),dt=n||function(i){if(!i||typeof i!="object")return!1;try{if(t.call(i),o)try{o.call(i)}catch{return!0}return i instanceof e}catch{}return!1},dt}var qa;function ai(){if(qa)return Dr.exports;qa=1;var r=fo(),e=ni();if(zt()()||zr()()){var n=Symbol.iterator;Dr.exports=function(I){if(I!=null&&typeof I[n]<"u")return I[n]();if(r(I))return Array.prototype[n].call(I)}}else{var o=co(),t=po(),f=vr(),i=f("%Map%",!0),a=f("%Set%",!0),u=oo(),c=u("Array.prototype.push"),v=u("String.prototype.charCodeAt"),p=u("String.prototype.slice"),y=function(I,_){var L=I.length;if(_+1>=L)return _+1;var N=v(I,_);if(N<55296||N>56319)return _+1;var U=v(I,_+1);return U<56320||U>57343?_+1:_+2},h=function(I){var _=0;return{next:function(){var N=_>=I.length,U;return N||(U=I[_],_+=1),{done:N,value:U}}}},S=function(I,_){if(o(I)||r(I))return h(I);if(t(I)){var L=0;return{next:function(){var U=y(I,L),V=p(I,L,U);return L=U,{done:U>I.length,value:V}}}}if(_&&typeof I["_es6-shim iterator_"]<"u")return I["_es6-shim iterator_"]()};if(!i&&!a)Dr.exports=function(I){if(I!=null)return S(I,!0)};else{var R=yo(),q=vo(),w=u("Map.prototype.forEach",!0),A=u("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var m=u("Map.prototype.iterator",!0),E=u("Set.prototype.iterator",!0);var Q=u("Map.prototype.@@iterator",!0)||u("Map.prototype._es6-shim iterator_",!0),H=u("Set.prototype.@@iterator",!0)||u("Set.prototype._es6-shim iterator_",!0),F=function(I){if(R(I)){if(m)return e(m(I));if(Q)return Q(I);if(w){var _=[];return w(I,function(N,U){c(_,[U,N])}),h(_)}}if(q(I)){if(E)return e(E(I));if(H)return H(I);if(A){var L=[];return A(I,function(N){c(L,N)}),h(L)}}};Dr.exports=function(I){return F(I)||S(I)}}}return Dr.exports}var mt,wa;function go(){if(wa)return mt;wa=1;var r=function(e){return e!==e};return mt=function(n,o){return n===0&&o===0?1/n===1/o:!!(n===o||r(n)&&r(o))},mt}var St,Ia;function ho(){if(Ia)return St;Ia=1;var r=go();return St=function(){return typeof Object.is=="function"?Object.is:r},St}var bt,Pa;function oi(){if(Pa)return bt;Pa=1;var r=ho(),e=Ir();return bt=function(){var o=r();return e(Object,{is:o},{is:function(){return Object.is!==o}}),o},bt}var At,Ra;function ii(){if(Ra)return At;Ra=1;var r=Ir(),e=Tr(),n=go(),o=ho(),t=oi(),f=e(o(),Object);return r(f,{getPolyfill:o,implementation:n,shim:t}),At=f,At}var Ot,$a;function mo(){if($a)return Ot;$a=1;var r=Tr(),e=Z(),n=vr(),o=n("%ArrayBuffer%",!0),t=e("ArrayBuffer.prototype.byteLength",!0),f=e("Object.prototype.toString"),i=!!o&&!t&&new o(0).slice,a=!!i&&r(i);return Ot=t||a?function(c){if(!c||typeof c!="object")return!1;try{return t?t(c):a(c,0),!0}catch{return!1}}:o?function(c){return f(c)==="[object ArrayBuffer]"}:function(c){return!1},Ot}var qt,xa;function ui(){if(xa)return qt;xa=1;var r=Z(),e=r("Date.prototype.getDay"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object Date]",f=Pr()();return qt=function(a){return typeof a!="object"||a===null?!1:f?n(a):o(a)===t},qt}var wt,Ea;function So(){if(Ea)return wt;Ea=1;var r=Z(),e=Pr()(),n=Xt(),o=wr(),t;if(e){var f=r("RegExp.prototype.exec"),i={},a=function(){throw i},u={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(u[Symbol.toPrimitive]=a),t=function(y){if(!y||typeof y!="object")return!1;var h=o(y,"lastIndex"),S=h&&n(h,"value");if(!S)return!1;try{f(y,u)}catch(R){return R===i}}}else{var c=r("Object.prototype.toString"),v="[object RegExp]";t=function(y){return!y||typeof y!="object"&&typeof y!="function"?!1:c(y)===v}}return wt=t,wt}var It,Ba;function fi(){if(Ba)return It;Ba=1;var r=Z(),e=r("SharedArrayBuffer.prototype.byteLength",!0);return It=e?function(o){if(!o||typeof o!="object")return!1;try{return e(o),!0}catch{return!1}}:function(o){return!1},It}var Pt,ja;function si(){if(ja)return Pt;ja=1;var r=Z(),e=r("Number.prototype.toString"),n=function(a){try{return e(a),!0}catch{return!1}},o=r("Object.prototype.toString"),t="[object Number]",f=Pr()();return Pt=function(a){return typeof a=="number"?!0:!a||typeof a!="object"?!1:f?n(a):o(a)===t},Pt}var Rt,Ta;function li(){if(Ta)return Rt;Ta=1;var r=Z(),e=r("Boolean.prototype.toString"),n=r("Object.prototype.toString"),o=function(a){try{return e(a),!0}catch{return!1}},t="[object Boolean]",f=Pr()();return Rt=function(a){return typeof a=="boolean"?!0:a===null||typeof a!="object"?!1:f?o(a):n(a)===t},Rt}var Lr={exports:{}},$t,Ma;function ci(){if(Ma)return $t;Ma=1;var r=Z(),e=So(),n=r("RegExp.prototype.exec"),o=ar();return $t=function(f){if(!e(f))throw new o("`regex` must be a RegExp");return function(a){return n(f,a)!==null}},$t}var Ca;function pi(){if(Ca)return Lr.exports;Ca=1;var r=Z(),e=r("Object.prototype.toString"),n=zt()(),o=ci();if(n){var t=r("Symbol.prototype.toString"),f=o(/^Symbol\(.*\)$/),i=function(u){return typeof u.valueOf()!="symbol"?!1:f(t(u))};Lr.exports=function(u){if(typeof u=="symbol")return!0;if(!u||typeof u!="object"||e(u)!=="[object Symbol]")return!1;try{return i(u)}catch{return!1}}}else Lr.exports=function(u){return!1};return Lr.exports}var Ur={exports:{}},xt,Da;function yi(){if(Da)return xt;Da=1;var r=typeof BigInt<"u"&&BigInt;return xt=function(){return typeof r=="function"&&typeof BigInt=="function"&&typeof r(42)=="bigint"&&typeof BigInt(42)=="bigint"},xt}var Fa;function vi(){if(Fa)return Ur.exports;Fa=1;var r=yi()();if(r){var e=BigInt.prototype.valueOf,n=function(t){try{return e.call(t),!0}catch{}return!1};Ur.exports=function(t){return t===null||typeof t>"u"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:n(t)}}else Ur.exports=function(t){return!1};return Ur.exports}var Et,_a;function gi(){if(_a)return Et;_a=1;var r=po(),e=si(),n=li(),o=pi(),t=vi();return Et=function(i){if(i==null||typeof i!="object"&&typeof i!="function")return null;if(r(i))return"String";if(e(i))return"Number";if(n(i))return"Boolean";if(o(i))return"Symbol";if(t(i))return"BigInt"},Et}var Bt,Na;function hi(){if(Na)return Bt;Na=1;var r=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,e=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,n;r||(n=function(i){return!1});var o=r?r.prototype.has:null,t=e?e.prototype.has:null;return!n&&!o&&(n=function(i){return!1}),Bt=n||function(i){if(!i||typeof i!="object")return!1;try{if(o.call(i,o),t)try{t.call(i,t)}catch{return!0}return i instanceof r}catch{}return!1},Bt}var Hr={exports:{}},Wa;function di(){if(Wa)return Hr.exports;Wa=1;var r=vr(),e=Z(),n=r("%WeakSet%",!0),o=e("WeakSet.prototype.has",!0);if(o){var t=e("WeakMap.prototype.has",!0);Hr.exports=function(i){if(!i||typeof i!="object")return!1;try{if(o(i,o),t)try{t(i,t)}catch{return!0}return i instanceof n}catch{}return!1}}else Hr.exports=function(i){return!1};return Hr.exports}var jt,ka;function mi(){if(ka)return jt;ka=1;var r=yo(),e=vo(),n=hi(),o=di();return jt=function(f){if(f&&typeof f=="object"){if(r(f))return"Map";if(e(f))return"Set";if(n(f))return"WeakMap";if(o(f))return"WeakSet"}return!1},jt}var Tt,La;function Si(){if(La)return Tt;La=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,o;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},e(function(){throw 42},null,n)}catch(A){A!==o&&(e=null)}else e=null;var t=/^\s*class\b/,f=function(m){try{var E=r.call(m);return t.test(E)}catch{return!1}},i=function(m){try{return f(m)?!1:(r.call(m),!0)}catch{return!1}},a=Object.prototype.toString,u="[object Object]",c="[object Function]",v="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",h="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,R=!(0 in[,]),q=function(){return!1};if(typeof document=="object"){var w=document.all;a.call(w)===a.call(document.all)&&(q=function(m){if((R||!m)&&(typeof m>"u"||typeof m=="object"))try{var E=a.call(m);return(E===p||E===y||E===h||E===u)&&m("")==null}catch{}return!1})}return Tt=e?function(m){if(q(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;try{e(m,null,n)}catch(E){if(E!==o)return!1}return!f(m)&&i(m)}:function(m){if(q(m))return!0;if(!m||typeof m!="function"&&typeof m!="object")return!1;if(S)return i(m);if(f(m))return!1;var E=a.call(m);return E!==c&&E!==v&&!/^\[object HTML/.test(E)?!1:i(m)},Tt}var Mt,Ua;function bi(){if(Ua)return Mt;Ua=1;var r=Si(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=function(u,c,v){for(var p=0,y=u.length;p<y;p++)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))},t=function(u,c,v){for(var p=0,y=u.length;p<y;p++)v==null?c(u.charAt(p),p,u):c.call(v,u.charAt(p),p,u)},f=function(u,c,v){for(var p in u)n.call(u,p)&&(v==null?c(u[p],p,u):c.call(v,u[p],p,u))};function i(a){return e.call(a)==="[object Array]"}return Mt=function(u,c,v){if(!r(c))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=v),i(u)?o(u,c,p):typeof u=="string"?t(u,c,p):f(u,c,p)},Mt}var Ct,Ha;function Ai(){return Ha||(Ha=1,Ct=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ct}var Dt,Ga;function Oi(){if(Ga)return Dt;Ga=1;var r=Ai(),e=typeof globalThis>"u"?jr.commonjsGlobal:globalThis;return Dt=function(){for(var o=[],t=0;t<r.length;t++)typeof e[r[t]]=="function"&&(o[o.length]=r[t]);return o},Dt}var Ft,za;function qi(){if(za)return Ft;za=1;var r=bi(),e=Oi(),n=Tr(),o=Z(),t=wr(),f=Yt(),i=o("Object.prototype.toString"),a=Pr()(),u=typeof globalThis>"u"?jr.commonjsGlobal:globalThis,c=e(),v=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(q,w){for(var A=0;A<q.length;A+=1)if(q[A]===w)return A;return-1},y={__proto__:null};a&&t&&f?r(c,function(R){var q=new u[R];if(Symbol.toStringTag in q&&f){var w=f(q),A=t(w,Symbol.toStringTag);if(!A&&w){var m=f(w);A=t(m,Symbol.toStringTag)}if(A&&A.get){var E=n(A.get);y["$"+R]=E}}}):r(c,function(R){var q=new u[R],w=q.slice||q.set;if(w){var A=n(w);y["$"+R]=A}});var h=function(q){var w=!1;return r(y,function(A,m){if(!w)try{"$"+A(q)===m&&(w=v(m,1))}catch{}}),w},S=function(q){var w=!1;return r(y,function(A,m){if(!w)try{A(q),w=v(m,1)}catch{}}),w};return Ft=function(q){if(!q||typeof q!="object")return!1;if(!a){var w=v(i(q),8,-1);return p(c,w)>-1?w:w!=="Object"?!1:S(q)}return t?h(q):null},Ft}var _t,Va;function wi(){if(Va)return _t;Va=1;var r=Z(),e=r("ArrayBuffer.prototype.byteLength",!0),n=mo();return _t=function(t){return n(t)?e?e(t):t.byteLength:NaN},_t}var Nt,Ka;function Ii(){if(Ka)return Nt;Ka=1;var r=zo(),e=oo(),n=Yo(),o=vr(),t=ai(),f=lo(),i=ii(),a=fo(),u=co(),c=mo(),v=ui(),p=So(),y=fi(),h=kt(),S=gi(),R=mi(),q=qi(),w=wi(),A=e("SharedArrayBuffer.prototype.byteLength",!0),m=e("Date.prototype.getTime"),E=Object.getPrototypeOf,Q=e("Object.prototype.toString"),H=o("%Set%",!0),F=e("Map.prototype.has",!0),D=e("Map.prototype.get",!0),I=e("Map.prototype.size",!0),_=e("Set.prototype.add",!0),L=e("Set.prototype.delete",!0),N=e("Set.prototype.has",!0),U=e("Set.prototype.size",!0);function V(g,d,x,$){for(var T=t(g),M;(M=T.next())&&!M.done;)if(G(d,M.value,x,$))return L(g,M.value),!0;return!1}function sr(g){if(typeof g>"u")return null;if(typeof g!="object")return typeof g=="symbol"?!1:typeof g=="string"||typeof g=="number"?+g==+g:!0}function Rr(g,d,x,$,T,M){var O=sr(x);if(O!=null)return O;var P=D(d,O),b=r({},T,{strict:!1});return typeof P>"u"&&!F(d,O)||!G($,P,b,M)?!1:!F(g,O)&&G($,P,b,M)}function br(g,d,x){var $=sr(x);return $??(N(d,$)&&!N(g,$))}function or(g,d,x,$,T,M){for(var O=t(g),P,b;(P=O.next())&&!P.done;)if(b=P.value,G(x,b,T,M)&&G($,D(d,b),T,M))return L(g,b),!0;return!1}function G(g,d,x,$){var T=x||{};if(T.strict?i(g,d):g===d)return!0;var M=S(g),O=S(d);if(M!==O)return!1;if(!g||!d||typeof g!="object"&&typeof d!="object")return T.strict?i(g,d):g==d;var P=$.has(g),b=$.has(d),B;if(P&&b){if($.get(g)===$.get(d))return!0}else B={};return P||$.set(g,B),b||$.set(d,B),gr(g,d,T,$)}function Ar(g){return!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number"?!1:!!(g.constructor&&g.constructor.isBuffer&&g.constructor.isBuffer(g))}function $r(g,d,x,$){if(U(g)!==U(d))return!1;for(var T=t(g),M=t(d),O,P,b;(O=T.next())&&!O.done;)if(O.value&&typeof O.value=="object")b||(b=new H),_(b,O.value);else if(!N(d,O.value)){if(x.strict||!br(g,d,O.value))return!1;b||(b=new H),_(b,O.value)}if(b){for(;(P=M.next())&&!P.done;)if(P.value&&typeof P.value=="object"){if(!V(b,P.value,x.strict,$))return!1}else if(!x.strict&&!N(g,P.value)&&!V(b,P.value,x.strict,$))return!1;return U(b)===0}return!0}function Or(g,d,x,$){if(I(g)!==I(d))return!1;for(var T=t(g),M=t(d),O,P,b,B,z,K;(O=T.next())&&!O.done;)if(B=O.value[0],z=O.value[1],B&&typeof B=="object")b||(b=new H),_(b,B);else if(K=D(d,B),typeof K>"u"&&!F(d,B)||!G(z,K,x,$)){if(x.strict||!Rr(g,d,B,z,x,$))return!1;b||(b=new H),_(b,B)}if(b){for(;(P=M.next())&&!P.done;)if(B=P.value[0],K=P.value[1],B&&typeof B=="object"){if(!or(b,g,B,K,x,$))return!1}else if(!x.strict&&(!g.has(B)||!G(D(g,B),K,x,$))&&!or(b,g,B,K,r({},x,{strict:!1}),$))return!1;return U(b)===0}return!0}function gr(g,d,x,$){var T,M;if(typeof g!=typeof d||g==null||d==null||Q(g)!==Q(d)||a(g)!==a(d))return!1;var O=u(g),P=u(d);if(O!==P)return!1;var b=g instanceof Error,B=d instanceof Error;if(b!==B||(b||B)&&(g.name!==d.name||g.message!==d.message))return!1;var z=p(g),K=p(d);if(z!==K||(z||K)&&(g.source!==d.source||n(g)!==n(d)))return!1;var J=v(g),X=v(d);if(J!==X||(J||X)&&m(g)!==m(d)||x.strict&&E&&E(g)!==E(d))return!1;var rr=q(g),lr=q(d);if(rr!==lr)return!1;if(rr||lr){if(g.length!==d.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==d[T])return!1;return!0}var ir=Ar(g),er=Ar(d);if(ir!==er)return!1;if(ir||er){if(g.length!==d.length)return!1;for(T=0;T<g.length;T++)if(g[T]!==d[T])return!1;return!0}var cr=c(g),pr=c(d);if(cr!==pr)return!1;if(cr||pr)return w(g)!==w(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);var yr=y(g),_r=y(d);if(yr!==_r)return!1;if(yr||_r)return A(g)!==A(d)?!1:typeof Uint8Array=="function"&&G(new Uint8Array(g),new Uint8Array(d),x,$);if(typeof g!=typeof d)return!1;var hr=h(g),xr=h(d);if(hr.length!==xr.length)return!1;for(hr.sort(),xr.sort(),T=hr.length-1;T>=0;T--)if(hr[T]!=xr[T])return!1;for(T=hr.length-1;T>=0;T--)if(M=hr[T],!G(g[M],d[M],x,$))return!1;var Mr=R(g),dr=R(d);return Mr!==dr?!1:Mr==="Set"||dr==="Set"?$r(g,d,x,$):Mr==="Map"?Or(g,d,x,$):!0}return Nt=function(d,x,$){return G(d,x,$,f())},Nt}var Pi=Ii();const Ri=jr.getDefaultExportFromCjs(Pi);function $i(r){return r}function bo(r,e,n,o){const t=$i,[f,i]=fr.useState(t(n)),a=fr.useRef(f);return fr.useEffect(()=>{const u=()=>{const c={...n,...r.getAttributes(e)};Object.keys(c).forEach(p=>{(c[p]===null||c[p]===void 0)&&(c[p]=n?n[p]:null)});const v=t(c);Ri(a.current,v)||(i(v),a.current=v)};return r.on("selectionUpdate",u),r.on("transaction",u),()=>{r.off("selectionUpdate",u),r.off("transaction",u)}},[r,n,e,t]),f}function Qt(r,e={}){if(typeof r=="object")return r;try{return JSON.parse(r)}catch{return e}}function xi({node:r}){const{text:e,macros:n}=r.attrs,o=fr.useMemo(()=>{try{return Xa.renderToString(decodeURIComponent(e||""),{macros:Qt(decodeURIComponent(n||""))})}catch{return e}},[e,n]),t=fr.useMemo(()=>e.trim()?Y.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:o}}):Y.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[e,o]);return Y.jsx(Ya.NodeViewWrapper,{as:"span",style:{display:"inline-block"},children:t})}function Ei(){const{t:r}=Io.useLocale(),[e,n]=fr.useState(!1),o=tr.useButtonProps(Wt.name),{icon:t=void 0,tooltip:f=void 0,tooltipOptions:i={},isActive:a=void 0}=(o==null?void 0:o.componentProps)??{},{editorDisabled:u}=tr.useToggleActive(a),c=tr.useEditorInstance(),v=bo(c,Wt.name,{text:"",macros:""}),{text:p,macros:y}=v,[h,S]=fr.useState(decodeURIComponent(p||"")),[R,q]=fr.useState(decodeURIComponent(y||"")),w=fr.useCallback(()=>{c.chain().focus().setKatex({text:encodeURIComponent(h),macros:encodeURIComponent(R)}).run(),S(""),q(""),n(!1)},[c,h,R]),A=fr.useMemo(()=>{try{return Xa.renderToString(h,{macros:Qt(R)})}catch{return h}},[R,h]),m=fr.useMemo(()=>`${h}`.trim()?A:null,[h,A]);return Y.jsxs(tr.Dialog,{onOpenChange:n,open:e,children:[Y.jsx(tr.DialogTrigger,{asChild:!0,disabled:u,children:Y.jsx(tr.ActionButton,{disabled:u,icon:t,tooltip:f,tooltipOptions:i,action:()=>{u||n(!0)}})}),Y.jsxs(tr.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[Y.jsx(tr.DialogTitle,{children:r("editor.formula.dialog.text")}),Y.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:Y.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[Y.jsxs("div",{className:"richtext-flex-1",children:[Y.jsx(tr.Label,{className:"mb-[6px]",children:"Expression"}),Y.jsx(tr.Textarea,{autoFocus:!0,className:"richtext-mb-[10px]",onChange:E=>S(E.target.value),placeholder:"Text",required:!0,rows:10,value:h,style:{color:"hsl(var(--foreground))"}}),Y.jsx(tr.Label,{className:"mb-[6px]",children:"Macros"}),Y.jsx(tr.Textarea,{className:"richtext-flex-1",placeholder:"Macros",rows:10,value:R,onChange:E=>{q(E.target.value)},style:{color:"hsl(var(--foreground))"}})]}),Y.jsx("div",{className:"richtext-flex richtext-flex-1 richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",dangerouslySetInnerHTML:{__html:m||""},style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"}})]})}),Y.jsx(tr.DialogFooter,{children:Y.jsx(tr.Button,{onClick:w,type:"button",children:"Save changes"})})]})]})}function Ja(r){return e=>e.getAttribute(r)}const Wt=ne.Node3.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({t:r})=>({componentProps:{action:()=>!0,isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:r("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Ja("text")},macros:{default:"",parseHTML:Ja("macros")}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:r}){return["span",ne.mergeAttributes(this.options&&this.options.HTMLAttributes||{},r)]},addCommands(){return{setKatex:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}},addInputRules(){return[ne.nodeInputRule({find:/^\$katex\$$/,type:this.type})]},addNodeView(){return Ya.ReactNodeViewRenderer(xi)}});exports.Katex=Wt;exports.RichTextKatex=Ei;exports.safeJSONParse=Qt;exports.useAttributes=bo;